diff --git a/package/src/api-types.ts b/package/src/api-types.ts index 4c5a06c9c..62dbfcaea 100644 --- a/package/src/api-types.ts +++ b/package/src/api-types.ts @@ -19,13 +19,13 @@ export type VersionSpec = string; export type UnresolvedVersionSpec = string; /** Target where host logs should be written to. */ -export type HostLogTarget = 'stderr' | 'stdout' | 'tracing'; +export type HostLogTarget = 'stderr' | 'stdout' | 'debug' | 'error' | 'trace' | 'warn' | 'tracing'; /** Input passed to the `host_log` host function. */ export interface HostLogInput { data?: Record; message: string; - /** @type {'stderr' | 'stdout' | 'tracing'} */ + /** @type {'stderr' | 'stdout' | 'debug' | 'error' | 'trace' | 'warn' | 'tracing'} */ target?: HostLogTarget; } @@ -153,10 +153,21 @@ export interface RegisterToolOutput { unstable?: Switch; } +/** Information about the current state of the tool. */ +export interface ToolUnresolvedContext { + /** The version of proto (the core crate) calling plugin functions. */ + protoVersion?: string | null; + /** Virtual path to the tool's temporary directory. */ + tempDir: VirtualPath; + toolDir: VirtualPath; + /** Current version if defined. */ + version?: VersionSpec | null; +} + /** Input passed to the `register_backend` function. */ export interface RegisterBackendInput { /** Current tool context. */ - context: ToolContext; + context: ToolUnresolvedContext; /** ID of the tool, as it was configured. */ id: string; } @@ -208,6 +219,8 @@ export interface DetectVersionOutput { export interface ParseVersionFileInput { /** File contents to parse/extract a version from. */ content: string; + /** Current tool context. */ + context: ToolUnresolvedContext; /** Name of file that's being parsed. */ file: string; /** Virtual path to the file being parsed. */ @@ -245,6 +258,8 @@ export interface NativeInstallOutput { export interface NativeUninstallInput { /** Current tool context. */ context: ToolContext; + /** Virtual directory to uninstall from. */ + uninstallDir: VirtualPath; } /** Output returned by the `native_uninstall` function. */ @@ -324,6 +339,8 @@ export interface VerifyChecksumOutput { export interface LocateExecutablesInput { /** Current tool context. */ context: ToolContext; + /** Virtual directory the tool was installed to. */ + installDir: VirtualPath; } export type StringOrVec = string | string[]; @@ -344,6 +361,11 @@ export interface ExecutableConfig { noBin?: boolean; /** Do not generate a shim in `~/.proto/shims`. */ noShim?: boolean; + /** + * List of arguments to append to the parent executable, but prepend before + * all other arguments. + */ + parentExeArgs?: string[]; /** The parent executable name required to execute the local executable path. */ parentExeName?: string | null; /** Whether this is the primary executable or not. */ @@ -363,12 +385,13 @@ export interface LocateExecutablesOutput { * The map key will be the name of the executable file. */ exes?: Record; + exesDir?: string | null; /** * Relative directory path from the tool install directory in which * pre-installed executables can be located. This directory path * will be used during `proto activate`, but not for bins/shims. */ - exesDir?: string | null; + exesDirs?: string[]; /** * List of directory paths to find the globals installation directory. * Each path supports environment variable expansion. @@ -379,22 +402,12 @@ export interface LocateExecutablesOutput { * when listing and filtering available globals. */ globalsPrefix?: string | null; - /** - * Configures the primary/default executable to create. - * If not provided, a primary shim and binary will *not* be created. - */ - primary?: ExecutableConfig | null; - /** - * Configures secondary/additional executables to create. - * The map key is the name of the shim/binary file. - */ - secondary?: Record; } /** Input passed to the `load_versions` function. */ export interface LoadVersionsInput { /** Current tool context. */ - context: ToolContext; + context: ToolUnresolvedContext; /** The alias or version currently being resolved. */ initial: UnresolvedVersionSpec; } @@ -414,7 +427,7 @@ export interface LoadVersionsOutput { /** Input passed to the `resolve_version` function. */ export interface ResolveVersionInput { /** Current tool context. */ - context: ToolContext; + context: ToolUnresolvedContext; /** The alias or version currently being resolved. */ initial: UnresolvedVersionSpec; } @@ -507,12 +520,16 @@ export interface RunHookResult { * Will overwrite any existing variables. */ env?: Record | null; + /** Additional paths to prepend to `PATH` for the running command. */ + paths?: string[] | null; } /** Input passed to the `build_instructions` function. */ export interface BuildInstructionsInput { /** Current tool context. */ context: ToolContext; + /** Virtual directory to install to. */ + installDir: VirtualPath; } export type BuildInstruction = { diff --git a/registry/data/third-party.json b/registry/data/third-party.json index aaf3cb24d..7379f4eef 100644 --- a/registry/data/third-party.json +++ b/registry/data/third-party.json @@ -273,12 +273,12 @@ { "id": "dotenvx", "locator": "https://gist.githubusercontent.com/alexbepple/9740643dbe1b2d423490b1fee21af807/raw/e2d85b647da191d339dfbf3e3e1cefb21616e7c7/dotenvx.toml", - "repositoryUrl": "https://gist.github.com/alexbepple/9740643dbe1b2d423490b1fee21af807", "format": "toml", - "author": "alexbepple", "name": "dotenvx", - "homepageUrl": "https://dotenvx.com/", "description": "Inject your env at runtime. A better dotenv – from the creator of dotenv.", + "author": "alexbepple", + "homepageUrl": "https://dotenvx.com/", + "repositoryUrl": "https://gist.github.com/alexbepple/9740643dbe1b2d423490b1fee21af807", "bins": [ "dotenvx" ] @@ -672,13 +672,13 @@ }, { "id": "kubectl", - "locator": "https://raw.githubusercontent.com/stk0vrfl0w/proto-toml-plugins/main/plugins/kubectl.toml", + "locator": "https://raw.githubusercontent.com/trillion-labs/proto-plugins/refs/heads/main/kubectl.toml", "format": "toml", "name": "kubectl", "description": "Kubernetes command line tool.", - "author": "stk0vrfl0w", + "author": "Trillion Labs", "homepageUrl": "https://kubernetes.io/", - "repositoryUrl": "https://github.com/stk0vrfl0w/proto-toml-plugins/blob/main/plugins/kubectl.toml", + "repositoryUrl": "https://github.com/trillion-labs/proto-plugins", "devicon": "kubernetes", "bins": [ "kubectl"