@ultimat3/ai 31.31.0 → 31.33.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/package.json +11 -11
- package/src/errors.ts +2 -2
- package/src/eval-baseline.ts +1 -0
- package/src/eval-errors.ts +2 -2
- package/src/openai-provider.ts +2 -2
- package/src/vector-scope.ts +7 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ultimat3/ai",
|
|
3
|
-
"version": "31.
|
|
3
|
+
"version": "31.33.0",
|
|
4
4
|
"description": "LLM gateway, versioned prompts, evals as tests, embeddings, hybrid vector search, RAG",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ultimate",
|
|
@@ -45,17 +45,17 @@
|
|
|
45
45
|
"test": "bun test"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@ultimat3/action": "31.
|
|
49
|
-
"@ultimat3/cache": "31.
|
|
50
|
-
"@ultimat3/core": "31.
|
|
51
|
-
"@ultimat3/db": "31.
|
|
52
|
-
"@ultimat3/http": "31.
|
|
53
|
-
"@ultimat3/jobs": "31.
|
|
54
|
-
"@ultimat3/money": "31.
|
|
55
|
-
"@ultimat3/schema": "31.
|
|
56
|
-
"@ultimat3/time": "31.
|
|
48
|
+
"@ultimat3/action": "31.33.0",
|
|
49
|
+
"@ultimat3/cache": "31.33.0",
|
|
50
|
+
"@ultimat3/core": "31.33.0",
|
|
51
|
+
"@ultimat3/db": "31.33.0",
|
|
52
|
+
"@ultimat3/http": "31.33.0",
|
|
53
|
+
"@ultimat3/jobs": "31.33.0",
|
|
54
|
+
"@ultimat3/money": "31.33.0",
|
|
55
|
+
"@ultimat3/schema": "31.33.0",
|
|
56
|
+
"@ultimat3/time": "31.33.0"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
|
-
"@ultimat3/policy": "31.
|
|
59
|
+
"@ultimat3/policy": "31.33.0"
|
|
60
60
|
}
|
|
61
61
|
}
|
package/src/errors.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// The error classes for @ultimat3/ai's core codes. Budget and threshold failures name the exact
|
|
2
2
|
// knob to change, because the caller is often a CI job with no human attached.
|
|
3
3
|
|
|
4
|
-
import { UltimateError } from '@ultimat3/core';
|
|
4
|
+
import { renderFixShellArg, UltimateError } from '@ultimat3/core';
|
|
5
5
|
// The codes, their titles and the single registration call are `./error-codes`, imported here for
|
|
6
6
|
// that side effect.
|
|
7
7
|
import './error-codes';
|
|
@@ -360,7 +360,7 @@ export class AiKeyMissingError extends UltimateError {
|
|
|
360
360
|
super({
|
|
361
361
|
code: 'X_AI_KEY_MISSING',
|
|
362
362
|
cause: `provider "${input.provider}" has no API key: ${input.envVar} is unset and none was passed to its constructor`,
|
|
363
|
-
fix: `export ${input.envVar}=<key>, or pass { apiKey } when constructing the provider`,
|
|
363
|
+
fix: `export ${renderFixShellArg(input.envVar, '<API_KEY_VAR>')}=<key>, or pass { apiKey } when constructing the provider`,
|
|
364
364
|
meta: { provider: input.provider, envVar: input.envVar },
|
|
365
365
|
});
|
|
366
366
|
}
|
package/src/eval-baseline.ts
CHANGED
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
// carries the prompt ref and hash that produced it, because a score with no prompt attached is
|
|
9
9
|
// not a measurement.
|
|
10
10
|
|
|
11
|
+
// why: Bun ships no path API; `isAbsolute` also knows a Windows drive-letter path is absolute.
|
|
11
12
|
import { isAbsolute } from 'node:path';
|
|
12
13
|
import { EvalBaselineInvalidError, EvalBaselineMissingError } from './eval-errors';
|
|
13
14
|
|
package/src/eval-errors.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// outgrew its ceiling. The codes themselves, their titles and the single `registerErrorCodes` call
|
|
3
3
|
// stay in ./error-codes — one owner, one registration, one place a duplicate can surface.
|
|
4
4
|
|
|
5
|
-
import { UltimateError } from '@ultimat3/core';
|
|
5
|
+
import { renderFixShellArg, UltimateError } from '@ultimat3/core';
|
|
6
6
|
|
|
7
7
|
// No `docs:` on the subclasses below. `UltimateError` fills it from `describeErrorCode(code).docs`,
|
|
8
8
|
// which is `@ultimat3/core`'s `ERROR_DOCS_URL` — one page for every code, never one per code, because
|
|
@@ -36,7 +36,7 @@ export class EvalThresholdError extends UltimateError {
|
|
|
36
36
|
// `x test eval --filter <name>`, never `x test <name>`: `x test`'s positional is a TestType,
|
|
37
37
|
// so the eval's own name there is `X_CLI_BAD_FLAG` ("not a test type") — a fix line that
|
|
38
38
|
// cannot be run is axiom 4 broken at the one moment it is needed.
|
|
39
|
-
fix: `x test eval --filter ${input.eval} to see per-case scores, then fix the prompt — or ULTIMATE_EVAL_RECORD=1 x test eval to accept the new numbers as a reviewed diff`,
|
|
39
|
+
fix: `x test eval --filter ${renderFixShellArg(input.eval, '<eval>')} to see per-case scores, then fix the prompt — or ULTIMATE_EVAL_RECORD=1 x test eval to accept the new numbers as a reviewed diff`,
|
|
40
40
|
});
|
|
41
41
|
}
|
|
42
42
|
}
|
package/src/openai-provider.ts
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
// credential and the errors.
|
|
9
9
|
|
|
10
10
|
import type { Secret } from '@ultimat3/core';
|
|
11
|
-
import { isSecret, revealSecret } from '@ultimat3/core';
|
|
11
|
+
import { isSecret, revealSecret, trimTrailingSlashes } from '@ultimat3/core';
|
|
12
12
|
import { readAnswerBody } from './answer-body';
|
|
13
13
|
import { billedCall } from './billed';
|
|
14
14
|
import { providerFailure } from './context-overflow';
|
|
@@ -295,7 +295,7 @@ class OpenAiProvider implements Provider {
|
|
|
295
295
|
private url(): string {
|
|
296
296
|
const base = this.config.baseUrl ?? DEFAULT_BASE_URL;
|
|
297
297
|
const cut = base.indexOf('?');
|
|
298
|
-
const path = (cut === -1 ? base : base.slice(0, cut))
|
|
298
|
+
const path = trimTrailingSlashes(cut === -1 ? base : base.slice(0, cut));
|
|
299
299
|
return `${path}/chat/completions${cut === -1 ? '' : base.slice(cut)}`;
|
|
300
300
|
}
|
|
301
301
|
}
|
package/src/vector-scope.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
// The security envelope a vector store carries: the tenant it is bound to, and the metadata
|
|
2
|
-
//
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
//
|
|
1
|
+
// The security envelope a vector store carries: the tenant it is bound to, and the metadata values
|
|
2
|
+
// a policy leaves visible.
|
|
3
|
+
//
|
|
4
|
+
// Kept separate from the stores because both the in-memory dev store and the Postgres one must
|
|
5
|
+
// enforce the SAME envelope — a leak that only reproduces in production is a leak nobody finds.
|
|
6
|
+
// Deriving a scope may only ever TIGHTEN it: a scope that could be widened from a call site is not
|
|
7
|
+
// a scope, it is a hint.
|
|
6
8
|
|
|
7
9
|
import { tryUseContext, UltimateError } from '@ultimat3/core';
|
|
8
10
|
import { VectorScopeWidenedError } from './errors';
|