@proposit/proposit-core 0.8.9
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/README.md +1032 -0
- package/dist/cli/commands/analysis.d.ts +3 -0
- package/dist/cli/commands/analysis.d.ts.map +1 -0
- package/dist/cli/commands/analysis.js +504 -0
- package/dist/cli/commands/analysis.js.map +1 -0
- package/dist/cli/commands/arguments.d.ts +3 -0
- package/dist/cli/commands/arguments.d.ts.map +1 -0
- package/dist/cli/commands/arguments.js +187 -0
- package/dist/cli/commands/arguments.js.map +1 -0
- package/dist/cli/commands/claims.d.ts +3 -0
- package/dist/cli/commands/claims.d.ts.map +1 -0
- package/dist/cli/commands/claims.js +120 -0
- package/dist/cli/commands/claims.js.map +1 -0
- package/dist/cli/commands/diff.d.ts +3 -0
- package/dist/cli/commands/diff.d.ts.map +1 -0
- package/dist/cli/commands/diff.js +61 -0
- package/dist/cli/commands/diff.js.map +1 -0
- package/dist/cli/commands/expressions.d.ts +3 -0
- package/dist/cli/commands/expressions.d.ts.map +1 -0
- package/dist/cli/commands/expressions.js +344 -0
- package/dist/cli/commands/expressions.js.map +1 -0
- package/dist/cli/commands/graph.d.ts +13 -0
- package/dist/cli/commands/graph.d.ts.map +1 -0
- package/dist/cli/commands/graph.js +382 -0
- package/dist/cli/commands/graph.js.map +1 -0
- package/dist/cli/commands/meta.d.ts +3 -0
- package/dist/cli/commands/meta.d.ts.map +1 -0
- package/dist/cli/commands/meta.js +14 -0
- package/dist/cli/commands/meta.js.map +1 -0
- package/dist/cli/commands/parse.d.ts +3 -0
- package/dist/cli/commands/parse.d.ts.map +1 -0
- package/dist/cli/commands/parse.js +171 -0
- package/dist/cli/commands/parse.js.map +1 -0
- package/dist/cli/commands/premises.d.ts +3 -0
- package/dist/cli/commands/premises.d.ts.map +1 -0
- package/dist/cli/commands/premises.js +261 -0
- package/dist/cli/commands/premises.js.map +1 -0
- package/dist/cli/commands/render.d.ts +3 -0
- package/dist/cli/commands/render.d.ts.map +1 -0
- package/dist/cli/commands/render.js +109 -0
- package/dist/cli/commands/render.js.map +1 -0
- package/dist/cli/commands/repair.d.ts +3 -0
- package/dist/cli/commands/repair.d.ts.map +1 -0
- package/dist/cli/commands/repair.js +53 -0
- package/dist/cli/commands/repair.js.map +1 -0
- package/dist/cli/commands/roles.d.ts +3 -0
- package/dist/cli/commands/roles.d.ts.map +1 -0
- package/dist/cli/commands/roles.js +64 -0
- package/dist/cli/commands/roles.js.map +1 -0
- package/dist/cli/commands/sources.d.ts +3 -0
- package/dist/cli/commands/sources.d.ts.map +1 -0
- package/dist/cli/commands/sources.js +103 -0
- package/dist/cli/commands/sources.js.map +1 -0
- package/dist/cli/commands/validate.d.ts +3 -0
- package/dist/cli/commands/validate.d.ts.map +1 -0
- package/dist/cli/commands/validate.js +27 -0
- package/dist/cli/commands/validate.js.map +1 -0
- package/dist/cli/commands/variables.d.ts +3 -0
- package/dist/cli/commands/variables.d.ts.map +1 -0
- package/dist/cli/commands/variables.js +206 -0
- package/dist/cli/commands/variables.js.map +1 -0
- package/dist/cli/commands/version-show.d.ts +3 -0
- package/dist/cli/commands/version-show.d.ts.map +1 -0
- package/dist/cli/commands/version-show.js +31 -0
- package/dist/cli/commands/version-show.js.map +1 -0
- package/dist/cli/config.d.ts +8 -0
- package/dist/cli/config.d.ts.map +1 -0
- package/dist/cli/config.js +24 -0
- package/dist/cli/config.js.map +1 -0
- package/dist/cli/engine.d.ts +19 -0
- package/dist/cli/engine.d.ts.map +1 -0
- package/dist/cli/engine.js +173 -0
- package/dist/cli/engine.js.map +1 -0
- package/dist/cli/import.d.ts +22 -0
- package/dist/cli/import.d.ts.map +1 -0
- package/dist/cli/import.js +242 -0
- package/dist/cli/import.js.map +1 -0
- package/dist/cli/llm/index.d.ts +6 -0
- package/dist/cli/llm/index.d.ts.map +1 -0
- package/dist/cli/llm/index.js +26 -0
- package/dist/cli/llm/index.js.map +1 -0
- package/dist/cli/llm/openai.d.ts +4 -0
- package/dist/cli/llm/openai.d.ts.map +1 -0
- package/dist/cli/llm/openai.js +44 -0
- package/dist/cli/llm/openai.js.map +1 -0
- package/dist/cli/llm/types.d.ts +14 -0
- package/dist/cli/llm/types.d.ts.map +1 -0
- package/dist/cli/llm/types.js +2 -0
- package/dist/cli/llm/types.js.map +1 -0
- package/dist/cli/logging.d.ts +8 -0
- package/dist/cli/logging.d.ts.map +1 -0
- package/dist/cli/logging.js +23 -0
- package/dist/cli/logging.js.map +1 -0
- package/dist/cli/output/diff-renderer.d.ts +4 -0
- package/dist/cli/output/diff-renderer.d.ts.map +1 -0
- package/dist/cli/output/diff-renderer.js +89 -0
- package/dist/cli/output/diff-renderer.js.map +1 -0
- package/dist/cli/output.d.ts +6 -0
- package/dist/cli/output.d.ts.map +1 -0
- package/dist/cli/output.js +41 -0
- package/dist/cli/output.js.map +1 -0
- package/dist/cli/router.d.ts +14 -0
- package/dist/cli/router.d.ts.map +1 -0
- package/dist/cli/router.js +59 -0
- package/dist/cli/router.js.map +1 -0
- package/dist/cli/schemata.d.ts +74 -0
- package/dist/cli/schemata.d.ts.map +1 -0
- package/dist/cli/schemata.js +89 -0
- package/dist/cli/schemata.js.map +1 -0
- package/dist/cli/storage/analysis.d.ts +9 -0
- package/dist/cli/storage/analysis.d.ts.map +1 -0
- package/dist/cli/storage/analysis.js +108 -0
- package/dist/cli/storage/analysis.js.map +1 -0
- package/dist/cli/storage/arguments.d.ts +12 -0
- package/dist/cli/storage/arguments.d.ts.map +1 -0
- package/dist/cli/storage/arguments.js +80 -0
- package/dist/cli/storage/arguments.js.map +1 -0
- package/dist/cli/storage/libraries.d.ts +14 -0
- package/dist/cli/storage/libraries.d.ts.map +1 -0
- package/dist/cli/storage/libraries.js +80 -0
- package/dist/cli/storage/libraries.js.map +1 -0
- package/dist/cli/storage/premises.d.ts +9 -0
- package/dist/cli/storage/premises.d.ts.map +1 -0
- package/dist/cli/storage/premises.js +67 -0
- package/dist/cli/storage/premises.js.map +1 -0
- package/dist/cli/storage/roles.d.ts +4 -0
- package/dist/cli/storage/roles.d.ts.map +1 -0
- package/dist/cli/storage/roles.js +26 -0
- package/dist/cli/storage/roles.js.map +1 -0
- package/dist/cli/storage/variables.d.ts +4 -0
- package/dist/cli/storage/variables.d.ts.map +1 -0
- package/dist/cli/storage/variables.js +36 -0
- package/dist/cli/storage/variables.js.map +1 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +65 -0
- package/dist/cli.js.map +1 -0
- package/dist/extensions/basics/argument-parser.d.ts +12 -0
- package/dist/extensions/basics/argument-parser.d.ts.map +1 -0
- package/dist/extensions/basics/argument-parser.js +27 -0
- package/dist/extensions/basics/argument-parser.js.map +1 -0
- package/dist/extensions/basics/index.d.ts +4 -0
- package/dist/extensions/basics/index.d.ts.map +1 -0
- package/dist/extensions/basics/index.js +3 -0
- package/dist/extensions/basics/index.js.map +1 -0
- package/dist/extensions/basics/schemata.d.ts +35 -0
- package/dist/extensions/basics/schemata.d.ts.map +1 -0
- package/dist/extensions/basics/schemata.js +55 -0
- package/dist/extensions/basics/schemata.js.map +1 -0
- package/dist/extensions/ieee/formatting.d.ts +18 -0
- package/dist/extensions/ieee/formatting.d.ts.map +1 -0
- package/dist/extensions/ieee/formatting.js +57 -0
- package/dist/extensions/ieee/formatting.js.map +1 -0
- package/dist/extensions/ieee/index.d.ts +6 -0
- package/dist/extensions/ieee/index.d.ts.map +1 -0
- package/dist/extensions/ieee/index.js +6 -0
- package/dist/extensions/ieee/index.js.map +1 -0
- package/dist/extensions/ieee/references.d.ts +1379 -0
- package/dist/extensions/ieee/references.d.ts.map +1 -0
- package/dist/extensions/ieee/references.js +929 -0
- package/dist/extensions/ieee/references.js.map +1 -0
- package/dist/extensions/ieee/relaxed.d.ts +1371 -0
- package/dist/extensions/ieee/relaxed.d.ts.map +1 -0
- package/dist/extensions/ieee/relaxed.js +160 -0
- package/dist/extensions/ieee/relaxed.js.map +1 -0
- package/dist/extensions/ieee/segment-builder.d.ts +9 -0
- package/dist/extensions/ieee/segment-builder.d.ts.map +1 -0
- package/dist/extensions/ieee/segment-builder.js +98 -0
- package/dist/extensions/ieee/segment-builder.js.map +1 -0
- package/dist/extensions/ieee/segment-templates.d.ts +58 -0
- package/dist/extensions/ieee/segment-templates.d.ts.map +1 -0
- package/dist/extensions/ieee/segment-templates.js +1618 -0
- package/dist/extensions/ieee/segment-templates.js.map +1 -0
- package/dist/extensions/ieee/source.d.ts +434 -0
- package/dist/extensions/ieee/source.d.ts.map +1 -0
- package/dist/extensions/ieee/source.js +12 -0
- package/dist/extensions/ieee/source.js.map +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +10 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/consts.d.ts +21 -0
- package/dist/lib/consts.d.ts.map +1 -0
- package/dist/lib/consts.js +117 -0
- package/dist/lib/consts.js.map +1 -0
- package/dist/lib/core/argument-engine.d.ts +181 -0
- package/dist/lib/core/argument-engine.d.ts.map +1 -0
- package/dist/lib/core/argument-engine.js +1294 -0
- package/dist/lib/core/argument-engine.js.map +1 -0
- package/dist/lib/core/argument-library.d.ts +84 -0
- package/dist/lib/core/argument-library.d.ts.map +1 -0
- package/dist/lib/core/argument-library.js +122 -0
- package/dist/lib/core/argument-library.js.map +1 -0
- package/dist/lib/core/argument-validation.d.ts +74 -0
- package/dist/lib/core/argument-validation.d.ts.map +1 -0
- package/dist/lib/core/argument-validation.js +315 -0
- package/dist/lib/core/argument-validation.js.map +1 -0
- package/dist/lib/core/change-collector.d.ts +24 -0
- package/dist/lib/core/change-collector.d.ts.map +1 -0
- package/dist/lib/core/change-collector.js +63 -0
- package/dist/lib/core/change-collector.js.map +1 -0
- package/dist/lib/core/checksum.d.ts +15 -0
- package/dist/lib/core/checksum.d.ts.map +1 -0
- package/dist/lib/core/checksum.js +43 -0
- package/dist/lib/core/checksum.js.map +1 -0
- package/dist/lib/core/claim-library.d.ts +23 -0
- package/dist/lib/core/claim-library.d.ts.map +1 -0
- package/dist/lib/core/claim-library.js +21 -0
- package/dist/lib/core/claim-library.js.map +1 -0
- package/dist/lib/core/claim-source-library.d.ts +32 -0
- package/dist/lib/core/claim-source-library.d.ts.map +1 -0
- package/dist/lib/core/claim-source-library.js +193 -0
- package/dist/lib/core/claim-source-library.js.map +1 -0
- package/dist/lib/core/diff.d.ts +20 -0
- package/dist/lib/core/diff.d.ts.map +1 -0
- package/dist/lib/core/diff.js +260 -0
- package/dist/lib/core/diff.js.map +1 -0
- package/dist/lib/core/evaluation/argument-evaluation.d.ts +53 -0
- package/dist/lib/core/evaluation/argument-evaluation.d.ts.map +1 -0
- package/dist/lib/core/evaluation/argument-evaluation.js +535 -0
- package/dist/lib/core/evaluation/argument-evaluation.js.map +1 -0
- package/dist/lib/core/evaluation/grading.d.ts +28 -0
- package/dist/lib/core/evaluation/grading.d.ts.map +1 -0
- package/dist/lib/core/evaluation/grading.js +44 -0
- package/dist/lib/core/evaluation/grading.js.map +1 -0
- package/dist/lib/core/evaluation/kleene.d.ts +12 -0
- package/dist/lib/core/evaluation/kleene.d.ts.map +1 -0
- package/dist/lib/core/evaluation/kleene.js +29 -0
- package/dist/lib/core/evaluation/kleene.js.map +1 -0
- package/dist/lib/core/evaluation/validation.d.ts +10 -0
- package/dist/lib/core/evaluation/validation.d.ts.map +1 -0
- package/dist/lib/core/evaluation/validation.js +28 -0
- package/dist/lib/core/evaluation/validation.js.map +1 -0
- package/dist/lib/core/expression-manager.d.ts +278 -0
- package/dist/lib/core/expression-manager.d.ts.map +1 -0
- package/dist/lib/core/expression-manager.js +1622 -0
- package/dist/lib/core/expression-manager.js.map +1 -0
- package/dist/lib/core/fork-library.d.ts +26 -0
- package/dist/lib/core/fork-library.d.ts.map +1 -0
- package/dist/lib/core/fork-library.js +71 -0
- package/dist/lib/core/fork-library.js.map +1 -0
- package/dist/lib/core/fork-namespace.d.ts +32 -0
- package/dist/lib/core/fork-namespace.d.ts.map +1 -0
- package/dist/lib/core/fork-namespace.js +99 -0
- package/dist/lib/core/fork-namespace.js.map +1 -0
- package/dist/lib/core/fork.d.ts +30 -0
- package/dist/lib/core/fork.d.ts.map +1 -0
- package/dist/lib/core/fork.js +125 -0
- package/dist/lib/core/fork.js.map +1 -0
- package/dist/lib/core/interfaces/argument-engine.interfaces.d.ts +366 -0
- package/dist/lib/core/interfaces/argument-engine.interfaces.d.ts.map +1 -0
- package/dist/lib/core/interfaces/argument-engine.interfaces.js +2 -0
- package/dist/lib/core/interfaces/argument-engine.interfaces.js.map +1 -0
- package/dist/lib/core/interfaces/index.d.ts +5 -0
- package/dist/lib/core/interfaces/index.d.ts.map +1 -0
- package/dist/lib/core/interfaces/index.js +2 -0
- package/dist/lib/core/interfaces/index.js.map +1 -0
- package/dist/lib/core/interfaces/library.interfaces.d.ts +347 -0
- package/dist/lib/core/interfaces/library.interfaces.d.ts.map +1 -0
- package/dist/lib/core/interfaces/library.interfaces.js +2 -0
- package/dist/lib/core/interfaces/library.interfaces.js.map +1 -0
- package/dist/lib/core/interfaces/premise-engine.interfaces.d.ts +401 -0
- package/dist/lib/core/interfaces/premise-engine.interfaces.d.ts.map +1 -0
- package/dist/lib/core/interfaces/premise-engine.interfaces.js +2 -0
- package/dist/lib/core/interfaces/premise-engine.interfaces.js.map +1 -0
- package/dist/lib/core/interfaces/shared.interfaces.d.ts +28 -0
- package/dist/lib/core/interfaces/shared.interfaces.d.ts.map +1 -0
- package/dist/lib/core/interfaces/shared.interfaces.js +2 -0
- package/dist/lib/core/interfaces/shared.interfaces.js.map +1 -0
- package/dist/lib/core/invariant-violation-error.d.ts +10 -0
- package/dist/lib/core/invariant-violation-error.d.ts.map +1 -0
- package/dist/lib/core/invariant-violation-error.js +16 -0
- package/dist/lib/core/invariant-violation-error.js.map +1 -0
- package/dist/lib/core/parser/formula-gen.js +923 -0
- package/dist/lib/core/parser/formula.d.ts +24 -0
- package/dist/lib/core/parser/formula.d.ts.map +1 -0
- package/dist/lib/core/parser/formula.js +8 -0
- package/dist/lib/core/parser/formula.js.map +1 -0
- package/dist/lib/core/premise-engine.d.ts +122 -0
- package/dist/lib/core/premise-engine.d.ts.map +1 -0
- package/dist/lib/core/premise-engine.js +1362 -0
- package/dist/lib/core/premise-engine.js.map +1 -0
- package/dist/lib/core/proposit-core.d.ts +111 -0
- package/dist/lib/core/proposit-core.d.ts.map +1 -0
- package/dist/lib/core/proposit-core.js +365 -0
- package/dist/lib/core/proposit-core.js.map +1 -0
- package/dist/lib/core/relationships.d.ts +15 -0
- package/dist/lib/core/relationships.d.ts.map +1 -0
- package/dist/lib/core/relationships.js +319 -0
- package/dist/lib/core/relationships.js.map +1 -0
- package/dist/lib/core/source-library.d.ts +23 -0
- package/dist/lib/core/source-library.d.ts.map +1 -0
- package/dist/lib/core/source-library.js +21 -0
- package/dist/lib/core/source-library.js.map +1 -0
- package/dist/lib/core/variable-manager.d.ts +68 -0
- package/dist/lib/core/variable-manager.d.ts.map +1 -0
- package/dist/lib/core/variable-manager.js +200 -0
- package/dist/lib/core/variable-manager.js.map +1 -0
- package/dist/lib/core/versioned-library.d.ts +52 -0
- package/dist/lib/core/versioned-library.d.ts.map +1 -0
- package/dist/lib/core/versioned-library.js +192 -0
- package/dist/lib/core/versioned-library.js.map +1 -0
- package/dist/lib/index.d.ts +54 -0
- package/dist/lib/index.d.ts.map +1 -0
- package/dist/lib/index.js +39 -0
- package/dist/lib/index.js.map +1 -0
- package/dist/lib/parsing/argument-parser.d.ts +49 -0
- package/dist/lib/parsing/argument-parser.d.ts.map +1 -0
- package/dist/lib/parsing/argument-parser.js +403 -0
- package/dist/lib/parsing/argument-parser.js.map +1 -0
- package/dist/lib/parsing/clamp-max-lengths.d.ts +11 -0
- package/dist/lib/parsing/clamp-max-lengths.d.ts.map +1 -0
- package/dist/lib/parsing/clamp-max-lengths.js +56 -0
- package/dist/lib/parsing/clamp-max-lengths.js.map +1 -0
- package/dist/lib/parsing/index.d.ts +7 -0
- package/dist/lib/parsing/index.d.ts.map +1 -0
- package/dist/lib/parsing/index.js +4 -0
- package/dist/lib/parsing/index.js.map +1 -0
- package/dist/lib/parsing/prompt-builder.d.ts +11 -0
- package/dist/lib/parsing/prompt-builder.d.ts.map +1 -0
- package/dist/lib/parsing/prompt-builder.js +229 -0
- package/dist/lib/parsing/prompt-builder.js.map +1 -0
- package/dist/lib/parsing/schemata.d.ts +79 -0
- package/dist/lib/parsing/schemata.d.ts.map +1 -0
- package/dist/lib/parsing/schemata.js +92 -0
- package/dist/lib/parsing/schemata.js.map +1 -0
- package/dist/lib/parsing/types.d.ts +24 -0
- package/dist/lib/parsing/types.d.ts.map +1 -0
- package/dist/lib/parsing/types.js +2 -0
- package/dist/lib/parsing/types.js.map +1 -0
- package/dist/lib/schemata/analysis.d.ts +9 -0
- package/dist/lib/schemata/analysis.d.ts.map +1 -0
- package/dist/lib/schemata/analysis.js +13 -0
- package/dist/lib/schemata/analysis.js.map +1 -0
- package/dist/lib/schemata/argument.d.ts +14 -0
- package/dist/lib/schemata/argument.d.ts.map +1 -0
- package/dist/lib/schemata/argument.js +24 -0
- package/dist/lib/schemata/argument.js.map +1 -0
- package/dist/lib/schemata/claim.d.ts +9 -0
- package/dist/lib/schemata/claim.d.ts.map +1 -0
- package/dist/lib/schemata/claim.js +18 -0
- package/dist/lib/schemata/claim.js.map +1 -0
- package/dist/lib/schemata/fork.d.ts +76 -0
- package/dist/lib/schemata/fork.d.ts.map +1 -0
- package/dist/lib/schemata/fork.js +55 -0
- package/dist/lib/schemata/fork.js.map +1 -0
- package/dist/lib/schemata/import.d.ts +33 -0
- package/dist/lib/schemata/import.d.ts.map +1 -0
- package/dist/lib/schemata/import.js +18 -0
- package/dist/lib/schemata/import.js.map +1 -0
- package/dist/lib/schemata/index.d.ts +8 -0
- package/dist/lib/schemata/index.d.ts.map +1 -0
- package/dist/lib/schemata/index.js +8 -0
- package/dist/lib/schemata/index.js.map +1 -0
- package/dist/lib/schemata/propositional.d.ts +142 -0
- package/dist/lib/schemata/propositional.d.ts.map +1 -0
- package/dist/lib/schemata/propositional.js +120 -0
- package/dist/lib/schemata/propositional.js.map +1 -0
- package/dist/lib/schemata/shared.d.ts +41 -0
- package/dist/lib/schemata/shared.d.ts.map +1 -0
- package/dist/lib/schemata/shared.js +66 -0
- package/dist/lib/schemata/shared.js.map +1 -0
- package/dist/lib/schemata/source.d.ts +18 -0
- package/dist/lib/schemata/source.d.ts.map +1 -0
- package/dist/lib/schemata/source.js +35 -0
- package/dist/lib/schemata/source.js.map +1 -0
- package/dist/lib/types/checksum.d.ts +20 -0
- package/dist/lib/types/checksum.d.ts.map +1 -0
- package/dist/lib/types/checksum.js +2 -0
- package/dist/lib/types/checksum.js.map +1 -0
- package/dist/lib/types/diff.d.ts +60 -0
- package/dist/lib/types/diff.d.ts.map +1 -0
- package/dist/lib/types/diff.js +2 -0
- package/dist/lib/types/diff.js.map +1 -0
- package/dist/lib/types/evaluation.d.ts +164 -0
- package/dist/lib/types/evaluation.d.ts.map +1 -0
- package/dist/lib/types/evaluation.js +2 -0
- package/dist/lib/types/evaluation.js.map +1 -0
- package/dist/lib/types/fork.d.ts +25 -0
- package/dist/lib/types/fork.d.ts.map +1 -0
- package/dist/lib/types/fork.js +2 -0
- package/dist/lib/types/fork.js.map +1 -0
- package/dist/lib/types/grammar.d.ts +38 -0
- package/dist/lib/types/grammar.d.ts.map +1 -0
- package/dist/lib/types/grammar.js +11 -0
- package/dist/lib/types/grammar.js.map +1 -0
- package/dist/lib/types/mutation.d.ts +31 -0
- package/dist/lib/types/mutation.d.ts.map +1 -0
- package/dist/lib/types/mutation.js +2 -0
- package/dist/lib/types/mutation.js.map +1 -0
- package/dist/lib/types/reactive.d.ts +14 -0
- package/dist/lib/types/reactive.d.ts.map +1 -0
- package/dist/lib/types/reactive.js +2 -0
- package/dist/lib/types/reactive.js.map +1 -0
- package/dist/lib/types/relationships.d.ts +36 -0
- package/dist/lib/types/relationships.d.ts.map +1 -0
- package/dist/lib/types/relationships.js +2 -0
- package/dist/lib/types/relationships.js.map +1 -0
- package/dist/lib/types/validation.d.ts +47 -0
- package/dist/lib/types/validation.d.ts.map +1 -0
- package/dist/lib/types/validation.js +43 -0
- package/dist/lib/types/validation.js.map +1 -0
- package/dist/lib/utils/changeset.d.ts +124 -0
- package/dist/lib/utils/changeset.d.ts.map +1 -0
- package/dist/lib/utils/changeset.js +221 -0
- package/dist/lib/utils/changeset.js.map +1 -0
- package/dist/lib/utils/collections.d.ts +12 -0
- package/dist/lib/utils/collections.d.ts.map +1 -0
- package/dist/lib/utils/collections.js +24 -0
- package/dist/lib/utils/collections.js.map +1 -0
- package/dist/lib/utils/default-map.d.ts +17 -0
- package/dist/lib/utils/default-map.d.ts.map +1 -0
- package/dist/lib/utils/default-map.js +33 -0
- package/dist/lib/utils/default-map.js.map +1 -0
- package/dist/lib/utils/lookup.d.ts +47 -0
- package/dist/lib/utils/lookup.d.ts.map +1 -0
- package/dist/lib/utils/lookup.js +62 -0
- package/dist/lib/utils/lookup.js.map +1 -0
- package/dist/lib/utils/position.d.ts +12 -0
- package/dist/lib/utils/position.d.ts.map +1 -0
- package/dist/lib/utils/position.js +13 -0
- package/dist/lib/utils/position.js.map +1 -0
- package/package.json +82 -0
- package/skills/proposit-core/SKILL.md +35 -0
- package/skills/proposit-core/docs/api-usage.md +442 -0
- package/skills/proposit-core/docs/architecture.md +256 -0
- package/skills/proposit-core/docs/cli.md +304 -0
- package/skills/proposit-core/docs/testing.md +281 -0
- package/skills/proposit-core/docs/types-schemas.md +648 -0
|
@@ -0,0 +1,401 @@
|
|
|
1
|
+
import type { TCoreArgument, TCoreLogicalOperatorType, TCorePremise, TCorePropositionalExpression, TCorePropositionalVariable } from "../../schemata/index.js";
|
|
2
|
+
import type { TCoreExpressionAssignment, TCorePremiseEvaluationResult, TCoreValidationResult } from "../../types/evaluation.js";
|
|
3
|
+
import type { TInvariantValidationResult } from "../../types/validation.js";
|
|
4
|
+
import type { TCoreMutationResult } from "../../types/mutation.js";
|
|
5
|
+
import type { TExpressionInput, TExpressionWithoutPosition, TExpressionUpdate } from "../expression-manager.js";
|
|
6
|
+
import type { TPremiseEngineSnapshot } from "../premise-engine.js";
|
|
7
|
+
/**
|
|
8
|
+
* Single-premise expression tree mutations.
|
|
9
|
+
*/
|
|
10
|
+
export interface TExpressionMutations<TArg extends TCoreArgument = TCoreArgument, TPremise extends TCorePremise = TCorePremise, TExpr extends TCorePropositionalExpression = TCorePropositionalExpression, TVar extends TCorePropositionalVariable = TCorePropositionalVariable> {
|
|
11
|
+
/**
|
|
12
|
+
* Adds an expression to this premise's tree.
|
|
13
|
+
*
|
|
14
|
+
* If the expression has `parentId: null` it becomes the root; only one
|
|
15
|
+
* root is permitted per premise. All structural rules (`implies`/`iff`
|
|
16
|
+
* root-only, child limits, position uniqueness) are enforced.
|
|
17
|
+
*
|
|
18
|
+
* When `grammarConfig.autoNormalize` is `true`, operator nesting
|
|
19
|
+
* violations are auto-corrected by inserting a `formula` buffer between
|
|
20
|
+
* the parent operator and the non-`not` operator child, rather than
|
|
21
|
+
* throwing. Auto-normalize is only active for `addExpression`; compound
|
|
22
|
+
* operations (`insertExpression`, `wrapExpression`) and `removeExpression`
|
|
23
|
+
* always throw on violations regardless of this flag.
|
|
24
|
+
*
|
|
25
|
+
* @param expression - The expression to add, including position and
|
|
26
|
+
* parent assignment.
|
|
27
|
+
* @returns The added expression (with checksum) and changeset.
|
|
28
|
+
* @throws If the premise already has a root expression and this one is
|
|
29
|
+
* also a root.
|
|
30
|
+
* @throws If the expression's parent does not exist in this premise.
|
|
31
|
+
* @throws If the expression is a variable reference and the variable
|
|
32
|
+
* has not been registered.
|
|
33
|
+
* @throws If a non-not operator would become a direct child of another
|
|
34
|
+
* operator expression (when `autoNormalize` is `false`).
|
|
35
|
+
*/
|
|
36
|
+
addExpression(expression: TExpressionInput<TExpr>): TCoreMutationResult<TExpr, TExpr, TVar, TPremise, TArg>;
|
|
37
|
+
/**
|
|
38
|
+
* Adds an expression as the last child of the given parent, with
|
|
39
|
+
* position computed automatically. If `parentId` is `null`, the
|
|
40
|
+
* expression becomes the root.
|
|
41
|
+
*
|
|
42
|
+
* @param parentId - The parent expression ID, or `null` for root.
|
|
43
|
+
* @param expression - The expression to add (position is auto-assigned).
|
|
44
|
+
* @returns The added expression (with checksum) and changeset.
|
|
45
|
+
* @throws If the premise already has a root and `parentId` is `null`.
|
|
46
|
+
* @throws If the expression is a variable reference and the variable
|
|
47
|
+
* has not been registered.
|
|
48
|
+
* @throws If a non-not operator would become a direct child of another
|
|
49
|
+
* operator expression.
|
|
50
|
+
*/
|
|
51
|
+
appendExpression(parentId: string | null, expression: TExpressionWithoutPosition<TExpr>): TCoreMutationResult<TExpr, TExpr, TVar, TPremise, TArg>;
|
|
52
|
+
/**
|
|
53
|
+
* Adds an expression immediately before or after an existing sibling,
|
|
54
|
+
* with position computed automatically.
|
|
55
|
+
*
|
|
56
|
+
* @param siblingId - The ID of the existing sibling expression.
|
|
57
|
+
* @param relativePosition - Whether to insert `"before"` or `"after"`
|
|
58
|
+
* the sibling.
|
|
59
|
+
* @param expression - The expression to add (position is auto-assigned).
|
|
60
|
+
* @returns The added expression (with checksum) and changeset.
|
|
61
|
+
* @throws If the sibling does not exist in this premise.
|
|
62
|
+
* @throws If the expression is a variable reference and the variable
|
|
63
|
+
* has not been registered.
|
|
64
|
+
* @throws If a non-not operator would become a direct child of another
|
|
65
|
+
* operator expression.
|
|
66
|
+
*/
|
|
67
|
+
addExpressionRelative(siblingId: string, relativePosition: "before" | "after", expression: TExpressionWithoutPosition<TExpr>): TCoreMutationResult<TExpr, TExpr, TVar, TPremise, TArg>;
|
|
68
|
+
/**
|
|
69
|
+
* Updates mutable fields of an existing expression. Only `position`,
|
|
70
|
+
* `variableId`, and `operator` may be updated.
|
|
71
|
+
*
|
|
72
|
+
* @param expressionId - The ID of the expression to update.
|
|
73
|
+
* @param updates - The fields to update.
|
|
74
|
+
* @returns The updated expression and changeset.
|
|
75
|
+
* @throws If the expression does not exist in this premise.
|
|
76
|
+
* @throws If `variableId` references a non-existent variable.
|
|
77
|
+
*/
|
|
78
|
+
updateExpression(expressionId: string, updates: TExpressionUpdate): TCoreMutationResult<TExpr, TExpr, TVar, TPremise, TArg>;
|
|
79
|
+
/**
|
|
80
|
+
* Removes an expression and optionally its entire descendant subtree,
|
|
81
|
+
* then collapses any ancestor operators with fewer than two children.
|
|
82
|
+
*
|
|
83
|
+
* @param expressionId - The ID of the expression to remove.
|
|
84
|
+
* @param deleteSubtree - Whether to remove all descendants as well.
|
|
85
|
+
* @returns The removed root expression, or `undefined` if not found.
|
|
86
|
+
* @throws If removal would promote a non-not operator as a direct
|
|
87
|
+
* child of another operator expression.
|
|
88
|
+
*/
|
|
89
|
+
removeExpression(expressionId: string, deleteSubtree: boolean): TCoreMutationResult<TExpr | undefined, TExpr, TVar, TPremise, TArg>;
|
|
90
|
+
/**
|
|
91
|
+
* Splices a new expression between existing nodes in the tree. The new
|
|
92
|
+
* expression inherits the tree slot of the anchor node
|
|
93
|
+
* (`leftNodeId ?? rightNodeId`).
|
|
94
|
+
*
|
|
95
|
+
* @param expression - The expression to insert, including position and
|
|
96
|
+
* parent assignment.
|
|
97
|
+
* @param leftNodeId - The existing node to become the left child of
|
|
98
|
+
* the new expression.
|
|
99
|
+
* @param rightNodeId - The existing node to become the right child of
|
|
100
|
+
* the new expression.
|
|
101
|
+
* @returns The inserted expression (with checksum) and changeset.
|
|
102
|
+
* @throws If the expression is a variable reference and the variable
|
|
103
|
+
* has not been registered.
|
|
104
|
+
* @throws If a non-not operator would become a direct child of another
|
|
105
|
+
* operator expression.
|
|
106
|
+
*/
|
|
107
|
+
insertExpression(expression: TExpressionInput<TExpr>, leftNodeId?: string, rightNodeId?: string): TCoreMutationResult<TExpr, TExpr, TVar, TPremise, TArg>;
|
|
108
|
+
/**
|
|
109
|
+
* Wraps an existing expression with a new operator and a new sibling
|
|
110
|
+
* in a single atomic operation.
|
|
111
|
+
*
|
|
112
|
+
* The operator takes the existing node's slot in the tree. Both the
|
|
113
|
+
* existing node and the new sibling become children of the operator.
|
|
114
|
+
* Exactly one of `leftNodeId` / `rightNodeId` must be provided — it
|
|
115
|
+
* identifies the existing node and which child slot it occupies.
|
|
116
|
+
*
|
|
117
|
+
* @param operator - The new operator expression to wrap with.
|
|
118
|
+
* @param newSibling - The new sibling expression to add alongside the
|
|
119
|
+
* existing node.
|
|
120
|
+
* @param leftNodeId - The existing node to place as the left child.
|
|
121
|
+
* @param rightNodeId - The existing node to place as the right child.
|
|
122
|
+
* @returns The inserted operator (with checksum) and changeset.
|
|
123
|
+
* @throws If the new sibling is a variable reference and the variable
|
|
124
|
+
* has not been registered.
|
|
125
|
+
* @throws If a non-not operator would become a direct child of another
|
|
126
|
+
* operator expression.
|
|
127
|
+
*/
|
|
128
|
+
wrapExpression(operator: TExpressionWithoutPosition<TExpr>, newSibling: TExpressionWithoutPosition<TExpr>, leftNodeId?: string, rightNodeId?: string): TCoreMutationResult<TExpr, TExpr, TVar, TPremise, TArg>;
|
|
129
|
+
/**
|
|
130
|
+
* Toggles negation on an expression. If the expression's parent is a
|
|
131
|
+
* NOT operator, removes the NOT (promoting the expression). Otherwise,
|
|
132
|
+
* wraps the expression with a new NOT operator.
|
|
133
|
+
*
|
|
134
|
+
* @param expressionId - The ID of the expression to toggle negation on.
|
|
135
|
+
* @param extraFields - Optional additional fields to merge into newly
|
|
136
|
+
* created expressions (NOT and formula nodes). Structural fields
|
|
137
|
+
* (id, type, operator, parentId, position, premiseId, argumentId,
|
|
138
|
+
* argumentVersion) cannot be overridden.
|
|
139
|
+
* @returns The new NOT expression when adding negation, or `null` when
|
|
140
|
+
* removing it, along with the changeset.
|
|
141
|
+
* @throws If the expression does not exist in this premise.
|
|
142
|
+
*/
|
|
143
|
+
toggleNegation(expressionId: string, extraFields?: Partial<TExpr>): TCoreMutationResult<TExpr | null, TExpr, TVar, TPremise, TArg>;
|
|
144
|
+
/**
|
|
145
|
+
* Changes the operator type of an existing operator expression.
|
|
146
|
+
*
|
|
147
|
+
* Handles three structural cases automatically:
|
|
148
|
+
* - **Simple change:** The operator has exactly 2 children and no merge
|
|
149
|
+
* condition. Updates the operator type in-place.
|
|
150
|
+
* - **Merge:** The operator has exactly 2 children and its parent is the
|
|
151
|
+
* same type as `newOperator`. Dissolves the current operator and
|
|
152
|
+
* reparents its children under the parent.
|
|
153
|
+
* - **Split:** The operator has >2 children. Extracts `sourceChildId` and
|
|
154
|
+
* `targetChildId` into a new sub-operator of type `newOperator`,
|
|
155
|
+
* inserting a formula buffer if required by grammar enforcement.
|
|
156
|
+
*
|
|
157
|
+
* @param expressionId The operator expression to change.
|
|
158
|
+
* @param newOperator The target operator type.
|
|
159
|
+
* @param sourceChildId First child to include in a split (required when >2 children).
|
|
160
|
+
* @param targetChildId Second child to include in a split (required when >2 children).
|
|
161
|
+
* @param extraFields Optional partial expression fields merged into any
|
|
162
|
+
* newly created expressions (formula buffer, new sub-operator).
|
|
163
|
+
* Structural fields (id, type, operator, parentId, position,
|
|
164
|
+
* premiseId, argumentId, argumentVersion) cannot be overridden.
|
|
165
|
+
* @returns result — For simple change: the updated operator expression.
|
|
166
|
+
* For merge: null (operator was dissolved).
|
|
167
|
+
* For split: the newly created sub-operator expression.
|
|
168
|
+
* changes — Full changeset with correct hierarchical checksums.
|
|
169
|
+
* @throws If the expression does not exist, is not an operator, or is "not".
|
|
170
|
+
* @throws If >2 children and sourceChildId/targetChildId not provided.
|
|
171
|
+
* @throws If sourceChildId/targetChildId are not children of expressionId.
|
|
172
|
+
*/
|
|
173
|
+
changeOperator(expressionId: string, newOperator: TCoreLogicalOperatorType, sourceChildId?: string, targetChildId?: string, extraFields?: Partial<TExpr>): TCoreMutationResult<TExpr | null, TExpr, TVar, TPremise, TArg>;
|
|
174
|
+
/**
|
|
175
|
+
* Performs a full normalization sweep on this premise's expression tree.
|
|
176
|
+
* Collapses unjustified formulas, operators with 0/1 children, and inserts
|
|
177
|
+
* formula buffers where needed. Works regardless of `autoNormalize` setting.
|
|
178
|
+
*/
|
|
179
|
+
normalizeExpressions(): TCoreMutationResult<void, TExpr, TVar, TPremise, TArg>;
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* Single-premise expression tree reads.
|
|
183
|
+
*/
|
|
184
|
+
export interface TExpressionQueries<TExpr extends TCorePropositionalExpression = TCorePropositionalExpression> {
|
|
185
|
+
/**
|
|
186
|
+
* Returns an expression by ID, or `undefined` if not found in this
|
|
187
|
+
* premise.
|
|
188
|
+
*
|
|
189
|
+
* @param id - The expression ID to look up.
|
|
190
|
+
* @returns The expression entity, or `undefined`.
|
|
191
|
+
*/
|
|
192
|
+
getExpression(id: string): TExpr | undefined;
|
|
193
|
+
/**
|
|
194
|
+
* Returns the ID of the root expression, or `undefined` if the premise
|
|
195
|
+
* is empty.
|
|
196
|
+
*
|
|
197
|
+
* @returns The root expression ID, or `undefined`.
|
|
198
|
+
*/
|
|
199
|
+
getRootExpressionId(): string | undefined;
|
|
200
|
+
/**
|
|
201
|
+
* Returns the root expression, or `undefined` if the premise is empty.
|
|
202
|
+
*
|
|
203
|
+
* @returns The root expression entity, or `undefined`.
|
|
204
|
+
*/
|
|
205
|
+
getRootExpression(): TExpr | undefined;
|
|
206
|
+
/**
|
|
207
|
+
* Returns all expressions in this premise.
|
|
208
|
+
*
|
|
209
|
+
* @returns An array of expression entities.
|
|
210
|
+
*/
|
|
211
|
+
getExpressions(): TExpr[];
|
|
212
|
+
/**
|
|
213
|
+
* Returns the child expressions of the given parent, sorted by
|
|
214
|
+
* position.
|
|
215
|
+
*
|
|
216
|
+
* @param parentId - The parent expression ID, or `null` for root-level
|
|
217
|
+
* children.
|
|
218
|
+
* @returns An array of child expression entities.
|
|
219
|
+
*/
|
|
220
|
+
getChildExpressions(parentId: string | null): TExpr[];
|
|
221
|
+
}
|
|
222
|
+
/**
|
|
223
|
+
* Variable reference queries and cascade deletion.
|
|
224
|
+
*/
|
|
225
|
+
export interface TVariableReferences<TArg extends TCoreArgument = TCoreArgument, TPremise extends TCorePremise = TCorePremise, TExpr extends TCorePropositionalExpression = TCorePropositionalExpression, TVar extends TCorePropositionalVariable = TCorePropositionalVariable> {
|
|
226
|
+
/**
|
|
227
|
+
* Returns all argument-level variables (from the shared
|
|
228
|
+
* VariableManager) sorted by ID. Since the VariableManager is shared
|
|
229
|
+
* across all premises, this returns every registered variable — not
|
|
230
|
+
* just those referenced by expressions in this premise.
|
|
231
|
+
*
|
|
232
|
+
* @returns An array of variable entities.
|
|
233
|
+
*/
|
|
234
|
+
getVariables(): TVar[];
|
|
235
|
+
/**
|
|
236
|
+
* Returns the set of variable IDs referenced by expressions in this
|
|
237
|
+
* premise. Only variables that appear in `type: "variable"` expression
|
|
238
|
+
* nodes are included.
|
|
239
|
+
*
|
|
240
|
+
* @returns A Set of referenced variable ID strings.
|
|
241
|
+
*/
|
|
242
|
+
getReferencedVariableIds(): Set<string>;
|
|
243
|
+
/**
|
|
244
|
+
* Deletes all expressions that reference the given variable ID,
|
|
245
|
+
* including their subtrees. Operator collapse runs after each removal.
|
|
246
|
+
*
|
|
247
|
+
* @param variableId - The variable ID whose referencing expressions
|
|
248
|
+
* should be removed.
|
|
249
|
+
* @returns The removed expressions and changeset.
|
|
250
|
+
*/
|
|
251
|
+
deleteExpressionsUsingVariable(variableId: string): TCoreMutationResult<TExpr[], TExpr, TVar, TPremise, TArg>;
|
|
252
|
+
}
|
|
253
|
+
/**
|
|
254
|
+
* Premise type classification (inference vs constraint).
|
|
255
|
+
*/
|
|
256
|
+
export interface TPremiseClassification {
|
|
257
|
+
/**
|
|
258
|
+
* Returns `true` if the root expression is an `implies` or `iff`
|
|
259
|
+
* operator, meaning this premise expresses a logical inference
|
|
260
|
+
* relationship.
|
|
261
|
+
*
|
|
262
|
+
* @returns Whether this premise is an inference.
|
|
263
|
+
*/
|
|
264
|
+
isInference(): boolean;
|
|
265
|
+
/**
|
|
266
|
+
* Returns `true` if this premise does not have an inference operator at
|
|
267
|
+
* its root. Equivalent to `!isInference()`.
|
|
268
|
+
*
|
|
269
|
+
* @returns Whether this premise is a constraint.
|
|
270
|
+
*/
|
|
271
|
+
isConstraint(): boolean;
|
|
272
|
+
}
|
|
273
|
+
/**
|
|
274
|
+
* Premise-level evaluation: single-assignment evaluation and evaluability
|
|
275
|
+
* validation.
|
|
276
|
+
*/
|
|
277
|
+
export interface TPremiseEvaluation {
|
|
278
|
+
/**
|
|
279
|
+
* Validates that this premise is structurally ready for evaluation.
|
|
280
|
+
*
|
|
281
|
+
* @returns A validation result with any issues found.
|
|
282
|
+
*/
|
|
283
|
+
validateEvaluability(): TCoreValidationResult;
|
|
284
|
+
/**
|
|
285
|
+
* Evaluates the premise under a three-valued expression assignment.
|
|
286
|
+
*
|
|
287
|
+
* Variable values are looked up using Kleene three-valued logic
|
|
288
|
+
* (`null` = unknown). Missing variables default to `null`. For
|
|
289
|
+
* inference premises (`implies`/`iff`), an `inferenceDiagnostic` is
|
|
290
|
+
* computed with three-valued fields unless the root is rejected.
|
|
291
|
+
*
|
|
292
|
+
* @param assignment - The variable assignment and optional rejected
|
|
293
|
+
* expression IDs.
|
|
294
|
+
* @param options - Optional evaluation options.
|
|
295
|
+
* @param options.strictUnknownKeys - If `true`, unknown variable keys
|
|
296
|
+
* in the assignment cause an error.
|
|
297
|
+
* @param options.requireExactCoverage - If `true`, the assignment must
|
|
298
|
+
* cover exactly the referenced variables.
|
|
299
|
+
* @returns The premise evaluation result.
|
|
300
|
+
*/
|
|
301
|
+
evaluate(assignment: TCoreExpressionAssignment, options?: {
|
|
302
|
+
strictUnknownKeys?: boolean;
|
|
303
|
+
requireExactCoverage?: boolean;
|
|
304
|
+
}): TCorePremiseEvaluationResult;
|
|
305
|
+
}
|
|
306
|
+
/**
|
|
307
|
+
* Premise snapshot and mutation callback lifecycle.
|
|
308
|
+
* Static fromSnapshot factory is class-level only.
|
|
309
|
+
*/
|
|
310
|
+
export interface TPremiseLifecycle<TPremise extends TCorePremise = TCorePremise, TExpr extends TCorePropositionalExpression = TCorePropositionalExpression> {
|
|
311
|
+
/**
|
|
312
|
+
* Returns a serializable snapshot of the premise's owned state.
|
|
313
|
+
*
|
|
314
|
+
* @returns The premise engine snapshot.
|
|
315
|
+
*/
|
|
316
|
+
snapshot(): TPremiseEngineSnapshot<TPremise, TExpr>;
|
|
317
|
+
/**
|
|
318
|
+
* Sets a callback invoked after every mutation, or `undefined` to
|
|
319
|
+
* clear.
|
|
320
|
+
*
|
|
321
|
+
* @param callback - The mutation callback, or `undefined` to remove.
|
|
322
|
+
*/
|
|
323
|
+
setOnMutate(callback: (() => void) | undefined): void;
|
|
324
|
+
/**
|
|
325
|
+
* Sets a callback that checks whether adding a variable-expression to a
|
|
326
|
+
* premise would create a circular binding. Injected by `ArgumentEngine`
|
|
327
|
+
* to enable cross-premise cycle detection. If not set, only the direct
|
|
328
|
+
* check (within the premise itself) runs.
|
|
329
|
+
*
|
|
330
|
+
* @param check - A function that returns `true` if adding the variable
|
|
331
|
+
* to the premise would create a cycle, or `undefined` to clear.
|
|
332
|
+
*/
|
|
333
|
+
setCircularityCheck(check: ((variableId: string, premiseId: string) => boolean) | undefined): void;
|
|
334
|
+
/**
|
|
335
|
+
* Sets a callback that checks whether a premise-bound variable's target
|
|
336
|
+
* premise has an empty expression tree. Injected by `ArgumentEngine` to
|
|
337
|
+
* enable cross-premise validation. Used during `validateEvaluability`.
|
|
338
|
+
*
|
|
339
|
+
* @param check - A function that returns `true` if the variable's bound
|
|
340
|
+
* premise has no root expression, or `undefined` to clear.
|
|
341
|
+
*/
|
|
342
|
+
setEmptyBoundPremiseCheck(check: ((variableId: string) => boolean) | undefined): void;
|
|
343
|
+
/**
|
|
344
|
+
* Invalidates the cached checksum so the next call recomputes it.
|
|
345
|
+
*/
|
|
346
|
+
markDirty(): void;
|
|
347
|
+
/**
|
|
348
|
+
* Run invariant validation on this premise and its expression tree.
|
|
349
|
+
*/
|
|
350
|
+
validate(): TInvariantValidationResult;
|
|
351
|
+
/**
|
|
352
|
+
* Sets a callback that returns the full set of variable IDs registered
|
|
353
|
+
* in the argument. Injected by `ArgumentEngine`.
|
|
354
|
+
*
|
|
355
|
+
* @param callback - A function returning the set of registered variable
|
|
356
|
+
* IDs, or `undefined` to clear.
|
|
357
|
+
*/
|
|
358
|
+
setVariableIdsCallback(callback: (() => Set<string>) | undefined): void;
|
|
359
|
+
/**
|
|
360
|
+
* Sets a callback that runs full argument-level invariant validation.
|
|
361
|
+
* Injected by `ArgumentEngine` so the premise can delegate to the
|
|
362
|
+
* argument-level validator.
|
|
363
|
+
*
|
|
364
|
+
* @param callback - A function returning the invariant validation result,
|
|
365
|
+
* or `undefined` to clear.
|
|
366
|
+
*/
|
|
367
|
+
setArgumentValidateCallback(callback: (() => TInvariantValidationResult) | undefined): void;
|
|
368
|
+
}
|
|
369
|
+
/**
|
|
370
|
+
* Premise entity identity and metadata access.
|
|
371
|
+
*/
|
|
372
|
+
export interface TPremiseIdentity<TArg extends TCoreArgument = TCoreArgument, TPremise extends TCorePremise = TCorePremise, TExpr extends TCorePropositionalExpression = TCorePropositionalExpression, TVar extends TCorePropositionalVariable = TCorePropositionalVariable> {
|
|
373
|
+
/**
|
|
374
|
+
* Returns the premise ID.
|
|
375
|
+
*
|
|
376
|
+
* @returns The premise ID string.
|
|
377
|
+
*/
|
|
378
|
+
getId(): string;
|
|
379
|
+
/**
|
|
380
|
+
* Returns a serializable premise representation containing only
|
|
381
|
+
* identity/metadata and checksum. Use `getRootExpressionId()`,
|
|
382
|
+
* `getExpressions()`, `getReferencedVariableIds()` for runtime state.
|
|
383
|
+
*
|
|
384
|
+
* @returns The premise data entity.
|
|
385
|
+
*/
|
|
386
|
+
toPremiseData(): TPremise;
|
|
387
|
+
/**
|
|
388
|
+
* Returns the premise's extra metadata record.
|
|
389
|
+
*
|
|
390
|
+
* @returns The extras record.
|
|
391
|
+
*/
|
|
392
|
+
getExtras(): Record<string, unknown>;
|
|
393
|
+
/**
|
|
394
|
+
* Replaces the premise's extra metadata record.
|
|
395
|
+
*
|
|
396
|
+
* @param extras - The new extras record.
|
|
397
|
+
* @returns The previous extras record and changeset.
|
|
398
|
+
*/
|
|
399
|
+
setExtras(extras: Record<string, unknown>): TCoreMutationResult<Record<string, unknown>, TExpr, TVar, TPremise, TArg>;
|
|
400
|
+
}
|
|
401
|
+
//# sourceMappingURL=premise-engine.interfaces.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"premise-engine.interfaces.d.ts","sourceRoot":"","sources":["../../../../src/lib/core/interfaces/premise-engine.interfaces.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,aAAa,EACb,wBAAwB,EACxB,YAAY,EACZ,4BAA4B,EAC5B,0BAA0B,EAC7B,MAAM,yBAAyB,CAAA;AAChC,OAAO,KAAK,EACR,yBAAyB,EACzB,4BAA4B,EAC5B,qBAAqB,EACxB,MAAM,2BAA2B,CAAA;AAClC,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,2BAA2B,CAAA;AAC3E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAA;AAClE,OAAO,KAAK,EACR,gBAAgB,EAChB,0BAA0B,EAC1B,iBAAiB,EACpB,MAAM,0BAA0B,CAAA;AACjC,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAA;AAElE;;GAEG;AACH,MAAM,WAAW,oBAAoB,CACjC,IAAI,SAAS,aAAa,GAAG,aAAa,EAC1C,QAAQ,SAAS,YAAY,GAAG,YAAY,EAC5C,KAAK,SAAS,4BAA4B,GAAG,4BAA4B,EACzE,IAAI,SAAS,0BAA0B,GAAG,0BAA0B;IAEpE;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACH,aAAa,CACT,UAAU,EAAE,gBAAgB,CAAC,KAAK,CAAC,GACpC,mBAAmB,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,CAAC,CAAA;IAC1D;;;;;;;;;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AE,MAAM,KAAK,OAAO,CAAC,GAAG,SAAS,GACxE,IAAI,CAAA;IACP;;;;;;;OAOG;IACH,yBAAyB,CACrB,KAAK,EAAE,CAAC,CAAC,UAAU,EAAE,MAAM,KAAK,OAAO,CAAC,GAAG,SAAS,GACrD,IAAI,CAAA;IACP;;OAEG;IACH,SAAS,IAAI,IAAI,CAAA;IACjB;;OAEG;IACH,QAAQ,IAAI,0BAA0B,CAAA;IACtC;;;;;;OAMG;IACH,sBAAsB,CAAC,QAAQ,EAAE,CAAC,MAAM,GAAG,CAAC,MAAM,CAAC,CAAC,GAAG,SAAS,GAAG,IAAI,CAAA;IACvE;;;;;;;OAOG;IACH,2BAA2B,CACvB,QAAQ,EAAE,CAAC,MAAM,0BAA0B,CAAC,GAAG,SAAS,GACzD,IAAI,CAAA;CACV;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB,CAC7B,IAAI,SAAS,aAAa,GAAG,aAAa,EAC1C,QAAQ,SAAS,YAAY,GAAG,YAAY,EAC5C,KAAK,SAAS,4BAA4B,GAAG,4BAA4B,EACzE,IAAI,SAAS,0BAA0B,GAAG,0BAA0B;IAEpE;;;;OAIG;IACH,KAAK,IAAI,MAAM,CAAA;IACf;;;;;;OAMG;IACH,aAAa,IAAI,QAAQ,CAAA;IACzB;;;;OAIG;IACH,SAAS,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACpC;;;;;OAKG;IACH,SAAS,CACL,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAChC,mBAAmB,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,CAAC,CAAA;CAC/E"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"premise-engine.interfaces.js","sourceRoot":"","sources":["../../../../src/lib/core/interfaces/premise-engine.interfaces.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* An entity that can produce a human-readable display string.
|
|
3
|
+
*/
|
|
4
|
+
export interface TDisplayable {
|
|
5
|
+
/**
|
|
6
|
+
* Renders the entity as a human-readable string.
|
|
7
|
+
*
|
|
8
|
+
* @returns A human-readable display string.
|
|
9
|
+
*/
|
|
10
|
+
toDisplayString(): string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* An entity that can produce hierarchical content checksums:
|
|
14
|
+
* meta (entity-only), descendant (children), and combined (both).
|
|
15
|
+
*/
|
|
16
|
+
export interface THierarchicalChecksummable<TCollectionName extends string = string> {
|
|
17
|
+
/** Returns the meta checksum — derived from entity data only. */
|
|
18
|
+
checksum(): string;
|
|
19
|
+
/** Returns the descendant checksum — derived from children's combinedChecksums. Null if no children. */
|
|
20
|
+
descendantChecksum(): string | null;
|
|
21
|
+
/** Returns the combined checksum — hash(checksum + descendantChecksum), or equals checksum if no descendants. */
|
|
22
|
+
combinedChecksum(): string;
|
|
23
|
+
/** Returns the checksum for a named descendant collection. Null if collection is empty. */
|
|
24
|
+
getCollectionChecksum(name: TCollectionName): string | null;
|
|
25
|
+
/** Forces recomputation of all dirty checksums in the hierarchy. */
|
|
26
|
+
flushChecksums(): void;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=shared.interfaces.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared.interfaces.d.ts","sourceRoot":"","sources":["../../../../src/lib/core/interfaces/shared.interfaces.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,YAAY;IACzB;;;;OAIG;IACH,eAAe,IAAI,MAAM,CAAA;CAC5B;AAED;;;GAGG;AACH,MAAM,WAAW,0BAA0B,CACvC,eAAe,SAAS,MAAM,GAAG,MAAM;IAEvC,iEAAiE;IACjE,QAAQ,IAAI,MAAM,CAAA;IAClB,wGAAwG;IACxG,kBAAkB,IAAI,MAAM,GAAG,IAAI,CAAA;IACnC,iHAAiH;IACjH,gBAAgB,IAAI,MAAM,CAAA;IAC1B,2FAA2F;IAC3F,qBAAqB,CAAC,IAAI,EAAE,eAAe,GAAG,MAAM,GAAG,IAAI,CAAA;IAC3D,oEAAoE;IACpE,cAAc,IAAI,IAAI,CAAA;CACzB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared.interfaces.js","sourceRoot":"","sources":["../../../../src/lib/core/interfaces/shared.interfaces.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { TInvariantViolation } from "../types/validation.js";
|
|
2
|
+
/**
|
|
3
|
+
* Thrown when a mutation would leave the system in an invalid state.
|
|
4
|
+
* Carries the full list of {@link TInvariantViolation} entries that were detected.
|
|
5
|
+
*/
|
|
6
|
+
export declare class InvariantViolationError extends Error {
|
|
7
|
+
readonly violations: TInvariantViolation[];
|
|
8
|
+
constructor(violations: TInvariantViolation[]);
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=invariant-violation-error.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"invariant-violation-error.d.ts","sourceRoot":"","sources":["../../../src/lib/core/invariant-violation-error.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAA;AAEjE;;;GAGG;AACH,qBAAa,uBAAwB,SAAQ,KAAK;IAC9C,SAAgB,UAAU,EAAE,mBAAmB,EAAE,CAAA;gBAErC,UAAU,EAAE,mBAAmB,EAAE;CAShD"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Thrown when a mutation would leave the system in an invalid state.
|
|
3
|
+
* Carries the full list of {@link TInvariantViolation} entries that were detected.
|
|
4
|
+
*/
|
|
5
|
+
export class InvariantViolationError extends Error {
|
|
6
|
+
violations;
|
|
7
|
+
constructor(violations) {
|
|
8
|
+
const summary = violations.length === 1
|
|
9
|
+
? violations[0].message
|
|
10
|
+
: `${violations.length} invariant violations detected`;
|
|
11
|
+
super(summary);
|
|
12
|
+
this.name = "InvariantViolationError";
|
|
13
|
+
this.violations = violations;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=invariant-violation-error.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"invariant-violation-error.js","sourceRoot":"","sources":["../../../src/lib/core/invariant-violation-error.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,MAAM,OAAO,uBAAwB,SAAQ,KAAK;IAC9B,UAAU,CAAuB;IAEjD,YAAY,UAAiC;QACzC,MAAM,OAAO,GACT,UAAU,CAAC,MAAM,KAAK,CAAC;YACnB,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,OAAO;YACvB,CAAC,CAAC,GAAG,UAAU,CAAC,MAAM,gCAAgC,CAAA;QAC9D,KAAK,CAAC,OAAO,CAAC,CAAA;QACd,IAAI,CAAC,IAAI,GAAG,yBAAyB,CAAA;QACrC,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;IAChC,CAAC;CACJ"}
|