@kontourai/survey 1.2.1 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -40,6 +40,13 @@ The Review Workbench rendering a real example queue — current vs proposed valu
40
40
  npm install @kontourai/survey @kontourai/surface
41
41
  ```
42
42
 
43
+ Requires Node.js >=22. TypeScript >=5.0 is required to compile against
44
+ Survey's published type declarations (`defineProductVocabulary`'s `const`
45
+ type parameters are TS 5.0+ syntax) — JavaScript consumers are unaffected;
46
+ TypeScript consumers on an older compiler should stay on `1.2.x`. See the
47
+ [Upgrade Guide](docs/upgrade-guide.md#consuming-decisioneffects-safely) for
48
+ details.
49
+
43
50
  ```ts
44
51
  import { buildTrustReport, validateTrustBundle } from "@kontourai/surface";
45
52
  import { buildSurveyTrustBundle, SurveyInputBuilder } from "@kontourai/survey";
@@ -27,8 +27,20 @@ export interface ProductVocabularyDefinition<TClaimTypes extends Readonly<Record
27
27
  * `currentProposedReviewItem` caller can pass instead of loose top-level
28
28
  * constants. Returns the same shape it received, frozen so callers cannot
29
29
  * mutate a shared vocabulary at runtime.
30
+ *
31
+ * The type parameters carry the `const` modifier, so `claimTypes` and
32
+ * `decisionEffects` string properties keep their literal types whether or
33
+ * not the caller appends `as const` to the argument — do not re-add an
34
+ * `as const` requirement to this helper's documented usage; it is not
35
+ * needed here (requires TypeScript 5.0+; unlike a plain object literal
36
+ * passed to a non-`const` generic elsewhere), and callers who already write
37
+ * `as const` continue to compile identically. Note: the `const` type-
38
+ * parameter syntax itself requires a TypeScript 5.0+ compiler to parse this
39
+ * function's declaration at all (see `package.json`'s
40
+ * `peerDependencies.typescript` and `docs/upgrade-guide.md`); this is a
41
+ * types-only floor and does not affect JavaScript consumers.
30
42
  */
31
- export declare function defineProductVocabulary<TClaimTypes extends Readonly<Record<string, string>>, TDecisionEffects extends Readonly<Record<string, string>>>(definition: ProductVocabularyDefinition<TClaimTypes, TDecisionEffects>): ProductVocabularyDefinition<TClaimTypes, TDecisionEffects>;
43
+ export declare function defineProductVocabulary<const TClaimTypes extends Readonly<Record<string, string>>, const TDecisionEffects extends Readonly<Record<string, string>>>(definition: ProductVocabularyDefinition<TClaimTypes, TDecisionEffects>): ProductVocabularyDefinition<TClaimTypes, TDecisionEffects>;
32
44
  export interface ConfidenceBasisForReviewInput {
33
45
  readonly status: TrustStatus;
34
46
  readonly impactLevel: ImpactLevel;
@@ -21,6 +21,18 @@ export function stableId(parts) {
21
21
  * `currentProposedReviewItem` caller can pass instead of loose top-level
22
22
  * constants. Returns the same shape it received, frozen so callers cannot
23
23
  * mutate a shared vocabulary at runtime.
24
+ *
25
+ * The type parameters carry the `const` modifier, so `claimTypes` and
26
+ * `decisionEffects` string properties keep their literal types whether or
27
+ * not the caller appends `as const` to the argument — do not re-add an
28
+ * `as const` requirement to this helper's documented usage; it is not
29
+ * needed here (requires TypeScript 5.0+; unlike a plain object literal
30
+ * passed to a non-`const` generic elsewhere), and callers who already write
31
+ * `as const` continue to compile identically. Note: the `const` type-
32
+ * parameter syntax itself requires a TypeScript 5.0+ compiler to parse this
33
+ * function's declaration at all (see `package.json`'s
34
+ * `peerDependencies.typescript` and `docs/upgrade-guide.md`); this is a
35
+ * types-only floor and does not affect JavaScript consumers.
24
36
  */
25
37
  export function defineProductVocabulary(definition) {
26
38
  return deepFreeze({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kontourai/survey",
3
- "version": "1.2.1",
3
+ "version": "1.3.0",
4
4
  "description": "Producer-side source, extraction, candidate, and review contracts for projecting verified claims into Surface.",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -71,11 +71,15 @@
71
71
  "@kontourai/surface": "^1.3.0"
72
72
  },
73
73
  "peerDependencies": {
74
- "@anthropic-ai/sdk": ">=0.20.0"
74
+ "@anthropic-ai/sdk": ">=0.20.0",
75
+ "typescript": ">=5.0.0"
75
76
  },
76
77
  "peerDependenciesMeta": {
77
78
  "@anthropic-ai/sdk": {
78
79
  "optional": true
80
+ },
81
+ "typescript": {
82
+ "optional": true
79
83
  }
80
84
  },
81
85
  "devDependencies": {