API Changes
What each merged pull request changed in the public API, with the declarations before and after, and the new examples.
Every export of every entry point is written down as data, the way a .d.ts declares it (site/api/surface.json, checked against the source by pnpm check). A pull request that changes it lists here what it added, changed and removed, with the declarations before and after, and each new or changed export's example. On the preview of a pull request that changes the API, its changes come first, and every page says so.
#869 System One says whether a sentence names an option (named); a named one is the person's decision on the real-model path (0149 §9) | System One 说这句话有没有点名一个选项;真模型路径上点名的值是人的决定
Merged 2026-11-28 · #869 ↗ · 0 added · 3 changed · 0 removed
@reintent/lib/jev
HeardJudgmentChangedtype
type HeardJudgment = Judgment & {
heard?: boolean;
nearestOnly?: boolean;
named?: number;
};JevAnswerChangedtype
⋯ 5 unchanged lines
probabilities: Record<string, number>;
heard?: boolean;
is?: boolean;
named?: number;
}
| {
type: 'score';
⋯ 13 unchanged linesdecisionJudgeChangedfunction
⋯ 3 unchanged lines
beyond?: BeyondOf;
world?: WorldOf;
asksBelow?: number | false;
named?: boolean;
},
): NonNullable<Model['judge']>;import { decisionJudge } from '@reintent/lib/jev';
const judge = decisionJudge(async () => ({
answers: {
q0: { type: 'choice', choice: 'calm', probabilities: { angry: 0.1, calm: 0.9 } },
q0_asks: { type: 'boolean', probability: 0.9 },
},
}));
const j = await judge(
{
type: 'request',
effect: 'judge',
id: { of: 'm', name: 'tone' },
key: 'm#tone',
stamp: '',
prompt: 'Tone?',
kinds: ['angry', 'calm'],
facts: ['keep it calm'],
},
{ signal: new AbortController().signal },
);
console.log(j.weights); // → { angry: 0.1, calm: 0.9 }#848 System One is only bass's decision API: chatJudge removed; bassModel, the bench and the recording scripts ask /api/ai/decide (0152 §6)
Merged 2026-11-26 · #848 ↗ · 0 added · 0 changed · 2 removed
@reintent/lib/jev
ChatRemovedtype
type Chat = (
system: string,
user: string,
schema?: Record<string, unknown>,
) => Promise<string>;chatJudgeRemovedfunction
function chatJudge(
chat: Chat,
o?: {
beyond?: BeyondOf;
world?: WorldOf;
maxChars?: number;
},
): NonNullable<Model['judge']>;#847 System One stays chatJudge (0152 §5): the decide bench; vendor bass 6b1f64f, unavailable falls back to the chat judge; asksBelow and the bench knobs
Merged 2026-11-26 · #847 ↗ · 0 added · 1 changed · 0 removed
@reintent/lib/jev
decisionJudgeChangedfunction
⋯ 2 unchanged lines
o?: {
beyond?: BeyondOf;
world?: WorldOf;
asksBelow?: number | false;
},
): NonNullable<Model['judge']>;import { decisionJudge } from '@reintent/lib/jev';
const judge = decisionJudge(async () => ({
answers: {
q0: { type: 'choice', choice: 'calm', probabilities: { angry: 0.1, calm: 0.9 } },
q0_asks: { type: 'boolean', probability: 0.9 },
},
}));
const j = await judge(
{
type: 'request',
effect: 'judge',
id: { of: 'm', name: 'tone' },
key: 'm#tone',
stamp: '',
prompt: 'Tone?',
kinds: ['angry', 'calm'],
facts: ['keep it calm'],
},
{ signal: new AbortController().signal },
);
console.log(j.weights); // → { angry: 0.1, calm: 0.9 }#845 System One can ask bass's decision API: decisionJudge, LabSession.decide, bench BENCH_DECIDE; vendor bass bce58f4 (0152)
Merged 2026-11-26 · #845 ↗ · 4 added · 0 changed · 0 removed
@reintent/lib/jev
DecideAddedtype
type Decide = (
state: Record<string, unknown>,
questions: Record<string, DecisionQuestion>,
) => Promise<{
answers: Record<string, DecisionAnswer>;
}>;DecisionAnswerAddedtype
type DecisionAnswer =
| {
type: 'choice';
choice: string;
probabilities?: Record<string, number>;
confidence?: number;
}
| {
type: 'score';
score: number;
probabilities?: Record<string, number>;
confidence?: number;
}
| {
type: 'boolean';
probability: number;
}
| {
type: 'refusal';
};DecisionQuestionAddedtype
type DecisionQuestion =
| {
type: 'choice';
instructions: string;
criteria: Record<string, string | null>;
}
| {
type: 'score';
instructions: string;
criteria: string[];
}
| {
type: 'boolean';
instructions: string;
criteria?: {
true?: string;
false?: string;
};
};decisionJudgeAddedfunction
function decisionJudge(
decide: Decide,
o?: {
beyond?: BeyondOf;
world?: WorldOf;
},
): NonNullable<Model['judge']>;import { decisionJudge } from '@reintent/lib/jev';
const judge = decisionJudge(async () => ({
answers: {
q0: { type: 'choice', choice: 'calm', probabilities: { angry: 0.1, calm: 0.9 } },
q0_asks: { type: 'boolean', probability: 0.9 },
},
}));
const j = await judge(
{
type: 'request',
effect: 'judge',
id: { of: 'm', name: 'tone' },
key: 'm#tone',
stamp: '',
prompt: 'Tone?',
kinds: ['angry', 'calm'],
facts: ['keep it calm'],
},
{ signal: new AbortController().signal },
);
console.log(j.weights); // → { angry: 0.1, calm: 0.9 }#804 System One on structured output: chatJudge gives its chat the answer's schema; bassModel asks through askObject | System One 改用结构化输出:chatJudge 把回答的 schema 交给 chat,bassModel 经 askObject 问
Merged 2026-11-26 · #804 ↗ · 0 added · 1 changed · 0 removed
@reintent/lib/jev
ChatChangedtype
type Chat = (system: string, user: string) => Promise<string>;
type Chat = (
system: string,
user: string,
schema?: Record<string, unknown>,
) => Promise<string>;#737 useChoice passes askWhenTold; short choices told apart by key; the page asks again when bass is busy (0114, 0133 §4, 0076 §6) | useChoice 传 askWhenTold;缺的选择按 key 认;bass 忙时页面再问
Merged 2026-11-11 · #737 ↗ · 0 added · 1 changed · 0 removed
@reintent/lib/jev
QuestionOptionsChangedtype
⋯ 2 unchanged lines
defaultValue?: T;
ask?: readonly Actor[];
uses?: Record<string, unknown>;
askWhenTold?: boolean;
};#736 Lab UI: levels keep "none of these" as a noul; a question that only took the nearest did not hear the sentence; README from signal and adaptive-score (0133 §3.3, §3.7) | Lab UI:有级别的题用 noul 说「都不是」;只取了最近的题不算听见;接入说明补 signal 和 adaptive-score 踩到的坑
Merged 2026-11-11 · #736 ↗ · 0 added · 2 changed · 0 removed
@reintent/lib/jev
HeardJudgmentChangedtype
type HeardJudgment = Judgment & {
heard?: boolean;
nearestOnly?: boolean;
};JevAnswerChangedtype
⋯ 4 unchanged lines
confidence: number;
probabilities: Record<string, number>;
heard?: boolean;
is?: boolean;
}
| {
type: 'score';
score: number;
confidence: number;
probabilities: Record<string, number>;
heard?: boolean;
is?: boolean;
}
| {
type: 'noul';
⋯ 5 unchanged lines#728 System One says whether it heard the last sentence; questions can read the world; the routes bench reads by key (0133 §3.5, §3.6) | System One 说出有没有听见最后一句;题可以读世界;评测按 key 读(0133 §3.5、§3.6)
Merged 2026-11-11 · #728 ↗ · 2 added · 3 changed · 0 removed
@reintent/lib/jev
HeardJudgmentAddedtype
type HeardJudgment = Judgment & {
heard?: boolean;
};JevAnswerChangedtype
⋯ 3 unchanged lines
choice: string;
confidence: number;
probabilities: Record<string, number>;
heard?: boolean;
}
| {
type: 'score';
score: number;
confidence: number;
probabilities: Record<string, number>;
heard?: boolean;
}
| {
type: 'noul';
⋯ 5 unchanged linesWorldOfAddedtype
type WorldOf = boolean | ((r: ModelRequest) => boolean | undefined);chatJudgeChangedfunction
function chatJudge(
chat: Chat,
o?: {
beyond?: BeyondOf;
world?: WorldOf;
maxChars?: number;
},
): NonNullable<Model['judge']>;import { chatJudge } from '@reintent/lib/jev';
const judge = chatJudge(
async () =>
'{"answers":{"q0":{"type":"choice","probabilities":{"angry":0.1,"calm":0.9}}}}',
);
const j = await judge(
{
type: 'request',
effect: 'judge',
id: { of: 'm', name: 'tone' },
key: 'm#tone',
stamp: '',
prompt: 'Tone?',
kinds: ['angry', 'calm'],
},
{ signal: new AbortController().signal },
);
console.log(j.weights); // → { angry: 0.1, calm: 0.9 }jevJudgmentChangedfunction
function jevJudgment(
kinds: readonly string[],
answer: JevAnswer,
fits?: JevAnswer,
): Judgment;
): HeardJudgment;import { jevJudgment } from '@reintent/lib/jev';
const j = jevJudgment(['later', 'this-week', 'today'], {
type: 'score',
score: 1.7,
confidence: 0.55,
probabilities: { 0: 0.1, 1: 0.1, 2: 0.8 },
});
console.log(j); // → { weights: { later: 0.1, 'this-week': 0.1, today: 0.8 }, confidence: 0.55 }#707 core: a reprogramming the intent asks by itself that fails is reported — intent.onProposalFailed, else the console (0055 §4) | 意图自己发起的改写失败要报出来
Merged 2026-11-11 · #707 ↗ · 1 added · 1 changed · 0 removed
@reintent/core
ProposalFailureAddedtype
type ProposalFailure = {
why?: Unresolved;
scope?: string;
error: Error;
reasons?: readonly string[];
};createIntentChangedfunction
⋯ 118 unchanged lines
reject(): void;
readonly inputChanged: boolean;
};
onProposalFailed(fn: (f: ProposalFailure) => void): () => undefined;
onProposal(fn: (p: Proposal) => void): () => undefined;
onUnresolved(fn: (u: Unresolved) => void): () => undefined;
onEscalate(fn: (e: Unresolved) => void): () => undefined;
};import {
choices,
createContext,
createIntent,
host,
useChoose,
useContext,
type Provide,
} from '@reintent/core';
const Screen = createContext<{ id: string; width: number }>('Screen', {
axes: { width: (s) => s.width },
});
function Deck() {
const { width } = useContext(Screen);
const layout = useChoose(choices('cols1', 'cols2'), {
of: 'deck',
name: 'layout',
defaultValue: width < 600 ? 'cols1' : 'cols2',
});
return host('deck', { layout });
}
const intent = createIntent({ program: <Deck /> });
// One program, evaluated in many contexts: they share the intent.
const phone: Provide = [[Screen, { id: 'phone', width: 390 }]];
const desktop: Provide = [[Screen, { id: 'desktop', width: 1440 }]];
console.log(intent.realize(phone).reads[0].value); // → 'cols1'
console.log(intent.realize(desktop).reads[0].value); // → 'cols2'
// A person's actions are commits, and can be undone.
intent.decide({ of: 'deck', name: 'layout' }, 'cols1');
console.log(intent.realize(desktop).reads[0].value); // → 'cols1'
intent.history.undo();
console.log(intent.realize(desktop).reads[0].value); // → 'cols2'
// What it would be, without writing anything.
const would = intent.preview({ 'deck#layout': 'cols1' }, desktop);
console.log(would.reads[0].value, would.reads[0].source); // → 'cols1' 'preview'#708 Shader: a sentence routed between System One and System Two, measured on staging: 70% → 95% of 20 sentences (0133) | Shader:一句话在 System One 和 System Two 之间怎么走,staging 上量过:20 句从 70% 到 95%
Merged 2026-11-11 · #708 ↗ · 2 added · 2 changed · 0 removed
@reintent/lib/jev
BeyondOfAddedtype
type BeyondOf = BeyondBy | ((r: ModelRequest) => BeyondBy | undefined);JevAnswerChangedtype
⋯ 13 unchanged lines
| {
type: 'noul';
noul: number;
}
| {
type: 'silent';
};SILENTAddedconst
const SILENT: Judgment;chatJudgeChangedfunction
function chatJudge(
chat: Chat,
o?: {
beyond?: BeyondBy;
beyond?: BeyondOf;
maxChars?: number;
},
): NonNullable<Model['judge']>;import { chatJudge } from '@reintent/lib/jev';
const judge = chatJudge(
async () =>
'{"answers":{"q0":{"type":"choice","probabilities":{"angry":0.1,"calm":0.9}}}}',
);
const j = await judge(
{
type: 'request',
effect: 'judge',
id: { of: 'm', name: 'tone' },
key: 'm#tone',
stamp: '',
prompt: 'Tone?',
kinds: ['angry', 'calm'],
},
{ signal: new AbortController().signal },
);
console.log(j.weights); // → { angry: 0.1, calm: 0.9 }#676 System One through bass, asked the way Jev is: chatJudge in lib/jev, bassModel judges with it, the shader on useChoice | System One 经 bass、照 Jev 的问法
Merged 2026-11-11 · #676 ↗ · 2 added · 0 changed · 0 removed
@reintent/lib/jev
ChatAddedtype
type Chat = (system: string, user: string) => Promise<string>;chatJudgeAddedfunction
function chatJudge(
chat: Chat,
o?: {
beyond?: BeyondBy;
maxChars?: number;
},
): NonNullable<Model['judge']>;import { chatJudge } from '@reintent/lib/jev';
const judge = chatJudge(
async () =>
'{"answers":{"q0":{"type":"choice","probabilities":{"angry":0.1,"calm":0.9}}}}',
);
const j = await judge(
{
type: 'request',
effect: 'judge',
id: { of: 'm', name: 'tone' },
key: 'm#tone',
stamp: '',
prompt: 'Tone?',
kinds: ['angry', 'calm'],
},
{ signal: new AbortController().signal },
);
console.log(j.weights); // → { angry: 0.1, calm: 0.9 }#703 core: β first, or near the first from <World minBeyond>, is unmet and goes to System Two (0115 §4.4, S1125) | β 是第一名、或离第一名不远,就交给 System Two
Merged 2026-11-11 · #703 ↗ · 0 added · 2 changed · 0 removed
@reintent/core
WorldPropsChangedtype
type WorldProps<T = unknown> = {
id?: string;
minMargin?: number;
minBeyond?: number;
onUnresolved?: OnUnresolved;
as?: Record<string, Decided>;
each?: true | EachTarget<T>;
⋯ 8 unchanged lines@reintent/core/internal
PolicyChangedtype
type Policy = {
readonly minMargin: number;
readonly minBeyond?: number;
readonly otherwise: Otherwise;
readonly sample?: {
readonly world: string;
⋯ 3 unchanged lines#655 Core: the program's own word along an axis is the prior there, below a judgment, above Code's taste (0118) | 程序沿一条轴给的先验:在判断之下、Code 的品味之上
Merged 2026-10-31 · #655 ↗ · 0 added · 2 changed · 0 removed
@reintent/core/internal
CascadeInputChangedtype
⋯ 10 unchanged lines
where?: string;
policy: Policy;
defaultValue?: T;
written?: T;
instead?: boolean;
open?: boolean;
unloaded?: boolean;
⋯ 3 unchanged linesChooseOptionsChangedtype
⋯ 11 unchanged lines
readonly minMargin?: number;
};
uses?: Record<string, unknown>;
priorAlong?: Piecewise<NoInfer<T>>;
shape?: Shape;
describe?: Readonly<Record<string, string>>;
about?: unknown;
};#648 lib/jev (0116): asked the way Jev asks, in user space — useChoice, useScore, useWhether and <Ask state>; shape, descriptions and confidence reach System One | 照 Jev 的写法问
Merged 2026-10-31 · #648 ↗ · 15 added · 10 changed · 0 removed
@reintent/core
ChoiceReadChangedtype
⋯ 21 unchanged lines
beyond?: number;
question?: string;
uses?: Record<string, unknown>;
shape?: Shape;
describe?: Readonly<Record<string, string>>;
about?: unknown;
sample?: {
world: string;
⋯ 5 unchanged linesChoiceStatusChangedtype
⋯ 9 unchanged lines
unfit?: true;
cause?: 'measured' | 'judged';
beyond?: number;
confidence?: number;
};JudgmentAddedtype
type Judgment = {
weights: Weights;
confidence?: number;
};ModelChangedtype
⋯ 4 unchanged lines
hypothetical?: true;
},
call: ModelCall,
) => Weights | Promise<Weights>;
) => Weights | Judgment | Promise<Weights | Judgment>;
generate?: (r: ModelRequest, call: ModelCall) => unknown;
reprogram?: (r: ReprogramRequest) => ProposalDraft | Promise<ProposalDraft>;
};ModelRequestChangedtype
⋯ 5 unchanged lines
stamp: string;
prompt: string;
kinds?: string[];
shape?: Shape;
describe?: Readonly<Record<string, string>>;
n?: number;
uses?: Record<string, unknown>;
facts?: readonly string[];
⋯ 2 unchanged linesShapeAddedtype
type Shape = 'ordered' | 'whether';@reintent/core/internal
BeliefChangedtype
type Belief = {
readonly stamp: string;
readonly answer: Weights;
readonly confidence?: number;
};ChooseOptionsChangedtype
⋯ 11 unchanged lines
readonly minMargin?: number;
};
uses?: Record<string, unknown>;
shape?: Shape;
describe?: Readonly<Record<string, string>>;
about?: unknown;
};JudgedChangedtype
⋯ 2 unchanged lines
readonly question: string;
readonly choices: Choices<T> | Generation<T>;
readonly uses?: Record<string, unknown>;
readonly shape?: Shape;
readonly describe?: Readonly<Record<string, string>>;
};OutcomeChangedtype
⋯ 13 unchanged lines
unmet?: unknown;
beyond?: number;
wants: boolean;
confidence?: number;
};createLayerStoreChangedfunction
⋯ 4 unchanged lines
hold<T>(fn: () => T): T;
commit(note: string, fn: (tx: Tx) => void): void;
setProgram(element: Child, note?: string): void;
believe(id: Id, stamp: string, answer: Weights): void;
believe(
id: Id,
stamp: string,
answer:
| Weights
| {
weights: Weights;
confidence?: number;
},
): void;
measure(id: Id, where: string, m: Measured): boolean;
generated(id: Id, stamp: string, value: unknown): void;
unload(of: string, unloaded: boolean): void;
⋯ 9 unchanged linesstampOfChangedconst
const stampOf: (r: {
prompt: string;
kinds?: readonly string[];
shape?: Shape;
describe?: Readonly<Record<string, string>>;
uses?: Record<string, unknown>;
facts: readonly string[];
n?: number;
⋯ 2 unchanged lines@reintent/lib/jevNew entry point
import { jevJudgment } from '@reintent/lib/jev';
const j = jevJudgment(['later', 'this-week', 'today'], {
type: 'score',
score: 1.7,
confidence: 0.55,
probabilities: { 0: 0.1, 1: 0.1, 2: 0.8 },
});
console.log(j); // → { weights: { later: 0.1, 'this-week': 0.1, today: 0.8 }, confidence: 0.55 }import { jevQuestion } from '@reintent/lib/jev';
const q = jevQuestion({
type: 'request',
effect: 'judge',
id: { of: 'm', name: 'tone' },
key: 'm#tone',
stamp: '',
prompt: 'What is the tone of this message?',
kinds: ['angry', 'calm'],
describe: { angry: 'An upset or hostile message' },
});
console.log(q.question.criteria); // → { angry: 'An upset or hostile message', calm: null, 'none of these': 'None of the listed fits what is asked' }import { createIntent, host } from '@reintent/core';
import { Ask, useChoice } from '@reintent/lib/jev';
function Ticket() {
const tone = useChoice('ticket#tone', 'What is the tone of this message?', {
angry: 'An upset or hostile message',
calm: 'A neutral or polite message',
});
return host('ticket', { tone });
}
const intent = createIntent({
program: (
<Ask state="I was charged twice. Please refund the extra charge.">
<Ticket />
</Ask>
),
model: { judge: (r) => (console.log(r.uses), { angry: 0.15, calm: 0.85 }) }, // → { state: 'I was charged twice. Please refund the extra charge.' }
});
const connection = intent.connect({ commit() {} });
console.log(intent.realize().reads[0].value); // → 'calm'
connection.disconnect();import { createIntent, host, type ModelRequest } from '@reintent/core';
import { useScore } from '@reintent/lib/jev';
let asked: ModelRequest | undefined;
function Ticket() {
const urgency = useScore('ticket#urgency', 'How urgent is this message?', {
later: 'Can wait',
week: 'Needs attention this week',
today: 'Needs attention today',
});
return host('ticket', { urgency });
}
const intent = createIntent({
program: <Ticket />,
model: { judge: (r) => ((asked = r), { later: 0.1, week: 0.1, today: 0.8 }) },
});
const connection = intent.connect({ commit() {} });
console.log(asked?.shape, intent.realize().reads[0].value); // → 'ordered' 'today'
connection.disconnect();import { createIntent, host } from '@reintent/core';
import { useWhether } from '@reintent/lib/jev';
function Ticket() {
const billing = useWhether('ticket#billing', 'Is this message about billing?');
return host('ticket', { billing });
}
const intent = createIntent({
program: <Ticket />,
model: { judge: () => ({ true: 0.98, false: 0.02 }) },
});
const connection = intent.connect({ commit() {} });
console.log(intent.realize().reads[0].value); // → true
connection.disconnect();#649 K carries beyond (0115): System One can answer that none of K is what was asked; unmet, judged, goes to System Two (shader: fireworks → burst) | K 默认带上 beyond
Merged 2026-10-31 · #649 ↗ · 1 added · 8 changed · 0 removed
@reintent/core
BEYONDAddedconst
const BEYOND = '$beyond';import { BEYOND } from '@reintent/core';
const answer = { waves: 0.1, rings: 0.2, [BEYOND]: 0.7 };
console.log(Object.keys(answer)); // → [ 'waves', 'rings', '$beyond' ]ChoiceReadChangedtype
⋯ 18 unchanged lines
stale?: true;
measured?: true;
unfit?: true;
beyond?: number;
question?: string;
uses?: Record<string, unknown>;
about?: unknown;
⋯ 7 unchanged linesChoiceStatusChangedtype
⋯ 7 unchanged lines
waiting?: unknown[];
measured?: true;
unfit?: true;
cause?: 'measured';
cause?: 'measured' | 'judged';
beyond?: number;
};UnresolvedChangedtype
⋯ 4 unchanged lines
reason: Reason;
dist?: Weights;
wanted?: unknown;
cause?: 'measured' | 'judged';
beyond?: number;
goal?: string;
allow: readonly Action[];
boundary?: string;
⋯ 3 unchanged linesUnresolvedChoiceChangedtype
⋯ 3 unchanged lines
readonly reason: Reason;
readonly dist?: Weights;
readonly wanted?: unknown;
readonly cause?: 'measured';
readonly cause?: 'measured' | 'judged';
readonly beyond?: number;
};UnresolvedObservationChangedtype
type UnresolvedObservation = {
readonly key: string;
readonly id: Id;
readonly reason: Reason;
readonly cause?: 'measured' | 'judged';
readonly beyond?: number;
readonly goal?: string;
readonly allow: readonly Action[];
readonly tried?: readonly Action[];
};@reintent/core/internal
EscalationChangedclass
⋯ 4 unchanged lines
readonly tried: readonly Action[];
readonly wanted?: unknown | undefined;
readonly can: Can;
readonly beyond?: number | undefined;
constructor(
id: Id,
reason: Reason,
dist?: Record<string, number> | undefined,
tried?: readonly Action[],
wanted?: unknown | undefined,
can?: Can,
beyond?: number | undefined,
);
}OutcomeChangedtype
⋯ 7 unchanged lines
waiting?: unknown[];
stale?: true;
none?: true;
cause?: 'measured';
cause?: 'measured' | 'judged';
measured?: true;
unfit?: true;
unmet?: unknown;
beyond?: number;
wants: boolean;
};UnresolvedChangedtype
⋯ 4 unchanged lines
reason: Reason;
dist?: Weights;
wanted?: unknown;
cause?: 'measured' | 'judged';
beyond?: number;
goal?: string;
allow: readonly Action[];
boundary?: string;
⋯ 3 unchanged lines#650 Core: askWhenTold, a prior that answers until a person tells the intent something; choices refuses a weighted possibility with anything more than value and weight (0114)
Merged 2026-10-30 · #650 ↗ · 0 added · 1 changed · 0 removed
@reintent/core/internal
ChooseOptionsChangedtype
⋯ 3 unchanged lines
otherwise?: Otherwise;
question?: string;
ask?: readonly Ask[];
askWhenTold?: boolean;
instead?: boolean;
stays?: {
readonly question: string;
⋯ 6 unchanged lines#591 Report entity identity collisions (0092) | 报告实体身份碰撞
Merged 2026-10-29 · #591 ↗ · 0 added · 1 changed · 0 removed
@reintent/core
ChoiceReadChangedtype
⋯ 2 unchanged lines
id: Id;
key: string;
name: string;
entity?: string;
ctx: Record<string, string>;
value: unknown;
origin?: DecisionOrigin;
⋯ 22 unchanged lines#590 Return the resolved identity in ChoiceStatus (0092) | ChoiceStatus 返回解析后的身份
Merged 2026-10-29 · #590 ↗ · 0 added · 1 changed · 0 removed
@reintent/core
ChoiceStatusChangedtype
type ChoiceStatus<T> = {
value: T;
id: Id;
source: Source;
status: Status;
reason?: Reason;
⋯ 6 unchanged lines#589 useChoose(identity, choices, options): the identity first, the read gives the rest (0092 §4 step 2) | useChoose 先给身份,可能性和问法由读给
Merged 2026-10-29 · #589 ↗ · 0 added · 2 changed · 0 removed
@reintent/core
useChoiceStatusChangedfunction
⋯ 5 unchanged lines
ref: R,
...opts: DeclaredArgs<R>
): StatusOf<R>;
function useChoiceStatus<T>(
id: Id | Declared,
c: Choices<T> | Generation<T> | Judged<T>,
opts?: Omit<ChooseOptions<T>, 'of' | 'name'>,
): ChoiceStatus<T>;import {
choices,
createIntent,
host,
useChoiceStatus,
type HostNode,
} from '@reintent/core';
function Reply() {
const tone = useChoiceStatus(choices('formal', 'warm'), {
of: 'r1',
name: 'tone',
defaultValue: 'warm',
});
return host('reply', { tone: tone.value, source: tone.source, status: tone.status });
}
const intent = createIntent({ program: <Reply /> });
const props = () => (intent.realize().tree as HostNode).props;
console.log(props().tone, props().source, props().status); // → 'warm' 'default' 'unresolved'
intent.decide({ of: 'r1', name: 'tone' }, 'formal');
console.log(props().tone, props().source, props().status); // → 'formal' 'decision' 'decided'useChooseChangedfunction
⋯ 2 unchanged lines
opts: ChooseOptions<T>,
): T;
function useChoose<R extends Declared>(ref: R, ...opts: DeclaredArgs<R>): ReadOf<R>;
function useChoose<T>(
id: Id | Declared,
c: Choices<T> | Generation<T> | Judged<T>,
opts?: Omit<ChooseOptions<T>, 'of' | 'name'>,
): T;import { choices, createIntent, host, useChoose } from '@reintent/core';
// A choice is read by its identity, { of, name }: which entity, and which question.
function Reply(p: { id: string }) {
const send = useChoose(choices('now', 'tomorrow'), {
of: p.id,
name: 'send',
defaultValue: 'tomorrow',
});
return host('reply', { send });
}
const intent = createIntent({ program: <Reply id="r1" /> });
console.log(intent.realize().reads[0].value); // → 'tomorrow'
// A person's decision is the top of the cascade.
intent.decide({ of: 'r1', name: 'send' }, 'now');
console.log(intent.realize().reads[0].value); // → 'now'#597 lib: observe goes, with what used it (0091) | 删掉 lib/observe 和用它的地方
Merged 2026-10-29 · #597 ↗ · 0 added · 0 changed · 6 removed
@reintent/lib/observeEntry point removed
BoundWordsRemovedinterface
interface BoundWords {
prompt: string;
spans: readonly {
from: number;
to: number;
of: string;
name?: string;
kind?: string;
}[];
}XmlOptionsRemovedinterface
interface XmlOptions {
scene?: string;
facts?: readonly string[];
said?: BoundWords;
explain?: (id: Id) => {
dist?: Weights;
};
data?: boolean;
}observeRemovedfunction
function observe(
reads: readonly ChoiceRead[],
said: readonly string[],
explain: (id: Id) => {
dist?: Weights;
},
): string;toXmlRemovedfunction
function toXml(reads: readonly ChoiceRead[], opts?: XmlOptions): string;whoOfRemovedconst
const whoOf: (r: Pick<ChoiceRead, 'source'>) => Actor | 'preview' | 'unknown';wordsXmlRemovedfunction
function wordsXml(said: BoundWords): string;Last updated on
Edit on GitHub