@orkestrel/brief 0.0.5 → 0.0.6

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.
@@ -1351,6 +1351,22 @@ import { Subject } from '@orkestrel/reason';
1351
1351
  value: StringShape;
1352
1352
  }, false>;
1353
1353
 
1354
+ /**
1355
+ * Every published `Interpretation` member name, frozen.
1356
+ *
1357
+ * @remarks
1358
+ * The capture list `BriefCompiler` hands `captureValue` at each interpret door — the borrowed
1359
+ * engine's return, and the caller's supplied interpretation. A class instance carries its
1360
+ * contract on the prototype, so the captured view materializes exactly the members named here,
1361
+ * and a name missing from the list is a member the view drops.
1362
+ *
1363
+ * The `satisfies` clause refuses a name `Interpretation` does not declare, and it holds the
1364
+ * element type at the listed names rather than widening it to `string`. That is what lets the
1365
+ * equality assertion beside the capture cases refuse a list that has fallen short of the
1366
+ * published shape.
1367
+ */
1368
+ export declare const INTERPRETATION_MEMBERS: readonly ("text" | "normalized" | "intent" | "entities" | "subject" | "definition" | "mappings" | "ambiguities" | "prompt" | "stages" | "failures" | "complete" | "confidence" | "digest")[];
1369
+
1354
1370
  /**
1355
1371
  * The `interpret` phase snapshot — raw text in, an `Interpretation` out.
1356
1372
  *
@@ -1351,6 +1351,22 @@ import { Subject } from '@orkestrel/reason';
1351
1351
  value: StringShape;
1352
1352
  }, false>;
1353
1353
 
1354
+ /**
1355
+ * Every published `Interpretation` member name, frozen.
1356
+ *
1357
+ * @remarks
1358
+ * The capture list `BriefCompiler` hands `captureValue` at each interpret door — the borrowed
1359
+ * engine's return, and the caller's supplied interpretation. A class instance carries its
1360
+ * contract on the prototype, so the captured view materializes exactly the members named here,
1361
+ * and a name missing from the list is a member the view drops.
1362
+ *
1363
+ * The `satisfies` clause refuses a name `Interpretation` does not declare, and it holds the
1364
+ * element type at the listed names rather than widening it to `string`. That is what lets the
1365
+ * equality assertion beside the capture cases refuse a list that has fallen short of the
1366
+ * published shape.
1367
+ */
1368
+ export declare const INTERPRETATION_MEMBERS: readonly ("text" | "normalized" | "intent" | "entities" | "subject" | "definition" | "mappings" | "ambiguities" | "prompt" | "stages" | "failures" | "complete" | "confidence" | "digest")[];
1369
+
1354
1370
  /**
1355
1371
  * The `interpret` phase snapshot — raw text in, an `Interpretation` out.
1356
1372
  *
@@ -44,6 +44,36 @@ var RISK_SEVERITIES = Object.freeze([
44
44
  "high"
45
45
  ]);
46
46
  /**
47
+ * Every published `Interpretation` member name, frozen.
48
+ *
49
+ * @remarks
50
+ * The capture list `BriefCompiler` hands `captureValue` at each interpret door — the borrowed
51
+ * engine's return, and the caller's supplied interpretation. A class instance carries its
52
+ * contract on the prototype, so the captured view materializes exactly the members named here,
53
+ * and a name missing from the list is a member the view drops.
54
+ *
55
+ * The `satisfies` clause refuses a name `Interpretation` does not declare, and it holds the
56
+ * element type at the listed names rather than widening it to `string`. That is what lets the
57
+ * equality assertion beside the capture cases refuse a list that has fallen short of the
58
+ * published shape.
59
+ */
60
+ var INTERPRETATION_MEMBERS = Object.freeze([
61
+ "text",
62
+ "normalized",
63
+ "intent",
64
+ "entities",
65
+ "subject",
66
+ "definition",
67
+ "mappings",
68
+ "ambiguities",
69
+ "prompt",
70
+ "stages",
71
+ "failures",
72
+ "complete",
73
+ "confidence",
74
+ "digest"
75
+ ]);
76
+ /**
47
77
  * `16` — the default turn cap `briefToGoal` renders.
48
78
  *
49
79
  * @remarks
@@ -2013,25 +2043,9 @@ var BriefCompiler = class {
2013
2043
  return cloned.success ? freezeDeep(cloned.value) : captureValue(value, members);
2014
2044
  }
2015
2045
  #read(input, raw, stages, failures) {
2016
- const members = [
2017
- "text",
2018
- "normalized",
2019
- "intent",
2020
- "entities",
2021
- "subject",
2022
- "definition",
2023
- "mappings",
2024
- "ambiguities",
2025
- "prompt",
2026
- "stages",
2027
- "failures",
2028
- "complete",
2029
- "confidence",
2030
- "digest"
2031
- ];
2032
2046
  const text = input.text;
2033
2047
  if (text !== void 0) {
2034
- const read = attempt(() => this.#own(this.#interpret.interpret(text), members));
2048
+ const read = attempt(() => this.#own(this.#interpret.interpret(text), INTERPRETATION_MEMBERS));
2035
2049
  if (read.success && isInterpretation(read.value)) {
2036
2050
  stages.push(Object.freeze({
2037
2051
  stage: "interpret",
@@ -2056,7 +2070,7 @@ var BriefCompiler = class {
2056
2070
  const supplied = input.interpretation;
2057
2071
  if (supplied === void 0 || isInterpretation(supplied)) return supplied;
2058
2072
  const live = raw.interpretation;
2059
- const captured = attempt(() => captureValue(live, members));
2073
+ const captured = attempt(() => captureValue(live, INTERPRETATION_MEMBERS));
2060
2074
  if (captured.success && isInterpretation(captured.value)) return captured.value;
2061
2075
  const message = "The supplied interpretation does not satisfy the published shape";
2062
2076
  stages.push(Object.freeze({
@@ -2215,6 +2229,6 @@ function createBriefContract() {
2215
2229
  return createContract(briefShape);
2216
2230
  }
2217
2231
  //#endregion
2218
- export { BLANK_PATTERN, BriefCompiler, BriefError, BriefManager, DEFAULT_BRIEF_TURNS, GATE_ID, LINE_BREAK_PATTERN, OUTPUT_FORMATS, RISK_SEVERITIES, SINGLE_LINE_PATTERN, TASK_DOMAINS, TASK_OPERATIONS, assertBrief, brief, briefShape, briefToContent, briefToDispatch, briefToGoal, briefToHash, briefToMarkdown, briefToSubject, briefToTrace, captureValue, citation, citationShape, countSentences, createBriefCompiler, createBriefContract, createBriefManager, deriveGaps, deriveGivens, deriveStatement, deriveTask, errorToMessage, example, exampleShape, exampleToLines, findBlockingGaps, findManifestOverlaps, findUngrantedAuthority, findUnmetRules, findUnpairedGaps, freezeBranch, freezeDeep, gap, gapShape, gateDefinition, given, givenShape, isBrief, isBriefError, isCitation, isExample, isGap, isGiven, isLine, isManifest, isOutcome, isOutput, isOutputFormat, isProof, isReference, isRisk, isRiskSeverity, isTask, isTaskDomain, isTaskOperation, isText, lineShape, manifest, manifestShape, outcome, outcomeShape, output, outputShape, parseBrief, pinBrief, proof, proofShape, reference, referenceShape, risk, riskShape, snapshotBrief, task, taskShape, textShape, validateBrief };
2232
+ export { BLANK_PATTERN, BriefCompiler, BriefError, BriefManager, DEFAULT_BRIEF_TURNS, GATE_ID, INTERPRETATION_MEMBERS, LINE_BREAK_PATTERN, OUTPUT_FORMATS, RISK_SEVERITIES, SINGLE_LINE_PATTERN, TASK_DOMAINS, TASK_OPERATIONS, assertBrief, brief, briefShape, briefToContent, briefToDispatch, briefToGoal, briefToHash, briefToMarkdown, briefToSubject, briefToTrace, captureValue, citation, citationShape, countSentences, createBriefCompiler, createBriefContract, createBriefManager, deriveGaps, deriveGivens, deriveStatement, deriveTask, errorToMessage, example, exampleShape, exampleToLines, findBlockingGaps, findManifestOverlaps, findUngrantedAuthority, findUnmetRules, findUnpairedGaps, freezeBranch, freezeDeep, gap, gapShape, gateDefinition, given, givenShape, isBrief, isBriefError, isCitation, isExample, isGap, isGiven, isLine, isManifest, isOutcome, isOutput, isOutputFormat, isProof, isReference, isRisk, isRiskSeverity, isTask, isTaskDomain, isTaskOperation, isText, lineShape, manifest, manifestShape, outcome, outcomeShape, output, outputShape, parseBrief, pinBrief, proof, proofShape, reference, referenceShape, risk, riskShape, snapshotBrief, task, taskShape, textShape, validateBrief };
2219
2233
 
2220
2234
  //# sourceMappingURL=index.js.map