envibe 0.1.1 → 0.2.1

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/README.md CHANGED
@@ -215,7 +215,14 @@ envibe setup
215
215
  | `env_list` | List visible variables with access levels |
216
216
  | `env_get` | Get a variable's value (respects permissions) |
217
217
  | `env_set` | Set a variable (only `full` access) |
218
- | `env_describe` | Get detailed info about a variable |
218
+ | `env_describe` | Get detailed info including format and example |
219
+ | `env_check_required` | Check which required variables are missing |
220
+
221
+ ### v0.2.0 Features
222
+
223
+ - **Better error messages** - When access is denied, get helpful guidance
224
+ - **Format hints** - Know what format a variable should be (url, key, number, etc.)
225
+ - **Required var checking** - Use `env_check_required` to guide users through setup
219
226
 
220
227
  ## Why envibe?
221
228
 
package/dist/cli/index.js CHANGED
@@ -23000,7 +23000,7 @@ async function startMCPServer() {
23000
23000
  },
23001
23001
  {
23002
23002
  name: "env_describe",
23003
- description: "Get detailed information about a variable including its access level and description.",
23003
+ description: "Get detailed information about a variable including its access level, description, format, and example.",
23004
23004
  inputSchema: {
23005
23005
  type: "object",
23006
23006
  properties: {
@@ -23011,6 +23011,14 @@ async function startMCPServer() {
23011
23011
  },
23012
23012
  required: ["key"]
23013
23013
  }
23014
+ },
23015
+ {
23016
+ name: "env_check_required",
23017
+ description: "Check which required environment variables are missing. Use this to help users set up their environment.",
23018
+ inputSchema: {
23019
+ type: "object",
23020
+ properties: {}
23021
+ }
23014
23022
  }
23015
23023
  ]
23016
23024
  };
@@ -23041,18 +23049,57 @@ async function startMCPServer() {
23041
23049
  }
