dsh-model-everything 0.1.0 → 0.2.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/src/tool.ts CHANGED
@@ -3,6 +3,7 @@ import type { JsonValue } from './json-value.js'
3
3
  import { runVerification } from './engine.js'
4
4
  import { renderReportText } from './report-view.js'
5
5
  import { OptionShapeError, optionRefusal, requireObjectOption } from './option-shape.js'
6
+ import { oneOf } from './model-file.js'
6
7
 
7
8
  export const MODEL_VERIFY_TOOL_NAME = 'model_verify'
8
9
 
@@ -22,8 +23,11 @@ export const modelVerifyTool = defineTool({
22
23
  parameters: {
23
24
  model: {
24
25
  type: 'json',
25
- required: true,
26
- description: 'LogicModelV1 state machine model to verify.',
26
+ description: 'LogicModelV1 state machine model to verify. Pass this, or modelPath, not both.',
27
+ },
28
+ modelPath: {
29
+ type: 'string',
30
+ description: 'Path to a JSON file holding the model, instead of inlining it. Formatting does not matter: whitespace, a BOM and pretty printing all parse. Relative paths resolve against the process working directory, which is the session workspace.',
27
31
  },
28
32
  maxStates: {
29
33
  type: 'integer',
@@ -41,6 +45,10 @@ export const modelVerifyTool = defineTool({
41
45
  type: 'json',
42
46
  description: 'Optional object mapping BEFORE state ids to AFTER state ids. Omit for identity mapping (same state names).',
43
47
  },
48
+ check: {
49
+ type: 'string',
50
+ description: 'Print one check in full when the digest truncated it. Pass the check id the CHECKS line lists (for example A9); the per-check budget no longer applies, and an id this report does not carry is answered with the ids that it does.',
51
+ },
44
52
  reportView: {
45
53
  type: 'string',
46
54
  enum: ['digest', 'full'],
@@ -53,7 +61,7 @@ export const modelVerifyTool = defineTool({
53
61
  description: 'this plugin verification report with summary and per-check findings.',
54
62
  },
55
63
  render(args, value) {
56
- return [{ type: 'text' as const, text: renderReportText(value, { full: args.reportView === 'full' }) }]
64
+ return [{ type: 'text' as const, text: renderReportText(value, { full: args.reportView === 'full', check: args.check }) }]
57
65
  },
58
66
  },
59
67
  timeoutMs: 10_000,
@@ -81,7 +89,8 @@ export const modelVerifyTool = defineTool({
81
89
  )
82
90
  }
83
91
  }
84
- return runVerification(args.model, {
92
+ const model = oneOf(args.model, args.modelPath, 'model', 'modelPath', 'VERIFY_OPTION_INVALID')
93
+ return runVerification(model, {
85
94
  maxStates: args.maxStates,
86
95
  maxPermutationEvents: args.maxPermutationEvents,
87
96
  beforeModel: args.beforeModel,