@gobing-ai/ts-ai-runner 0.5.20 → 0.5.22

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
@@ -832,6 +832,21 @@ Applications own decision policy and evidence selection. For example, Spur can a
832
832
  `HitlResponder` to use DecisionMaker while retaining its own HITL actions and fallback behavior;
833
833
  the workflow engine itself has no dependency on ai-runner.
834
834
 
835
+ ### Shared validators for external drivers
836
+
837
+ Out-of-tree drivers reuse the same two validators instead of reimplementing neutral validation.
838
+ Both are named exports of the main barrel:
839
+
840
+ | Export | Signature | Purpose |
841
+ | ------ | --------- | ------- |
842
+ | `validateQuestions` | `(questions: unknown) => asserts questions is Record<string, Question>` | Rejects a malformed question map before any transport. |
843
+ | `validateAnswers` | `(questions: Record<string, Question>, answers: unknown) => void` | Verifies answer names/kinds, label and level keys, bounded probabilities/confidence, normalized mass (tolerance `1e-6`) and rubric bounds. |
844
+
845
+ The facade already runs both around every `ask`, so a driver that also calls them reports matching
846
+ errors from its own boundary. Driver-local concerns the neutral validators do not cover (provider
847
+ question/option counts, JSON-serializability of `state`, provider response caps) stay in the
848
+ driver — see [`@gobing-ai/ts-decision-clef`](../decision-clef/README.md) for a worked example.
849
+
835
850
  ### Adding a backend driver
836
851
 
837
852
  Additional backend drivers are the intended extension point. A driver implements only `ask` —
package/dist/index.d.ts CHANGED
@@ -6,6 +6,7 @@ export * from './ai-runner';
6
6
  export * from './decision/decision-maker';
7
7
  export * from './decision/errors';
8
8
  export * from './decision/types';
9
+ export * from './decision/validation';
9
10
  export * from './doctor-runner';
10
11
  export * from './events';
11
12
  export * from './identity';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,sBAAsB,CAAC;AACrC,cAAc,SAAS,CAAC;AACxB,cAAc,iBAAiB,CAAC;AAChC,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,iBAAiB,CAAC;AAChC,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,sBAAsB,CAAC;AACrC,cAAc,SAAS,CAAC;AACxB,cAAc,iBAAiB,CAAC;AAChC,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC"}
package/dist/index.js CHANGED
@@ -6,6 +6,7 @@ export * from './ai-runner.js';
6
6
  export * from './decision/decision-maker.js';
7
7
  export * from './decision/errors.js';
8
8
  export * from './decision/types.js';
9
+ export * from './decision/validation.js';
9
10
  export * from './doctor-runner.js';
10
11
  export * from './events.js';
11
12
  export * from './identity.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gobing-ai/ts-ai-runner",
3
- "version": "0.5.20",
3
+ "version": "0.5.22",
4
4
  "description": "@gobing-ai/ts-ai-runner — Coding-agent shims, detection, doctor checks, and prompt execution.",
5
5
  "keywords": [
6
6
  "typescript",
@@ -47,13 +47,13 @@
47
47
  "release": "echo 'Manual publish is disabled. Releases go through GitHub Actions via Trusted Publishing — push a tag: git tag @gobing-ai/ts-ai-runner-v<version> && git push --tags' && exit 1"
48
48
  },
49
49
  "dependencies": {
50
- "@gobing-ai/ts-infra": "^0.5.20",
51
- "@gobing-ai/ts-runtime": "^0.5.20",
50
+ "@gobing-ai/ts-infra": "^0.5.22",
51
+ "@gobing-ai/ts-runtime": "^0.5.22",
52
52
  "@typesafe-ai/sdk": "0.6.0"
53
53
  },
54
54
  "devDependencies": {
55
55
  "@types/bun": "1.3.14",
56
- "@gobing-ai/ts-db": "^0.5.20"
56
+ "@gobing-ai/ts-db": "^0.5.22"
57
57
  },
58
58
  "publishConfig": {
59
59
  "access": "public"
package/src/index.ts CHANGED
@@ -6,6 +6,7 @@ export * from './ai-runner';
6
6
  export * from './decision/decision-maker';
7
7
  export * from './decision/errors';
8
8
  export * from './decision/types';
9
+ export * from './decision/validation';
9
10
  export * from './doctor-runner';
10
11
  export * from './events';
11
12
  export * from './identity';