@knights-eye-chess/ai-analysis 0.0.0-stage → 0.1.0-dev.14
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 +235 -0
- package/LICENSING.md +26 -0
- package/NOTICE +5 -0
- package/NPM-PUBLISHING.md +24 -0
- package/README.md +141 -2
- package/SOURCE-ORIGIN.json +16 -0
- package/THIRD_PARTY_NOTICES.md +18 -0
- package/build.mjs +22 -0
- package/dist/answer-pipeline.test.mjs +375 -0
- package/dist/chunk-PLKNJRPF.js +10662 -0
- package/dist/chunk-XQDZJOYD.js +2515 -0
- package/dist/index.js +146 -0
- package/dist/owner-tests/chess-reasoning-compact-search-preparation.test.mjs +963 -0
- package/dist/owner-tests/mechanism-encoding.test.mjs +529 -0
- package/dist/owner-tests/move-mechanism-facts.test.mjs +396 -0
- package/dist/owner-tests/pipeline-host-preparation.test.mjs +10556 -0
- package/dist/owner-tests/position-preparation.test.mjs +625 -0
- package/dist/owner-tests/preparation-consolidation.test.mjs +1052 -0
- package/dist/owner-tests/prose-reference-admission.test.mjs +1770 -0
- package/dist/owner-tests/score-comparison-notices.test.mjs +240 -0
- package/dist/owner-tests/simple-engine-presentation.test.mjs +233 -0
- package/dist/owner-tests/tool-input-loop-guard.test.mjs +78 -0
- package/dist/research.js +2274 -0
- package/dist/runtime-closure.json +103 -0
- package/dist/shared-runtime-closure.json +39 -0
- package/dist/shared.js +152 -0
- package/dist/types/ai-request-failure.d.ts +14 -0
- package/dist/types/ai-request-limits.d.ts +4 -0
- package/dist/types/ai-routing-diagnostics.d.ts +14 -0
- package/dist/types/chess-reasoning/ablation-adaptive-evidence-loop.d.ts +127 -0
- package/dist/types/chess-reasoning/ablation-adaptive-runtime.d.ts +178 -0
- package/dist/types/chess-reasoning/ablation-direct-synthesis.d.ts +1030 -0
- package/dist/types/chess-reasoning/ablation-evidence-bundle.d.ts +185 -0
- package/dist/types/chess-reasoning/ablation-evidence-capture.d.ts +37 -0
- package/dist/types/chess-reasoning/ablation-lean-direct-runtime.d.ts +193 -0
- package/dist/types/chess-reasoning/ablation-model-facing-evidence.d.ts +38 -0
- package/dist/types/chess-reasoning/ablation-transport-correction.d.ts +13 -0
- package/dist/types/chess-reasoning/ai-sdk-runtime-support.d.ts +93 -0
- package/dist/types/chess-reasoning/answer-host-contracts.d.ts +59 -0
- package/dist/types/chess-reasoning/answer-model-connector.d.ts +68 -0
- package/dist/types/chess-reasoning/answer-pipeline-exports.d.ts +98 -0
- package/dist/types/chess-reasoning/answer-pipeline.d.ts +41 -0
- package/dist/types/chess-reasoning/answer-reference-validation.d.ts +40 -0
- package/dist/types/chess-reasoning/answer-tool-host.d.ts +8 -0
- package/dist/types/chess-reasoning/branch-expansion-policy.d.ts +13 -0
- package/dist/types/chess-reasoning/branch-expansion.d.ts +39 -0
- package/dist/types/chess-reasoning/causal-claim-checks.d.ts +21 -0
- package/dist/types/chess-reasoning/chess-reference-dictionary.d.ts +13 -0
- package/dist/types/chess-reasoning/classification-question-target.d.ts +22 -0
- package/dist/types/chess-reasoning/classification-reassessment.d.ts +31 -0
- package/dist/types/chess-reasoning/compact-search-preparation.d.ts +7 -0
- package/dist/types/chess-reasoning/concept-registry.d.ts +99 -0
- package/dist/types/chess-reasoning/conversation-context.d.ts +12 -0
- package/dist/types/chess-reasoning/engine-search-failure.d.ts +7 -0
- package/dist/types/chess-reasoning/evidence-citation-normalization.d.ts +9 -0
- package/dist/types/chess-reasoning/evidence-licenses.d.ts +57 -0
- package/dist/types/chess-reasoning/evidence-selector-contract.d.ts +5 -0
- package/dist/types/chess-reasoning/existing-analysis-context.d.ts +104 -0
- package/dist/types/chess-reasoning/fact-observation-provider.d.ts +15 -0
- package/dist/types/chess-reasoning/fact-provider.d.ts +111 -0
- package/dist/types/chess-reasoning/fresh-engine-pv-witnesses.d.ts +67 -0
- package/dist/types/chess-reasoning/historical-prose.d.ts +23 -0
- package/dist/types/chess-reasoning/idea-graph.d.ts +34 -0
- package/dist/types/chess-reasoning/initial-search-plan.d.ts +37 -0
- package/dist/types/chess-reasoning/lossless-evidence-sharing.d.ts +18 -0
- package/dist/types/chess-reasoning/matched-comparison.d.ts +10 -0
- package/dist/types/chess-reasoning/material-accounting.d.ts +80 -0
- package/dist/types/chess-reasoning/material-format.d.ts +4 -0
- package/dist/types/chess-reasoning/mechanical-fact-provider.d.ts +33 -0
- package/dist/types/chess-reasoning/mechanical-ray-facts.d.ts +19 -0
- package/dist/types/chess-reasoning/mechanism-presentation.d.ts +9 -0
- package/dist/types/chess-reasoning/move-mechanism-facts.d.ts +45 -0
- package/dist/types/chess-reasoning/native-answer-connector.d.ts +4 -0
- package/dist/types/chess-reasoning/opening-source-contracts.d.ts +54 -0
- package/dist/types/chess-reasoning/opening-source-credits.d.ts +16 -0
- package/dist/types/chess-reasoning/opponent-threat-preparation.d.ts +7 -0
- package/dist/types/chess-reasoning/piece-identities.d.ts +11 -0
- package/dist/types/chess-reasoning/poc-contracts.d.ts +1026 -0
- package/dist/types/chess-reasoning/poc-hypotheses.d.ts +74 -0
- package/dist/types/chess-reasoning/poc-move-witnesses.d.ts +13 -0
- package/dist/types/chess-reasoning/poc-observations.d.ts +23 -0
- package/dist/types/chess-reasoning/poc-piece-refs.d.ts +12 -0
- package/dist/types/chess-reasoning/poc-plan-model.d.ts +45 -0
- package/dist/types/chess-reasoning/poc-semantic-text.d.ts +8 -0
- package/dist/types/chess-reasoning/poc-tools.d.ts +81 -0
- package/dist/types/chess-reasoning/portable-answer-runtime.d.ts +291 -0
- package/dist/types/chess-reasoning/position-analysis-contracts.d.ts +31 -0
- package/dist/types/chess-reasoning/position-analysis-scope.d.ts +3 -0
- package/dist/types/chess-reasoning/preparation-consolidation.d.ts +21 -0
- package/dist/types/chess-reasoning/production-observation-provider.d.ts +16 -0
- package/dist/types/chess-reasoning/question-routing.d.ts +326 -0
- package/dist/types/chess-reasoning/recorded-main-line.d.ts +37 -0
- package/dist/types/chess-reasoning/recorded-position-tools.d.ts +11 -0
- package/dist/types/chess-reasoning/recorded-reference-context.d.ts +13 -0
- package/dist/types/chess-reasoning/recorded-selected-classification.d.ts +36 -0
- package/dist/types/chess-reasoning/reference-limits.d.ts +2 -0
- package/dist/types/chess-reasoning/research-exports.d.ts +197 -0
- package/dist/types/chess-reasoning/saved-score-presentation.d.ts +14 -0
- package/dist/types/chess-reasoning/score-comparison-notices.d.ts +33 -0
- package/dist/types/chess-reasoning/server-simple-policy.d.ts +31 -0
- package/dist/types/chess-reasoning/simple-agent-config.d.ts +73 -0
- package/dist/types/chess-reasoning/simple-board-analysis.d.ts +85 -0
- package/dist/types/chess-reasoning/simple-compact-evidence.d.ts +7 -0
- package/dist/types/chess-reasoning/simple-completion.d.ts +23 -0
- package/dist/types/chess-reasoning/simple-engine-presentation.d.ts +3 -0
- package/dist/types/chess-reasoning/simple-evidence-preparation.d.ts +17 -0
- package/dist/types/chess-reasoning/simple-evidence-view.d.ts +17 -0
- package/dist/types/chess-reasoning/simple-explanation-coverage.d.ts +90 -0
- package/dist/types/chess-reasoning/simple-fact-delivery.d.ts +43 -0
- package/dist/types/chess-reasoning/simple-fallback-premise.d.ts +5 -0
- package/dist/types/chess-reasoning/simple-prose-references.d.ts +108 -0
- package/dist/types/chess-reasoning/simple-runtime-version.d.ts +1 -0
- package/dist/types/chess-reasoning/stable.d.ts +2 -0
- package/dist/types/chess-reasoning/tool-input-loop-guard.d.ts +5 -0
- package/dist/types/chess-reasoning/types.d.ts +180 -0
- package/dist/types/chess-reasoning/visible-support-lines.d.ts +12 -0
- package/dist/types/chess-reasoning/wikibooks-index.d.ts +30 -0
- package/dist/types/chess-reasoning/wikibooks-tool-context.d.ts +10 -0
- package/dist/types/player-perspective.d.ts +16 -0
- package/dist/types/shared-exports.d.ts +22 -0
- package/docs/API.md +82 -0
- package/docs/OWNERSHIP-ADOPTION.md +35 -0
- package/docs/OWNERSHIP-DRIFT.json +55 -0
- package/docs/RESEARCH-API.md +28 -0
- package/licenses/third-party/INVENTORY.json +202 -0
- package/licenses/third-party/ai-7.0.85/LICENSE +13 -0
- package/licenses/third-party/ai-sdk--gateway-4.0.69/LICENSE +13 -0
- package/licenses/third-party/ai-sdk--provider-4.0.9/LICENSE +13 -0
- package/licenses/third-party/ai-sdk--provider-utils-5.0.34/APACHE-2.0.txt +73 -0
- package/licenses/third-party/ai-sdk--provider-utils-5.0.34/src/to-json-schema/zod3-to-json-schema/LICENSE +16 -0
- package/licenses/third-party/chess.js-1.4.0/LICENSE +23 -0
- package/licenses/third-party/eventsource-parser-3.1.1/LICENSE +21 -0
- package/licenses/third-party/json-schema-0.4.0/LICENSE +195 -0
- package/licenses/third-party/standard-schema--spec-1.1.0/LICENSE +21 -0
- package/licenses/third-party/types--json-schema-7.0.15/LICENSE +21 -0
- package/licenses/third-party/types--node-22.19.19/LICENSE +21 -0
- package/licenses/third-party/undici-7.30.0/LICENSE +21 -0
- package/licenses/third-party/undici-7.30.0/lib/web/fetch/LICENSE +21 -0
- package/licenses/third-party/undici-types-6.21.0/LICENSE +21 -0
- package/licenses/third-party/vercel--oidc-3.2.0/LICENSE +202 -0
- package/licenses/third-party/workflow--serde-4.1.0/APACHE-2.0.txt +73 -0
- package/licenses/third-party/workflow--serde-4.1.0/LICENSE.md +3 -0
- package/licenses/third-party/zod-4.6.5/LICENSE +21 -0
- package/npm-release.json +5 -0
- package/package.json +72 -4
- package/scripts/check-release-tooling.mjs +22 -0
- package/scripts/pack.mjs +68 -0
- package/scripts/publish-reviewed.mjs +72 -0
- package/scripts/release-tooling.json +13 -0
- package/scripts/update-dependency.mjs +44 -0
- package/scripts/verify-release.mjs +52 -0
- package/src/ai-request-failure.ts +34 -0
- package/src/ai-request-limits.ts +4 -0
- package/src/ai-routing-diagnostics.ts +33 -0
- package/src/chess-reasoning/ablation-adaptive-evidence-loop.ts +515 -0
- package/src/chess-reasoning/ablation-adaptive-runtime.ts +924 -0
- package/src/chess-reasoning/ablation-direct-synthesis.ts +1128 -0
- package/src/chess-reasoning/ablation-evidence-bundle.ts +726 -0
- package/src/chess-reasoning/ablation-evidence-capture.ts +513 -0
- package/src/chess-reasoning/ablation-lean-direct-runtime.ts +670 -0
- package/src/chess-reasoning/ablation-model-facing-evidence.ts +212 -0
- package/src/chess-reasoning/ablation-transport-correction.ts +106 -0
- package/src/chess-reasoning/ai-sdk-runtime-support.ts +381 -0
- package/src/chess-reasoning/answer-host-contracts.ts +10 -0
- package/src/chess-reasoning/answer-model-connector.ts +83 -0
- package/src/chess-reasoning/answer-pipeline-exports.ts +98 -0
- package/src/chess-reasoning/answer-pipeline.ts +195 -0
- package/src/chess-reasoning/answer-reference-validation.ts +124 -0
- package/src/chess-reasoning/answer-tool-host.ts +10 -0
- package/src/chess-reasoning/branch-expansion-policy.ts +32 -0
- package/src/chess-reasoning/branch-expansion.ts +80 -0
- package/src/chess-reasoning/causal-claim-checks.ts +256 -0
- package/src/chess-reasoning/chess-reference-dictionary.ts +21 -0
- package/src/chess-reasoning/classification-question-target.ts +30 -0
- package/src/chess-reasoning/classification-reassessment.ts +34 -0
- package/src/chess-reasoning/compact-search-preparation.ts +125 -0
- package/src/chess-reasoning/concept-registry.ts +275 -0
- package/src/chess-reasoning/conversation-context.ts +29 -0
- package/src/chess-reasoning/engine-search-failure.ts +11 -0
- package/src/chess-reasoning/evidence-citation-normalization.ts +15 -0
- package/src/chess-reasoning/evidence-licenses.ts +166 -0
- package/src/chess-reasoning/evidence-selector-contract.ts +5 -0
- package/src/chess-reasoning/existing-analysis-context.ts +544 -0
- package/src/chess-reasoning/fact-observation-provider.ts +134 -0
- package/src/chess-reasoning/fact-provider.ts +250 -0
- package/src/chess-reasoning/fresh-engine-pv-witnesses.ts +128 -0
- package/src/chess-reasoning/historical-prose.ts +116 -0
- package/src/chess-reasoning/idea-graph.ts +224 -0
- package/src/chess-reasoning/initial-search-plan.ts +115 -0
- package/src/chess-reasoning/lossless-evidence-sharing.ts +135 -0
- package/src/chess-reasoning/matched-comparison.ts +40 -0
- package/src/chess-reasoning/material-accounting.ts +55 -0
- package/src/chess-reasoning/material-format.ts +47 -0
- package/src/chess-reasoning/mechanical-fact-provider.ts +1602 -0
- package/src/chess-reasoning/mechanical-ray-facts.ts +123 -0
- package/src/chess-reasoning/mechanism-presentation.ts +94 -0
- package/src/chess-reasoning/move-mechanism-facts.ts +185 -0
- package/src/chess-reasoning/native-answer-connector.ts +13 -0
- package/src/chess-reasoning/opening-source-contracts.ts +47 -0
- package/src/chess-reasoning/opening-source-credits.ts +53 -0
- package/src/chess-reasoning/opponent-threat-preparation.ts +98 -0
- package/src/chess-reasoning/piece-identities.ts +159 -0
- package/src/chess-reasoning/poc-contracts.ts +1097 -0
- package/src/chess-reasoning/poc-hypotheses.ts +759 -0
- package/src/chess-reasoning/poc-move-witnesses.ts +170 -0
- package/src/chess-reasoning/poc-observations.ts +611 -0
- package/src/chess-reasoning/poc-piece-refs.ts +62 -0
- package/src/chess-reasoning/poc-plan-model.ts +345 -0
- package/src/chess-reasoning/poc-semantic-text.ts +10 -0
- package/src/chess-reasoning/poc-tools.ts +978 -0
- package/src/chess-reasoning/portable-answer-runtime.ts +684 -0
- package/src/chess-reasoning/position-analysis-contracts.ts +88 -0
- package/src/chess-reasoning/position-analysis-scope.ts +20 -0
- package/src/chess-reasoning/preparation-consolidation.ts +91 -0
- package/src/chess-reasoning/production-observation-provider.ts +41 -0
- package/src/chess-reasoning/question-routing.ts +332 -0
- package/src/chess-reasoning/recorded-main-line.ts +55 -0
- package/src/chess-reasoning/recorded-position-tools.ts +78 -0
- package/src/chess-reasoning/recorded-reference-context.ts +44 -0
- package/src/chess-reasoning/recorded-selected-classification.ts +54 -0
- package/src/chess-reasoning/reference-limits.ts +2 -0
- package/src/chess-reasoning/research-exports.ts +197 -0
- package/src/chess-reasoning/saved-score-presentation.ts +6 -0
- package/src/chess-reasoning/score-comparison-notices.ts +115 -0
- package/src/chess-reasoning/server-simple-policy.ts +75 -0
- package/src/chess-reasoning/simple-agent-config.ts +58 -0
- package/src/chess-reasoning/simple-board-analysis.ts +57 -0
- package/src/chess-reasoning/simple-compact-evidence.ts +79 -0
- package/src/chess-reasoning/simple-completion.ts +37 -0
- package/src/chess-reasoning/simple-engine-presentation.ts +95 -0
- package/src/chess-reasoning/simple-evidence-preparation.ts +32 -0
- package/src/chess-reasoning/simple-evidence-view.ts +69 -0
- package/src/chess-reasoning/simple-explanation-coverage.ts +118 -0
- package/src/chess-reasoning/simple-fact-delivery.ts +52 -0
- package/src/chess-reasoning/simple-fallback-premise.ts +65 -0
- package/src/chess-reasoning/simple-prose-references.ts +528 -0
- package/src/chess-reasoning/simple-runtime-version.ts +2 -0
- package/src/chess-reasoning/stable.ts +18 -0
- package/src/chess-reasoning/tool-input-loop-guard.ts +38 -0
- package/src/chess-reasoning/types.ts +195 -0
- package/src/chess-reasoning/visible-support-lines.ts +44 -0
- package/src/chess-reasoning/wikibooks-index.ts +56 -0
- package/src/chess-reasoning/wikibooks-tool-context.ts +91 -0
- package/src/player-perspective.ts +41 -0
- package/src/shared-exports.ts +23 -0
- package/test/answer-pipeline.test.mjs +375 -0
- package/test/owner/chess-reasoning-compact-search-preparation.test.mjs +111 -0
- package/test/owner/mechanism-encoding.test.mjs +78 -0
- package/test/owner/move-mechanism-facts.test.mjs +105 -0
- package/test/owner/pipeline-host-preparation.test.mjs +115 -0
- package/test/owner/position-preparation.test.mjs +22 -0
- package/test/owner/preparation-consolidation.test.mjs +74 -0
- package/test/owner/prose-reference-admission.test.mjs +26 -0
- package/test/owner/score-comparison-notices.test.mjs +116 -0
- package/test/owner/simple-engine-presentation.test.mjs +50 -0
- package/test/owner/tool-input-loop-guard.test.mjs +25 -0
- package/test-types.mts +23 -0
- package/tsconfig.json +22 -0
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { type EvidenceLicense } from "./evidence-licenses.js";
|
|
2
|
+
import { type ChessFactAuthority } from "./fact-provider.js";
|
|
3
|
+
import { type ObservationProvider, type ReasoningObservationSet, type ReasoningPositionContext, type ReasoningRunControls } from "./poc-contracts.js";
|
|
4
|
+
import type { SemanticValue } from "./types.js";
|
|
5
|
+
export declare const EXISTING_ANALYSIS_CONTEXT_VERSION: "existing-analysis-context/2";
|
|
6
|
+
export declare const LEGACY_EXISTING_ANALYSIS_CONTEXT_VERSION: "existing-analysis-context/1";
|
|
7
|
+
export declare const CANONICAL_EDGE_ANALYSIS_SNAPSHOT_VERSION: "canonical-edge-analysis-snapshot/1";
|
|
8
|
+
export declare const EXISTING_ANALYSIS_RECORD_VERSION: "existing-analysis-record/1";
|
|
9
|
+
export declare const MATERIAL_OFFER_SET_VERSION: "classifier-material-offer-set/1";
|
|
10
|
+
export declare const EXISTING_ANALYSIS_OBSERVATION_PROVIDER_ID: "knights-eye/existing-analysis-context";
|
|
11
|
+
/**
|
|
12
|
+
* Development/evaluation views over one identical canonical context snapshot.
|
|
13
|
+
* These are ablation controls, not user-query kinds or alternative providers.
|
|
14
|
+
*/
|
|
15
|
+
export declare const EXISTING_ANALYSIS_CONTEXT_MODE: Readonly<{
|
|
16
|
+
readonly HIDDEN: "hidden";
|
|
17
|
+
readonly LABEL_ONLY: "label-only";
|
|
18
|
+
readonly DIAGNOSTICS_ONLY: "diagnostics-only";
|
|
19
|
+
readonly FULL: "full";
|
|
20
|
+
}>;
|
|
21
|
+
export type ExistingAnalysisContextMode = typeof EXISTING_ANALYSIS_CONTEXT_MODE[keyof typeof EXISTING_ANALYSIS_CONTEXT_MODE];
|
|
22
|
+
export declare const ANALYSIS_CONTEXT_PROVENANCE_TIER: Readonly<{
|
|
23
|
+
readonly RAW_ANALYSIS: "raw-analysis";
|
|
24
|
+
readonly LEGACY_HEURISTIC: "legacy-heuristic-diagnostic";
|
|
25
|
+
readonly REVIEWED_SEMANTIC: "reviewed-semantic-state";
|
|
26
|
+
readonly POLICY_LABEL: "policy-derived-label";
|
|
27
|
+
}>;
|
|
28
|
+
export type AnalysisContextProvenanceTier = typeof ANALYSIS_CONTEXT_PROVENANCE_TIER[keyof typeof ANALYSIS_CONTEXT_PROVENANCE_TIER];
|
|
29
|
+
export type MaterialOfferCandidateSummary = {
|
|
30
|
+
captureUci: string;
|
|
31
|
+
offeredSquare: string;
|
|
32
|
+
offeredPiece: string;
|
|
33
|
+
nominalOffer: number;
|
|
34
|
+
voluntaryOfferCap: number;
|
|
35
|
+
bestImmediateRecoveryNet: number;
|
|
36
|
+
qualifying: boolean;
|
|
37
|
+
acceptanceLine: string[];
|
|
38
|
+
persistent: boolean | null;
|
|
39
|
+
conversionGain: number | null;
|
|
40
|
+
};
|
|
41
|
+
export type MaterialOfferSet = {
|
|
42
|
+
version: typeof MATERIAL_OFFER_SET_VERSION;
|
|
43
|
+
status: "complete" | "unavailable";
|
|
44
|
+
offers: MaterialOfferCandidateSummary[] | null;
|
|
45
|
+
screenedCandidates: MaterialOfferCandidateSummary[];
|
|
46
|
+
classifierVersion: number;
|
|
47
|
+
detector: "classifier-sacrifice-offer-tracker";
|
|
48
|
+
policy: string;
|
|
49
|
+
horizon: {
|
|
50
|
+
verificationDepth: number | null;
|
|
51
|
+
materialWindowPlies: number | null;
|
|
52
|
+
principalVariationPlies: number;
|
|
53
|
+
};
|
|
54
|
+
limitations: string[];
|
|
55
|
+
};
|
|
56
|
+
export type ExistingAnalysisRecord = {
|
|
57
|
+
version: typeof EXISTING_ANALYSIS_RECORD_VERSION;
|
|
58
|
+
id: string;
|
|
59
|
+
kind: string;
|
|
60
|
+
scope: "selected-edge" | "path-window";
|
|
61
|
+
authority: ChessFactAuthority;
|
|
62
|
+
licenses: EvidenceLicense[];
|
|
63
|
+
summary: string;
|
|
64
|
+
data: Record<string, SemanticValue>;
|
|
65
|
+
coverage: {
|
|
66
|
+
complete: boolean;
|
|
67
|
+
covered: string[];
|
|
68
|
+
unresolved: string[];
|
|
69
|
+
};
|
|
70
|
+
provenance: {
|
|
71
|
+
tier: AnalysisContextProvenanceTier;
|
|
72
|
+
provider: string;
|
|
73
|
+
version: string;
|
|
74
|
+
derivedFromIds: string[];
|
|
75
|
+
};
|
|
76
|
+
replay: Record<string, SemanticValue> | null;
|
|
77
|
+
limitations: string[];
|
|
78
|
+
};
|
|
79
|
+
export type ExistingAnalysisContext = {
|
|
80
|
+
version: typeof EXISTING_ANALYSIS_CONTEXT_VERSION;
|
|
81
|
+
materialOffers: MaterialOfferSet;
|
|
82
|
+
records: ExistingAnalysisRecord[];
|
|
83
|
+
coverage: {
|
|
84
|
+
complete: boolean;
|
|
85
|
+
includedKinds: string[];
|
|
86
|
+
omitted: Array<{
|
|
87
|
+
kind: string;
|
|
88
|
+
reason: "relevance" | "budget" | "unavailable";
|
|
89
|
+
}>;
|
|
90
|
+
unavailableKinds: string[];
|
|
91
|
+
};
|
|
92
|
+
};
|
|
93
|
+
export declare function normalizeExistingAnalysisContext(value: unknown, context: ReasoningPositionContext, options?: {
|
|
94
|
+
question?: string;
|
|
95
|
+
maxRecords?: number;
|
|
96
|
+
}): ExistingAnalysisContext | null;
|
|
97
|
+
export declare class ExistingAnalysisObservationProvider implements ObservationProvider {
|
|
98
|
+
private readonly existing;
|
|
99
|
+
private readonly mode;
|
|
100
|
+
readonly id: "knights-eye/existing-analysis-context";
|
|
101
|
+
readonly version: "existing-analysis-context/2";
|
|
102
|
+
constructor(existing: ExistingAnalysisContext | null, mode?: ExistingAnalysisContextMode);
|
|
103
|
+
observe(context: ReasoningPositionContext, _controls: ReasoningRunControls, signal?: AbortSignal): ReasoningObservationSet;
|
|
104
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type ChessFactProvider } from "./fact-provider.js";
|
|
2
|
+
import { type ObservationProvider, type ReasoningObservationSet, type ReasoningPositionContext, type ReasoningRunControls } from "./poc-contracts.js";
|
|
3
|
+
export declare const FACT_OBSERVATION_ADAPTER_VERSION: "chess-fact-observation-adapter/1";
|
|
4
|
+
export type ChessFactObservationProviderOptions = {
|
|
5
|
+
maxRecords?: number;
|
|
6
|
+
maxBytes?: number;
|
|
7
|
+
};
|
|
8
|
+
export declare class ChessFactObservationProvider implements ObservationProvider {
|
|
9
|
+
private readonly provider;
|
|
10
|
+
private readonly options;
|
|
11
|
+
readonly id: string;
|
|
12
|
+
readonly version: string;
|
|
13
|
+
constructor(provider: ChessFactProvider, options?: ChessFactObservationProviderOptions);
|
|
14
|
+
observe(context: ReasoningPositionContext, controls: ReasoningRunControls, signal?: AbortSignal): Promise<ReasoningObservationSet>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import type { ReasoningPositionContext } from "./poc-contracts.js";
|
|
2
|
+
import { type EvidenceLicense } from "./evidence-licenses.js";
|
|
3
|
+
import type { ProofStrength, SemanticParticipant, SemanticValue } from "./types.js";
|
|
4
|
+
export declare const CHESS_FACT_SCHEMA_VERSION: "chess-facts/1";
|
|
5
|
+
export declare const CHESS_FACT_REQUEST_VERSION: "chess-fact-request/1";
|
|
6
|
+
export declare const CHESS_FACT_RESULT_VERSION: "chess-fact-result/1";
|
|
7
|
+
export type ChessFactAuthority = "legal-exact" | "deterministic-derived" | "heuristic-affordance" | "bounded-engine";
|
|
8
|
+
export type ChessFactPhase = "before" | "after" | "transition" | "path";
|
|
9
|
+
export type ChessFactCoverage = {
|
|
10
|
+
domain: string;
|
|
11
|
+
exhaustive: boolean;
|
|
12
|
+
covered: string[];
|
|
13
|
+
unresolved: string[];
|
|
14
|
+
};
|
|
15
|
+
export type ChessFactEngineProvenance = {
|
|
16
|
+
name: string;
|
|
17
|
+
build: string;
|
|
18
|
+
network: string | null;
|
|
19
|
+
depth: number;
|
|
20
|
+
threads: 1;
|
|
21
|
+
multiPv: number;
|
|
22
|
+
rootMoves: string[];
|
|
23
|
+
};
|
|
24
|
+
export type ChessFactRecord = {
|
|
25
|
+
schemaVersion: typeof CHESS_FACT_SCHEMA_VERSION;
|
|
26
|
+
id: string;
|
|
27
|
+
contextHash: string;
|
|
28
|
+
kind: string;
|
|
29
|
+
phase: ChessFactPhase;
|
|
30
|
+
authority: ChessFactAuthority;
|
|
31
|
+
licenses?: EvidenceLicense[];
|
|
32
|
+
summary: string;
|
|
33
|
+
participants: SemanticParticipant[];
|
|
34
|
+
data: Record<string, SemanticValue>;
|
|
35
|
+
coverage: ChessFactCoverage;
|
|
36
|
+
provenance: {
|
|
37
|
+
provider: string;
|
|
38
|
+
version: string;
|
|
39
|
+
method: string;
|
|
40
|
+
derivedFromIds: string[];
|
|
41
|
+
engine?: ChessFactEngineProvenance;
|
|
42
|
+
};
|
|
43
|
+
replay: Record<string, SemanticValue> | null;
|
|
44
|
+
};
|
|
45
|
+
export type ChessFactCapability = {
|
|
46
|
+
kind: string;
|
|
47
|
+
phases: ChessFactPhase[];
|
|
48
|
+
authorities: ChessFactAuthority[];
|
|
49
|
+
coverageDomains: string[];
|
|
50
|
+
expandable: boolean;
|
|
51
|
+
limitations: string[];
|
|
52
|
+
};
|
|
53
|
+
export type ChessFactRequest = {
|
|
54
|
+
schemaVersion: typeof CHESS_FACT_REQUEST_VERSION;
|
|
55
|
+
requestId: string;
|
|
56
|
+
context: ReasoningPositionContext;
|
|
57
|
+
requestedKinds: string[];
|
|
58
|
+
budgets: {
|
|
59
|
+
maxRecords: number;
|
|
60
|
+
maxBytes: number;
|
|
61
|
+
maxWallTimeMs: number;
|
|
62
|
+
};
|
|
63
|
+
engineLimits?: {
|
|
64
|
+
depth: number;
|
|
65
|
+
threads: 1;
|
|
66
|
+
multiPv: number;
|
|
67
|
+
rootMoves: string[];
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
export type ChessFactOmission = {
|
|
71
|
+
kind: string;
|
|
72
|
+
reason: "budget" | "not-requested";
|
|
73
|
+
recordId: string | null;
|
|
74
|
+
};
|
|
75
|
+
export type ChessFactResult = {
|
|
76
|
+
schemaVersion: typeof CHESS_FACT_RESULT_VERSION;
|
|
77
|
+
contextHash: string;
|
|
78
|
+
records: ChessFactRecord[];
|
|
79
|
+
capabilities: ChessFactCapability[];
|
|
80
|
+
omitted: ChessFactOmission[];
|
|
81
|
+
unavailableKinds: Array<{
|
|
82
|
+
kind: string;
|
|
83
|
+
reason: string;
|
|
84
|
+
}>;
|
|
85
|
+
limitations: string[];
|
|
86
|
+
};
|
|
87
|
+
export interface ChessFactProvider {
|
|
88
|
+
readonly id: string;
|
|
89
|
+
readonly version: string;
|
|
90
|
+
capabilities(): readonly ChessFactCapability[];
|
|
91
|
+
collect(request: ChessFactRequest, signal?: AbortSignal): Promise<ChessFactResult> | ChessFactResult;
|
|
92
|
+
}
|
|
93
|
+
export declare function validateChessFactRequest(request: ChessFactRequest): ChessFactRequest;
|
|
94
|
+
export declare function validateChessFactRecord(record: ChessFactRecord): ChessFactRecord;
|
|
95
|
+
export declare function chessFactRecordLicenses(record: ChessFactRecord): EvidenceLicense[];
|
|
96
|
+
/**
|
|
97
|
+
* Central authority-to-proof policy for every fact-provider boundary.
|
|
98
|
+
*
|
|
99
|
+
* `forced` is intentionally absent: fact records cannot establish it. Forced
|
|
100
|
+
* proof belongs to the rules-complete probe/coverage validators.
|
|
101
|
+
*/
|
|
102
|
+
export declare function maximumFactProofStrength(authority: ChessFactAuthority, coverage?: Pick<ChessFactCoverage, "exhaustive" | "unresolved"> | null): ProofStrength | null;
|
|
103
|
+
export declare function factProofStrength(authority: ChessFactAuthority, coverage?: Pick<ChessFactCoverage, "exhaustive" | "unresolved"> | null): ProofStrength | null;
|
|
104
|
+
export declare function assertFactProofWithinAuthority(input: {
|
|
105
|
+
authority: ChessFactAuthority;
|
|
106
|
+
proofStrength: ProofStrength | null;
|
|
107
|
+
coverage?: Pick<ChessFactCoverage, "exhaustive" | "unresolved"> | null;
|
|
108
|
+
label?: string;
|
|
109
|
+
}): void;
|
|
110
|
+
export declare function isChessFactAuthority(value: unknown): value is ChessFactAuthority;
|
|
111
|
+
export declare function factCoverageSupportsAbsence(record: ChessFactRecord, domain: string): boolean;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import type { PositionAnalysisLine } from './position-analysis-contracts.js';
|
|
2
|
+
import { type ReasoningPositionContext } from './poc-contracts.js';
|
|
3
|
+
/** Host-only input, created from this answer's acquired engine results, never a saved snapshot. */
|
|
4
|
+
export type FreshEnginePvWitness = {
|
|
5
|
+
version: 'fresh-engine-pv-witness/1';
|
|
6
|
+
acquisition: 'same-answer-engine';
|
|
7
|
+
acquisitionId: number;
|
|
8
|
+
evidenceId: string;
|
|
9
|
+
contextHash: string;
|
|
10
|
+
phase: 'before' | 'after';
|
|
11
|
+
fen: string;
|
|
12
|
+
engineBuild: string;
|
|
13
|
+
command: string;
|
|
14
|
+
requestedDepth: number;
|
|
15
|
+
multiPv: number;
|
|
16
|
+
rootMoves: string[];
|
|
17
|
+
authority: 'bounded-engine';
|
|
18
|
+
licenses: ['engine.bounded-continuation'];
|
|
19
|
+
lines: Pick<PositionAnalysisLine, 'rootMove' | 'pv' | 'depth' | 'scoreProvenance' | 'scoreCp' | 'mateInMoves'>[];
|
|
20
|
+
};
|
|
21
|
+
export type FreshEnginePvReferenceEvidence = {
|
|
22
|
+
acquisitionId: number;
|
|
23
|
+
evidenceId: string;
|
|
24
|
+
rootFen: string;
|
|
25
|
+
rootMove: string;
|
|
26
|
+
depth: number;
|
|
27
|
+
requestedDepth: number;
|
|
28
|
+
engineBuild: string;
|
|
29
|
+
command: string;
|
|
30
|
+
scoreCp: number | null;
|
|
31
|
+
mateInMoves: number | null;
|
|
32
|
+
scoreProvenance: NonNullable<PositionAnalysisLine['scoreProvenance']>;
|
|
33
|
+
conditional: true;
|
|
34
|
+
scoreInterpretation: 'Root-search score only; the continuation is conditional, not forced and not a score for a later position.';
|
|
35
|
+
};
|
|
36
|
+
export type FreshEnginePvReferenceLine = {
|
|
37
|
+
start: 'before' | 'after';
|
|
38
|
+
ucis: string[];
|
|
39
|
+
evidenceIds: string[];
|
|
40
|
+
authority: string;
|
|
41
|
+
engineEvidence: FreshEnginePvReferenceEvidence[];
|
|
42
|
+
};
|
|
43
|
+
export declare const MAX_FRESH_ENGINE_WITNESS_ACQUISITIONS = 64;
|
|
44
|
+
export type FreshEnginePvRejectionReason = 'invalid-acquisition' | 'missing-authority-license' | 'context-mismatch' | 'root-mismatch' | 'invalid-search-scope' | 'root-set-mismatch' | 'depth-mismatch' | 'provenance-mismatch' | 'score-mismatch' | 'invalid-pv' | 'illegal-pv' | 'audit-capacity-exceeded';
|
|
45
|
+
export type FreshEnginePvAdmissionAudit = {
|
|
46
|
+
version: 'fresh-engine-pv-admission/1';
|
|
47
|
+
inputAcquisitions: number;
|
|
48
|
+
inspectedAcquisitions: number;
|
|
49
|
+
acceptedAcquisitions: number;
|
|
50
|
+
rejectedAcquisitions: number;
|
|
51
|
+
acceptedLines: number;
|
|
52
|
+
omittedAcquisitions: number;
|
|
53
|
+
acceptedAcquisitionIds: number[];
|
|
54
|
+
rejectedAcquisitionIds: (number | null)[];
|
|
55
|
+
rejections: {
|
|
56
|
+
acquisitionId: number | null;
|
|
57
|
+
reason: FreshEnginePvRejectionReason;
|
|
58
|
+
}[];
|
|
59
|
+
rejectionCounts: Partial<Record<FreshEnginePvRejectionReason, number>>;
|
|
60
|
+
};
|
|
61
|
+
/** Bounded, safe reason codes; no raw error message, board, path or private source in the audit. */
|
|
62
|
+
export declare function admitFreshEnginePvWitnesses(context: ReasoningPositionContext, witnesses: readonly FreshEnginePvWitness[]): {
|
|
63
|
+
lines: FreshEnginePvReferenceLine[];
|
|
64
|
+
audit: FreshEnginePvAdmissionAudit;
|
|
65
|
+
};
|
|
66
|
+
/** Presentation witness admission. Scores retain their original root scope, without entailment claims. */
|
|
67
|
+
export declare function freshEnginePvReferenceLines(context: ReasoningPositionContext, witnesses: readonly FreshEnginePvWitness[]): FreshEnginePvReferenceLine[];
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type ReasoningPositionContext, type ReasoningEvidenceRecord } from './poc-contracts.js';
|
|
2
|
+
export type RecordedReferenceLine = {
|
|
3
|
+
startFen: string;
|
|
4
|
+
moves: readonly {
|
|
5
|
+
uci: string;
|
|
6
|
+
san: string;
|
|
7
|
+
}[];
|
|
8
|
+
};
|
|
9
|
+
type Root = {
|
|
10
|
+
context: ReasoningPositionContext;
|
|
11
|
+
records: ReasoningEvidenceRecord[];
|
|
12
|
+
};
|
|
13
|
+
/** Exact frozen witnesses for game:<recorded ply>:<local UCI path> links. */
|
|
14
|
+
export declare function historicalProseRoots(selected: ReasoningPositionContext, records: readonly ReasoningEvidenceRecord[], line?: RecordedReferenceLine): {
|
|
15
|
+
roots: Map<number, Root>;
|
|
16
|
+
annotate: (text: string) => string;
|
|
17
|
+
recorded: string[] | undefined;
|
|
18
|
+
witnessedSuffixes: (ply: number, path: string[]) => {
|
|
19
|
+
root: Root;
|
|
20
|
+
path: string[];
|
|
21
|
+
}[];
|
|
22
|
+
};
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { type ConceptRegistry } from "./concept-registry.js";
|
|
2
|
+
import { type IdeaGraph, type IdentityState, type ProofStrength, type SemanticAttributes, type SemanticEntity, type SemanticParticipant, type SemanticRelation } from "./types.js";
|
|
3
|
+
export type CreateSemanticEntityInput = {
|
|
4
|
+
id?: string;
|
|
5
|
+
branchId: string;
|
|
6
|
+
entityType: string;
|
|
7
|
+
concepts: string[];
|
|
8
|
+
owner?: SemanticEntity["owner"];
|
|
9
|
+
createdByPly: number;
|
|
10
|
+
createdByUci: string;
|
|
11
|
+
participants?: SemanticParticipant[];
|
|
12
|
+
attributes?: SemanticAttributes;
|
|
13
|
+
proofStrength?: ProofStrength | null;
|
|
14
|
+
state?: string;
|
|
15
|
+
evidence?: string[];
|
|
16
|
+
};
|
|
17
|
+
export declare function createSemanticEntity(input: CreateSemanticEntityInput, registry?: ConceptRegistry): SemanticEntity;
|
|
18
|
+
export type CreateSemanticRelationInput = {
|
|
19
|
+
id?: string;
|
|
20
|
+
branchId: string;
|
|
21
|
+
relationType: string;
|
|
22
|
+
from: string;
|
|
23
|
+
to: string;
|
|
24
|
+
createdAtPly: number;
|
|
25
|
+
attributes?: SemanticAttributes;
|
|
26
|
+
evidence?: string[];
|
|
27
|
+
};
|
|
28
|
+
export declare function createSemanticRelation(input: CreateSemanticRelationInput): SemanticRelation;
|
|
29
|
+
export declare function createIdeaGraph(branchId?: string, ply?: number): IdeaGraph;
|
|
30
|
+
export declare function extendIdeaGraph(graph: IdeaGraph, entities: SemanticEntity[], relations?: SemanticRelation[], ply?: number): IdeaGraph;
|
|
31
|
+
export declare function forkIdeaGraph(graph: IdeaGraph, branchId: string): IdeaGraph;
|
|
32
|
+
export declare function graphIdentityCompatible(identity: IdentityState, graph: IdeaGraph): boolean;
|
|
33
|
+
export declare function isTerminalEntity(entity: SemanticEntity, registry?: ConceptRegistry): boolean;
|
|
34
|
+
export declare function openEntityCount(graph: IdeaGraph, registry?: ConceptRegistry): number;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { AnswerScope, ReviewSubject } from './question-routing.js';
|
|
2
|
+
import type { ReasoningEvidenceRecord } from './poc-contracts.js';
|
|
3
|
+
import type { RecordedMainLine } from './answer-host-contracts.js';
|
|
4
|
+
import type { PlayerPerspective } from '../player-perspective.js';
|
|
5
|
+
import type { ReasoningPositionContext, ReasoningToolName } from './poc-contracts.js';
|
|
6
|
+
export type InitialSearch = {
|
|
7
|
+
tool: ReasoningToolName;
|
|
8
|
+
input: Record<string, unknown>;
|
|
9
|
+
reason: string;
|
|
10
|
+
playedMove?: string;
|
|
11
|
+
};
|
|
12
|
+
export type InitialSearchPlan = {
|
|
13
|
+
version: 'initial-search-plan/1';
|
|
14
|
+
requests: InitialSearch[];
|
|
15
|
+
limitations: string[];
|
|
16
|
+
classificationReassessment?: boolean;
|
|
17
|
+
reviewScope?: {
|
|
18
|
+
subject: ReviewSubject;
|
|
19
|
+
resolvedSide: 'white' | 'black' | 'both' | 'unknown';
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
/** Recognition is deliberately narrow: unresolved language stays with the answering model. */
|
|
23
|
+
export declare function planInitialSearches(input: {
|
|
24
|
+
question: string;
|
|
25
|
+
context: ReasoningPositionContext;
|
|
26
|
+
mainLine?: RecordedMainLine;
|
|
27
|
+
reviewGame?: boolean;
|
|
28
|
+
reviewSubject?: ReviewSubject;
|
|
29
|
+
omitSelectedContext?: boolean;
|
|
30
|
+
playerPerspective?: PlayerPerspective | null;
|
|
31
|
+
answerScope?: AnswerScope;
|
|
32
|
+
positionPreparation?: boolean;
|
|
33
|
+
classificationQuestion?: boolean;
|
|
34
|
+
}): InitialSearchPlan;
|
|
35
|
+
/** Use the same recorded-position comparison tool the model uses. Discovery may
|
|
36
|
+
* already include played+best at the same depth; otherwise compare explicitly. */
|
|
37
|
+
export declare function preparedMoveComparison(request: InitialSearch, evidence: ReasoningEvidenceRecord[]): InitialSearch | undefined;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ModelMessage } from 'ai';
|
|
2
|
+
export declare const EVIDENCE_SHARING_VERSION = "evidence-sharing/1";
|
|
3
|
+
export declare const EVIDENCE_SHARING_INSTRUCTIONS = "Evidence encoding evidence-sharing/1 is lossless and self-contained. Read content with each {\"$shared\":\"sN\"} replaced by values.sN in the SAME envelope; dictionary values can themselves contain these references. Then interpret existing engine/metadata encodings normally. All values are already supplied: no tool is needed to expand them. References share identical values only, never authority, position scope, scores or search provenance. Dictionary IDs are not evidence IDs or citations.";
|
|
4
|
+
export declare const EVIDENCE_SHARING_GUIDANCE_CHARS = 490;
|
|
5
|
+
/** Exact JSON-value DAG. Unlike the older metadata pass, definitions are also
|
|
6
|
+
* interned recursively, so repeated children of different shared parents survive
|
|
7
|
+
* only once. Literal strings are counted after object sharing, since repeated
|
|
8
|
+
* object subtrees otherwise exaggerate their actual delivered frequency. No
|
|
9
|
+
* cross-message state or chess inference is involved. */
|
|
10
|
+
export declare function shareEvidence(value: unknown): unknown;
|
|
11
|
+
/** Both SDK and hosted-provider message shapes contain JSON strings. Detect an
|
|
12
|
+
* actual envelope, never an incidental mention of the codec in ordinary prose. */
|
|
13
|
+
export declare function hasSharedEvidence(value: unknown): boolean;
|
|
14
|
+
/** Strict verifier; malformed/dangling/cyclic dictionaries never decode silently. */
|
|
15
|
+
export declare function expandSharedEvidence(value: unknown): unknown;
|
|
16
|
+
/** Serialize a copy at the model boundary, retaining native tool identity and
|
|
17
|
+
* opaque assistant/provider continuation objects without modification. */
|
|
18
|
+
export declare function shareEvidenceMessages(messages: ModelMessage[]): ModelMessage[];
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { PositionAnalysisResult } from './poc-tools.js';
|
|
2
|
+
export type MatchedComparison = {
|
|
3
|
+
status: 'matched' | 'unmatched';
|
|
4
|
+
actualDepth: number | null;
|
|
5
|
+
rootMoves: string[];
|
|
6
|
+
reason: string;
|
|
7
|
+
};
|
|
8
|
+
/** One retained engine response establishes search identity; candidate caches do not. */
|
|
9
|
+
export declare function matchedRootComparison(result: PositionAnalysisResult, fen: string, requiredRoots?: readonly string[]): MatchedComparison;
|
|
10
|
+
export declare const MATCHED_COMPARISON_GUIDANCE = "For an explicit claim that one move is better than another, use and cite a matched comparison covering both moves at the same exact root, from one engine search at a common achieved depth. searchScope.comparison identifies matched or unmatched results. A completed engine comparison can be reused. Stored board alternatives are historical observations; their greater reported depth does not supersede a matched comparison or establish a precise relative advantage. Reuse initial preparation when its matched search already covers both choices. Otherwise request compare_moves (or the appropriate recorded-position comparison) while investigation is open. Never subtract separately cached candidate scores to support a better-than claim. If a matched comparison is unavailable or searches disagree, explain the supported chess mechanism and qualify the ranking; do not claim an absolute ordering or search again merely to resolve small cross-depth differences.";
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { Chess } from 'chess.js';
|
|
2
|
+
declare const pieces: {
|
|
3
|
+
readonly p: "pawn";
|
|
4
|
+
readonly n: "knight";
|
|
5
|
+
readonly b: "bishop";
|
|
6
|
+
readonly r: "rook";
|
|
7
|
+
readonly q: "queen";
|
|
8
|
+
};
|
|
9
|
+
type Counts = Record<typeof pieces[keyof typeof pieces], number>;
|
|
10
|
+
/** Absolute counts, independent of turn, engine evaluation or starting inventory. */
|
|
11
|
+
export declare function materialAtPosition(board: Chess): {
|
|
12
|
+
white: Counts;
|
|
13
|
+
black: Counts;
|
|
14
|
+
whiteMinusBlack: Counts;
|
|
15
|
+
balance: string;
|
|
16
|
+
};
|
|
17
|
+
/** Count by legal replay; never report a partial replay as a complete endpoint. */
|
|
18
|
+
export declare function materialAlongLine(startFen: string, movesUci: readonly string[]): {
|
|
19
|
+
authority: string;
|
|
20
|
+
startFen: string;
|
|
21
|
+
plies: number;
|
|
22
|
+
start: {
|
|
23
|
+
white: Counts;
|
|
24
|
+
black: Counts;
|
|
25
|
+
whiteMinusBlack: Counts;
|
|
26
|
+
balance: string;
|
|
27
|
+
};
|
|
28
|
+
changes: {
|
|
29
|
+
ply: number;
|
|
30
|
+
san: string;
|
|
31
|
+
whiteMinusBlack: Counts;
|
|
32
|
+
balance: string;
|
|
33
|
+
}[];
|
|
34
|
+
endFen: string;
|
|
35
|
+
end: {
|
|
36
|
+
white: Counts;
|
|
37
|
+
black: Counts;
|
|
38
|
+
whiteMinusBlack: Counts;
|
|
39
|
+
balance: string;
|
|
40
|
+
};
|
|
41
|
+
balanceChangeFromStart: Counts;
|
|
42
|
+
scope: string;
|
|
43
|
+
};
|
|
44
|
+
export declare function materialForVariations<T extends {
|
|
45
|
+
rootMove: string;
|
|
46
|
+
pv: string[];
|
|
47
|
+
}>(startFen: string, lines: readonly T[]): ((T & {
|
|
48
|
+
material: {
|
|
49
|
+
authority: string;
|
|
50
|
+
startFen: string;
|
|
51
|
+
plies: number;
|
|
52
|
+
start: {
|
|
53
|
+
white: Counts;
|
|
54
|
+
black: Counts;
|
|
55
|
+
whiteMinusBlack: Counts;
|
|
56
|
+
balance: string;
|
|
57
|
+
};
|
|
58
|
+
changes: {
|
|
59
|
+
ply: number;
|
|
60
|
+
san: string;
|
|
61
|
+
whiteMinusBlack: Counts;
|
|
62
|
+
balance: string;
|
|
63
|
+
}[];
|
|
64
|
+
endFen: string;
|
|
65
|
+
end: {
|
|
66
|
+
white: Counts;
|
|
67
|
+
black: Counts;
|
|
68
|
+
whiteMinusBlack: Counts;
|
|
69
|
+
balance: string;
|
|
70
|
+
};
|
|
71
|
+
balanceChangeFromStart: Counts;
|
|
72
|
+
scope: string;
|
|
73
|
+
};
|
|
74
|
+
}) | (T & {
|
|
75
|
+
material: {
|
|
76
|
+
status: string;
|
|
77
|
+
reason: string;
|
|
78
|
+
};
|
|
79
|
+
}))[];
|
|
80
|
+
export {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/** Presentation only: the legally computed canonical material record is immutable. */
|
|
2
|
+
export type MaterialFormat = 'raw' | 'hybrid' | 'text';
|
|
3
|
+
export declare const DEFAULT_MATERIAL_FORMAT: MaterialFormat;
|
|
4
|
+
export declare function projectMaterial(value: unknown, format?: MaterialFormat): unknown;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { type Square } from "chess.js";
|
|
2
|
+
import { type ChessFactCapability, type ChessFactProvider, type ChessFactRecord, type ChessFactRequest, type ChessFactResult } from "./fact-provider.js";
|
|
3
|
+
import { type ReasoningPositionContext } from "./poc-contracts.js";
|
|
4
|
+
export declare const MECHANICAL_CHESS_FACT_PROVIDER_ID: "knights-eye/mechanical-chess-facts";
|
|
5
|
+
export declare const MECHANICAL_CHESS_FACT_PROVIDER_VERSION: "mechanical-chess-facts/18";
|
|
6
|
+
/** A replayable immediate-capture response fact in the ordinary fact contract. */
|
|
7
|
+
export type AdmittedCaptureResponseAvailabilityFact = ChessFactRecord;
|
|
8
|
+
export type AdmittedCaptureResponseAvailabilityInput = {
|
|
9
|
+
/** The target-move context that owns stable identities and the record hash. */
|
|
10
|
+
context: ReasoningPositionContext;
|
|
11
|
+
/** Must be the hash of `context`; callers cannot attach a path fact elsewhere. */
|
|
12
|
+
contextHash: string;
|
|
13
|
+
/** Which exact target-context phase the supplied line starts from. */
|
|
14
|
+
start: "before" | "after";
|
|
15
|
+
/** An admitted, fully declared line whose final move must be a legal capture. */
|
|
16
|
+
movesUci: readonly string[];
|
|
17
|
+
};
|
|
18
|
+
export declare function squaresBetween(from: Square, to: Square): Square[];
|
|
19
|
+
/**
|
|
20
|
+
* Derive the immediate legal recapture availability after a capture already
|
|
21
|
+
* admitted by a replayable line. This never discovers a continuation: the
|
|
22
|
+
* caller supplies every UCI move, and the result is rooted at the declared
|
|
23
|
+
* target-context phase. Stable identities are replayed along that exact
|
|
24
|
+
* prefix so a later capture can still name the original piece accurately.
|
|
25
|
+
*/
|
|
26
|
+
export declare function deriveAdmittedCaptureResponseAvailabilityFact(input: AdmittedCaptureResponseAvailabilityInput): AdmittedCaptureResponseAvailabilityFact;
|
|
27
|
+
export declare class MechanicalChessFactProvider implements ChessFactProvider {
|
|
28
|
+
readonly id: "knights-eye/mechanical-chess-facts";
|
|
29
|
+
readonly version: "mechanical-chess-facts/18";
|
|
30
|
+
capabilities(): readonly ChessFactCapability[];
|
|
31
|
+
collect(requestInput: ChessFactRequest, signal?: AbortSignal): ChessFactResult;
|
|
32
|
+
}
|
|
33
|
+
export declare function createMechanicalFactRequest(context: ReasoningPositionContext, overrides?: Partial<ChessFactRequest["budgets"]>): ChessFactRequest;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type Color, type PieceSymbol, type Square } from "chess.js";
|
|
2
|
+
import type { IdentityState } from "./types.js";
|
|
3
|
+
export type OccupiedRayPiece = {
|
|
4
|
+
pieceId: string;
|
|
5
|
+
currentSquare: Square;
|
|
6
|
+
pieceType: PieceSymbol;
|
|
7
|
+
color: Color;
|
|
8
|
+
};
|
|
9
|
+
export type ExchangeRayAlignmentWitness = {
|
|
10
|
+
movesUci: string[];
|
|
11
|
+
finalFen: string;
|
|
12
|
+
slider: OccupiedRayPiece;
|
|
13
|
+
front: OccupiedRayPiece;
|
|
14
|
+
rear: OccupiedRayPiece;
|
|
15
|
+
ray: Square[];
|
|
16
|
+
};
|
|
17
|
+
export declare function exchangeRayAlignmentWitnesses(fenAfter: string, identityAfter: IdentityState, exchangeLines: readonly (readonly {
|
|
18
|
+
uci: string;
|
|
19
|
+
}[])[]): ExchangeRayAlignmentWitness[];
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** Restores the precise bounded projection, including its coverage/omission markers.
|
|
2
|
+
* Unknown versions or schemas pass through unchanged rather than losing fields. */
|
|
3
|
+
export declare function expandMechanismPresentation(value: unknown): unknown;
|
|
4
|
+
/** A measured but untransmitted square is not a negative result. Full control
|
|
5
|
+
* deltas stay on the immutable evidence record for retrieval. */
|
|
6
|
+
export declare function compactMechanism(value: unknown, targetSquares: string[]): unknown;
|
|
7
|
+
/** Root + first reply by default; explicit one-based replay targets, and moves
|
|
8
|
+
* landing on inspected squares, can expose a deeper mechanism without a search. */
|
|
9
|
+
export declare function presentMoveMechanisms(moves: unknown[], inspectPlies?: number[], inspectSquares?: string[]): unknown[];
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { Chess, type Color, type PieceSymbol, type Square } from "chess.js";
|
|
2
|
+
import type { IdentityState } from "./types.js";
|
|
3
|
+
type Direction = "N" | "NE" | "E" | "SE" | "S" | "SW" | "W" | "NW";
|
|
4
|
+
export type MoveMechanismFacts = {
|
|
5
|
+
mover: {
|
|
6
|
+
pieceId: string;
|
|
7
|
+
pieceIdAfter: string;
|
|
8
|
+
fromSquare: Square;
|
|
9
|
+
toSquare: Square;
|
|
10
|
+
color: Color;
|
|
11
|
+
pieceTypeBefore: PieceSymbol;
|
|
12
|
+
pieceTypeAfter: PieceSymbol;
|
|
13
|
+
attackersBefore: Square[];
|
|
14
|
+
attackersAfter: Square[];
|
|
15
|
+
};
|
|
16
|
+
attackedUnmovedFriendlyPieces: Array<{
|
|
17
|
+
pieceId: string;
|
|
18
|
+
square: Square;
|
|
19
|
+
pieceType: PieceSymbol;
|
|
20
|
+
attackersBefore: Square[];
|
|
21
|
+
attackersAfter: Square[];
|
|
22
|
+
}>;
|
|
23
|
+
stationarySliderRays: Array<{
|
|
24
|
+
pieceId: string;
|
|
25
|
+
fromSquare: Square;
|
|
26
|
+
color: Color;
|
|
27
|
+
pieceType: PieceSymbol;
|
|
28
|
+
direction: Direction;
|
|
29
|
+
beforeSquares: Square[];
|
|
30
|
+
afterSquares: Square[];
|
|
31
|
+
gainedSquares: Square[];
|
|
32
|
+
lostSquares: Square[];
|
|
33
|
+
}>;
|
|
34
|
+
controlDelta: Array<{
|
|
35
|
+
square: Square;
|
|
36
|
+
color: Color;
|
|
37
|
+
attackersBefore: Square[];
|
|
38
|
+
attackersAfter: Square[];
|
|
39
|
+
}>;
|
|
40
|
+
checksRun: string[];
|
|
41
|
+
scope: string;
|
|
42
|
+
};
|
|
43
|
+
/** Complete board-local geometric measurements for one already-admitted legal move. */
|
|
44
|
+
export declare function moveMechanismFacts(before: Chess, after: Chess, from: Square, to: Square, beforeIds?: IdentityState, afterIds?: IdentityState): MoveMechanismFacts;
|
|
45
|
+
export {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type LanguageModel } from 'ai';
|
|
2
|
+
import type { AnswerModelConnector } from './answer-model-connector.js';
|
|
3
|
+
/** Native SDK performs exactly one model turn; pipeline owns tool dispatch. */
|
|
4
|
+
export declare function createNativeAnswerConnector(model: LanguageModel): AnswerModelConnector;
|