@dxos/brain 0.13.0 → 0.14.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/dist/lib/Builtins.mjs +4 -2
- package/dist/lib/Builtins.mjs.map +1 -1
- package/dist/lib/Encoding.mjs +12 -2
- package/dist/lib/Encoding.mjs.map +1 -1
- package/dist/lib/Evaluator.mjs +144 -0
- package/dist/lib/Evaluator.mjs.map +1 -0
- package/dist/lib/GoalRules.mjs +62 -4
- package/dist/lib/GoalRules.mjs.map +1 -1
- package/dist/lib/Oracle.mjs +169 -0
- package/dist/lib/Oracle.mjs.map +1 -0
- package/dist/lib/index.mjs +3 -1
- package/dist/types/src/Builtins.d.ts +2 -0
- package/dist/types/src/Builtins.d.ts.map +1 -1
- package/dist/types/src/Encoding.d.ts +4 -0
- package/dist/types/src/Encoding.d.ts.map +1 -1
- package/dist/types/src/Evaluator.d.ts +77 -0
- package/dist/types/src/Evaluator.d.ts.map +1 -0
- package/dist/types/src/Evaluator.test.d.ts +2 -0
- package/dist/types/src/Evaluator.test.d.ts.map +1 -0
- package/dist/types/src/GoalRules.d.ts +6 -0
- package/dist/types/src/GoalRules.d.ts.map +1 -1
- package/dist/types/src/Oracle.d.ts +126 -0
- package/dist/types/src/Oracle.d.ts.map +1 -0
- package/dist/types/src/Oracle.test.d.ts +2 -0
- package/dist/types/src/Oracle.test.d.ts.map +1 -0
- package/dist/types/src/index.d.ts +2 -0
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +15 -5
- package/src/Builtins.ts +2 -1
- package/src/Encoding.test.ts +14 -0
- package/src/Encoding.ts +9 -0
- package/src/Evaluator.test.ts +158 -0
- package/src/Evaluator.ts +186 -0
- package/src/GoalRules.test.ts +8 -0
- package/src/GoalRules.ts +81 -4
- package/src/Oracle.test.ts +71 -0
- package/src/Oracle.ts +182 -0
- package/src/index.ts +2 -0
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import { t as __exportAll } from "./chunk-rolldown-runtime.mjs";
|
|
2
|
+
import { parseDuration } from "./Builtins.mjs";
|
|
3
|
+
import { CompileError, formatDiagnostic } from "./Compiler.mjs";
|
|
4
|
+
import { make } from "./GoalRules.mjs";
|
|
5
|
+
import * as Schema from "effect/Schema";
|
|
6
|
+
import { BaseError } from "@dxos/errors";
|
|
7
|
+
import { trim } from "@dxos/util";
|
|
8
|
+
//#region src/Oracle.ts
|
|
9
|
+
var Oracle_exports = /* @__PURE__ */ __exportAll({
|
|
10
|
+
Reply: () => Reply,
|
|
11
|
+
ReplyError: () => ReplyError,
|
|
12
|
+
SYSTEM_PROMPT: () => SYSTEM_PROMPT,
|
|
13
|
+
Statement: () => Statement,
|
|
14
|
+
Step: () => Step,
|
|
15
|
+
parseReply: () => parseReply,
|
|
16
|
+
replay: () => replay,
|
|
17
|
+
userMessage: () => userMessage
|
|
18
|
+
});
|
|
19
|
+
/**
|
|
20
|
+
* The replay gate's oracle (BRAIN.md, "Compilation"): a model call that sees only the goal's text and
|
|
21
|
+
* writes a short timeline of statements with what each should do to the goal. A compilation goes active
|
|
22
|
+
* only if it replays that timeline correctly; the oracle never sees the rules, so it cannot share the
|
|
23
|
+
* compiler's misreading of the goal.
|
|
24
|
+
*/
|
|
25
|
+
/** One statement in a test timeline; people and things are named by the ids the goal was given. */
|
|
26
|
+
var Statement = Schema.Struct({
|
|
27
|
+
speaker: Schema.String,
|
|
28
|
+
quote: Schema.String,
|
|
29
|
+
subject: Schema.String,
|
|
30
|
+
predicate: Schema.String,
|
|
31
|
+
object: Schema.String,
|
|
32
|
+
force: Schema.optional(Schema.Literals([
|
|
33
|
+
"assertive",
|
|
34
|
+
"directive",
|
|
35
|
+
"commissive",
|
|
36
|
+
"expressive"
|
|
37
|
+
])),
|
|
38
|
+
polarity: Schema.optional(Schema.Literals(["+", "-"]))
|
|
39
|
+
});
|
|
40
|
+
/** A step of the timeline: when it happens after the goal is set, what is said, and what should follow. */
|
|
41
|
+
var Step = Schema.Struct({
|
|
42
|
+
/** A duration after the goal was set, e.g. `10m`, `1h`, `3d`. */
|
|
43
|
+
after: Schema.String,
|
|
44
|
+
says: Schema.Array(Statement),
|
|
45
|
+
/** Whether the goal should wake (be judged) at this step. */
|
|
46
|
+
wake: Schema.Boolean,
|
|
47
|
+
/** Whether the goal should be achieved after this step; absent when either is acceptable. */
|
|
48
|
+
achieved: Schema.optional(Schema.Boolean),
|
|
49
|
+
note: Schema.optional(Schema.String)
|
|
50
|
+
});
|
|
51
|
+
var Reply = Schema.Struct({ steps: Schema.Array(Step) });
|
|
52
|
+
/** Thrown by {@link parseReply} when the reply is not a timeline. */
|
|
53
|
+
var ReplyError = class extends BaseError.extend("OracleReplyError", "Oracle reply is not a timeline") {};
|
|
54
|
+
/** The oracle's instructions. */
|
|
55
|
+
var SYSTEM_PROMPT = trim`
|
|
56
|
+
You write acceptance tests for an agent's goal. A goal is a plain-text directive; a runtime will decide,
|
|
57
|
+
after every statement anyone makes, whether the goal should WAKE (the agent looks at it again because
|
|
58
|
+
something relevant happened) and whether it is ACHIEVED (its outcome happened). You do not see how the
|
|
59
|
+
runtime decides; you only describe what a careful person would expect.
|
|
60
|
+
|
|
61
|
+
Write a short timeline of 3 to 6 steps after the goal is set. Include at least one step that should
|
|
62
|
+
wake the goal and at least one near miss that should not (the wrong person, an unrelated topic, a
|
|
63
|
+
refusal or a question instead of a statement). Say only what is needed; each step usually has one
|
|
64
|
+
statement.
|
|
65
|
+
|
|
66
|
+
Each statement is one fact as an extractor would record it: who said it (speaker), the words as said
|
|
67
|
+
(quote), and a subject–predicate–object triple. Name people by the ids given with the goal, exactly as
|
|
68
|
+
given (e.g. "did:halo:…"); name other things with lowercase hyphenated words ("indexer-migration").
|
|
69
|
+
force is assertive (states), directive (asks), commissive (promises or agrees) or expressive; polarity
|
|
70
|
+
is "+" (affirmed) or "-" (denied, refused).
|
|
71
|
+
|
|
72
|
+
Reply with JSON only:
|
|
73
|
+
{"steps":[{"after":"10m","says":[{"speaker":"…","quote":"…","subject":"…","predicate":"…","object":"…","force":"assertive","polarity":"+"}],"wake":true,"achieved":false,"note":"why"}]}
|
|
74
|
+
"after" is a duration since the goal was set (10m, 2h, 3d) and must increase from step to step.
|
|
75
|
+
Leave "achieved" out when either answer would be acceptable.
|
|
76
|
+
`;
|
|
77
|
+
/** The user message for one goal. */
|
|
78
|
+
var userMessage = ({ goal, instructions, owner, people = [] }) => [
|
|
79
|
+
`Goal: "${goal}"`,
|
|
80
|
+
`Owner: ${owner}`,
|
|
81
|
+
instructions?.trim() ? `Instructions: ${instructions.trim()}` : void 0,
|
|
82
|
+
people.length > 0 ? `People (use these ids): ${people.map(({ name, id }) => `${name} = ${id}`).join("; ")}` : void 0
|
|
83
|
+
].filter((line) => line !== void 0).join("\n");
|
|
84
|
+
var decode = Schema.decodeUnknownSync(Reply);
|
|
85
|
+
/**
|
|
86
|
+
* Extracts the timeline from the oracle's reply; tolerates a code fence or prose around the JSON.
|
|
87
|
+
* @throws ReplyError if there is no valid timeline.
|
|
88
|
+
*/
|
|
89
|
+
var parseReply = (text) => {
|
|
90
|
+
const start = text.indexOf("{");
|
|
91
|
+
const end = text.lastIndexOf("}");
|
|
92
|
+
if (start < 0 || end <= start) throw new ReplyError({ message: "the reply has no JSON object" });
|
|
93
|
+
try {
|
|
94
|
+
const reply = decode(JSON.parse(text.slice(start, end + 1)));
|
|
95
|
+
if (reply.steps.length === 0) throw new ReplyError({ message: "the timeline is empty" });
|
|
96
|
+
return reply;
|
|
97
|
+
} catch (error) {
|
|
98
|
+
throw error instanceof ReplyError ? error : new ReplyError({ message: error instanceof Error ? error.message : String(error) });
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
/** A statement as the fact the extractor would record. */
|
|
102
|
+
var toFact = (statement, id, saidAt) => ({
|
|
103
|
+
id,
|
|
104
|
+
assertion: {
|
|
105
|
+
subject: {
|
|
106
|
+
kind: "entity",
|
|
107
|
+
entity: statement.subject
|
|
108
|
+
},
|
|
109
|
+
predicate: statement.predicate,
|
|
110
|
+
object: {
|
|
111
|
+
kind: "entity",
|
|
112
|
+
entity: statement.object
|
|
113
|
+
},
|
|
114
|
+
quote: statement.quote
|
|
115
|
+
},
|
|
116
|
+
factuality: {
|
|
117
|
+
value: statement.polarity === "-" ? "CT-" : "CT+",
|
|
118
|
+
polarity: statement.polarity ?? "+"
|
|
119
|
+
},
|
|
120
|
+
illocution: { force: statement.force ?? "assertive" },
|
|
121
|
+
attribution: {
|
|
122
|
+
agent: statement.speaker,
|
|
123
|
+
source: "oracle",
|
|
124
|
+
generatedAtTime: saidAt
|
|
125
|
+
},
|
|
126
|
+
recordedAt: saidAt,
|
|
127
|
+
extractor: {
|
|
128
|
+
id: "oracle",
|
|
129
|
+
model: "none",
|
|
130
|
+
version: "1"
|
|
131
|
+
},
|
|
132
|
+
sourceHash: id
|
|
133
|
+
});
|
|
134
|
+
/** Replays the oracle's timeline against compiled rules; a compile error is a failure. */
|
|
135
|
+
var replay = (source, { createdAt, steps }) => {
|
|
136
|
+
let rules;
|
|
137
|
+
try {
|
|
138
|
+
rules = make({
|
|
139
|
+
source,
|
|
140
|
+
createdAt
|
|
141
|
+
});
|
|
142
|
+
} catch (error) {
|
|
143
|
+
if (error instanceof CompileError) return {
|
|
144
|
+
ok: false,
|
|
145
|
+
failures: error.diagnostics.map(formatDiagnostic)
|
|
146
|
+
};
|
|
147
|
+
throw error;
|
|
148
|
+
}
|
|
149
|
+
const failures = [];
|
|
150
|
+
steps.forEach((step, index) => {
|
|
151
|
+
const offset = parseDuration(step.after) ?? 0;
|
|
152
|
+
const saidAt = new Date(createdAt + offset).toISOString();
|
|
153
|
+
const { wakes, achieved } = rules.update({
|
|
154
|
+
at: createdAt + offset,
|
|
155
|
+
facts: step.says.map((statement, position) => toFact(statement, `oracle-${index}-${position}`, saidAt))
|
|
156
|
+
});
|
|
157
|
+
const label = `step ${index + 1} (${step.note ?? step.says.map(({ quote }) => quote).join(" / ")})`;
|
|
158
|
+
if (wakes.length > 0 !== step.wake) failures.push(`${label}: wake=${wakes.length > 0}, expected ${step.wake}`);
|
|
159
|
+
if (step.achieved !== void 0 && achieved !== step.achieved) failures.push(`${label}: achieved=${achieved}, expected ${step.achieved}`);
|
|
160
|
+
});
|
|
161
|
+
return {
|
|
162
|
+
ok: failures.length === 0,
|
|
163
|
+
failures
|
|
164
|
+
};
|
|
165
|
+
};
|
|
166
|
+
//#endregion
|
|
167
|
+
export { Reply, ReplyError, SYSTEM_PROMPT, Statement, Step, parseReply, replay, Oracle_exports as t, userMessage };
|
|
168
|
+
|
|
169
|
+
//# sourceMappingURL=Oracle.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Oracle.mjs","names":[],"sources":["../../src/Oracle.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\n// @import-as-namespace\n\nimport * as Schema from 'effect/Schema';\n\nimport { BaseError } from '@dxos/errors';\nimport { type RDF } from '@dxos/pipeline-rdf';\nimport { trim } from '@dxos/util';\n\nimport * as Builtins from './Builtins.ts';\nimport * as Compiler from './Compiler.ts';\nimport * as GoalRules from './GoalRules.ts';\n\n/**\n * The replay gate's oracle (BRAIN.md, \"Compilation\"): a model call that sees only the goal's text and\n * writes a short timeline of statements with what each should do to the goal. A compilation goes active\n * only if it replays that timeline correctly; the oracle never sees the rules, so it cannot share the\n * compiler's misreading of the goal.\n */\n\n/** One statement in a test timeline; people and things are named by the ids the goal was given. */\nexport const Statement = Schema.Struct({\n speaker: Schema.String,\n quote: Schema.String,\n subject: Schema.String,\n predicate: Schema.String,\n object: Schema.String,\n force: Schema.optional(Schema.Literals(['assertive', 'directive', 'commissive', 'expressive'])),\n polarity: Schema.optional(Schema.Literals(['+', '-'])),\n});\nexport interface Statement extends Schema.Schema.Type<typeof Statement> {}\n\n/** A step of the timeline: when it happens after the goal is set, what is said, and what should follow. */\nexport const Step = Schema.Struct({\n /** A duration after the goal was set, e.g. `10m`, `1h`, `3d`. */\n after: Schema.String,\n says: Schema.Array(Statement),\n /** Whether the goal should wake (be judged) at this step. */\n wake: Schema.Boolean,\n /** Whether the goal should be achieved after this step; absent when either is acceptable. */\n achieved: Schema.optional(Schema.Boolean),\n note: Schema.optional(Schema.String),\n});\nexport interface Step extends Schema.Schema.Type<typeof Step> {}\n\nexport const Reply = Schema.Struct({ steps: Schema.Array(Step) });\nexport interface Reply extends Schema.Schema.Type<typeof Reply> {}\n\nexport type Person = { readonly name: string; readonly id: string };\n\nexport type Goal = {\n readonly goal: string;\n readonly instructions?: string;\n /** Id of the goal's owner. */\n readonly owner: string;\n /** People the goal may concern, with the ids statements must use for them. */\n readonly people?: ReadonlyArray<Person>;\n};\n\n/** Thrown by {@link parseReply} when the reply is not a timeline. */\nexport class ReplyError extends BaseError.extend('OracleReplyError', 'Oracle reply is not a timeline') {}\n\n/** The oracle's instructions. */\nexport const SYSTEM_PROMPT = trim`\n You write acceptance tests for an agent's goal. A goal is a plain-text directive; a runtime will decide,\n after every statement anyone makes, whether the goal should WAKE (the agent looks at it again because\n something relevant happened) and whether it is ACHIEVED (its outcome happened). You do not see how the\n runtime decides; you only describe what a careful person would expect.\n\n Write a short timeline of 3 to 6 steps after the goal is set. Include at least one step that should\n wake the goal and at least one near miss that should not (the wrong person, an unrelated topic, a\n refusal or a question instead of a statement). Say only what is needed; each step usually has one\n statement.\n\n Each statement is one fact as an extractor would record it: who said it (speaker), the words as said\n (quote), and a subject–predicate–object triple. Name people by the ids given with the goal, exactly as\n given (e.g. \"did:halo:…\"); name other things with lowercase hyphenated words (\"indexer-migration\").\n force is assertive (states), directive (asks), commissive (promises or agrees) or expressive; polarity\n is \"+\" (affirmed) or \"-\" (denied, refused).\n\n Reply with JSON only:\n {\"steps\":[{\"after\":\"10m\",\"says\":[{\"speaker\":\"…\",\"quote\":\"…\",\"subject\":\"…\",\"predicate\":\"…\",\"object\":\"…\",\"force\":\"assertive\",\"polarity\":\"+\"}],\"wake\":true,\"achieved\":false,\"note\":\"why\"}]}\n \"after\" is a duration since the goal was set (10m, 2h, 3d) and must increase from step to step.\n Leave \"achieved\" out when either answer would be acceptable.\n`;\n\n/** The user message for one goal. */\nexport const userMessage = ({ goal, instructions, owner, people = [] }: Goal): string =>\n [\n `Goal: \"${goal}\"`,\n `Owner: ${owner}`,\n instructions?.trim() ? `Instructions: ${instructions.trim()}` : undefined,\n people.length > 0\n ? `People (use these ids): ${people.map(({ name, id }) => `${name} = ${id}`).join('; ')}`\n : undefined,\n ]\n .filter((line) => line !== undefined)\n .join('\\n');\n\nconst decode = Schema.decodeUnknownSync(Reply);\n\n/**\n * Extracts the timeline from the oracle's reply; tolerates a code fence or prose around the JSON.\n * @throws ReplyError if there is no valid timeline.\n */\nexport const parseReply = (text: string): Reply => {\n const start = text.indexOf('{');\n const end = text.lastIndexOf('}');\n if (start < 0 || end <= start) {\n throw new ReplyError({ message: 'the reply has no JSON object' });\n }\n try {\n const reply = decode(JSON.parse(text.slice(start, end + 1)));\n if (reply.steps.length === 0) {\n throw new ReplyError({ message: 'the timeline is empty' });\n }\n return reply;\n } catch (error) {\n throw error instanceof ReplyError\n ? error\n : new ReplyError({ message: error instanceof Error ? error.message : String(error) });\n }\n};\n\n/** A statement as the fact the extractor would record. */\nconst toFact = (statement: Statement, id: string, saidAt: string): RDF.Fact => ({\n id,\n assertion: {\n subject: { kind: 'entity', entity: statement.subject },\n predicate: statement.predicate,\n object: { kind: 'entity', entity: statement.object },\n quote: statement.quote,\n },\n factuality: { value: statement.polarity === '-' ? 'CT-' : 'CT+', polarity: statement.polarity ?? '+' },\n illocution: { force: statement.force ?? 'assertive' },\n attribution: { agent: statement.speaker, source: 'oracle', generatedAtTime: saidAt },\n recordedAt: saidAt,\n extractor: { id: 'oracle', model: 'none', version: '1' },\n sourceHash: id,\n});\n\nexport type Result = {\n readonly ok: boolean;\n /** One line per expectation the rules violate. */\n readonly failures: ReadonlyArray<string>;\n};\n\n/** Replays the oracle's timeline against compiled rules; a compile error is a failure. */\nexport const replay = (\n source: string,\n { createdAt, steps }: { createdAt: number; steps: ReadonlyArray<Step> },\n): Result => {\n let rules: GoalRules.GoalRules;\n try {\n rules = GoalRules.make({ source, createdAt });\n } catch (error) {\n if (error instanceof Compiler.CompileError) {\n return { ok: false, failures: error.diagnostics.map(Compiler.formatDiagnostic) };\n }\n throw error;\n }\n const failures: string[] = [];\n steps.forEach((step, index) => {\n const offset = Builtins.parseDuration(step.after) ?? 0;\n const saidAt = new Date(createdAt + offset).toISOString();\n const { wakes, achieved } = rules.update({\n at: createdAt + offset,\n facts: step.says.map((statement, position) => toFact(statement, `oracle-${index}-${position}`, saidAt)),\n });\n const label = `step ${index + 1} (${step.note ?? step.says.map(({ quote }) => quote).join(' / ')})`;\n if (wakes.length > 0 !== step.wake) {\n failures.push(`${label}: wake=${wakes.length > 0}, expected ${step.wake}`);\n }\n if (step.achieved !== undefined && achieved !== step.achieved) {\n failures.push(`${label}: achieved=${achieved}, expected ${step.achieved}`);\n }\n });\n return { ok: failures.length === 0, failures };\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAwBA,IAAa,YAAY,OAAO,OAAO;CACrC,SAAS,OAAO;CAChB,OAAO,OAAO;CACd,SAAS,OAAO;CAChB,WAAW,OAAO;CAClB,QAAQ,OAAO;CACf,OAAO,OAAO,SAAS,OAAO,SAAS;EAAC;EAAa;EAAa;EAAc;CAAY,CAAC,CAAC;CAC9F,UAAU,OAAO,SAAS,OAAO,SAAS,CAAC,KAAK,GAAG,CAAC,CAAC;AACvD,CAAC;;AAID,IAAa,OAAO,OAAO,OAAO;;CAEhC,OAAO,OAAO;CACd,MAAM,OAAO,MAAM,SAAS;;CAE5B,MAAM,OAAO;;CAEb,UAAU,OAAO,SAAS,OAAO,OAAO;CACxC,MAAM,OAAO,SAAS,OAAO,MAAM;AACrC,CAAC;AAGD,IAAa,QAAQ,OAAO,OAAO,EAAE,OAAO,OAAO,MAAM,IAAI,EAAE,CAAC;;AA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HANGED
|
@@ -4,4 +4,6 @@ import { t as Vocabulary_exports } from "./Vocabulary.mjs";
|
|
|
4
4
|
import { t as Compiler_exports } from "./Compiler.mjs";
|
|
5
5
|
import { t as CompilePrompt_exports } from "./CompilePrompt.mjs";
|
|
6
6
|
import { t as GoalRules_exports } from "./GoalRules.mjs";
|
|
7
|
-
|
|
7
|
+
import { t as Evaluator_exports } from "./Evaluator.mjs";
|
|
8
|
+
import { t as Oracle_exports } from "./Oracle.mjs";
|
|
9
|
+
export { Builtins_exports as Builtins, CompilePrompt_exports as CompilePrompt, Compiler_exports as Compiler, Encoding_exports as Encoding, Evaluator_exports as Evaluator, GoalRules_exports as GoalRules, Oracle_exports as Oracle, Vocabulary_exports as Vocabulary };
|
|
@@ -49,6 +49,8 @@ export declare class MemoryEntityIndex implements EntityIndex {
|
|
|
49
49
|
}
|
|
50
50
|
/** Parses `30s`, `5m`, `2h`, `2d`, `1w` (optionally ISO-prefixed `P`/`PT`) to milliseconds. */
|
|
51
51
|
export declare const parseDuration: (duration: string | number) => number | undefined;
|
|
52
|
+
/** Parses an epoch-ms number or an ISO timestamp. */
|
|
53
|
+
export declare const parseTime: (value: string | number) => number | undefined;
|
|
52
54
|
/**
|
|
53
55
|
* The goal built-ins: `about(F, Text)` and `concerns(F, Entity)` (both may bind `F`),
|
|
54
56
|
* `elapsed(Ref, Duration)` (`Ref` is `goal`, a fact id or a time), `every(Duration)` (a period
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Builtins.d.ts","sourceRoot":"","sources":["../../../src/Builtins.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,OAAO,MAAM,uBAAuB,CAAC;AAEjD,mGAAmG;AACnG,MAAM,WAAW,SAAS;IACxB,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACxC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,yCAAyC;IACzC,OAAO,C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E,MAAM,EAAE,QAAQ,EAAE,aAAa,CAAC,MAAM,CAAC,GAAG,IAAI,CAEzD;IAED,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAE3B;IAED,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,aAAa,CAAC,MAAM,CAAC,CAE9C;IAEA,KAAK,CAAC,MAAM,EAAE,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC,CAMvC;CACF;AAID,+FAA+F;AAC/F,eAAO,MAAM,aAAa,aAAc,MAAM,GAAG,MAAM,KAAG,MAAM,GAAG,SAIlE,CAAC;AAIF,qDAAqD;AACrD,eAAO,MAAM,SAAS,UAAW,MAAM,GAAG,MAAM,KAAG,MAAM,GAAG,SAG3D,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,IAAI,8BAA+B,OAAO,KAAG,OAAO,CAAC,QAmGjE,CAAC;AAEF,mGAAmG;AACnG,eAAO,MAAM,YAAY,QAAO,OAI9B,CAAC"}
|
|
@@ -39,4 +39,8 @@ export declare const RELATIONS: Readonly<Record<string, number>>;
|
|
|
39
39
|
export declare const encode: (fact: RDF.Fact, vocabulary?: Vocabulary.Vocabulary) => Engine.Entry[];
|
|
40
40
|
/** The fact ids among base entries (from provenance). */
|
|
41
41
|
export declare const factIds: (entries: ReadonlyArray<Engine.Entry>) => string[];
|
|
42
|
+
/** An entry as a ground Datalog fact in the dialect goal rules are written in, e.g. `speaker("fact-1", dima).`. */
|
|
43
|
+
export declare const formatEntry: ({ relation, tuple }: Engine.Entry) => string;
|
|
44
|
+
/** The relations the rules engine sees for a fact ({@link encode}), one ground Datalog fact per line. */
|
|
45
|
+
export declare const format: (fact: RDF.Fact, vocabulary?: Vocabulary.Vocabulary) => string[];
|
|
42
46
|
//# sourceMappingURL=Encoding.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Encoding.d.ts","sourceRoot":"","sources":["../../../src/Encoding.ts"],"names":[],"mappings":"
|
|
1
|
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,KAAK,KAAG,MACiB,CAAC;AAElF,yGAAyG;AACzG,eAAO,MAAM,MAAM,SAAU,GAAG,CAAC,IAAI,eAAe,UAAU,CAAC,UAAU,KAAG,MAAM,EACvC,CAAC"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { type RDF } from '@dxos/pipeline-rdf';
|
|
2
|
+
import * as GoalRules from './GoalRules.ts';
|
|
3
|
+
/** A standing goal the evaluator watches: its compiled rules and when it began. */
|
|
4
|
+
export type Subscription = {
|
|
5
|
+
readonly id: string;
|
|
6
|
+
/** A goal program (`wake`, `achieved`, `holds`, `blocks`); see `Compiler`. */
|
|
7
|
+
readonly rules: string;
|
|
8
|
+
/** ISO time the subscription began; the rules' clock starts here. */
|
|
9
|
+
readonly createdAt: string;
|
|
10
|
+
};
|
|
11
|
+
/** A wake of one subscription, ready to queue in its outbox. */
|
|
12
|
+
export type Event = {
|
|
13
|
+
/**
|
|
14
|
+
* Stable for the same wake: the subscription, the wake label and the facts behind it (or, for a
|
|
15
|
+
* wake no fact caused, the evaluation time), so a host that re-derives a wake queues it once.
|
|
16
|
+
*/
|
|
17
|
+
readonly id: string;
|
|
18
|
+
readonly subscription: string;
|
|
19
|
+
readonly label: string;
|
|
20
|
+
readonly cause: GoalRules.Wake['cause'];
|
|
21
|
+
/** The facts behind the wake, in the order they arrived. */
|
|
22
|
+
readonly facts: ReadonlyArray<RDF.Fact>;
|
|
23
|
+
/** Evaluation time (epoch ms). */
|
|
24
|
+
readonly at: number;
|
|
25
|
+
};
|
|
26
|
+
export type PushOptions = {
|
|
27
|
+
/** Evaluation time (epoch ms). */
|
|
28
|
+
readonly at: number;
|
|
29
|
+
/**
|
|
30
|
+
* Speakers (entity ids) whose facts are evaluated but wake nothing on their own: an agent's own
|
|
31
|
+
* words must not wake it. A wake resting on a quiet fact and another one still wakes.
|
|
32
|
+
*/
|
|
33
|
+
readonly quiet?: ReadonlyArray<string>;
|
|
34
|
+
};
|
|
35
|
+
/** The id of an event: see {@link Event.id}. */
|
|
36
|
+
export declare const eventId: (subscription: string, label: string, facts: ReadonlyArray<string>, at: number) => string;
|
|
37
|
+
/**
|
|
38
|
+
* Evaluates every subscription of one brain over a shared fact stream. Synchronous and in memory: a
|
|
39
|
+
* host keeps the facts and the outboxes in its own store, feeds pushes and clock ticks through
|
|
40
|
+
* {@link Evaluator.push} and {@link Evaluator.tick}, and after a restart rebuilds the evaluator with
|
|
41
|
+
* {@link Evaluator.hydrate}, which re-derives the rules' state without emitting events.
|
|
42
|
+
*/
|
|
43
|
+
export declare class Evaluator {
|
|
44
|
+
#private;
|
|
45
|
+
constructor({ maxFacts }?: {
|
|
46
|
+
maxFacts?: number;
|
|
47
|
+
});
|
|
48
|
+
/** The subscriptions, in the order they were added. */
|
|
49
|
+
get subscriptions(): Subscription[];
|
|
50
|
+
has(id: string): boolean;
|
|
51
|
+
/**
|
|
52
|
+
* Adds or replaces a subscription. It sees the facts already held (said before it began, so its
|
|
53
|
+
* rules can read history) without waking on them.
|
|
54
|
+
* @throws Compiler.CompileError if the rules do not compile; nothing is changed.
|
|
55
|
+
*/
|
|
56
|
+
add(subscription: Subscription): void;
|
|
57
|
+
/** Removes a subscription; false when it was not held. */
|
|
58
|
+
remove(id: string): boolean;
|
|
59
|
+
/** Evaluates new facts at time `at`; returns the wakes, one event each. */
|
|
60
|
+
push(facts: ReadonlyArray<RDF.Fact>, { at, quiet }: PushOptions): Event[];
|
|
61
|
+
/** Re-evaluates the clock at time `at` (a scheduled tick); returns the wakes. */
|
|
62
|
+
tick(at: number): Event[];
|
|
63
|
+
/**
|
|
64
|
+
* Rebuilds state after a restart: adds the subscriptions and replays the facts as of `at` (the last
|
|
65
|
+
* evaluation before the restart), emitting nothing. Wakes due since then come from the next
|
|
66
|
+
* {@link tick} or {@link push}.
|
|
67
|
+
* @throws Compiler.CompileError if a subscription's rules do not compile.
|
|
68
|
+
*/
|
|
69
|
+
hydrate(subscriptions: ReadonlyArray<Subscription>, facts: ReadonlyArray<RDF.Fact>, at: number): void;
|
|
70
|
+
/** The earliest time any subscription's clock can next change; see `GoalRules.nextDueAt`. */
|
|
71
|
+
nextDueAt(): number | undefined;
|
|
72
|
+
}
|
|
73
|
+
/** Creates an evaluator. */
|
|
74
|
+
export declare const make: (options?: {
|
|
75
|
+
maxFacts?: number;
|
|
76
|
+
}) => Evaluator;
|
|
77
|
+
//# sourceMappingURL=Evaluator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Evaluator.d.ts","sourceRoot":"","sources":["../../../src/Evaluator.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,GAAG,EAAE,MAAM,oBAAoB,CAAC;AAE9C,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAC;AAE5C,mFAAmF;AACnF,MAAM,MAAM,YAAY,GAAG;IACzB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,8EAA8E;IAC9E,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,qEAAqE;IACrE,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC5B,CAAC;AAEF,gEAAgE;AAChE,MAAM,MAAM,KAAK,GAAG;IAClB;;;OAGG;IACH,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACxC,4DAA4D;IAC5D,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACxC,kCAAkC;IAClC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACxB,kCAAkC;IAClC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,QAAQ,CAAC,KAA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appings":""}
|
|
@@ -116,6 +116,12 @@ export declare class GoalRules {
|
|
|
116
116
|
* @throws CapacityError if the input would exceed the sub-goal cap; nothing is applied.
|
|
117
117
|
*/
|
|
118
118
|
update({ at, facts, subgoals }: Input): Evaluation;
|
|
119
|
+
/**
|
|
120
|
+
* The earliest time after the last evaluation at which a time built-in can change its answer
|
|
121
|
+
* (`elapsed`, `every`, `due`), so a host schedules its next {@link update} rather than polling;
|
|
122
|
+
* `undefined` when the rules read no clock.
|
|
123
|
+
*/
|
|
124
|
+
nextDueAt(): number | undefined;
|
|
119
125
|
/** Evaluates the `blocks` rules for a proposed action without keeping it. */
|
|
120
126
|
checkAction(action: Action): ActionCheck;
|
|
121
127
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GoalRules.d.ts","sourceRoot":"","sources":["../../../src/GoalRules.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAC;AAEzC,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAC;AAC1C,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAC;AAE1C,OAAO,KAAK,KAAK,UAAU,MAAM,iBAAiB,CAAC;AAEnD;;;GAGG;AACH,eAAO,MAAM,SAAS,QAAS,CAAC;AAEhC,kGAAkG;AAClG,eAAO,MAAM,YAAY,MAAM,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEhC,qGAAqG;AACrG,qBAAa,aAAc,SAAQ,kBAAqE;IACtG,YAAY,OAAO,EAAE;QAAE,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;KAAE,EAExE;CACF;AAED,4CAA4C;AAC5C,MAAM,MAAM,IAAI,GAAG;IACjB,+EAA+E;IAC/E,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,EA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Aa,CAAC,MAAM,CAAC,CAAC;IAC9D;;;;;;;;OAQG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,sCAAsC;IACtC,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;CAC/B,CAAC;AAEF,MAAM,MAAM,KAAK,GAAG;IAClB,wEAAwE;IACxE,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,KAAK,CAAC,EAAE,aAAa,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACzC,mEAAmE;IACnE,QAAQ,CAAC,QAAQ,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;CACtD,CAAC;AAEF;;;;GAIG;AACH,qBAAa,SAAS;;IACpB,QAAQ,CAAC,WAAW,EAAE,QAAQ,CAAC,WAAW,CAAC;IAiB3C,iEAAiE;IACjE,YAAY,OAAO,EAAE,OAAO,EAuB3B;IAED,IAAI,QAAQ,IAAI,OAAO,CAEtB;IAED,IAAI,KAAK,IAAI,OAAO,CAEnB;IAED;;;;OAIG;IACH,MAAM,CAAC,EAAE,EAAE,EAAE,KAAU,EAAE,QAAa,EAAE,EAAE,KAAK,GAAG,UAAU,CAgF3D;IA+CD;;;;OAIG;IACH,SAAS,IAAI,MAAM,GAAG,SAAS,CAyD9B;IAED,6EAA6E;IAC7E,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,WAAW,CAWvC;CACF;AAeD,gCAAgC;AAChC,eAAO,MAAM,IAAI,YAAa,OAAO,KAAG,SAAmC,CAAC"}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import * as Schema from 'effect/Schema';
|
|
2
|
+
import { BaseError } from '@dxos/errors';
|
|
3
|
+
/**
|
|
4
|
+
* The replay gate's oracle (BRAIN.md, "Compilation"): a model call that sees only the goal's text and
|
|
5
|
+
* writes a short timeline of statements with what each should do to the goal. A compilation goes active
|
|
6
|
+
* only if it replays that timeline correctly; the oracle never sees the rules, so it cannot share the
|
|
7
|
+
* compiler's misreading of the goal.
|
|
8
|
+
*/
|
|
9
|
+
/** One statement in a test timeline; people and things are named by the ids the goal was given. */
|
|
10
|
+
export declare const Statement: Schema.Struct<{
|
|
11
|
+
readonly speaker: Schema.String;
|
|
12
|
+
readonly quote: Schema.String;
|
|
13
|
+
readonly subject: Schema.String;
|
|
14
|
+
readonly predicate: Schema.String;
|
|
15
|
+
readonly object: Schema.String;
|
|
16
|
+
readonly force: Schema.optional<Schema.Literals<readonly ["assertive", "directive", "commissive", "expressive"]>>;
|
|
17
|
+
readonly polarity: Schema.optional<Schema.Literals<readonly ["+", "-"]>>;
|
|
18
|
+
}>;
|
|
19
|
+
export interface Statement extends Schema.Schema.Type<typeof Statement> {
|
|
20
|
+
}
|
|
21
|
+
/** A step of the timeline: when it happens after the goal is set, what is said, and what should follow. */
|
|
22
|
+
export declare const Step: Schema.Struct<{
|
|
23
|
+
/** A duration after the goal was set, e.g. `10m`, `1h`, `3d`. */
|
|
24
|
+
readonly after: Schema.String;
|
|
25
|
+
readonly says: Schema.$Array<Schema.Struct<{
|
|
26
|
+
readonly speaker: Schema.String;
|
|
27
|
+
readonly quote: Schema.String;
|
|
28
|
+
readonly subject: Schema.String;
|
|
29
|
+
readonly predicate: Schema.String;
|
|
30
|
+
readonly object: Schema.String;
|
|
31
|
+
readonly force: Schema.optional<Schema.Literals<readonly ["assertive", "directive", "commissive", "expressive"]>>;
|
|
32
|
+
readonly polarity: Schema.optional<Schema.Literals<readonly ["+", "-"]>>;
|
|
33
|
+
}>>;
|
|
34
|
+
/** Whether the goal should wake (be judged) at this step. */
|
|
35
|
+
readonly wake: Schema.Boolean;
|
|
36
|
+
/** Whether the goal should be achieved after this step; absent when either is acceptable. */
|
|
37
|
+
readonly achieved: Schema.optional<Schema.Boolean>;
|
|
38
|
+
readonly note: Schema.optional<Schema.String>;
|
|
39
|
+
}>;
|
|
40
|
+
export interface Step extends Schema.Schema.Type<typeof Step> {
|
|
41
|
+
}
|
|
42
|
+
export declare const Reply: Schema.Struct<{
|
|
43
|
+
readonly steps: Schema.$Array<Schema.Struct<{
|
|
44
|
+
/** A duration after the goal was set, e.g. `10m`, `1h`, `3d`. */
|
|
45
|
+
readonly after: Schema.String;
|
|
46
|
+
readonly says: Schema.$Array<Schema.Struct<{
|
|
47
|
+
readonly speaker: Schema.String;
|
|
48
|
+
readonly quote: Schema.String;
|
|
49
|
+
readonly subject: Schema.String;
|
|
50
|
+
readonly predicate: Schema.String;
|
|
51
|
+
readonly object: Schema.String;
|
|
52
|
+
readonly force: Schema.optional<Schema.Literals<readonly ["assertive", "directive", "commissive", "expressive"]>>;
|
|
53
|
+
readonly polarity: Schema.optional<Schema.Literals<readonly ["+", "-"]>>;
|
|
54
|
+
}>>;
|
|
55
|
+
/** Whether the goal should wake (be judged) at this step. */
|
|
56
|
+
readonly wake: Schema.Boolean;
|
|
57
|
+
/** Whether the goal should be achieved after this step; absent when either is acceptable. */
|
|
58
|
+
readonly achieved: Schema.optional<Schema.Boolean>;
|
|
59
|
+
readonly note: Schema.optional<Schema.String>;
|
|
60
|
+
}>>;
|
|
61
|
+
}>;
|
|
62
|
+
export interface Reply extends Schema.Schema.Type<typeof Reply> {
|
|
63
|
+
}
|
|
64
|
+
export type Person = {
|
|
65
|
+
readonly name: string;
|
|
66
|
+
readonly id: string;
|
|
67
|
+
};
|
|
68
|
+
export type Goal = {
|
|
69
|
+
readonly goal: string;
|
|
70
|
+
readonly instructions?: string;
|
|
71
|
+
/** Id of the goal's owner. */
|
|
72
|
+
readonly owner: string;
|
|
73
|
+
/** People the goal may concern, with the ids statements must use for them. */
|
|
74
|
+
readonly people?: ReadonlyArray<Person>;
|
|
75
|
+
};
|
|
76
|
+
declare const ReplyError_base: {
|
|
77
|
+
new (options?: import("@dxos/errors").BaseErrorOptions): {
|
|
78
|
+
cause?: unknown;
|
|
79
|
+
stack?: string;
|
|
80
|
+
name: "OracleReplyError";
|
|
81
|
+
context: Record<string, unknown>;
|
|
82
|
+
readonly message: string;
|
|
83
|
+
readonly _tag: "OracleReplyError";
|
|
84
|
+
};
|
|
85
|
+
isError(error: unknown): error is Error;
|
|
86
|
+
name: "OracleReplyError";
|
|
87
|
+
is(error: unknown): error is BaseError;
|
|
88
|
+
wrap(options?: Omit<import("@dxos/errors").BaseErrorOptions, 'cause'> & {
|
|
89
|
+
ifTypeDiffers?: boolean;
|
|
90
|
+
}): (error: unknown) => {
|
|
91
|
+
cause?: unknown;
|
|
92
|
+
stack?: string;
|
|
93
|
+
name: "OracleReplyError";
|
|
94
|
+
context: Record<string, unknown>;
|
|
95
|
+
readonly message: string;
|
|
96
|
+
readonly _tag: "OracleReplyError";
|
|
97
|
+
};
|
|
98
|
+
extend<Name extends string = string>(name: Name, message?: string): any;
|
|
99
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
100
|
+
prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined;
|
|
101
|
+
stackTraceLimit: number;
|
|
102
|
+
};
|
|
103
|
+
/** Thrown by {@link parseReply} when the reply is not a timeline. */
|
|
104
|
+
export declare class ReplyError extends ReplyError_base {
|
|
105
|
+
}
|
|
106
|
+
/** The oracle's instructions. */
|
|
107
|
+
export declare const SYSTEM_PROMPT: string;
|
|
108
|
+
/** The user message for one goal. */
|
|
109
|
+
export declare const userMessage: ({ goal, instructions, owner, people }: Goal) => string;
|
|
110
|
+
/**
|
|
111
|
+
* Extracts the timeline from the oracle's reply; tolerates a code fence or prose around the JSON.
|
|
112
|
+
* @throws ReplyError if there is no valid timeline.
|
|
113
|
+
*/
|
|
114
|
+
export declare const parseReply: (text: string) => Reply;
|
|
115
|
+
export type Result = {
|
|
116
|
+
readonly ok: boolean;
|
|
117
|
+
/** One line per expectation the rules violate. */
|
|
118
|
+
readonly failures: ReadonlyArray<string>;
|
|
119
|
+
};
|
|
120
|
+
/** Replays the oracle's timeline against compiled rules; a compile error is a failure. */
|
|
121
|
+
export declare const replay: (source: string, { createdAt, steps }: {
|
|
122
|
+
createdAt: number;
|
|
123
|
+
steps: ReadonlyArray<Step>;
|
|
124
|
+
}) => Result;
|
|
125
|
+
export {};
|
|
126
|
+
//# sourceMappingURL=Oracle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Oracle.d.ts","sourceRoot":"","sources":["../../../src/Oracle.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAQzC;;;;;GAKG;AAEH,mGAAmG;AACnG,eAAO,MAAM,SAAS;;;;;;;;EAQpB,CAAC;AACH,MAAM,WAAW,SAAU,SAAQ,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,SAAS,CAAC;CAAG;AAE1E,2GAA2G;AAC3G,eAAO,MAAM,IAAI;IACf,iEAAiE;;;;;;;;;;;IAGjE,6DAA6D;;IAE7D,6FAA6F;;;EAG7F,CAAC;AACH,MAAM,WAAW,IAAK,SAAQ,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,IAAI,CAAC;CAAG;AAEhE,eAAO,MAAM,KAAK;;QAXhB,iEAAiE;;;;;;;;;;;QAGjE,6DAA6D;;QAE7D,6FAA6F;;;;EAM9B,CAAC;AAClE,MAAM,WAAW,KAAM,SAAQ,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,KAAK,CAAC;CAAG;AAElE,MAAM,MAAM,MAAM,GAAG;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;CAAE,CAAC;AAEpE,MAAM,MAAM,IAAI,GAAG;IACjB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B,8BAA8B;IAC9B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,8EAA8E;IAC9E,QAAQ,CAAC,MAAM,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;CACzC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEF,qEAAqE;AACrE,qBAAa,UAAW,SAAQ,eAAsE;CAAG;AAEzG,iCAAiC;AACjC,eAAO,MAAM,aAAa,QAqBzB,CAAC;AAEF,qCAAqC;AACrC,eAAO,MAAM,WAAW,0CAAgD,IAAI,KAAG,MAUhE,CAAC;AAIhB;;;GAGG;AACH,eAAO,MAAM,UAAU,SAAU,MAAM,KAAG,KAiBzC,CAAC;AAmBF,MAAM,MAAM,MAAM,GAAG;IACnB,QAAQ,CAAC,EAAE,EAAE,OAAO,CAAC;IACrB,kDAAkD;IAClD,QAAQ,CAAC,QAAQ,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;CAC1C,CAAC;AAEF,0FAA0F;AAC1F,eAAO,MAAM,MAAM,WACT,MAAM,wBACQ;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,aAAa,CAAC,IAAI,CAAC,CAAA;CAAE,KACtE,MA2BF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Oracle.test.d.ts","sourceRoot":"","sources":["../../../src/Oracle.test.ts"],"names":[],"mappings":""}
|
|
@@ -2,6 +2,8 @@ export * as Builtins from './Builtins.ts';
|
|
|
2
2
|
export * as CompilePrompt from './CompilePrompt.ts';
|
|
3
3
|
export * as Compiler from './Compiler.ts';
|
|
4
4
|
export * as Encoding from './Encoding.ts';
|
|
5
|
+
export * as Evaluator from './Evaluator.ts';
|
|
5
6
|
export * as GoalRules from './GoalRules.ts';
|
|
7
|
+
export * as Oracle from './Oracle.ts';
|
|
6
8
|
export * as Vocabulary from './Vocabulary.ts';
|
|
7
9
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAC;AAC1C,OAAO,KAAK,aAAa,MAAM,oBAAoB,CAAC;AACpD,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAC;AAC1C,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAC;AAC1C,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAC;AAC5C,OAAO,KAAK,UAAU,MAAM,iBAAiB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAC;AAC1C,OAAO,KAAK,aAAa,MAAM,oBAAoB,CAAC;AACpD,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAC;AAC1C,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAC;AAC1C,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAC;AAC5C,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAC;AAC5C,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AACtC,OAAO,KAAK,UAAU,MAAM,iBAAiB,CAAC"}
|