@mhingston5/jev-cli 0.1.0 → 0.1.1
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/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/client.d.ts +41 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/questions.d.ts +22 -0
- package/dist/questions.d.ts.map +1 -0
- package/dist/types.d.ts +17 -0
- package/dist/types.d.ts.map +1 -0
- package/package.json +1 -1
package/dist/cli.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":""}
|
package/dist/client.d.ts
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { SystemOneLikeClient, SystemOneRequest, SystemOneResponse } from "./types.js";
|
|
2
|
+
export declare const JEV_PROVIDERS: readonly ["typesafe", "vercel", "cloudflare", "custom"];
|
|
3
|
+
export type JevProvider = typeof JEV_PROVIDERS[number];
|
|
4
|
+
export interface JevClientOptions {
|
|
5
|
+
provider?: JevProvider;
|
|
6
|
+
apiKey?: string;
|
|
7
|
+
accountId?: string;
|
|
8
|
+
endpoint?: string;
|
|
9
|
+
model?: string;
|
|
10
|
+
timeoutMs?: number;
|
|
11
|
+
headers?: Record<string, string>;
|
|
12
|
+
fetchImpl?: typeof fetch;
|
|
13
|
+
}
|
|
14
|
+
export declare const DEFAULT_ENDPOINT = "https://api.typesafe.ai/v1/systemone";
|
|
15
|
+
export declare const VERCEL_ENDPOINT = "https://ai-gateway.vercel.sh/typesafe/v1/systemone";
|
|
16
|
+
export declare function resolveJevProvider(options?: JevClientOptions): JevProvider;
|
|
17
|
+
export declare function defaultModelForProvider(provider: JevProvider): string;
|
|
18
|
+
export declare function credentialEnvironmentForProvider(provider: JevProvider): string[];
|
|
19
|
+
export declare function defaultEndpointForProvider(provider: JevProvider, accountId?: string): string;
|
|
20
|
+
export declare class FetchJevClient implements SystemOneLikeClient {
|
|
21
|
+
private readonly endpoint;
|
|
22
|
+
private readonly apiKey;
|
|
23
|
+
private readonly model;
|
|
24
|
+
private readonly timeoutMs;
|
|
25
|
+
private readonly headers;
|
|
26
|
+
private readonly fetchImpl;
|
|
27
|
+
constructor(options?: JevClientOptions);
|
|
28
|
+
systemOne(request: SystemOneRequest): Promise<SystemOneResponse>;
|
|
29
|
+
}
|
|
30
|
+
export declare class CloudflareJevClient implements SystemOneLikeClient {
|
|
31
|
+
private readonly endpoint;
|
|
32
|
+
private readonly apiKey;
|
|
33
|
+
private readonly model;
|
|
34
|
+
private readonly timeoutMs;
|
|
35
|
+
private readonly headers;
|
|
36
|
+
private readonly fetchImpl;
|
|
37
|
+
constructor(options?: JevClientOptions);
|
|
38
|
+
systemOne(request: SystemOneRequest): Promise<SystemOneResponse>;
|
|
39
|
+
}
|
|
40
|
+
export declare function createJevClient(options?: JevClientOptions): SystemOneLikeClient;
|
|
41
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAE3F,eAAO,MAAM,aAAa,yDAA0D,CAAC;AACrF,MAAM,MAAM,WAAW,GAAG,OAAO,aAAa,CAAC,MAAM,CAAC,CAAC;AAGvD,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,EAAE,WAAW,CAAC;IACvB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,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AAS,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,iBAAiB,CAAC;CAyBvE;AAED,wBAAgB,eAAe,CAAC,OAAO,GAAE,gBAAqB,GAAG,mBAAmB,CAWnF"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export type NoulQuestionSpec = {
|
|
2
|
+
type: "noul";
|
|
3
|
+
instructions: string;
|
|
4
|
+
labels?: {
|
|
5
|
+
true?: string;
|
|
6
|
+
false?: string;
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
export type ChoiceQuestionSpec = {
|
|
10
|
+
type: "choice";
|
|
11
|
+
instructions: string;
|
|
12
|
+
choices: Record<string, string | null>;
|
|
13
|
+
};
|
|
14
|
+
export type ScoreQuestionSpec = {
|
|
15
|
+
type: "score";
|
|
16
|
+
instructions: string;
|
|
17
|
+
levels: string[];
|
|
18
|
+
};
|
|
19
|
+
export type QuestionSpec = NoulQuestionSpec | ChoiceQuestionSpec | ScoreQuestionSpec;
|
|
20
|
+
export declare function buildQuestion(spec: QuestionSpec): unknown;
|
|
21
|
+
export declare function buildQuestions(specs: Record<string, QuestionSpec>): Record<string, unknown>;
|
|
22
|
+
//# sourceMappingURL=questions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"questions.d.ts","sourceRoot":"","sources":["../src/questions.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CAC5C,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,IAAI,EAAE,QAAQ,CAAC;IACf,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC,CAAC;CACxC,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,IAAI,EAAE,OAAO,CAAC;IACd,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG,gBAAgB,GAAG,kBAAkB,GAAG,iBAAiB,CAAC;AAMrF,wBAAgB,aAAa,CAAC,IAAI,EAAE,YAAY,GAAG,OAAO,CAuBzD;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAS3F"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface SystemOneRequest {
|
|
2
|
+
model?: string;
|
|
3
|
+
state: unknown;
|
|
4
|
+
questions: unknown;
|
|
5
|
+
}
|
|
6
|
+
export interface SystemOneResponse {
|
|
7
|
+
model: string;
|
|
8
|
+
answers: Record<string, unknown>;
|
|
9
|
+
usage?: {
|
|
10
|
+
input_tokens?: number;
|
|
11
|
+
output_tokens?: number;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
export interface SystemOneLikeClient {
|
|
15
|
+
systemOne(request: SystemOneRequest): Promise<SystemOneResponse>;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,gBAAgB;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,OAAO,CAAC;IACf,SAAS,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,KAAK,CAAC,EAAE;QACN,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,aAAa,CAAC,EAAE,MAAM,CAAC;KACxB,CAAC;CACH;AAED,MAAM,WAAW,mBAAmB;IAClC,SAAS,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;CAClE"}
|