system-one 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.
- package/LICENSE +21 -0
- package/README.md +172 -0
- package/dist/adapter-DndZN8Se.d.mts +30 -0
- package/dist/adapter.d.mts +3 -0
- package/dist/adapter.mjs +43 -0
- package/dist/adapter.mjs.map +1 -0
- package/dist/adapters/cloudflare.d.mts +12 -0
- package/dist/adapters/cloudflare.mjs +67 -0
- package/dist/adapters/cloudflare.mjs.map +1 -0
- package/dist/adapters/laya.d.mts +12 -0
- package/dist/adapters/laya.mjs +36 -0
- package/dist/adapters/laya.mjs.map +1 -0
- package/dist/adapters/typesafe.d.mts +11 -0
- package/dist/adapters/typesafe.mjs +39 -0
- package/dist/adapters/typesafe.mjs.map +1 -0
- package/dist/core-D7i-WVU7.mjs +259 -0
- package/dist/core-D7i-WVU7.mjs.map +1 -0
- package/dist/core-DwacbzM7.d.mts +161 -0
- package/dist/core.d.mts +2 -0
- package/dist/core.mjs +2 -0
- package/dist/effect.d.mts +19 -0
- package/dist/effect.mjs +60 -0
- package/dist/effect.mjs.map +1 -0
- package/dist/index.d.mts +18 -0
- package/dist/index.mjs +51 -0
- package/dist/index.mjs.map +1 -0
- package/dist/typed-decisions-W30cNQUJ.mjs +88 -0
- package/dist/typed-decisions-W30cNQUJ.mjs.map +1 -0
- package/package.json +85 -0
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { a as prepare, c as validateResult, i as expectedIndex, l as System1Error, n as Question, o as record, r as defineQuestions, s as snapshot, t as DISTRIBUTION_TOLERANCE, u as isSystem1Error } from "./core-D7i-WVU7.mjs";
|
|
2
|
+
//#region src/client.ts
|
|
3
|
+
/** One attempt per evaluation. No hidden retries, redirects, or model fallback. */
|
|
4
|
+
function createClient(config) {
|
|
5
|
+
const transport = config.fetch ?? globalThis.fetch;
|
|
6
|
+
const model = config.model;
|
|
7
|
+
return { async evaluate(request, options = {}) {
|
|
8
|
+
const prepared = prepare(request, model.capabilities);
|
|
9
|
+
if (options.timeoutMs !== void 0 && (!Number.isSafeInteger(options.timeoutMs) || options.timeoutMs <= 0)) throw new System1Error("InvalidRequest", "timeoutMs must be a positive integer");
|
|
10
|
+
const timeout = options.timeoutMs === void 0 ? void 0 : AbortSignal.timeout(options.timeoutMs);
|
|
11
|
+
const signals = [options.signal, timeout].filter((s) => s !== void 0);
|
|
12
|
+
const signal = signals.length ? AbortSignal.any(signals) : void 0;
|
|
13
|
+
signal?.throwIfAborted();
|
|
14
|
+
const encoded = model.encode(prepared);
|
|
15
|
+
let response;
|
|
16
|
+
let text;
|
|
17
|
+
try {
|
|
18
|
+
response = await transport(encoded.url, {
|
|
19
|
+
method: encoded.method,
|
|
20
|
+
headers: encoded.headers,
|
|
21
|
+
body: encoded.body,
|
|
22
|
+
redirect: "error",
|
|
23
|
+
...signal ? { signal } : {}
|
|
24
|
+
});
|
|
25
|
+
text = await response.text();
|
|
26
|
+
} catch {
|
|
27
|
+
if (options.signal?.aborted) throw options.signal.reason;
|
|
28
|
+
throw new System1Error("TransportError", timeout?.aborted ? "Request timed out" : "HTTP transport failed");
|
|
29
|
+
}
|
|
30
|
+
signal?.throwIfAborted();
|
|
31
|
+
let body;
|
|
32
|
+
try {
|
|
33
|
+
body = JSON.parse(text);
|
|
34
|
+
} catch {
|
|
35
|
+
body = null;
|
|
36
|
+
}
|
|
37
|
+
const decoded = model.decode({
|
|
38
|
+
status: response.status,
|
|
39
|
+
headers: Object.fromEntries(response.headers),
|
|
40
|
+
body
|
|
41
|
+
}, prepared);
|
|
42
|
+
return validateResult(prepared, decoded, {
|
|
43
|
+
adapter: model.id,
|
|
44
|
+
model: model.model
|
|
45
|
+
}, model.capabilities);
|
|
46
|
+
} };
|
|
47
|
+
}
|
|
48
|
+
//#endregion
|
|
49
|
+
export { DISTRIBUTION_TOLERANCE, Question, System1Error, createClient, defineQuestions, expectedIndex, isSystem1Error, prepare, record, snapshot, validateResult };
|
|
50
|
+
|
|
51
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../src/client.ts"],"sourcesContent":["import { prepare, validateResult } from \"./core.js\";\nimport type { EvaluationRequest, EvaluationResult, Questions, Requirements } from \"./core.js\";\nimport type { ModelProtocol } from \"./adapter.js\";\nimport { System1Error } from \"./errors.js\";\n\nexport interface ExecutionOptions {\n readonly signal?: AbortSignal;\n readonly timeoutMs?: number;\n}\nexport interface Client {\n evaluate<const Q extends Questions, const R extends Requirements = {}>(\n request: EvaluationRequest<Q, R>,\n options?: ExecutionOptions,\n ): Promise<EvaluationResult<Q, R>>;\n}\n\n/** One attempt per evaluation. No hidden retries, redirects, or model fallback. */\nexport function createClient(config: {\n readonly model: ModelProtocol;\n readonly fetch?: typeof globalThis.fetch;\n}): Client {\n const transport = config.fetch ?? globalThis.fetch;\n const model = config.model;\n return {\n async evaluate(request, options = {}) {\n const prepared = prepare(request, model.capabilities);\n if (\n options.timeoutMs !== undefined &&\n (!Number.isSafeInteger(options.timeoutMs) || options.timeoutMs <= 0)\n )\n throw new System1Error(\"InvalidRequest\", \"timeoutMs must be a positive integer\");\n const timeout =\n options.timeoutMs === undefined ? undefined : AbortSignal.timeout(options.timeoutMs);\n const signals = [options.signal, timeout].filter((s): s is AbortSignal => s !== undefined);\n const signal = signals.length ? AbortSignal.any(signals) : undefined;\n signal?.throwIfAborted();\n const encoded = model.encode(prepared);\n let response: Response;\n let text: string;\n try {\n response = await transport(encoded.url, {\n method: encoded.method,\n headers: encoded.headers,\n body: encoded.body,\n redirect: \"error\",\n ...(signal ? { signal } : {}),\n });\n text = await response.text();\n } catch {\n if (options.signal?.aborted) throw options.signal.reason;\n throw new System1Error(\n \"TransportError\",\n timeout?.aborted ? \"Request timed out\" : \"HTTP transport failed\",\n );\n }\n signal?.throwIfAborted();\n let body: unknown;\n try {\n body = JSON.parse(text);\n } catch {\n body = null;\n }\n const decoded = model.decode(\n { status: response.status, headers: Object.fromEntries(response.headers), body },\n prepared,\n );\n return validateResult(\n prepared,\n decoded,\n { adapter: model.id, model: model.model },\n model.capabilities,\n );\n },\n };\n}\n"],"mappings":";;;AAiBA,SAAgB,aAAa,QAGlB;CACT,MAAM,YAAY,OAAO,SAAS,WAAW;CAC7C,MAAM,QAAQ,OAAO;CACrB,OAAO,EACL,MAAM,SAAS,SAAS,UAAU,CAAC,GAAG;EACpC,MAAM,WAAW,QAAQ,SAAS,MAAM,YAAY;EACpD,IACE,QAAQ,cAAc,KAAA,MACrB,CAAC,OAAO,cAAc,QAAQ,SAAS,KAAK,QAAQ,aAAa,IAElE,MAAM,IAAI,aAAa,kBAAkB,sCAAsC;EACjF,MAAM,UACJ,QAAQ,cAAc,KAAA,IAAY,KAAA,IAAY,YAAY,QAAQ,QAAQ,SAAS;EACrF,MAAM,UAAU,CAAC,QAAQ,QAAQ,OAAO,CAAC,CAAC,QAAQ,MAAwB,MAAM,KAAA,CAAS;EACzF,MAAM,SAAS,QAAQ,SAAS,YAAY,IAAI,OAAO,IAAI,KAAA;EAC3D,QAAQ,eAAe;EACvB,MAAM,UAAU,MAAM,OAAO,QAAQ;EACrC,IAAI;EACJ,IAAI;EACJ,IAAI;GACF,WAAW,MAAM,UAAU,QAAQ,KAAK;IACtC,QAAQ,QAAQ;IAChB,SAAS,QAAQ;IACjB,MAAM,QAAQ;IACd,UAAU;IACV,GAAI,SAAS,EAAE,OAAO,IAAI,CAAC;GAC7B,CAAC;GACD,OAAO,MAAM,SAAS,KAAK;EAC7B,QAAQ;GACN,IAAI,QAAQ,QAAQ,SAAS,MAAM,QAAQ,OAAO;GAClD,MAAM,IAAI,aACR,kBACA,SAAS,UAAU,sBAAsB,uBAC3C;EACF;EACA,QAAQ,eAAe;EACvB,IAAI;EACJ,IAAI;GACF,OAAO,KAAK,MAAM,IAAI;EACxB,QAAQ;GACN,OAAO;EACT;EACA,MAAM,UAAU,MAAM,OACpB;GAAE,QAAQ,SAAS;GAAQ,SAAS,OAAO,YAAY,SAAS,OAAO;GAAG;EAAK,GAC/E,QACF;EACA,OAAO,eACL,UACA,SACA;GAAE,SAAS,MAAM;GAAI,OAAO,MAAM;EAAM,GACxC,MAAM,YACR;CACF,EACF;AACF"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { l as System1Error, o as record } from "./core-D7i-WVU7.mjs";
|
|
2
|
+
//#region src/adapters/typed-decisions.ts
|
|
3
|
+
const typedCapabilities = Object.freeze({
|
|
4
|
+
kinds: Object.freeze({
|
|
5
|
+
boolean: Object.freeze({
|
|
6
|
+
probabilities: true,
|
|
7
|
+
confidence: false
|
|
8
|
+
}),
|
|
9
|
+
choice: Object.freeze({
|
|
10
|
+
probabilities: true,
|
|
11
|
+
confidence: true
|
|
12
|
+
}),
|
|
13
|
+
ordinal: Object.freeze({
|
|
14
|
+
probabilities: true,
|
|
15
|
+
confidence: true
|
|
16
|
+
})
|
|
17
|
+
}),
|
|
18
|
+
state: "text-or-structured",
|
|
19
|
+
descriptions: "json"
|
|
20
|
+
});
|
|
21
|
+
function encodeQuestions(request) {
|
|
22
|
+
return Object.fromEntries(Object.entries(request.questions).map(([key, q]) => [key, {
|
|
23
|
+
type: q.kind === "boolean" ? "noul" : q.kind === "ordinal" ? "score" : "choice",
|
|
24
|
+
instructions: q.instructions,
|
|
25
|
+
...q.kind === "boolean" ? q.criteria === void 0 ? {} : { criteria: q.criteria } : { criteria: q.kind === "choice" ? q.options : q.levels }
|
|
26
|
+
}]));
|
|
27
|
+
}
|
|
28
|
+
/** Shared shape, but confidence identities remain provider-specific. */
|
|
29
|
+
function decodeTyped(body, request, confidenceDefinition) {
|
|
30
|
+
const data = record(body);
|
|
31
|
+
const answers = record(data.answers);
|
|
32
|
+
const normalized = Object.fromEntries(Object.entries(answers).map(([key, value]) => {
|
|
33
|
+
const a = record(value);
|
|
34
|
+
const q = Object.hasOwn(request.questions, key) ? request.questions[key] : void 0;
|
|
35
|
+
if (!q) throw new System1Error("InvalidResponse", "Unexpected answer key");
|
|
36
|
+
const expectedType = q.kind === "boolean" ? "noul" : q.kind === "ordinal" ? "score" : "choice";
|
|
37
|
+
if (a.type !== expectedType) throw new System1Error("InvalidResponse", "Provider returned wrong answer type");
|
|
38
|
+
const confidence = a.confidence === void 0 ? {} : { confidence: {
|
|
39
|
+
value: a.confidence,
|
|
40
|
+
definition: confidenceDefinition
|
|
41
|
+
} };
|
|
42
|
+
if (q.kind === "boolean") return [key, {
|
|
43
|
+
kind: "boolean",
|
|
44
|
+
probabilityTrue: a.noul,
|
|
45
|
+
...confidence
|
|
46
|
+
}];
|
|
47
|
+
if (q.kind === "choice") return [key, {
|
|
48
|
+
kind: "choice",
|
|
49
|
+
value: a.choice,
|
|
50
|
+
probabilities: a.probabilities,
|
|
51
|
+
...confidence
|
|
52
|
+
}];
|
|
53
|
+
const probabilities = record(a.probabilities);
|
|
54
|
+
const indices = q.levels.map((_, i) => String(i));
|
|
55
|
+
if (Object.keys(probabilities).length !== indices.length || indices.some((i) => !Object.hasOwn(probabilities, i))) throw new System1Error("InvalidResponse", "Invalid ordinal probability keys");
|
|
56
|
+
if (a.legend !== void 0) {
|
|
57
|
+
const legend = record(a.legend);
|
|
58
|
+
if (Object.keys(legend).length !== indices.length || indices.some((i) => !Object.hasOwn(legend, i) || !sameJson(legend[i], q.levels[Number(i)]))) throw new System1Error("InvalidResponse", "Ordinal legend differs from requested scale");
|
|
59
|
+
}
|
|
60
|
+
return [key, {
|
|
61
|
+
kind: "ordinal",
|
|
62
|
+
expectedIndex: a.score,
|
|
63
|
+
probabilities: indices.map((i) => probabilities[i]),
|
|
64
|
+
...confidence
|
|
65
|
+
}];
|
|
66
|
+
}));
|
|
67
|
+
const usage = data.usage === void 0 ? void 0 : record(data.usage);
|
|
68
|
+
return {
|
|
69
|
+
answers: normalized,
|
|
70
|
+
...data.model === void 0 ? {} : { resolvedModel: data.model },
|
|
71
|
+
...usage === void 0 ? {} : { usage: {
|
|
72
|
+
...usage.input_tokens === void 0 ? {} : { inputTokens: usage.input_tokens },
|
|
73
|
+
...usage.output_tokens === void 0 ? {} : { outputTokens: usage.output_tokens },
|
|
74
|
+
...usage.total_tokens === void 0 ? {} : { totalTokens: usage.total_tokens }
|
|
75
|
+
} }
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
function sameJson(a, b) {
|
|
79
|
+
if (a === b) return true;
|
|
80
|
+
if (!a || !b || typeof a !== "object" || typeof b !== "object" || Array.isArray(a) !== Array.isArray(b)) return false;
|
|
81
|
+
const left = a, right = b;
|
|
82
|
+
const keys = Object.keys(left);
|
|
83
|
+
return keys.length === Object.keys(right).length && keys.every((k) => Object.hasOwn(right, k) && sameJson(left[k], right[k]));
|
|
84
|
+
}
|
|
85
|
+
//#endregion
|
|
86
|
+
export { encodeQuestions as n, typedCapabilities as r, decodeTyped as t };
|
|
87
|
+
|
|
88
|
+
//# sourceMappingURL=typed-decisions-W30cNQUJ.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typed-decisions-W30cNQUJ.mjs","names":[],"sources":["../src/adapters/typed-decisions.ts"],"sourcesContent":["import { record } from \"../core.js\";\nimport type { Capabilities, DecodedEvaluation, EvaluationRequest } from \"../core.js\";\nimport { System1Error } from \"../errors.js\";\n\nexport const typedCapabilities: Capabilities = Object.freeze({\n kinds: Object.freeze({\n boolean: Object.freeze({ probabilities: true, confidence: false }),\n choice: Object.freeze({ probabilities: true, confidence: true }),\n ordinal: Object.freeze({ probabilities: true, confidence: true }),\n }),\n state: \"text-or-structured\",\n descriptions: \"json\",\n});\n\nexport function encodeQuestions(request: EvaluationRequest): Record<string, unknown> {\n return Object.fromEntries(\n Object.entries(request.questions).map(([key, q]) => [\n key,\n {\n type: q.kind === \"boolean\" ? \"noul\" : q.kind === \"ordinal\" ? \"score\" : \"choice\",\n instructions: q.instructions,\n ...(q.kind === \"boolean\"\n ? q.criteria === undefined\n ? {}\n : { criteria: q.criteria }\n : { criteria: q.kind === \"choice\" ? q.options : q.levels }),\n },\n ]),\n );\n}\n\n/** Shared shape, but confidence identities remain provider-specific. */\nexport function decodeTyped(\n body: unknown,\n request: EvaluationRequest,\n confidenceDefinition: string,\n): DecodedEvaluation {\n const data = record(body);\n const answers = record(data.answers);\n const normalized = Object.fromEntries(\n Object.entries(answers).map(([key, value]) => {\n const a = record(value);\n const q = Object.hasOwn(request.questions, key) ? request.questions[key] : undefined;\n if (!q) throw new System1Error(\"InvalidResponse\", \"Unexpected answer key\");\n const expectedType =\n q.kind === \"boolean\" ? \"noul\" : q.kind === \"ordinal\" ? \"score\" : \"choice\";\n if (a.type !== expectedType)\n throw new System1Error(\"InvalidResponse\", \"Provider returned wrong answer type\");\n const confidence =\n a.confidence === undefined\n ? {}\n : { confidence: { value: a.confidence, definition: confidenceDefinition } };\n if (q.kind === \"boolean\")\n return [key, { kind: \"boolean\", probabilityTrue: a.noul, ...confidence }];\n if (q.kind === \"choice\")\n return [\n key,\n { kind: \"choice\", value: a.choice, probabilities: a.probabilities, ...confidence },\n ];\n const probabilities = record(a.probabilities);\n const indices = q.levels.map((_, i) => String(i));\n if (\n Object.keys(probabilities).length !== indices.length ||\n indices.some((i) => !Object.hasOwn(probabilities, i))\n )\n throw new System1Error(\"InvalidResponse\", \"Invalid ordinal probability keys\");\n // A supplied legend must refer to the original scale, not another rubric.\n if (a.legend !== undefined) {\n const legend = record(a.legend);\n if (\n Object.keys(legend).length !== indices.length ||\n indices.some(\n (i) => !Object.hasOwn(legend, i) || !sameJson(legend[i], q.levels[Number(i)]),\n )\n )\n throw new System1Error(\"InvalidResponse\", \"Ordinal legend differs from requested scale\");\n }\n return [\n key,\n {\n kind: \"ordinal\",\n expectedIndex: a.score,\n probabilities: indices.map((i) => probabilities[i]),\n ...confidence,\n },\n ];\n }),\n );\n const usage = data.usage === undefined ? undefined : record(data.usage);\n return {\n answers: normalized,\n ...(data.model === undefined ? {} : { resolvedModel: data.model as string }),\n ...(usage === undefined\n ? {}\n : {\n usage: {\n ...(usage.input_tokens === undefined\n ? {}\n : { inputTokens: usage.input_tokens as number }),\n ...(usage.output_tokens === undefined\n ? {}\n : { outputTokens: usage.output_tokens as number }),\n ...(usage.total_tokens === undefined\n ? {}\n : { totalTokens: usage.total_tokens as number }),\n },\n }),\n };\n}\nfunction sameJson(a: unknown, b: unknown): boolean {\n if (a === b) return true;\n if (\n !a ||\n !b ||\n typeof a !== \"object\" ||\n typeof b !== \"object\" ||\n Array.isArray(a) !== Array.isArray(b)\n )\n return false;\n const left = a as Record<string, unknown>,\n right = b as Record<string, unknown>;\n const keys = Object.keys(left);\n return (\n keys.length === Object.keys(right).length &&\n keys.every((k) => Object.hasOwn(right, k) && sameJson(left[k], right[k]))\n );\n}\n"],"mappings":";;AAIA,MAAa,oBAAkC,OAAO,OAAO;CAC3D,OAAO,OAAO,OAAO;EACnB,SAAS,OAAO,OAAO;GAAE,eAAe;GAAM,YAAY;EAAM,CAAC;EACjE,QAAQ,OAAO,OAAO;GAAE,eAAe;GAAM,YAAY;EAAK,CAAC;EAC/D,SAAS,OAAO,OAAO;GAAE,eAAe;GAAM,YAAY;EAAK,CAAC;CAClE,CAAC;CACD,OAAO;CACP,cAAc;AAChB,CAAC;AAED,SAAgB,gBAAgB,SAAqD;CACnF,OAAO,OAAO,YACZ,OAAO,QAAQ,QAAQ,SAAS,CAAC,CAAC,KAAK,CAAC,KAAK,OAAO,CAClD,KACA;EACE,MAAM,EAAE,SAAS,YAAY,SAAS,EAAE,SAAS,YAAY,UAAU;EACvE,cAAc,EAAE;EAChB,GAAI,EAAE,SAAS,YACX,EAAE,aAAa,KAAA,IACb,CAAC,IACD,EAAE,UAAU,EAAE,SAAS,IACzB,EAAE,UAAU,EAAE,SAAS,WAAW,EAAE,UAAU,EAAE,OAAO;CAC7D,CACF,CAAC,CACH;AACF;;AAGA,SAAgB,YACd,MACA,SACA,sBACmB;CACnB,MAAM,OAAO,OAAO,IAAI;CACxB,MAAM,UAAU,OAAO,KAAK,OAAO;CACnC,MAAM,aAAa,OAAO,YACxB,OAAO,QAAQ,OAAO,CAAC,CAAC,KAAK,CAAC,KAAK,WAAW;EAC5C,MAAM,IAAI,OAAO,KAAK;EACtB,MAAM,IAAI,OAAO,OAAO,QAAQ,WAAW,GAAG,IAAI,QAAQ,UAAU,OAAO,KAAA;EAC3E,IAAI,CAAC,GAAG,MAAM,IAAI,aAAa,mBAAmB,uBAAuB;EACzE,MAAM,eACJ,EAAE,SAAS,YAAY,SAAS,EAAE,SAAS,YAAY,UAAU;EACnE,IAAI,EAAE,SAAS,cACb,MAAM,IAAI,aAAa,mBAAmB,qCAAqC;EACjF,MAAM,aACJ,EAAE,eAAe,KAAA,IACb,CAAC,IACD,EAAE,YAAY;GAAE,OAAO,EAAE;GAAY,YAAY;EAAqB,EAAE;EAC9E,IAAI,EAAE,SAAS,WACb,OAAO,CAAC,KAAK;GAAE,MAAM;GAAW,iBAAiB,EAAE;GAAM,GAAG;EAAW,CAAC;EAC1E,IAAI,EAAE,SAAS,UACb,OAAO,CACL,KACA;GAAE,MAAM;GAAU,OAAO,EAAE;GAAQ,eAAe,EAAE;GAAe,GAAG;EAAW,CACnF;EACF,MAAM,gBAAgB,OAAO,EAAE,aAAa;EAC5C,MAAM,UAAU,EAAE,OAAO,KAAK,GAAG,MAAM,OAAO,CAAC,CAAC;EAChD,IACE,OAAO,KAAK,aAAa,CAAC,CAAC,WAAW,QAAQ,UAC9C,QAAQ,MAAM,MAAM,CAAC,OAAO,OAAO,eAAe,CAAC,CAAC,GAEpD,MAAM,IAAI,aAAa,mBAAmB,kCAAkC;EAE9E,IAAI,EAAE,WAAW,KAAA,GAAW;GAC1B,MAAM,SAAS,OAAO,EAAE,MAAM;GAC9B,IACE,OAAO,KAAK,MAAM,CAAC,CAAC,WAAW,QAAQ,UACvC,QAAQ,MACL,MAAM,CAAC,OAAO,OAAO,QAAQ,CAAC,KAAK,CAAC,SAAS,OAAO,IAAI,EAAE,OAAO,OAAO,CAAC,EAAE,CAC9E,GAEA,MAAM,IAAI,aAAa,mBAAmB,6CAA6C;EAC3F;EACA,OAAO,CACL,KACA;GACE,MAAM;GACN,eAAe,EAAE;GACjB,eAAe,QAAQ,KAAK,MAAM,cAAc,EAAE;GAClD,GAAG;EACL,CACF;CACF,CAAC,CACH;CACA,MAAM,QAAQ,KAAK,UAAU,KAAA,IAAY,KAAA,IAAY,OAAO,KAAK,KAAK;CACtE,OAAO;EACL,SAAS;EACT,GAAI,KAAK,UAAU,KAAA,IAAY,CAAC,IAAI,EAAE,eAAe,KAAK,MAAgB;EAC1E,GAAI,UAAU,KAAA,IACV,CAAC,IACD,EACE,OAAO;GACL,GAAI,MAAM,iBAAiB,KAAA,IACvB,CAAC,IACD,EAAE,aAAa,MAAM,aAAuB;GAChD,GAAI,MAAM,kBAAkB,KAAA,IACxB,CAAC,IACD,EAAE,cAAc,MAAM,cAAwB;GAClD,GAAI,MAAM,iBAAiB,KAAA,IACvB,CAAC,IACD,EAAE,aAAa,MAAM,aAAuB;EAClD,EACF;CACN;AACF;AACA,SAAS,SAAS,GAAY,GAAqB;CACjD,IAAI,MAAM,GAAG,OAAO;CACpB,IACE,CAAC,KACD,CAAC,KACD,OAAO,MAAM,YACb,OAAO,MAAM,YACb,MAAM,QAAQ,CAAC,MAAM,MAAM,QAAQ,CAAC,GAEpC,OAAO;CACT,MAAM,OAAO,GACX,QAAQ;CACV,MAAM,OAAO,OAAO,KAAK,IAAI;CAC7B,OACE,KAAK,WAAW,OAAO,KAAK,KAAK,CAAC,CAAC,UACnC,KAAK,OAAO,MAAM,OAAO,OAAO,OAAO,CAAC,KAAK,SAAS,KAAK,IAAI,MAAM,EAAE,CAAC;AAE5E"}
|
package/package.json
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "system-one",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Typed decisions across System-1 models, with Promise and Effect-native clients",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"decision-model",
|
|
7
|
+
"effect",
|
|
8
|
+
"jev",
|
|
9
|
+
"laya",
|
|
10
|
+
"system-one",
|
|
11
|
+
"typesafe",
|
|
12
|
+
"typescript"
|
|
13
|
+
],
|
|
14
|
+
"homepage": "https://github.com/lukeramsden/system1#readme",
|
|
15
|
+
"bugs": {
|
|
16
|
+
"url": "https://github.com/lukeramsden/system1/issues"
|
|
17
|
+
},
|
|
18
|
+
"license": "MIT",
|
|
19
|
+
"author": "Luke Ramsden",
|
|
20
|
+
"repository": {
|
|
21
|
+
"type": "git",
|
|
22
|
+
"url": "git+https://github.com/lukeramsden/system1.git",
|
|
23
|
+
"directory": "packages/system1"
|
|
24
|
+
},
|
|
25
|
+
"files": [
|
|
26
|
+
"dist",
|
|
27
|
+
"README.md",
|
|
28
|
+
"LICENSE"
|
|
29
|
+
],
|
|
30
|
+
"type": "module",
|
|
31
|
+
"sideEffects": false,
|
|
32
|
+
"exports": {
|
|
33
|
+
".": {
|
|
34
|
+
"types": "./dist/index.d.mts",
|
|
35
|
+
"import": "./dist/index.mjs"
|
|
36
|
+
},
|
|
37
|
+
"./core": {
|
|
38
|
+
"types": "./dist/core.d.mts",
|
|
39
|
+
"import": "./dist/core.mjs"
|
|
40
|
+
},
|
|
41
|
+
"./adapter": {
|
|
42
|
+
"types": "./dist/adapter.d.mts",
|
|
43
|
+
"import": "./dist/adapter.mjs"
|
|
44
|
+
},
|
|
45
|
+
"./effect": {
|
|
46
|
+
"types": "./dist/effect.d.mts",
|
|
47
|
+
"import": "./dist/effect.mjs"
|
|
48
|
+
},
|
|
49
|
+
"./adapters/typesafe": {
|
|
50
|
+
"types": "./dist/adapters/typesafe.d.mts",
|
|
51
|
+
"import": "./dist/adapters/typesafe.mjs"
|
|
52
|
+
},
|
|
53
|
+
"./adapters/cloudflare": {
|
|
54
|
+
"types": "./dist/adapters/cloudflare.d.mts",
|
|
55
|
+
"import": "./dist/adapters/cloudflare.mjs"
|
|
56
|
+
},
|
|
57
|
+
"./adapters/laya": {
|
|
58
|
+
"types": "./dist/adapters/laya.d.mts",
|
|
59
|
+
"import": "./dist/adapters/laya.mjs"
|
|
60
|
+
},
|
|
61
|
+
"./package.json": "./package.json"
|
|
62
|
+
},
|
|
63
|
+
"publishConfig": {
|
|
64
|
+
"access": "public"
|
|
65
|
+
},
|
|
66
|
+
"scripts": {
|
|
67
|
+
"build": "vp pack",
|
|
68
|
+
"prepack": "vp pack && cp ../../README.md README.md"
|
|
69
|
+
},
|
|
70
|
+
"peerDependencies": {
|
|
71
|
+
"@effect/platform": "^0.97.2",
|
|
72
|
+
"effect": "^3.22.2"
|
|
73
|
+
},
|
|
74
|
+
"peerDependenciesMeta": {
|
|
75
|
+
"effect": {
|
|
76
|
+
"optional": true
|
|
77
|
+
},
|
|
78
|
+
"@effect/platform": {
|
|
79
|
+
"optional": true
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
"engines": {
|
|
83
|
+
"node": ">=22.18.0"
|
|
84
|
+
}
|
|
85
|
+
}
|