envpkt 0.7.1 → 0.7.3
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/cli.js +5 -37
- package/dist/index.d.ts +93 -93
- package/dist/index.js +1 -23
- package/package.json +27 -29
package/dist/cli.js
CHANGED
|
@@ -14,7 +14,6 @@ import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
|
14
14
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
15
15
|
import { CallToolRequestSchema, ListResourcesRequestSchema, ListToolsRequestSchema, ReadResourceRequestSchema } from "@modelcontextprotocol/sdk/types.js";
|
|
16
16
|
import { createInterface } from "node:readline";
|
|
17
|
-
|
|
18
17
|
//#region src/core/audit.ts
|
|
19
18
|
const MS_PER_DAY = 864e5;
|
|
20
19
|
const WARN_BEFORE_DAYS = 30;
|
|
@@ -112,7 +111,6 @@ const computeEnvAudit = (config, env = process.env) => {
|
|
|
112
111
|
missing: entries.filter((e) => e.status === "missing").length
|
|
113
112
|
};
|
|
114
113
|
};
|
|
115
|
-
|
|
116
114
|
//#endregion
|
|
117
115
|
//#region src/core/schema.ts
|
|
118
116
|
const DATE_RE$1 = /^\d{4}-\d{2}-\d{2}$/;
|
|
@@ -207,7 +205,6 @@ const EnvpktConfigSchema = Type.Object({
|
|
|
207
205
|
title: "envpkt configuration",
|
|
208
206
|
description: "Credential lifecycle and fleet management configuration for AI agents"
|
|
209
207
|
});
|
|
210
|
-
|
|
211
208
|
//#endregion
|
|
212
209
|
//#region src/core/config.ts
|
|
213
210
|
const CONFIG_FILENAME$2 = "envpkt.toml";
|
|
@@ -368,7 +365,6 @@ const resolveConfigPath = (flagPath, envVar, cwd) => {
|
|
|
368
365
|
source
|
|
369
366
|
}));
|
|
370
367
|
};
|
|
371
|
-
|
|
372
368
|
//#endregion
|
|
373
369
|
//#region src/core/catalog.ts
|
|
374
370
|
/** Load and validate a catalog file, mapping ConfigError → CatalogError */
|
|
@@ -445,7 +441,6 @@ const resolveConfig = (agentConfig, agentConfigDir) => {
|
|
|
445
441
|
};
|
|
446
442
|
}));
|
|
447
443
|
};
|
|
448
|
-
|
|
449
444
|
//#endregion
|
|
450
445
|
//#region src/cli/output.ts
|
|
451
446
|
const RESET = "\x1B[0m";
|
|
@@ -652,7 +647,6 @@ const formatConfigSource = (path, source) => {
|
|
|
652
647
|
if (source === "cwd") return "";
|
|
653
648
|
return `${DIM}envpkt: loaded ${path}${RESET}`;
|
|
654
649
|
};
|
|
655
|
-
|
|
656
650
|
//#endregion
|
|
657
651
|
//#region src/cli/commands/audit.ts
|
|
658
652
|
const runAudit = (options) => {
|
|
@@ -731,7 +725,6 @@ const runAuditOnConfig = (config, options) => {
|
|
|
731
725
|
const code = options.strict ? exitCodeForAudit(audit) : audit.status === "critical" ? 2 : 0;
|
|
732
726
|
process.exit(code);
|
|
733
727
|
};
|
|
734
|
-
|
|
735
728
|
//#endregion
|
|
736
729
|
//#region src/fnox/cli.ts
|
|
737
730
|
/** Export all secrets from fnox as key=value pairs for a given profile */
|
|
@@ -764,7 +757,6 @@ const fnoxExport = (profile, agentKey) => {
|
|
|
764
757
|
return Right(entries);
|
|
765
758
|
});
|
|
766
759
|
};
|
|
767
|
-
|
|
768
760
|
//#endregion
|
|
769
761
|
//#region src/fnox/detect.ts
|
|
770
762
|
const FNOX_CONFIG = "fnox.toml";
|
|
@@ -778,7 +770,6 @@ const fnoxAvailable = () => Try(() => {
|
|
|
778
770
|
execFileSync("fnox", ["--version"], { stdio: "pipe" });
|
|
779
771
|
return true;
|
|
780
772
|
}).fold(() => false, (v) => v);
|
|
781
|
-
|
|
782
773
|
//#endregion
|
|
783
774
|
//#region src/fnox/identity.ts
|
|
784
775
|
/** Check if the age CLI is available on PATH */
|
|
@@ -808,7 +799,6 @@ const unwrapAgentKey = (identityPath) => {
|
|
|
808
799
|
message: `age decrypt failed: ${err}`
|
|
809
800
|
}), (output) => Right(output.trim()));
|
|
810
801
|
};
|
|
811
|
-
|
|
812
802
|
//#endregion
|
|
813
803
|
//#region src/fnox/parse.ts
|
|
814
804
|
/** Read and parse fnox.toml, extracting secret keys and profiles */
|
|
@@ -829,7 +819,6 @@ const readFnoxConfig = (path) => Try(() => readFileSync(path, "utf-8")).fold((er
|
|
|
829
819
|
}));
|
|
830
820
|
/** Extract the set of secret key names from a parsed fnox config */
|
|
831
821
|
const extractFnoxKeys = (config) => new Set(Object.keys(config.secrets));
|
|
832
|
-
|
|
833
822
|
//#endregion
|
|
834
823
|
//#region src/core/keygen.ts
|
|
835
824
|
/** Resolve the age identity file path: ENVPKT_AGE_KEY_FILE env var > ~/.envpkt/age-key.txt */
|
|
@@ -929,7 +918,6 @@ const updateConfigRecipient = (configPath, recipient) => {
|
|
|
929
918
|
}), () => Right(true));
|
|
930
919
|
});
|
|
931
920
|
};
|
|
932
|
-
|
|
933
921
|
//#endregion
|
|
934
922
|
//#region src/core/seal.ts
|
|
935
923
|
/** Encrypt a plaintext string using age with the given recipient public key (armored output) */
|
|
@@ -1029,7 +1017,6 @@ const unsealSecrets = (meta, identityPath) => {
|
|
|
1029
1017
|
}
|
|
1030
1018
|
return Right(result);
|
|
1031
1019
|
};
|
|
1032
|
-
|
|
1033
1020
|
//#endregion
|
|
1034
1021
|
//#region src/core/boot.ts
|
|
1035
1022
|
const resolveAndLoad = (opts) => resolveConfigPath(opts.configPath).fold((err) => Left(err), ({ path: configPath, source: configSource }) => loadConfig(configPath).fold((err) => Left(err), (config) => {
|
|
@@ -1153,7 +1140,6 @@ const bootSafe = (options) => {
|
|
|
1153
1140
|
});
|
|
1154
1141
|
});
|
|
1155
1142
|
};
|
|
1156
|
-
|
|
1157
1143
|
//#endregion
|
|
1158
1144
|
//#region src/core/patterns.ts
|
|
1159
1145
|
const EXCLUDED_VARS = new Set([
|
|
@@ -1852,7 +1838,6 @@ const scanEnv = (env) => {
|
|
|
1852
1838
|
});
|
|
1853
1839
|
return results;
|
|
1854
1840
|
};
|
|
1855
|
-
|
|
1856
1841
|
//#endregion
|
|
1857
1842
|
//#region src/core/env.ts
|
|
1858
1843
|
/** Scan env for credentials, returning structured results */
|
|
@@ -1935,7 +1920,6 @@ created = "${todayIso$1()}"
|
|
|
1935
1920
|
}
|
|
1936
1921
|
return blocks.join("\n");
|
|
1937
1922
|
};
|
|
1938
|
-
|
|
1939
1923
|
//#endregion
|
|
1940
1924
|
//#region src/core/toml-edit.ts
|
|
1941
1925
|
const SECTION_RE = /^\[.+\]\s*$/;
|
|
@@ -2085,7 +2069,6 @@ const updateSectionFields = (raw, sectionHeader, updates) => {
|
|
|
2085
2069
|
* Ensures proper spacing (double newline before the block).
|
|
2086
2070
|
*/
|
|
2087
2071
|
const appendSection = (raw, block) => `${raw.trimEnd()}\n\n${block}`;
|
|
2088
|
-
|
|
2089
2072
|
//#endregion
|
|
2090
2073
|
//#region src/cli/commands/env.ts
|
|
2091
2074
|
const printPostWriteGuidance = () => {
|
|
@@ -2175,6 +2158,10 @@ const runEnvExport = (options) => {
|
|
|
2175
2158
|
if (sourceMsg) console.error(sourceMsg);
|
|
2176
2159
|
for (const warning of boot.warnings) console.error(`${YELLOW}Warning:${RESET} ${warning}`);
|
|
2177
2160
|
for (const [key, value] of Object.entries(boot.envDefaults)) console.log(`export ${key}='${shellEscape(value)}'`);
|
|
2161
|
+
if (boot.overridden.length > 0) loadConfig(boot.configPath).fold(() => {}, (config) => {
|
|
2162
|
+
const envEntries = config.env ?? {};
|
|
2163
|
+
for (const key of boot.overridden) if (key in envEntries) console.log(`export ${key}='${shellEscape(envEntries[key].value)}'`);
|
|
2164
|
+
});
|
|
2178
2165
|
for (const [key, value] of Object.entries(boot.secrets)) console.log(`export ${key}='${shellEscape(value)}'`);
|
|
2179
2166
|
});
|
|
2180
2167
|
};
|
|
@@ -2320,7 +2307,6 @@ const registerEnvCommands = (program) => {
|
|
|
2320
2307
|
runEnvRename(oldName, newName, options);
|
|
2321
2308
|
});
|
|
2322
2309
|
};
|
|
2323
|
-
|
|
2324
2310
|
//#endregion
|
|
2325
2311
|
//#region src/cli/commands/exec.ts
|
|
2326
2312
|
const runExec = (args, options) => {
|
|
@@ -2374,7 +2360,6 @@ const runExec = (args, options) => {
|
|
|
2374
2360
|
process.exit(exitCode);
|
|
2375
2361
|
}
|
|
2376
2362
|
};
|
|
2377
|
-
|
|
2378
2363
|
//#endregion
|
|
2379
2364
|
//#region src/core/fleet.ts
|
|
2380
2365
|
const CONFIG_FILENAME$1 = "envpkt.toml";
|
|
@@ -2439,7 +2424,6 @@ const scanFleet = (rootDir, options) => {
|
|
|
2439
2424
|
expiring_soon
|
|
2440
2425
|
};
|
|
2441
2426
|
};
|
|
2442
|
-
|
|
2443
2427
|
//#endregion
|
|
2444
2428
|
//#region src/cli/commands/fleet.ts
|
|
2445
2429
|
const statusIcon = (status) => {
|
|
@@ -2469,7 +2453,6 @@ const runFleet = (options) => {
|
|
|
2469
2453
|
}
|
|
2470
2454
|
process.exit(fleet.status === "critical" ? 2 : 0);
|
|
2471
2455
|
};
|
|
2472
|
-
|
|
2473
2456
|
//#endregion
|
|
2474
2457
|
//#region src/cli/commands/init.ts
|
|
2475
2458
|
const CONFIG_FILENAME = "envpkt.toml";
|
|
@@ -2580,14 +2563,12 @@ const runInit = (dir, options) => {
|
|
|
2580
2563
|
console.log(` ${BOLD}Next:${RESET} Fill in metadata for each secret`);
|
|
2581
2564
|
});
|
|
2582
2565
|
};
|
|
2583
|
-
|
|
2584
2566
|
//#endregion
|
|
2585
2567
|
//#region src/core/format.ts
|
|
2586
2568
|
const maskValue = (value) => {
|
|
2587
2569
|
if (value.length > 8) return `${value.slice(0, 3)}${"•".repeat(5)}${value.slice(-4)}`;
|
|
2588
2570
|
return "•".repeat(5);
|
|
2589
2571
|
};
|
|
2590
|
-
|
|
2591
2572
|
//#endregion
|
|
2592
2573
|
//#region src/cli/commands/inspect.ts
|
|
2593
2574
|
const printSecretMeta = (meta, indent) => {
|
|
@@ -2707,7 +2688,6 @@ const runInspect = (options) => {
|
|
|
2707
2688
|
});
|
|
2708
2689
|
});
|
|
2709
2690
|
};
|
|
2710
|
-
|
|
2711
2691
|
//#endregion
|
|
2712
2692
|
//#region src/cli/commands/keygen.ts
|
|
2713
2693
|
const runKeygen = (options) => {
|
|
@@ -2744,7 +2724,6 @@ const runKeygen = (options) => {
|
|
|
2744
2724
|
}
|
|
2745
2725
|
});
|
|
2746
2726
|
};
|
|
2747
|
-
|
|
2748
2727
|
//#endregion
|
|
2749
2728
|
//#region src/mcp/resources.ts
|
|
2750
2729
|
const loadConfigSafe = () => {
|
|
@@ -2822,7 +2801,6 @@ const readResource = (uri) => {
|
|
|
2822
2801
|
const handler = resourceHandlers[uri];
|
|
2823
2802
|
return handler?.();
|
|
2824
2803
|
};
|
|
2825
|
-
|
|
2826
2804
|
//#endregion
|
|
2827
2805
|
//#region src/mcp/tools.ts
|
|
2828
2806
|
const textResult = (text) => ({ content: [{
|
|
@@ -3013,7 +2991,6 @@ const callTool = (name, args) => {
|
|
|
3013
2991
|
if (!handler) return errorResult(`Unknown tool: ${name}`);
|
|
3014
2992
|
return handler(args);
|
|
3015
2993
|
};
|
|
3016
|
-
|
|
3017
2994
|
//#endregion
|
|
3018
2995
|
//#region src/mcp/server.ts
|
|
3019
2996
|
const createServer = () => {
|
|
@@ -3054,7 +3031,6 @@ const startServer = async () => {
|
|
|
3054
3031
|
const transport = new StdioServerTransport();
|
|
3055
3032
|
await server.connect(transport);
|
|
3056
3033
|
};
|
|
3057
|
-
|
|
3058
3034
|
//#endregion
|
|
3059
3035
|
//#region src/cli/commands/mcp.ts
|
|
3060
3036
|
const runMcp = (_options) => {
|
|
@@ -3063,7 +3039,6 @@ const runMcp = (_options) => {
|
|
|
3063
3039
|
process.exit(1);
|
|
3064
3040
|
});
|
|
3065
3041
|
};
|
|
3066
|
-
|
|
3067
3042
|
//#endregion
|
|
3068
3043
|
//#region src/cli/commands/resolve.ts
|
|
3069
3044
|
const runResolve = (options) => {
|
|
@@ -3098,7 +3073,6 @@ const runResolve = (options) => {
|
|
|
3098
3073
|
});
|
|
3099
3074
|
});
|
|
3100
3075
|
};
|
|
3101
|
-
|
|
3102
3076
|
//#endregion
|
|
3103
3077
|
//#region src/core/resolve-values.ts
|
|
3104
3078
|
/** Resolve plaintext values for the given keys via cascade: fnox → env → interactive prompt */
|
|
@@ -3134,7 +3108,6 @@ const resolveValues = async (keys, profile, agentKey) => {
|
|
|
3134
3108
|
}
|
|
3135
3109
|
return result;
|
|
3136
3110
|
};
|
|
3137
|
-
|
|
3138
3111
|
//#endregion
|
|
3139
3112
|
//#region src/cli/commands/seal.ts
|
|
3140
3113
|
/** Write sealed values back into the TOML file, preserving structure */
|
|
@@ -3359,7 +3332,6 @@ const runSeal = async (options) => {
|
|
|
3359
3332
|
console.log(`${GREEN}Sealed${RESET} ${sealedCount} secret(s) into ${DIM}${configPath}${RESET}${summary}`);
|
|
3360
3333
|
});
|
|
3361
3334
|
};
|
|
3362
|
-
|
|
3363
3335
|
//#endregion
|
|
3364
3336
|
//#region src/cli/commands/secret.ts
|
|
3365
3337
|
const DATE_RE = /^\d{4}-\d{2}-\d{2}$/;
|
|
@@ -3531,7 +3503,6 @@ const registerSecretCommands = (program) => {
|
|
|
3531
3503
|
runSecretRename(oldName, newName, options);
|
|
3532
3504
|
});
|
|
3533
3505
|
};
|
|
3534
|
-
|
|
3535
3506
|
//#endregion
|
|
3536
3507
|
//#region src/cli/commands/shell-hook.ts
|
|
3537
3508
|
const ZSH_HOOK = `# envpkt shell hook — add to your .zshrc
|
|
@@ -3573,7 +3544,6 @@ const runShellHook = (shell) => {
|
|
|
3573
3544
|
process.exit(1);
|
|
3574
3545
|
}
|
|
3575
3546
|
};
|
|
3576
|
-
|
|
3577
3547
|
//#endregion
|
|
3578
3548
|
//#region src/cli/commands/upgrade.ts
|
|
3579
3549
|
const getCurrentVersion = () => {
|
|
@@ -3635,7 +3605,6 @@ const runUpgrade = () => {
|
|
|
3635
3605
|
if (before === after && before !== "unknown") console.log(`\n${GREEN}✓${RESET} Already on latest version ${BOLD}${after}${RESET}`);
|
|
3636
3606
|
else console.log(`\n${GREEN}✓${RESET} Upgraded ${YELLOW}${before}${RESET} → ${BOLD}${after}${RESET}`);
|
|
3637
3607
|
};
|
|
3638
|
-
|
|
3639
3608
|
//#endregion
|
|
3640
3609
|
//#region src/cli/index.ts
|
|
3641
3610
|
const program = new Command();
|
|
@@ -3684,6 +3653,5 @@ program.command("shell-hook").description("Output shell function for ambient cre
|
|
|
3684
3653
|
runShellHook(shell);
|
|
3685
3654
|
});
|
|
3686
3655
|
program.parse();
|
|
3687
|
-
|
|
3688
3656
|
//#endregion
|
|
3689
|
-
export {
|
|
3657
|
+
export {};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,121 +1,121 @@
|
|
|
1
|
-
import * as _sinclair_typebox0 from "@sinclair/typebox";
|
|
1
|
+
import * as _$_sinclair_typebox0 from "@sinclair/typebox";
|
|
2
2
|
import { Static } from "@sinclair/typebox";
|
|
3
3
|
import { Either, List, Option } from "functype";
|
|
4
4
|
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
5
5
|
import { CallToolResult, ReadResourceResult, Resource } from "@modelcontextprotocol/sdk/types.js";
|
|
6
6
|
|
|
7
7
|
//#region src/core/schema.d.ts
|
|
8
|
-
declare const ConsumerType: _sinclair_typebox0.TUnion<[_sinclair_typebox0.TLiteral<"agent">, _sinclair_typebox0.TLiteral<"service">, _sinclair_typebox0.TLiteral<"developer">, _sinclair_typebox0.TLiteral<"ci">]>;
|
|
8
|
+
declare const ConsumerType: _$_sinclair_typebox0.TUnion<[_$_sinclair_typebox0.TLiteral<"agent">, _$_sinclair_typebox0.TLiteral<"service">, _$_sinclair_typebox0.TLiteral<"developer">, _$_sinclair_typebox0.TLiteral<"ci">]>;
|
|
9
9
|
type ConsumerType = Static<typeof ConsumerType>;
|
|
10
|
-
declare const IdentitySchema: _sinclair_typebox0.TObject<{
|
|
11
|
-
name: _sinclair_typebox0.TString;
|
|
12
|
-
consumer: _sinclair_typebox0.TOptional<_sinclair_typebox0.TUnion<[_sinclair_typebox0.TLiteral<"agent">, _sinclair_typebox0.TLiteral<"service">, _sinclair_typebox0.TLiteral<"developer">, _sinclair_typebox0.TLiteral<"ci">]>>;
|
|
13
|
-
description: _sinclair_typebox0.TOptional<_sinclair_typebox0.TString>;
|
|
14
|
-
capabilities: _sinclair_typebox0.TOptional<_sinclair_typebox0.TArray<_sinclair_typebox0.TString>>;
|
|
15
|
-
expires: _sinclair_typebox0.TOptional<_sinclair_typebox0.TString>;
|
|
16
|
-
services: _sinclair_typebox0.TOptional<_sinclair_typebox0.TArray<_sinclair_typebox0.TString>>;
|
|
17
|
-
key_file: _sinclair_typebox0.TOptional<_sinclair_typebox0.TString>;
|
|
18
|
-
recipient: _sinclair_typebox0.TOptional<_sinclair_typebox0.TString>;
|
|
19
|
-
secrets: _sinclair_typebox0.TOptional<_sinclair_typebox0.TArray<_sinclair_typebox0.TString>>;
|
|
10
|
+
declare const IdentitySchema: _$_sinclair_typebox0.TObject<{
|
|
11
|
+
name: _$_sinclair_typebox0.TString;
|
|
12
|
+
consumer: _$_sinclair_typebox0.TOptional<_$_sinclair_typebox0.TUnion<[_$_sinclair_typebox0.TLiteral<"agent">, _$_sinclair_typebox0.TLiteral<"service">, _$_sinclair_typebox0.TLiteral<"developer">, _$_sinclair_typebox0.TLiteral<"ci">]>>;
|
|
13
|
+
description: _$_sinclair_typebox0.TOptional<_$_sinclair_typebox0.TString>;
|
|
14
|
+
capabilities: _$_sinclair_typebox0.TOptional<_$_sinclair_typebox0.TArray<_$_sinclair_typebox0.TString>>;
|
|
15
|
+
expires: _$_sinclair_typebox0.TOptional<_$_sinclair_typebox0.TString>;
|
|
16
|
+
services: _$_sinclair_typebox0.TOptional<_$_sinclair_typebox0.TArray<_$_sinclair_typebox0.TString>>;
|
|
17
|
+
key_file: _$_sinclair_typebox0.TOptional<_$_sinclair_typebox0.TString>;
|
|
18
|
+
recipient: _$_sinclair_typebox0.TOptional<_$_sinclair_typebox0.TString>;
|
|
19
|
+
secrets: _$_sinclair_typebox0.TOptional<_$_sinclair_typebox0.TArray<_$_sinclair_typebox0.TString>>;
|
|
20
20
|
}>;
|
|
21
21
|
type Identity = Static<typeof IdentitySchema>;
|
|
22
22
|
/** @deprecated Use `IdentitySchema` instead */
|
|
23
|
-
declare const AgentIdentitySchema: _sinclair_typebox0.TObject<{
|
|
24
|
-
name: _sinclair_typebox0.TString;
|
|
25
|
-
consumer: _sinclair_typebox0.TOptional<_sinclair_typebox0.TUnion<[_sinclair_typebox0.TLiteral<"agent">, _sinclair_typebox0.TLiteral<"service">, _sinclair_typebox0.TLiteral<"developer">, _sinclair_typebox0.TLiteral<"ci">]>>;
|
|
26
|
-
description: _sinclair_typebox0.TOptional<_sinclair_typebox0.TString>;
|
|
27
|
-
capabilities: _sinclair_typebox0.TOptional<_sinclair_typebox0.TArray<_sinclair_typebox0.TString>>;
|
|
28
|
-
expires: _sinclair_typebox0.TOptional<_sinclair_typebox0.TString>;
|
|
29
|
-
services: _sinclair_typebox0.TOptional<_sinclair_typebox0.TArray<_sinclair_typebox0.TString>>;
|
|
30
|
-
key_file: _sinclair_typebox0.TOptional<_sinclair_typebox0.TString>;
|
|
31
|
-
recipient: _sinclair_typebox0.TOptional<_sinclair_typebox0.TString>;
|
|
32
|
-
secrets: _sinclair_typebox0.TOptional<_sinclair_typebox0.TArray<_sinclair_typebox0.TString>>;
|
|
23
|
+
declare const AgentIdentitySchema: _$_sinclair_typebox0.TObject<{
|
|
24
|
+
name: _$_sinclair_typebox0.TString;
|
|
25
|
+
consumer: _$_sinclair_typebox0.TOptional<_$_sinclair_typebox0.TUnion<[_$_sinclair_typebox0.TLiteral<"agent">, _$_sinclair_typebox0.TLiteral<"service">, _$_sinclair_typebox0.TLiteral<"developer">, _$_sinclair_typebox0.TLiteral<"ci">]>>;
|
|
26
|
+
description: _$_sinclair_typebox0.TOptional<_$_sinclair_typebox0.TString>;
|
|
27
|
+
capabilities: _$_sinclair_typebox0.TOptional<_$_sinclair_typebox0.TArray<_$_sinclair_typebox0.TString>>;
|
|
28
|
+
expires: _$_sinclair_typebox0.TOptional<_$_sinclair_typebox0.TString>;
|
|
29
|
+
services: _$_sinclair_typebox0.TOptional<_$_sinclair_typebox0.TArray<_$_sinclair_typebox0.TString>>;
|
|
30
|
+
key_file: _$_sinclair_typebox0.TOptional<_$_sinclair_typebox0.TString>;
|
|
31
|
+
recipient: _$_sinclair_typebox0.TOptional<_$_sinclair_typebox0.TString>;
|
|
32
|
+
secrets: _$_sinclair_typebox0.TOptional<_$_sinclair_typebox0.TArray<_$_sinclair_typebox0.TString>>;
|
|
33
33
|
}>;
|
|
34
|
-
declare const SecretMetaSchema: _sinclair_typebox0.TObject<{
|
|
35
|
-
service: _sinclair_typebox0.TOptional<_sinclair_typebox0.TString>;
|
|
36
|
-
expires: _sinclair_typebox0.TOptional<_sinclair_typebox0.TString>;
|
|
37
|
-
rotation_url: _sinclair_typebox0.TOptional<_sinclair_typebox0.TString>;
|
|
38
|
-
purpose: _sinclair_typebox0.TOptional<_sinclair_typebox0.TString>;
|
|
39
|
-
comment: _sinclair_typebox0.TOptional<_sinclair_typebox0.TString>;
|
|
40
|
-
capabilities: _sinclair_typebox0.TOptional<_sinclair_typebox0.TArray<_sinclair_typebox0.TString>>;
|
|
41
|
-
created: _sinclair_typebox0.TOptional<_sinclair_typebox0.TString>;
|
|
42
|
-
rotates: _sinclair_typebox0.TOptional<_sinclair_typebox0.TString>;
|
|
43
|
-
rate_limit: _sinclair_typebox0.TOptional<_sinclair_typebox0.TString>;
|
|
44
|
-
model_hint: _sinclair_typebox0.TOptional<_sinclair_typebox0.TString>;
|
|
45
|
-
source: _sinclair_typebox0.TOptional<_sinclair_typebox0.TString>;
|
|
46
|
-
encrypted_value: _sinclair_typebox0.TOptional<_sinclair_typebox0.TString>;
|
|
47
|
-
required: _sinclair_typebox0.TOptional<_sinclair_typebox0.TBoolean>;
|
|
48
|
-
tags: _sinclair_typebox0.TOptional<_sinclair_typebox0.TRecord<_sinclair_typebox0.TString, _sinclair_typebox0.TString>>;
|
|
34
|
+
declare const SecretMetaSchema: _$_sinclair_typebox0.TObject<{
|
|
35
|
+
service: _$_sinclair_typebox0.TOptional<_$_sinclair_typebox0.TString>;
|
|
36
|
+
expires: _$_sinclair_typebox0.TOptional<_$_sinclair_typebox0.TString>;
|
|
37
|
+
rotation_url: _$_sinclair_typebox0.TOptional<_$_sinclair_typebox0.TString>;
|
|
38
|
+
purpose: _$_sinclair_typebox0.TOptional<_$_sinclair_typebox0.TString>;
|
|
39
|
+
comment: _$_sinclair_typebox0.TOptional<_$_sinclair_typebox0.TString>;
|
|
40
|
+
capabilities: _$_sinclair_typebox0.TOptional<_$_sinclair_typebox0.TArray<_$_sinclair_typebox0.TString>>;
|
|
41
|
+
created: _$_sinclair_typebox0.TOptional<_$_sinclair_typebox0.TString>;
|
|
42
|
+
rotates: _$_sinclair_typebox0.TOptional<_$_sinclair_typebox0.TString>;
|
|
43
|
+
rate_limit: _$_sinclair_typebox0.TOptional<_$_sinclair_typebox0.TString>;
|
|
44
|
+
model_hint: _$_sinclair_typebox0.TOptional<_$_sinclair_typebox0.TString>;
|
|
45
|
+
source: _$_sinclair_typebox0.TOptional<_$_sinclair_typebox0.TString>;
|
|
46
|
+
encrypted_value: _$_sinclair_typebox0.TOptional<_$_sinclair_typebox0.TString>;
|
|
47
|
+
required: _$_sinclair_typebox0.TOptional<_$_sinclair_typebox0.TBoolean>;
|
|
48
|
+
tags: _$_sinclair_typebox0.TOptional<_$_sinclair_typebox0.TRecord<_$_sinclair_typebox0.TString, _$_sinclair_typebox0.TString>>;
|
|
49
49
|
}>;
|
|
50
50
|
type SecretMeta = Static<typeof SecretMetaSchema>;
|
|
51
|
-
declare const LifecycleConfigSchema: _sinclair_typebox0.TObject<{
|
|
52
|
-
stale_warning_days: _sinclair_typebox0.TOptional<_sinclair_typebox0.TNumber>;
|
|
53
|
-
require_expiration: _sinclair_typebox0.TOptional<_sinclair_typebox0.TBoolean>;
|
|
54
|
-
require_service: _sinclair_typebox0.TOptional<_sinclair_typebox0.TBoolean>;
|
|
51
|
+
declare const LifecycleConfigSchema: _$_sinclair_typebox0.TObject<{
|
|
52
|
+
stale_warning_days: _$_sinclair_typebox0.TOptional<_$_sinclair_typebox0.TNumber>;
|
|
53
|
+
require_expiration: _$_sinclair_typebox0.TOptional<_$_sinclair_typebox0.TBoolean>;
|
|
54
|
+
require_service: _$_sinclair_typebox0.TOptional<_$_sinclair_typebox0.TBoolean>;
|
|
55
55
|
}>;
|
|
56
56
|
type LifecycleConfig = Static<typeof LifecycleConfigSchema>;
|
|
57
|
-
declare const CallbackConfigSchema: _sinclair_typebox0.TObject<{
|
|
58
|
-
on_expiring: _sinclair_typebox0.TOptional<_sinclair_typebox0.TString>;
|
|
59
|
-
on_expired: _sinclair_typebox0.TOptional<_sinclair_typebox0.TString>;
|
|
60
|
-
on_audit_fail: _sinclair_typebox0.TOptional<_sinclair_typebox0.TString>;
|
|
57
|
+
declare const CallbackConfigSchema: _$_sinclair_typebox0.TObject<{
|
|
58
|
+
on_expiring: _$_sinclair_typebox0.TOptional<_$_sinclair_typebox0.TString>;
|
|
59
|
+
on_expired: _$_sinclair_typebox0.TOptional<_$_sinclair_typebox0.TString>;
|
|
60
|
+
on_audit_fail: _$_sinclair_typebox0.TOptional<_$_sinclair_typebox0.TString>;
|
|
61
61
|
}>;
|
|
62
62
|
type CallbackConfig = Static<typeof CallbackConfigSchema>;
|
|
63
|
-
declare const ToolsConfigSchema: _sinclair_typebox0.TRecord<_sinclair_typebox0.TString, _sinclair_typebox0.TUnknown>;
|
|
63
|
+
declare const ToolsConfigSchema: _$_sinclair_typebox0.TRecord<_$_sinclair_typebox0.TString, _$_sinclair_typebox0.TUnknown>;
|
|
64
64
|
type ToolsConfig = Static<typeof ToolsConfigSchema>;
|
|
65
|
-
declare const EnvMetaSchema: _sinclair_typebox0.TObject<{
|
|
66
|
-
value: _sinclair_typebox0.TString;
|
|
67
|
-
purpose: _sinclair_typebox0.TOptional<_sinclair_typebox0.TString>;
|
|
68
|
-
comment: _sinclair_typebox0.TOptional<_sinclair_typebox0.TString>;
|
|
69
|
-
tags: _sinclair_typebox0.TOptional<_sinclair_typebox0.TRecord<_sinclair_typebox0.TString, _sinclair_typebox0.TString>>;
|
|
65
|
+
declare const EnvMetaSchema: _$_sinclair_typebox0.TObject<{
|
|
66
|
+
value: _$_sinclair_typebox0.TString;
|
|
67
|
+
purpose: _$_sinclair_typebox0.TOptional<_$_sinclair_typebox0.TString>;
|
|
68
|
+
comment: _$_sinclair_typebox0.TOptional<_$_sinclair_typebox0.TString>;
|
|
69
|
+
tags: _$_sinclair_typebox0.TOptional<_$_sinclair_typebox0.TRecord<_$_sinclair_typebox0.TString, _$_sinclair_typebox0.TString>>;
|
|
70
70
|
}>;
|
|
71
71
|
type EnvMeta = Static<typeof EnvMetaSchema>;
|
|
72
|
-
declare const EnvpktConfigSchema: _sinclair_typebox0.TObject<{
|
|
73
|
-
version: _sinclair_typebox0.TNumber;
|
|
74
|
-
catalog: _sinclair_typebox0.TOptional<_sinclair_typebox0.TString>;
|
|
75
|
-
identity: _sinclair_typebox0.TOptional<_sinclair_typebox0.TObject<{
|
|
76
|
-
name: _sinclair_typebox0.TString;
|
|
77
|
-
consumer: _sinclair_typebox0.TOptional<_sinclair_typebox0.TUnion<[_sinclair_typebox0.TLiteral<"agent">, _sinclair_typebox0.TLiteral<"service">, _sinclair_typebox0.TLiteral<"developer">, _sinclair_typebox0.TLiteral<"ci">]>>;
|
|
78
|
-
description: _sinclair_typebox0.TOptional<_sinclair_typebox0.TString>;
|
|
79
|
-
capabilities: _sinclair_typebox0.TOptional<_sinclair_typebox0.TArray<_sinclair_typebox0.TString>>;
|
|
80
|
-
expires: _sinclair_typebox0.TOptional<_sinclair_typebox0.TString>;
|
|
81
|
-
services: _sinclair_typebox0.TOptional<_sinclair_typebox0.TArray<_sinclair_typebox0.TString>>;
|
|
82
|
-
key_file: _sinclair_typebox0.TOptional<_sinclair_typebox0.TString>;
|
|
83
|
-
recipient: _sinclair_typebox0.TOptional<_sinclair_typebox0.TString>;
|
|
84
|
-
secrets: _sinclair_typebox0.TOptional<_sinclair_typebox0.TArray<_sinclair_typebox0.TString>>;
|
|
72
|
+
declare const EnvpktConfigSchema: _$_sinclair_typebox0.TObject<{
|
|
73
|
+
version: _$_sinclair_typebox0.TNumber;
|
|
74
|
+
catalog: _$_sinclair_typebox0.TOptional<_$_sinclair_typebox0.TString>;
|
|
75
|
+
identity: _$_sinclair_typebox0.TOptional<_$_sinclair_typebox0.TObject<{
|
|
76
|
+
name: _$_sinclair_typebox0.TString;
|
|
77
|
+
consumer: _$_sinclair_typebox0.TOptional<_$_sinclair_typebox0.TUnion<[_$_sinclair_typebox0.TLiteral<"agent">, _$_sinclair_typebox0.TLiteral<"service">, _$_sinclair_typebox0.TLiteral<"developer">, _$_sinclair_typebox0.TLiteral<"ci">]>>;
|
|
78
|
+
description: _$_sinclair_typebox0.TOptional<_$_sinclair_typebox0.TString>;
|
|
79
|
+
capabilities: _$_sinclair_typebox0.TOptional<_$_sinclair_typebox0.TArray<_$_sinclair_typebox0.TString>>;
|
|
80
|
+
expires: _$_sinclair_typebox0.TOptional<_$_sinclair_typebox0.TString>;
|
|
81
|
+
services: _$_sinclair_typebox0.TOptional<_$_sinclair_typebox0.TArray<_$_sinclair_typebox0.TString>>;
|
|
82
|
+
key_file: _$_sinclair_typebox0.TOptional<_$_sinclair_typebox0.TString>;
|
|
83
|
+
recipient: _$_sinclair_typebox0.TOptional<_$_sinclair_typebox0.TString>;
|
|
84
|
+
secrets: _$_sinclair_typebox0.TOptional<_$_sinclair_typebox0.TArray<_$_sinclair_typebox0.TString>>;
|
|
85
85
|
}>>;
|
|
86
|
-
secret: _sinclair_typebox0.TOptional<_sinclair_typebox0.TRecord<_sinclair_typebox0.TString, _sinclair_typebox0.TObject<{
|
|
87
|
-
service: _sinclair_typebox0.TOptional<_sinclair_typebox0.TString>;
|
|
88
|
-
expires: _sinclair_typebox0.TOptional<_sinclair_typebox0.TString>;
|
|
89
|
-
rotation_url: _sinclair_typebox0.TOptional<_sinclair_typebox0.TString>;
|
|
90
|
-
purpose: _sinclair_typebox0.TOptional<_sinclair_typebox0.TString>;
|
|
91
|
-
comment: _sinclair_typebox0.TOptional<_sinclair_typebox0.TString>;
|
|
92
|
-
capabilities: _sinclair_typebox0.TOptional<_sinclair_typebox0.TArray<_sinclair_typebox0.TString>>;
|
|
93
|
-
created: _sinclair_typebox0.TOptional<_sinclair_typebox0.TString>;
|
|
94
|
-
rotates: _sinclair_typebox0.TOptional<_sinclair_typebox0.TString>;
|
|
95
|
-
rate_limit: _sinclair_typebox0.TOptional<_sinclair_typebox0.TString>;
|
|
96
|
-
model_hint: _sinclair_typebox0.TOptional<_sinclair_typebox0.TString>;
|
|
97
|
-
source: _sinclair_typebox0.TOptional<_sinclair_typebox0.TString>;
|
|
98
|
-
encrypted_value: _sinclair_typebox0.TOptional<_sinclair_typebox0.TString>;
|
|
99
|
-
required: _sinclair_typebox0.TOptional<_sinclair_typebox0.TBoolean>;
|
|
100
|
-
tags: _sinclair_typebox0.TOptional<_sinclair_typebox0.TRecord<_sinclair_typebox0.TString, _sinclair_typebox0.TString>>;
|
|
86
|
+
secret: _$_sinclair_typebox0.TOptional<_$_sinclair_typebox0.TRecord<_$_sinclair_typebox0.TString, _$_sinclair_typebox0.TObject<{
|
|
87
|
+
service: _$_sinclair_typebox0.TOptional<_$_sinclair_typebox0.TString>;
|
|
88
|
+
expires: _$_sinclair_typebox0.TOptional<_$_sinclair_typebox0.TString>;
|
|
89
|
+
rotation_url: _$_sinclair_typebox0.TOptional<_$_sinclair_typebox0.TString>;
|
|
90
|
+
purpose: _$_sinclair_typebox0.TOptional<_$_sinclair_typebox0.TString>;
|
|
91
|
+
comment: _$_sinclair_typebox0.TOptional<_$_sinclair_typebox0.TString>;
|
|
92
|
+
capabilities: _$_sinclair_typebox0.TOptional<_$_sinclair_typebox0.TArray<_$_sinclair_typebox0.TString>>;
|
|
93
|
+
created: _$_sinclair_typebox0.TOptional<_$_sinclair_typebox0.TString>;
|
|
94
|
+
rotates: _$_sinclair_typebox0.TOptional<_$_sinclair_typebox0.TString>;
|
|
95
|
+
rate_limit: _$_sinclair_typebox0.TOptional<_$_sinclair_typebox0.TString>;
|
|
96
|
+
model_hint: _$_sinclair_typebox0.TOptional<_$_sinclair_typebox0.TString>;
|
|
97
|
+
source: _$_sinclair_typebox0.TOptional<_$_sinclair_typebox0.TString>;
|
|
98
|
+
encrypted_value: _$_sinclair_typebox0.TOptional<_$_sinclair_typebox0.TString>;
|
|
99
|
+
required: _$_sinclair_typebox0.TOptional<_$_sinclair_typebox0.TBoolean>;
|
|
100
|
+
tags: _$_sinclair_typebox0.TOptional<_$_sinclair_typebox0.TRecord<_$_sinclair_typebox0.TString, _$_sinclair_typebox0.TString>>;
|
|
101
101
|
}>>>;
|
|
102
|
-
env: _sinclair_typebox0.TOptional<_sinclair_typebox0.TRecord<_sinclair_typebox0.TString, _sinclair_typebox0.TObject<{
|
|
103
|
-
value: _sinclair_typebox0.TString;
|
|
104
|
-
purpose: _sinclair_typebox0.TOptional<_sinclair_typebox0.TString>;
|
|
105
|
-
comment: _sinclair_typebox0.TOptional<_sinclair_typebox0.TString>;
|
|
106
|
-
tags: _sinclair_typebox0.TOptional<_sinclair_typebox0.TRecord<_sinclair_typebox0.TString, _sinclair_typebox0.TString>>;
|
|
102
|
+
env: _$_sinclair_typebox0.TOptional<_$_sinclair_typebox0.TRecord<_$_sinclair_typebox0.TString, _$_sinclair_typebox0.TObject<{
|
|
103
|
+
value: _$_sinclair_typebox0.TString;
|
|
104
|
+
purpose: _$_sinclair_typebox0.TOptional<_$_sinclair_typebox0.TString>;
|
|
105
|
+
comment: _$_sinclair_typebox0.TOptional<_$_sinclair_typebox0.TString>;
|
|
106
|
+
tags: _$_sinclair_typebox0.TOptional<_$_sinclair_typebox0.TRecord<_$_sinclair_typebox0.TString, _$_sinclair_typebox0.TString>>;
|
|
107
107
|
}>>>;
|
|
108
|
-
lifecycle: _sinclair_typebox0.TOptional<_sinclair_typebox0.TObject<{
|
|
109
|
-
stale_warning_days: _sinclair_typebox0.TOptional<_sinclair_typebox0.TNumber>;
|
|
110
|
-
require_expiration: _sinclair_typebox0.TOptional<_sinclair_typebox0.TBoolean>;
|
|
111
|
-
require_service: _sinclair_typebox0.TOptional<_sinclair_typebox0.TBoolean>;
|
|
108
|
+
lifecycle: _$_sinclair_typebox0.TOptional<_$_sinclair_typebox0.TObject<{
|
|
109
|
+
stale_warning_days: _$_sinclair_typebox0.TOptional<_$_sinclair_typebox0.TNumber>;
|
|
110
|
+
require_expiration: _$_sinclair_typebox0.TOptional<_$_sinclair_typebox0.TBoolean>;
|
|
111
|
+
require_service: _$_sinclair_typebox0.TOptional<_$_sinclair_typebox0.TBoolean>;
|
|
112
112
|
}>>;
|
|
113
|
-
callbacks: _sinclair_typebox0.TOptional<_sinclair_typebox0.TObject<{
|
|
114
|
-
on_expiring: _sinclair_typebox0.TOptional<_sinclair_typebox0.TString>;
|
|
115
|
-
on_expired: _sinclair_typebox0.TOptional<_sinclair_typebox0.TString>;
|
|
116
|
-
on_audit_fail: _sinclair_typebox0.TOptional<_sinclair_typebox0.TString>;
|
|
113
|
+
callbacks: _$_sinclair_typebox0.TOptional<_$_sinclair_typebox0.TObject<{
|
|
114
|
+
on_expiring: _$_sinclair_typebox0.TOptional<_$_sinclair_typebox0.TString>;
|
|
115
|
+
on_expired: _$_sinclair_typebox0.TOptional<_$_sinclair_typebox0.TString>;
|
|
116
|
+
on_audit_fail: _$_sinclair_typebox0.TOptional<_$_sinclair_typebox0.TString>;
|
|
117
117
|
}>>;
|
|
118
|
-
tools: _sinclair_typebox0.TOptional<_sinclair_typebox0.TRecord<_sinclair_typebox0.TString, _sinclair_typebox0.TUnknown>>;
|
|
118
|
+
tools: _$_sinclair_typebox0.TOptional<_$_sinclair_typebox0.TRecord<_$_sinclair_typebox0.TString, _$_sinclair_typebox0.TUnknown>>;
|
|
119
119
|
}>;
|
|
120
120
|
type EnvpktConfig = Static<typeof EnvpktConfigSchema>;
|
|
121
121
|
//#endregion
|
package/dist/index.js
CHANGED
|
@@ -11,7 +11,6 @@ import { createInterface } from "node:readline";
|
|
|
11
11
|
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
12
12
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
13
13
|
import { CallToolRequestSchema, ListResourcesRequestSchema, ListToolsRequestSchema, ReadResourceRequestSchema } from "@modelcontextprotocol/sdk/types.js";
|
|
14
|
-
|
|
15
14
|
//#region src/core/schema.ts
|
|
16
15
|
const DATE_RE = /^\d{4}-\d{2}-\d{2}$/;
|
|
17
16
|
const URI_RE = /^https?:\/\/.+/;
|
|
@@ -107,7 +106,6 @@ const EnvpktConfigSchema = Type.Object({
|
|
|
107
106
|
title: "envpkt configuration",
|
|
108
107
|
description: "Credential lifecycle and fleet management configuration for AI agents"
|
|
109
108
|
});
|
|
110
|
-
|
|
111
109
|
//#endregion
|
|
112
110
|
//#region src/core/config.ts
|
|
113
111
|
const CONFIG_FILENAME$1 = "envpkt.toml";
|
|
@@ -282,7 +280,6 @@ const resolveConfigPath = (flagPath, envVar, cwd) => {
|
|
|
282
280
|
source
|
|
283
281
|
}));
|
|
284
282
|
};
|
|
285
|
-
|
|
286
283
|
//#endregion
|
|
287
284
|
//#region src/core/catalog.ts
|
|
288
285
|
/** Load and validate a catalog file, mapping ConfigError → CatalogError */
|
|
@@ -359,7 +356,6 @@ const resolveConfig = (agentConfig, agentConfigDir) => {
|
|
|
359
356
|
};
|
|
360
357
|
}));
|
|
361
358
|
};
|
|
362
|
-
|
|
363
359
|
//#endregion
|
|
364
360
|
//#region src/core/format.ts
|
|
365
361
|
const maskValue = (value) => {
|
|
@@ -432,7 +428,6 @@ const formatPacket = (result, options) => {
|
|
|
432
428
|
}
|
|
433
429
|
return sections.join("\n\n");
|
|
434
430
|
};
|
|
435
|
-
|
|
436
431
|
//#endregion
|
|
437
432
|
//#region src/core/audit.ts
|
|
438
433
|
const MS_PER_DAY = 864e5;
|
|
@@ -531,7 +526,6 @@ const computeEnvAudit = (config, env = process.env) => {
|
|
|
531
526
|
missing: entries.filter((e) => e.status === "missing").length
|
|
532
527
|
};
|
|
533
528
|
};
|
|
534
|
-
|
|
535
529
|
//#endregion
|
|
536
530
|
//#region src/core/patterns.ts
|
|
537
531
|
const EXCLUDED_VARS = new Set([
|
|
@@ -1230,7 +1224,6 @@ const scanEnv = (env) => {
|
|
|
1230
1224
|
});
|
|
1231
1225
|
return results;
|
|
1232
1226
|
};
|
|
1233
|
-
|
|
1234
1227
|
//#endregion
|
|
1235
1228
|
//#region src/core/env.ts
|
|
1236
1229
|
/** Scan env for credentials, returning structured results */
|
|
@@ -1313,7 +1306,6 @@ created = "${todayIso()}"
|
|
|
1313
1306
|
}
|
|
1314
1307
|
return blocks.join("\n");
|
|
1315
1308
|
};
|
|
1316
|
-
|
|
1317
1309
|
//#endregion
|
|
1318
1310
|
//#region src/fnox/cli.ts
|
|
1319
1311
|
/** Export all secrets from fnox as key=value pairs for a given profile */
|
|
@@ -1367,7 +1359,6 @@ const fnoxGet = (key, profile, agentKey) => {
|
|
|
1367
1359
|
message: `fnox get ${key} failed: ${err}`
|
|
1368
1360
|
}), (output) => Right(output.trim()));
|
|
1369
1361
|
};
|
|
1370
|
-
|
|
1371
1362
|
//#endregion
|
|
1372
1363
|
//#region src/fnox/detect.ts
|
|
1373
1364
|
const FNOX_CONFIG = "fnox.toml";
|
|
@@ -1381,7 +1372,6 @@ const fnoxAvailable = () => Try(() => {
|
|
|
1381
1372
|
execFileSync("fnox", ["--version"], { stdio: "pipe" });
|
|
1382
1373
|
return true;
|
|
1383
1374
|
}).fold(() => false, (v) => v);
|
|
1384
|
-
|
|
1385
1375
|
//#endregion
|
|
1386
1376
|
//#region src/fnox/identity.ts
|
|
1387
1377
|
/** Check if the age CLI is available on PATH */
|
|
@@ -1411,7 +1401,6 @@ const unwrapAgentKey = (identityPath) => {
|
|
|
1411
1401
|
message: `age decrypt failed: ${err}`
|
|
1412
1402
|
}), (output) => Right(output.trim()));
|
|
1413
1403
|
};
|
|
1414
|
-
|
|
1415
1404
|
//#endregion
|
|
1416
1405
|
//#region src/fnox/parse.ts
|
|
1417
1406
|
/** Read and parse fnox.toml, extracting secret keys and profiles */
|
|
@@ -1432,7 +1421,6 @@ const readFnoxConfig = (path) => Try(() => readFileSync(path, "utf-8")).fold((er
|
|
|
1432
1421
|
}));
|
|
1433
1422
|
/** Extract the set of secret key names from a parsed fnox config */
|
|
1434
1423
|
const extractFnoxKeys = (config) => new Set(Object.keys(config.secrets));
|
|
1435
|
-
|
|
1436
1424
|
//#endregion
|
|
1437
1425
|
//#region src/core/keygen.ts
|
|
1438
1426
|
/** Resolve the age identity file path: ENVPKT_AGE_KEY_FILE env var > ~/.envpkt/age-key.txt */
|
|
@@ -1537,7 +1525,6 @@ const updateConfigRecipient = (configPath, recipient) => {
|
|
|
1537
1525
|
}), () => Right(true));
|
|
1538
1526
|
});
|
|
1539
1527
|
};
|
|
1540
|
-
|
|
1541
1528
|
//#endregion
|
|
1542
1529
|
//#region src/core/seal.ts
|
|
1543
1530
|
/** Encrypt a plaintext string using age with the given recipient public key (armored output) */
|
|
@@ -1637,7 +1624,6 @@ const unsealSecrets = (meta, identityPath) => {
|
|
|
1637
1624
|
}
|
|
1638
1625
|
return Right(result);
|
|
1639
1626
|
};
|
|
1640
|
-
|
|
1641
1627
|
//#endregion
|
|
1642
1628
|
//#region src/core/boot.ts
|
|
1643
1629
|
const resolveAndLoad = (opts) => resolveConfigPath(opts.configPath).fold((err) => Left(err), ({ path: configPath, source: configSource }) => loadConfig(configPath).fold((err) => Left(err), (config) => {
|
|
@@ -1794,7 +1780,6 @@ const formatBootError = (error) => {
|
|
|
1794
1780
|
default: return `Boot error: ${JSON.stringify(error)}`;
|
|
1795
1781
|
}
|
|
1796
1782
|
};
|
|
1797
|
-
|
|
1798
1783
|
//#endregion
|
|
1799
1784
|
//#region src/core/resolve-values.ts
|
|
1800
1785
|
/** Resolve plaintext values for the given keys via cascade: fnox → env → interactive prompt */
|
|
@@ -1830,7 +1815,6 @@ const resolveValues = async (keys, profile, agentKey) => {
|
|
|
1830
1815
|
}
|
|
1831
1816
|
return result;
|
|
1832
1817
|
};
|
|
1833
|
-
|
|
1834
1818
|
//#endregion
|
|
1835
1819
|
//#region src/core/toml-edit.ts
|
|
1836
1820
|
const SECTION_RE = /^\[.+\]\s*$/;
|
|
@@ -1980,7 +1964,6 @@ const updateSectionFields = (raw, sectionHeader, updates) => {
|
|
|
1980
1964
|
* Ensures proper spacing (double newline before the block).
|
|
1981
1965
|
*/
|
|
1982
1966
|
const appendSection = (raw, block) => `${raw.trimEnd()}\n\n${block}`;
|
|
1983
|
-
|
|
1984
1967
|
//#endregion
|
|
1985
1968
|
//#region src/core/fleet.ts
|
|
1986
1969
|
const CONFIG_FILENAME = "envpkt.toml";
|
|
@@ -2045,7 +2028,6 @@ const scanFleet = (rootDir, options) => {
|
|
|
2045
2028
|
expiring_soon
|
|
2046
2029
|
};
|
|
2047
2030
|
};
|
|
2048
|
-
|
|
2049
2031
|
//#endregion
|
|
2050
2032
|
//#region src/fnox/sync.ts
|
|
2051
2033
|
/** Compare fnox keys and envpkt meta keys to find mismatches */
|
|
@@ -2055,7 +2037,6 @@ const compareFnoxAndEnvpkt = (fnoxKeys, envpktKeys) => {
|
|
|
2055
2037
|
orphaned: List([...envpktKeys].filter((k) => !fnoxKeys.has(k)))
|
|
2056
2038
|
};
|
|
2057
2039
|
};
|
|
2058
|
-
|
|
2059
2040
|
//#endregion
|
|
2060
2041
|
//#region src/mcp/resources.ts
|
|
2061
2042
|
const loadConfigSafe = () => {
|
|
@@ -2133,7 +2114,6 @@ const readResource = (uri) => {
|
|
|
2133
2114
|
const handler = resourceHandlers[uri];
|
|
2134
2115
|
return handler?.();
|
|
2135
2116
|
};
|
|
2136
|
-
|
|
2137
2117
|
//#endregion
|
|
2138
2118
|
//#region src/mcp/tools.ts
|
|
2139
2119
|
const textResult = (text) => ({ content: [{
|
|
@@ -2324,7 +2304,6 @@ const callTool = (name, args) => {
|
|
|
2324
2304
|
if (!handler) return errorResult(`Unknown tool: ${name}`);
|
|
2325
2305
|
return handler(args);
|
|
2326
2306
|
};
|
|
2327
|
-
|
|
2328
2307
|
//#endregion
|
|
2329
2308
|
//#region src/mcp/server.ts
|
|
2330
2309
|
const createServer = () => {
|
|
@@ -2365,6 +2344,5 @@ const startServer = async () => {
|
|
|
2365
2344
|
const transport = new StdioServerTransport();
|
|
2366
2345
|
await server.connect(transport);
|
|
2367
2346
|
};
|
|
2368
|
-
|
|
2369
2347
|
//#endregion
|
|
2370
|
-
export { AgentIdentitySchema, CallbackConfigSchema, ConsumerType, EnvMetaSchema, EnvpktBootError, EnvpktConfigSchema, IdentitySchema, LifecycleConfigSchema, SecretMetaSchema, ToolsConfigSchema, ageAvailable, ageDecrypt, ageEncrypt, appendSection, boot, bootSafe, callTool, compareFnoxAndEnvpkt, computeAudit, computeEnvAudit, createServer, deriveServiceFromName, detectFnox, discoverConfig, envCheck, envScan, extractFnoxKeys, findConfigPath, fnoxAvailable, fnoxExport, fnoxGet, formatPacket, generateKeypair, generateTomlFromScan, loadCatalog, loadConfig, loadConfigFromCwd, maskValue, matchEnvVar, matchValueShape, parseToml, readConfigFile, readFnoxConfig, readResource, removeSection, renameSection, resolveConfig, resolveConfigPath, resolveInlineKey, resolveKeyPath, resolveSecrets, resolveValues, resourceDefinitions, scanEnv, scanFleet, sealSecrets, startServer, toolDefinitions, unsealSecrets, unwrapAgentKey, updateConfigRecipient, updateSectionFields, validateConfig };
|
|
2348
|
+
export { AgentIdentitySchema, CallbackConfigSchema, ConsumerType, EnvMetaSchema, EnvpktBootError, EnvpktConfigSchema, IdentitySchema, LifecycleConfigSchema, SecretMetaSchema, ToolsConfigSchema, ageAvailable, ageDecrypt, ageEncrypt, appendSection, boot, bootSafe, callTool, compareFnoxAndEnvpkt, computeAudit, computeEnvAudit, createServer, deriveServiceFromName, detectFnox, discoverConfig, envCheck, envScan, extractFnoxKeys, findConfigPath, fnoxAvailable, fnoxExport, fnoxGet, formatPacket, generateKeypair, generateTomlFromScan, loadCatalog, loadConfig, loadConfigFromCwd, maskValue, matchEnvVar, matchValueShape, parseToml, readConfigFile, readFnoxConfig, readResource, removeSection, renameSection, resolveConfig, resolveConfigPath, resolveInlineKey, resolveKeyPath, resolveSecrets, resolveValues, resourceDefinitions, scanEnv, scanFleet, sealSecrets, startServer, toolDefinitions, unsealSecrets, unwrapAgentKey, updateConfigRecipient, updateSectionFields, validateConfig };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "envpkt",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.3",
|
|
4
4
|
"description": "Credential lifecycle and fleet management for AI agents",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"credentials",
|
|
@@ -20,36 +20,18 @@
|
|
|
20
20
|
"bin": {
|
|
21
21
|
"envpkt": "dist/cli.js"
|
|
22
22
|
},
|
|
23
|
-
"scripts": {
|
|
24
|
-
"validate": "ts-builds validate",
|
|
25
|
-
"format": "ts-builds format",
|
|
26
|
-
"format:check": "ts-builds format:check",
|
|
27
|
-
"lint": "ts-builds lint",
|
|
28
|
-
"lint:check": "ts-builds lint:check",
|
|
29
|
-
"typecheck": "ts-builds typecheck",
|
|
30
|
-
"test": "ts-builds test",
|
|
31
|
-
"test:watch": "ts-builds test:watch",
|
|
32
|
-
"test:coverage": "ts-builds test:coverage",
|
|
33
|
-
"build": "ts-builds build",
|
|
34
|
-
"build:schema": "tsx scripts/build-schema.ts",
|
|
35
|
-
"demo": "tsx scripts/generate-demo-html.ts",
|
|
36
|
-
"dev": "ts-builds dev",
|
|
37
|
-
"docs:dev": "pnpm --dir site dev",
|
|
38
|
-
"docs:build": "pnpm --dir site build",
|
|
39
|
-
"prepublishOnly": "pnpm validate"
|
|
40
|
-
},
|
|
41
23
|
"dependencies": {
|
|
42
|
-
"@modelcontextprotocol/sdk": "^1.
|
|
43
|
-
"@sinclair/typebox": "^0.34.
|
|
24
|
+
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
25
|
+
"@sinclair/typebox": "^0.34.49",
|
|
44
26
|
"commander": "^14.0.3",
|
|
45
|
-
"functype": "^0.
|
|
46
|
-
"functype-os": "^0.
|
|
47
|
-
"smol-toml": "^1.6.
|
|
27
|
+
"functype": "^0.56.0",
|
|
28
|
+
"functype-os": "^0.4.2",
|
|
29
|
+
"smol-toml": "^1.6.1"
|
|
48
30
|
},
|
|
49
31
|
"devDependencies": {
|
|
50
|
-
"@types/node": "^24.12.
|
|
51
|
-
"ts-builds": "^2.
|
|
52
|
-
"tsdown": "^0.
|
|
32
|
+
"@types/node": "^24.12.2",
|
|
33
|
+
"ts-builds": "^2.6.3",
|
|
34
|
+
"tsdown": "^0.21.7",
|
|
53
35
|
"tsx": "^4.21.0"
|
|
54
36
|
},
|
|
55
37
|
"type": "module",
|
|
@@ -70,5 +52,21 @@
|
|
|
70
52
|
"schemas"
|
|
71
53
|
],
|
|
72
54
|
"prettier": "ts-builds/prettier",
|
|
73
|
-
"
|
|
74
|
-
|
|
55
|
+
"scripts": {
|
|
56
|
+
"validate": "ts-builds validate",
|
|
57
|
+
"format": "ts-builds format",
|
|
58
|
+
"format:check": "ts-builds format:check",
|
|
59
|
+
"lint": "ts-builds lint",
|
|
60
|
+
"lint:check": "ts-builds lint:check",
|
|
61
|
+
"typecheck": "ts-builds typecheck",
|
|
62
|
+
"test": "ts-builds test",
|
|
63
|
+
"test:watch": "ts-builds test:watch",
|
|
64
|
+
"test:coverage": "ts-builds test:coverage",
|
|
65
|
+
"build": "ts-builds build",
|
|
66
|
+
"build:schema": "tsx scripts/build-schema.ts",
|
|
67
|
+
"demo": "tsx scripts/generate-demo-html.ts",
|
|
68
|
+
"dev": "ts-builds dev",
|
|
69
|
+
"docs:dev": "pnpm --dir site dev",
|
|
70
|
+
"docs:build": "pnpm --dir site build"
|
|
71
|
+
}
|
|
72
|
+
}
|