@promptbook/google
Version:
Promptbook: Create persistent AI agents that turn your company's scattered knowledge into action
103 lines (102 loc) • 4 kB
TypeScript
import type { PromptRunnerHarnessName } from '../promptRunnerCliOptions';
/**
* Description of a standalone *(self-managed)* installation of one CLI coding harness.
*
* Some harnesses are also distributed by their own installer which puts the harness outside of npm and
* updates it in place. Such an installation must never be updated with `npm install -g`, because that
* installs a second copy of the harness instead of updating the one which is really used.
*
* @private internal utility of `promptbookCli`
*/
export type HarnessStandaloneInstallation = {
/**
* Directory names which appear in the resolved path of a standalone installation of the harness,
* for example `.codex` in `~/.codex/packages/standalone/current/bin/codex`.
*/
readonly directoryNames: ReadonlyArray<string>;
/**
* Command which updates the standalone installation in place.
*/
readonly updateCommand: string;
};
/**
* Description of how the user signs in to one CLI coding harness again.
*
* Every harness refuses to work once its login is missing or its session has expired, and each of them is
* signed in differently - some have a dedicated login command, others sign in from their own interactive UI.
*
* @private internal utility of `promptbookCli`
*/
export type HarnessAuthenticationMethod = {
/**
* Command which starts the sign-in flow of the harness.
*/
readonly command: string;
/**
* Step which finishes the sign-in inside the started command.
*
* Harnesses which sign in from their own interactive user interface leave the user in that interface, so
* naming just the command would not be enough to get them signed in. Harnesses with a dedicated login
* command leave this undefined.
*/
readonly interactiveStep?: string;
};
/**
* Static description of one supported CLI coding harness.
*
* @private internal utility of `promptbookCli`
*/
export type HarnessDefinition = {
/**
* Harness identifier used by the `--harness` option.
*/
readonly harnessName: PromptRunnerHarnessName;
/**
* Human-readable harness name shown in the terminal.
*/
readonly label: string;
/**
* Globally installed command which runs the harness.
*/
readonly commandName: string;
/**
* Npm package which installs the harness command globally.
*/
readonly npmPackageName: string;
/**
* Extra environment variables required by the global npm installation of this harness.
*/
readonly npmInstallEnvironment?: Readonly<Record<string, string>>;
/**
* Project-local files or directories which this harness can create and which should not be committed.
*/
readonly projectGitignoreRules: ReadonlyArray<string>;
/**
* How the user signs in to this harness again after its login is missing or has expired.
*/
readonly authenticationMethod: HarnessAuthenticationMethod;
/**
* How a standalone installation of this harness is recognized and updated.
*
* Harnesses which are distributed only through npm leave this undefined.
*/
readonly standaloneInstallation?: HarnessStandaloneInstallation;
};
/**
* Single source of truth about how each supported CLI coding harness is installed and detected.
*
* @private internal utility of `promptbookCli`
*/
export declare const HARNESS_DEFINITIONS: Readonly<Record<PromptRunnerHarnessName, HarnessDefinition>>;
/**
* Looks up the definition of one supported CLI coding harness.
*
* @private internal utility of `promptbookCli`
*/
export declare function getHarnessDefinition(harnessName: PromptRunnerHarnessName): HarnessDefinition;
/**
* Lists the unique project ignore rules required by the selected harnesses, in selection order.
*
* @private internal utility of `promptbookCli`
*/
export declare function getHarnessProjectGitignoreRules(harnessNames: ReadonlyArray<PromptRunnerHarnessName>): ReadonlyArray<string>;