23042
23050
  case "env_get": {
23043
23051
  const key = args.key;
23052
+ const config2 = manifest2.variables[key];
23044
23053
  const variable = getVariableForAI(key, env, manifest2);
23054
+ if (config2 && config2.access === "hidden" /* HIDDEN */) {
23055
+ return {
23056
+ content: [
23057
+ {
23058
+ type: "text",
23059
+ text: JSON.stringify({
23060
+ error: "ACCESS_DENIED",
23061
+ key,
23062
+ access: "hidden",
23063
+ message: "This variable is hidden from AI. Ask the user to configure it manually.",
23064
+ hint: config2.description
23065
+ }, null, 2)
23066
+ }
23067
+ ],
23068
+ isError: true
23069
+ };
23070
+ }
23045
23071
  if (!variable) {
23046
23072
  return {
23047
23073
  content: [
23048
23074
  {
23049
23075
  type: "text",
23050
- text: `Error: Variable "${key}" is hidden or does not exist`
23076
+ text: JSON.stringify({
23077
+ error: "NOT_FOUND",
23078
+ key,
23079
+ message: `Variable "${key}" does not exist in the manifest.`
23080
+ }, null, 2)
23051
23081
  }
23052
23082
  ],
23053
23083
  isError: true
23054
23084
  };
23055
23085
  }
23086
+ if (variable.access === "placeholder" /* PLACEHOLDER */) {
23087
+ return {
23088
+ content: [
23089
+ {
23090
+ type: "text",
23091
+ text: JSON.stringify({
23092
+ value: variable.displayValue,
23093
+ access: "placeholder",
23094
+ message: "You can reference this variable but cannot see the actual value.",
23095
+ hint: config2?.description,
23096
+ format: config2?.format,
23097
+ example: config2?.example
23098
+ }, null, 2)
23099
+ }
23100
+ ]
23101
+ };
23102
+ }
23056
23103
  return {
23057
23104
  content: [
23058
23105
  {
@@ -23094,25 +23141,50 @@ async function startMCPServer() {
23094
23141
  const key = args.key;
23095
23142
  const variable = getVariableForAI(key, env, manifest2);
23096
23143
  const config2 = manifest2.variables[key];
23097
- if (!variable) {
23144
+ if (config2 && config2.access === "hidden" /* HIDDEN */) {
23098
23145
  return {
23099
23146
  content: [
23100
23147
  {
23101
23148
  type: "text",
23102
- text: `Error: Variable "${key}" is hidden or does not exist`
23149
+ text: JSON.stringify({
23150
+ key,
23151
+ access: "hidden",
23152
+ canModify: false,
23153
+ description: config2.description,
23154
+ message: "This variable is hidden from AI. Ask the user to configure it.",
23155
+ required: config2.required ?? false,
23156
+ format: config2.format,
23157
+ example: config2.example
23158
+ }, null, 2)
23159
+ }
23160
+ ]
23161
+ };
23162
+ }
23163
+ if (!variable && !config2) {
23164
+ return {
23165
+ content: [
23166
+ {
23167
+ type: "text",
23168
+ text: JSON.stringify({
23169
+ error: "NOT_FOUND",
23170
+ key,
23171
+ message: `Variable "${key}" does not exist in the manifest.`
23172
+ }, null, 2)
23103
23173
  }
23104
23174
  ],
23105
23175
  isError: true
23106
23176
  };
23107
23177
  }
23108
23178
  const info = {
23109
- key: variable.key,
23110
- access: variable.access,
23111
- canModify: variable.canModify,
23112
- description: variable.description,
23179
+ key: variable?.key ?? key,
23180
+ access: variable?.access ?? config2?.access,
23181
+ canModify: variable?.canModify ?? false,
23182
+ description: variable?.description ?? config2?.description,
23113
23183
  required: config2?.required ?? false,
23114
23184
  hasDefault: config2?.default !== undefined,
23115
- isSet: env[key] !== undefined
23185
+ isSet: env[key] !== undefined,
23186
+ format: config2?.format,
23187
+ example: config2?.example
23116
23188
  };
23117
23189
  return {
23118
23190
  content: [
@@ -23123,6 +23195,42 @@ async function startMCPServer() {
23123
23195
  ]
23124
23196
  };
23125
23197
  }
23198
+ case "env_check_required": {
23199
+ const missing = [];
23200
+ const set2 = [];
23201
+ for (const [key, config2] of Object.entries(manifest2.variables)) {
23202
+ if (config2.required) {
23203
+ if (env[key] === undefined || env[key] === "") {
23204
+ missing.push({
23205
+ key,
23206
+ description: config2.description,
23207
+ format: config2.format,
23208
+ example: config2.example
23209
+ });
23210
+ } else {
23211
+ const variable = getVariableForAI(key, env, manifest2);
23212
+ if (variable && (variable.access === "full" /* FULL */ || variable.access === "read-only" /* READ_ONLY */)) {
23213
+ set2.push({ key, value: variable.displayValue });
23214
+ } else {
23215
+ set2.push({ key, value: "<set>" });
23216
+ }
23217
+ }
23218
+ }
23219
+ }
23220
+ const result = {
23221
+ missing,
23222
+ set: set2,
23223
+ message: missing.length > 0 ? `${missing.length} required variable(s) are not set. Ask the user to configure them.` : "All required variables are set."
23224
+ };
23225
+ return {
23226
+ content: [
23227
+ {
23228
+ type: "text",
23229
+ text: JSON.stringify(result, null, 2)
23230
+ }
23231
+ ]
23232
+ };
23233
+ }
23126
23234
  default:
23127
23235
  return {
23128
23236
  content: [
package/dist/index.js CHANGED
@@ -20509,7 +20509,7 @@ async function startMCPServer() {
20509
20509
  },
20510
20510
  {
20511
20511
  name: "env_describe",
20512
- description: "Get detailed information about a variable including its access level and description.",
20512
+ description: "Get detailed information about a variable including its access level, description, format, and example.",
20513
20513
  inputSchema: {
20514
20514
  type: "object",
20515
20515
  properties: {
@@ -20520,6 +20520,14 @@ async function startMCPServer() {
20520
20520
  },
20521
20521
  required: ["key"]
20522
20522
  }
20523
+ },
20524
+ {
20525
+ name: "env_check_required",
20526
+ description: "Check which required environment variables are missing. Use this to help users set up their environment.",
20527
+ inputSchema: {
20528
+ type: "object",
20529
+ properties: {}
20530
+ }
20523
20531
  }
20524
20532
  ]
20525
20533
  };
@@ -20550,18 +20558,57 @@ async function startMCPServer() {
20550
20558
  }
20551
20559
  case "env_get": {
20552
20560
  const key = args.key;
20561
+ const config2 = manifest2.variables[key];
20553
20562
  const variable = getVariableForAI(key, env, manifest2);
20563
+ if (config2 && config2.access === "hidden" /* HIDDEN */) {
20564
+ return {
20565
+ content: [
20566
+ {
20567
+ type: "text",
20568
+ text: JSON.stringify({
20569
+ error: "ACCESS_DENIED",
20570
+ key,
20571
+ access: "hidden",
20572
+ message: "This variable is hidden from AI. Ask the user to configure it manually.",
20573
+ hint: config2.description
20574
+ }, null, 2)
20575
+ }
20576
+ ],
20577
+ isError: true
20578
+ };
20579
+ }
20554
20580
  if (!variable) {
20555
20581
  return {
20556
20582
  content: [
20557
20583
  {
20558
20584
  type: "text",
20559
- text: `Error: Variable "${key}" is hidden or does not exist`
20585
+ text: JSON.stringify({
20586
+ error: "NOT_FOUND",
20587
+ key,
20588
+ message: `Variable "${key}" does not exist in the manifest.`
20589
+ }, null, 2)
20560
20590
  }
20561
20591
  ],
20562
20592
  isError: true
20563
20593
  };
20564
20594
  }
20595
+ if (variable.access === "placeholder" /* PLACEHOLDER */) {
20596
+ return {
20597
+ content: [
20598
+ {
20599
+ type: "text",
20600
+ text: JSON.stringify({
20601
+ value: variable.displayValue,
20602
+ access: "placeholder",
20603
+ message: "You can reference this variable but cannot see the actual value.",
20604
+ hint: config2?.description,
20605
+ format: config2?.format,
20606
+ example: config2?.example
20607
+ }, null, 2)
20608
+ }
20609
+ ]
20610
+ };
20611
+ }
20565
20612
  return {
20566
20613
  content: [
20567
20614
  {
@@ -20603,25 +20650,50 @@ async function startMCPServer() {
20603
20650
  const key = args.key;
20604
20651
  const variable = getVariableForAI(key, env, manifest2);
20605
20652
  const config2 = manifest2.variables[key];
20606
- if (!variable) {
20653
+ if (config2 && config2.access === "hidden" /* HIDDEN */) {
20607
20654
  return {
20608
20655
  content: [
20609
20656
  {
20610
20657
  type: "text",
20611
- text: `Error: Variable "${key}" is hidden or does not exist`
20658
+ text: JSON.stringify({
20659
+ key,
20660
+ access: "hidden",
20661
+ canModify: false,
20662
+ description: config2.description,
20663
+ message: "This variable is hidden from AI. Ask the user to configure it.",
20664
+ required: config2.required ?? false,
20665
+ format: config2.format,
20666
+ example: config2.example
20667
+ }, null, 2)
20668
+ }
20669
+ ]
20670
+ };
20671
+ }
20672
+ if (!variable && !config2) {
20673
+ return {
20674
+ content: [
20675
+ {
20676
+ type: "text",
20677
+ text: JSON.stringify({
20678
+ error: "NOT_FOUND",
20679
+ key,
20680
+ message: `Variable "${key}" does not exist in the manifest.`
20681
+ }, null, 2)
20612
20682
  }
20613
20683
  ],
20614
20684
  isError: true
20615
20685
  };
20616
20686
  }
20617
20687
  const info = {
20618
- key: variable.key,
20619
- access: variable.access,
20620
- canModify: variable.canModify,
20621
- description: variable.description,
20688
+ key: variable?.key ?? key,
20689
+ access: variable?.access ?? config2?.access,
20690
+ canModify: variable?.canModify ?? false,
20691
+ description: variable?.description ?? config2?.description,
20622
20692
  required: config2?.required ?? false,
20623
20693
  hasDefault: config2?.default !== undefined,
20624
- isSet: env[key] !== undefined
20694
+ isSet: env[key] !== undefined,
20695
+ format: config2?.format,
20696
+ example: config2?.example
20625
20697
  };
20626
20698
  return {
20627
20699
  content: [
@@ -20632,6 +20704,42 @@ async function startMCPServer() {
20632
20704
  ]
20633
20705
  };
20634
20706
  }
20707
+ case "env_check_required": {
20708
+ const missing = [];
20709
+ const set2 = [];
20710
+ for (const [key, config2] of Object.entries(manifest2.variables)) {
20711
+ if (config2.required) {
20712
+ if (env[key] === undefined || env[key] === "") {
20713
+ missing.push({
20714
+ key,
20715
+ description: config2.description,
20716
+ format: config2.format,
20717
+ example: config2.example
20718
+ });
20719
+ } else {
20720
+ const variable = getVariableForAI(key, env, manifest2);
20721
+ if (variable && (variable.access === "full" /* FULL */ || variable.access === "read-only" /* READ_ONLY */)) {
20722
+ set2.push({ key, value: variable.displayValue });
20723
+ } else {
20724
+ set2.push({ key, value: "<set>" });
20725
+ }
20726
+ }
20727
+ }
20728
+ }
20729
+ const result = {
20730
+ missing,
20731
+ set: set2,
20732
+ message: missing.length > 0 ? `${missing.length} required variable(s) are not set. Ask the user to configure them.` : "All required variables are set."
20733
+ };
20734
+ return {
20735
+ content: [
20736
+ {
20737
+ type: "text",
20738
+ text: JSON.stringify(result, null, 2)
20739
+ }
20740
+ ]
20741
+ };
20742
+ }
20635
20743
  default:
20636
20744
  return {
20637
20745
  content: [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "envibe",
3
- "version": "0.1.1",
3
+ "version": "0.2.1",
4
4
  "description": "The missing permission layer between AI agents and your .env",
5
5
  "type": "module",
6
6
  "bin": {