@aplaytest/llm 0.1.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.
@@ -0,0 +1,27 @@
1
+ /**
2
+ * The no-model client.
3
+ *
4
+ * Every call throws a NAMED error rather than returning empty output. That is
5
+ * the degradation contract: a command either works, works with reduced scope,
6
+ * or exits non-zero saying which. What it must never do is quietly produce a
7
+ * worse answer that looks like a normal one.
8
+ */
9
+ import { LlmUnavailableError } from '../errors.js';
10
+ import { DEFAULT_MODELS } from '../pricing.js';
11
+ export class UnavailableLlmClient {
12
+ reason;
13
+ available = false;
14
+ constructor(reason) {
15
+ this.reason = reason;
16
+ }
17
+ modelFor(role) {
18
+ return DEFAULT_MODELS[role];
19
+ }
20
+ async complete(_request) {
21
+ throw new LlmUnavailableError(this.reason);
22
+ }
23
+ async completeStructured(_request, _schema) {
24
+ throw new LlmUnavailableError(this.reason);
25
+ }
26
+ }
27
+ //# sourceMappingURL=unavailable.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unavailable.js","sourceRoot":"","sources":["../../src/providers/unavailable.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAWH,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAE/C,MAAM,OAAO,oBAAoB;IAGF;IAFpB,SAAS,GAAG,KAAK,CAAC;IAE3B,YAA6B,MAAc;QAAd,WAAM,GAAN,MAAM,CAAQ;IAAG,CAAC;IAE/C,QAAQ,CAAC,IAAe;QACtB,OAAO,cAAc,CAAC,IAAI,CAAC,CAAC;IAC9B,CAAC;IAED,KAAK,CAAC,QAAQ,CAAC,QAAyB;QACtC,MAAM,IAAI,mBAAmB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC7C,CAAC;IAED,KAAK,CAAC,kBAAkB,CACtB,QAAyB,EACzB,OAAqB;QAErB,MAAM,IAAI,mBAAmB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC7C,CAAC;CACF"}
package/package.json ADDED
@@ -0,0 +1,38 @@
1
+ {
2
+ "name": "@aplaytest/llm",
3
+ "version": "0.1.0",
4
+ "description": "LLM provider abstraction: structured output, prompt caching, budget accounting",
5
+ "license": "MIT",
6
+ "type": "module",
7
+ "main": "./dist/index.js",
8
+ "types": "./dist/index.d.ts",
9
+ "files": [
10
+ "dist"
11
+ ],
12
+ "scripts": {
13
+ "build": "tsc --build",
14
+ "test": "vitest run"
15
+ },
16
+ "dependencies": {
17
+ "@anthropic-ai/sdk": "^0.117.1",
18
+ "zod": "^4.3.6"
19
+ },
20
+ "exports": {
21
+ ".": {
22
+ "types": "./dist/index.d.ts",
23
+ "import": "./dist/index.js"
24
+ }
25
+ },
26
+ "publishConfig": {
27
+ "access": "public"
28
+ },
29
+ "repository": {
30
+ "type": "git",
31
+ "url": "git+https://github.com/ianoflynnautomation/aplaytest.git",
32
+ "directory": "packages/llm"
33
+ },
34
+ "homepage": "https://github.com/ianoflynnautomation/aplaytest#readme",
35
+ "bugs": {
36
+ "url": "https://github.com/ianoflynnautomation/aplaytest/issues"
37
+ }
38
+ }