@hue-run/sdk 0.4.2 → 0.5.0
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/CLI.md +192 -4
- package/ENVIRONMENTS.md +29 -8
- package/EVALUATIONS.md +125 -4
- package/README.md +27 -2
- package/dist/cli/eval-direct.d.ts +47 -0
- package/dist/cli/eval-direct.js +171 -0
- package/dist/cli/eval.d.ts +28 -0
- package/dist/cli/eval.js +985 -0
- package/dist/cli/login.d.ts +32 -0
- package/dist/cli/login.js +712 -0
- package/dist/cli/mcp.d.ts +76 -0
- package/dist/cli/mcp.js +466 -0
- package/dist/evals/client.d.ts +30 -1
- package/dist/evals/client.js +138 -1
- package/dist/evals/files.d.ts +50 -0
- package/dist/evals/files.js +223 -0
- package/dist/evals/local-worker.d.ts +49 -4
- package/dist/evals/local-worker.js +63 -12
- package/dist/evals/runner.d.ts +30 -10
- package/dist/evals/runner.js +216 -68
- package/dist/evals/scenarios.d.ts +79 -0
- package/dist/evals/scenarios.js +169 -0
- package/dist/evals/scorers.d.ts +13 -0
- package/dist/evals/scorers.js +21 -3
- package/dist/evals/simulation.d.ts +12 -1
- package/dist/evals/simulation.js +36 -0
- package/dist/evals/types.d.ts +174 -1
- package/dist/evals/types.js +17 -1
- package/dist/evals/verdicts.d.ts +161 -0
- package/dist/evals/verdicts.js +192 -0
- package/dist/evals.d.ts +9 -3
- package/dist/evals.js +5 -1
- package/dist/setup/cli.js +13 -3
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `hue login`: guided storage of keys that a person creates in Hue. The command never mints a key.
|
|
3
|
+
* Hue's setup credentials are deliberately isolated from ordinary project keys, so this flow
|
|
4
|
+
* points at the settings page, reads the pasted keys without echo, validates each one against
|
|
5
|
+
* the configured origin and stores them in a private env file. Key values are never printed.
|
|
6
|
+
*/
|
|
7
|
+
/** Streams, environment and network seams for {@link runLoginCommand}; tests inject these. */
|
|
8
|
+
export interface LoginCommandIo {
|
|
9
|
+
stdin?: NodeJS.ReadableStream;
|
|
10
|
+
stdout?: NodeJS.WritableStream;
|
|
11
|
+
stderr?: NodeJS.WritableStream;
|
|
12
|
+
env?: NodeJS.ProcessEnv;
|
|
13
|
+
cwd?: string;
|
|
14
|
+
fetch?: typeof fetch;
|
|
15
|
+
openBrowser?: (url: string) => Promise<boolean>;
|
|
16
|
+
}
|
|
17
|
+
export declare const LOGIN_USAGE = "Usage: hue login [--origin URL] [--env-file PATH] [--keys evaluations|coding-agent|both]\n [--no-browser] [--force] [--gitignore]\n\nStore keys you created in Hue in a private env file. Each key is validated against Hue before it\nis stored; key values are never printed.\n\nOptions:\n --origin URL Hue origin (default https://app.hue.run)\n --env-file PATH Env file to write (default .env.hue in the current directory)\n --keys KIND evaluations (HUE_API_KEY), coding-agent (HUE_MCP_KEY) or both (default both)\n --no-browser Do not open the key settings page in a browser\n --force Replace an existing different value in the env file\n --gitignore Add the env file to .gitignore when a git repository does not ignore it\n -h, --help Show this help";
|
|
18
|
+
/** Hue MCP endpoint that pairs with an application origin. */
|
|
19
|
+
export declare function mcpUrlForOrigin(origin: string): string;
|
|
20
|
+
/** Normalizes a Hue origin: HTTPS, or HTTP for loopback only; no credentials, path, query or hash. */
|
|
21
|
+
export declare function parseHueOrigin(value: string): string | null;
|
|
22
|
+
/** Explains why a pasted value cannot be a Hue key, or returns null when it is acceptable. */
|
|
23
|
+
export declare function invalidKeyReason(value: string): string | null;
|
|
24
|
+
/** Reads the effective value of a variable from env-file text; the last assignment wins. */
|
|
25
|
+
export declare function readEnvValue(text: string, variable: string): string | undefined;
|
|
26
|
+
/** Replaces or appends the given assignments while preserving every other line. */
|
|
27
|
+
export declare function mergeEnvText(text: string, entries: Record<string, string>): string;
|
|
28
|
+
/**
|
|
29
|
+
* Runs `hue login` and returns the process exit code: 0 stored, 1 failed, 2 usage error, 130
|
|
30
|
+
* interrupted. `argv` may start with the `login` command word.
|
|
31
|
+
*/
|
|
32
|
+
export declare function runLoginCommand(argv: string[], io?: LoginCommandIo): Promise<number>;
|