perttool 0.5.0 → 0.5.2

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.
Files changed (41) hide show
  1. package/CHANGELOG.md +39 -1
  2. package/README.md +66 -28
  3. package/dist/cli.js +41 -0
  4. package/dist/cli.js.map +1 -1
  5. package/dist/command/actuals-discovery.d.ts.map +1 -1
  6. package/dist/command/actuals-discovery.js +92 -13
  7. package/dist/command/actuals-discovery.js.map +1 -1
  8. package/dist/history/git-probe.d.ts +4 -0
  9. package/dist/history/git-probe.d.ts.map +1 -1
  10. package/dist/history/git-probe.js +23 -14
  11. package/dist/history/git-probe.js.map +1 -1
  12. package/dist/index.d.ts +2 -0
  13. package/dist/index.d.ts.map +1 -1
  14. package/dist/index.js +1 -0
  15. package/dist/index.js.map +1 -1
  16. package/dist/schema/registry.d.ts +53 -0
  17. package/dist/schema/registry.d.ts.map +1 -0
  18. package/dist/schema/registry.js +346 -0
  19. package/dist/schema/registry.js.map +1 -0
  20. package/dist/version.d.ts +1 -1
  21. package/dist/version.js +1 -1
  22. package/package.json +5 -2
  23. package/schemas/Perttool.AgentGuidanceResult.v1.schema.json +607 -0
  24. package/schemas/Perttool.AnalysisResult.v4.schema.json +790 -0
  25. package/schemas/Perttool.CheckResult.v3.schema.json +203 -0
  26. package/schemas/Perttool.CliError.v1.schema.json +119 -0
  27. package/schemas/Perttool.CommandHelpResult.v1.schema.json +377 -0
  28. package/schemas/Perttool.Common.v1.schema.json +1893 -0
  29. package/schemas/Perttool.ExportResult.v1.schema.json +96 -0
  30. package/schemas/Perttool.FormatResult.v1.schema.json +82 -0
  31. package/schemas/Perttool.GuideResult.v1.schema.json +138 -0
  32. package/schemas/Perttool.ImportResult.v1.schema.json +111 -0
  33. package/schemas/Perttool.InitResult.v1.schema.json +70 -0
  34. package/schemas/Perttool.MutationResult.v3.schema.json +194 -0
  35. package/schemas/Perttool.NextResult.v5.schema.json +1264 -0
  36. package/schemas/Perttool.OverrideDecision.v1.schema.json +402 -0
  37. package/schemas/Perttool.ProjectHistoryResult.v1.schema.json +283 -0
  38. package/schemas/Perttool.ProjectResult.v3.schema.json +217 -0
  39. package/schemas/Perttool.SchemaResult.v1.schema.json +137 -0
  40. package/schemas/Perttool.UnitMigrationResult.v3.schema.json +343 -0
  41. package/schemas/Perttool.VelocityObservationResult.v1.schema.json +301 -0
@@ -0,0 +1,203 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://github.com/mako10k/perttool/schemas/Perttool.CheckResult.v3.schema.json",
4
+ "title": "Perttool.CheckResult.v3",
5
+ "type": "object",
6
+ "required": [
7
+ "schema_version",
8
+ "cli_contract_version",
9
+ "tool_version",
10
+ "operation",
11
+ "ok",
12
+ "document_id",
13
+ "source",
14
+ "source_digest",
15
+ "diagnostics",
16
+ "diagnostics_truncated",
17
+ "grammar_version",
18
+ "summary",
19
+ "temporal_inputs",
20
+ "actuals_inputs"
21
+ ],
22
+ "properties": {
23
+ "schema_version": {
24
+ "const": "Perttool.CheckResult.v3"
25
+ },
26
+ "cli_contract_version": {
27
+ "const": 6
28
+ },
29
+ "tool_version": {
30
+ "type": "string"
31
+ },
32
+ "operation": {
33
+ "const": "document.check"
34
+ },
35
+ "ok": {
36
+ "type": "boolean"
37
+ },
38
+ "document_id": {
39
+ "$ref": "Perttool.Common.v1.schema.json#/$defs/nullableString"
40
+ },
41
+ "source": {
42
+ "type": "string"
43
+ },
44
+ "source_digest": {
45
+ "$ref": "Perttool.Common.v1.schema.json#/$defs/digest"
46
+ },
47
+ "diagnostics": {
48
+ "$ref": "Perttool.Common.v1.schema.json#/$defs/diagnostics"
49
+ },
50
+ "diagnostics_truncated": {
51
+ "type": "boolean"
52
+ },
53
+ "grammar_version": {
54
+ "type": [
55
+ "integer",
56
+ "null"
57
+ ],
58
+ "minimum": 1,
59
+ "maximum": 5
60
+ },
61
+ "summary": {
62
+ "type": "object",
63
+ "required": [
64
+ "resources",
65
+ "milestones",
66
+ "tasks",
67
+ "gates",
68
+ "errors",
69
+ "warnings"
70
+ ],
71
+ "properties": {
72
+ "resources": {
73
+ "type": "integer",
74
+ "minimum": 0
75
+ },
76
+ "milestones": {
77
+ "type": "integer",
78
+ "minimum": 0
79
+ },
80
+ "tasks": {
81
+ "type": "integer",
82
+ "minimum": 0
83
+ },
84
+ "gates": {
85
+ "type": "integer",
86
+ "minimum": 0
87
+ },
88
+ "errors": {
89
+ "type": "integer",
90
+ "minimum": 0
91
+ },
92
+ "warnings": {
93
+ "type": "integer",
94
+ "minimum": 0
95
+ }
96
+ },
97
+ "additionalProperties": false
98
+ },
99
+ "temporal_inputs": {
100
+ "type": [
101
+ "object",
102
+ "null"
103
+ ],
104
+ "required": [
105
+ "anchor",
106
+ "milestone_deadlines",
107
+ "task_constraints"
108
+ ],
109
+ "properties": {
110
+ "anchor": {
111
+ "oneOf": [
112
+ {
113
+ "$ref": "Perttool.Common.v1.schema.json#/$defs/calendarValue"
114
+ },
115
+ {
116
+ "type": "null"
117
+ }
118
+ ]
119
+ },
120
+ "milestone_deadlines": {
121
+ "type": "array",
122
+ "items": {
123
+ "type": "object",
124
+ "required": [
125
+ "milestone_id",
126
+ "deadline"
127
+ ],
128
+ "properties": {
129
+ "milestone_id": {
130
+ "type": "string"
131
+ },
132
+ "deadline": {
133
+ "$ref": "Perttool.Common.v1.schema.json#/$defs/calendarValue"
134
+ }
135
+ },
136
+ "additionalProperties": false
137
+ }
138
+ },
139
+ "task_constraints": {
140
+ "type": "array",
141
+ "items": {
142
+ "type": "object",
143
+ "required": [
144
+ "task_id",
145
+ "not_before",
146
+ "deadline"
147
+ ],
148
+ "properties": {
149
+ "task_id": {
150
+ "type": "string"
151
+ },
152
+ "not_before": {
153
+ "oneOf": [
154
+ {
155
+ "$ref": "Perttool.Common.v1.schema.json#/$defs/calendarValue"
156
+ },
157
+ {
158
+ "type": "null"
159
+ }
160
+ ]
161
+ },
162
+ "deadline": {
163
+ "oneOf": [
164
+ {
165
+ "$ref": "Perttool.Common.v1.schema.json#/$defs/calendarValue"
166
+ },
167
+ {
168
+ "type": "null"
169
+ }
170
+ ]
171
+ }
172
+ },
173
+ "additionalProperties": false
174
+ }
175
+ }
176
+ },
177
+ "additionalProperties": false
178
+ },
179
+ "actuals_inputs": {
180
+ "type": [
181
+ "object",
182
+ "null"
183
+ ],
184
+ "required": [
185
+ "model_version",
186
+ "events"
187
+ ],
188
+ "properties": {
189
+ "model_version": {
190
+ "const": 1
191
+ },
192
+ "events": {
193
+ "type": "array",
194
+ "items": {
195
+ "$ref": "Perttool.Common.v1.schema.json#/$defs/workEvent"
196
+ }
197
+ }
198
+ },
199
+ "additionalProperties": false
200
+ }
201
+ },
202
+ "additionalProperties": false
203
+ }
@@ -0,0 +1,119 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://github.com/mako10k/perttool/schemas/Perttool.CliError.v1.schema.json",
4
+ "title": "Perttool.CliError.v1",
5
+ "type": "object",
6
+ "required": [
7
+ "schema_version",
8
+ "cli_contract_version",
9
+ "tool_version",
10
+ "operation",
11
+ "ok",
12
+ "diagnostics"
13
+ ],
14
+ "properties": {
15
+ "schema_version": {
16
+ "const": "Perttool.CliError.v1"
17
+ },
18
+ "cli_contract_version": {
19
+ "const": 6
20
+ },
21
+ "tool_version": {
22
+ "type": "string"
23
+ },
24
+ "operation": {
25
+ "type": [
26
+ "string",
27
+ "null"
28
+ ]
29
+ },
30
+ "ok": {
31
+ "const": false
32
+ },
33
+ "help_target": {
34
+ "type": "object",
35
+ "required": [
36
+ "resource",
37
+ "action"
38
+ ],
39
+ "properties": {
40
+ "resource": {
41
+ "type": [
42
+ "string",
43
+ "null"
44
+ ]
45
+ },
46
+ "action": {
47
+ "type": [
48
+ "string",
49
+ "null"
50
+ ]
51
+ }
52
+ },
53
+ "additionalProperties": false
54
+ },
55
+ "usage": {
56
+ "type": "object",
57
+ "required": [
58
+ "kind",
59
+ "token",
60
+ "suggestion"
61
+ ],
62
+ "properties": {
63
+ "kind": {
64
+ "enum": [
65
+ "missing_resource",
66
+ "unknown_resource",
67
+ "missing_action",
68
+ "unknown_action",
69
+ "unknown_option",
70
+ "missing_option_value",
71
+ "unexpected_option_value",
72
+ "duplicate_option",
73
+ "invalid_option_value",
74
+ "missing_operand",
75
+ "extra_operand",
76
+ "missing_required_option",
77
+ "option_conflict",
78
+ "option_requires"
79
+ ]
80
+ },
81
+ "token": {
82
+ "$ref": "Perttool.Common.v1.schema.json#/$defs/nullableString"
83
+ },
84
+ "suggestion": {
85
+ "oneOf": [
86
+ {
87
+ "type": "object",
88
+ "required": [
89
+ "kind",
90
+ "value"
91
+ ],
92
+ "properties": {
93
+ "kind": {
94
+ "enum": [
95
+ "resource",
96
+ "action",
97
+ "option"
98
+ ]
99
+ },
100
+ "value": {
101
+ "type": "string"
102
+ }
103
+ },
104
+ "additionalProperties": false
105
+ },
106
+ {
107
+ "type": "null"
108
+ }
109
+ ]
110
+ }
111
+ },
112
+ "additionalProperties": false
113
+ },
114
+ "diagnostics": {
115
+ "$ref": "Perttool.Common.v1.schema.json#/$defs/diagnostics"
116
+ }
117
+ },
118
+ "additionalProperties": false
119
+ }
@@ -0,0 +1,377 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://github.com/mako10k/perttool/schemas/Perttool.CommandHelpResult.v1.schema.json",
4
+ "title": "Perttool.CommandHelpResult.v1",
5
+ "type": "object",
6
+ "required": [
7
+ "schema_version",
8
+ "cli_contract_version",
9
+ "tool_version",
10
+ "operation",
11
+ "ok",
12
+ "query",
13
+ "resources",
14
+ "commands",
15
+ "diagnostics"
16
+ ],
17
+ "properties": {
18
+ "schema_version": {
19
+ "const": "Perttool.CommandHelpResult.v1"
20
+ },
21
+ "cli_contract_version": {
22
+ "const": 6
23
+ },
24
+ "tool_version": {
25
+ "type": "string"
26
+ },
27
+ "operation": {
28
+ "const": "help"
29
+ },
30
+ "ok": {
31
+ "type": "boolean"
32
+ },
33
+ "query": {
34
+ "type": "object",
35
+ "required": [
36
+ "resource",
37
+ "action"
38
+ ],
39
+ "properties": {
40
+ "resource": {
41
+ "$ref": "Perttool.Common.v1.schema.json#/$defs/nullableString"
42
+ },
43
+ "action": {
44
+ "$ref": "Perttool.Common.v1.schema.json#/$defs/nullableString"
45
+ }
46
+ },
47
+ "additionalProperties": false
48
+ },
49
+ "resources": {
50
+ "type": "array",
51
+ "items": {
52
+ "type": "object",
53
+ "required": [
54
+ "name",
55
+ "summary",
56
+ "actions"
57
+ ],
58
+ "properties": {
59
+ "name": {
60
+ "type": "string"
61
+ },
62
+ "summary": {
63
+ "type": "string"
64
+ },
65
+ "actions": {
66
+ "$ref": "Perttool.Common.v1.schema.json#/$defs/stringArray"
67
+ }
68
+ },
69
+ "additionalProperties": false
70
+ }
71
+ },
72
+ "commands": {
73
+ "type": "array",
74
+ "items": {
75
+ "type": "object",
76
+ "required": [
77
+ "cli_contract_version",
78
+ "path",
79
+ "operation",
80
+ "summary",
81
+ "operands",
82
+ "options",
83
+ "input",
84
+ "output",
85
+ "stdin",
86
+ "effect",
87
+ "result_schemas",
88
+ "exit_statuses",
89
+ "examples"
90
+ ],
91
+ "properties": {
92
+ "cli_contract_version": {
93
+ "const": 6
94
+ },
95
+ "path": {
96
+ "type": "array",
97
+ "items": {
98
+ "type": "string"
99
+ },
100
+ "minItems": 1,
101
+ "maxItems": 2
102
+ },
103
+ "operation": {
104
+ "type": "string"
105
+ },
106
+ "summary": {
107
+ "type": "string"
108
+ },
109
+ "operands": {
110
+ "type": "array",
111
+ "items": {
112
+ "type": "object",
113
+ "required": [
114
+ "name",
115
+ "value_type",
116
+ "required",
117
+ "position"
118
+ ],
119
+ "properties": {
120
+ "name": {
121
+ "type": "string"
122
+ },
123
+ "value_type": {
124
+ "type": "string"
125
+ },
126
+ "required": {
127
+ "type": "boolean"
128
+ },
129
+ "position": {
130
+ "type": "integer",
131
+ "minimum": 0
132
+ }
133
+ },
134
+ "additionalProperties": false
135
+ }
136
+ },
137
+ "options": {
138
+ "type": "array",
139
+ "items": {
140
+ "type": "object",
141
+ "required": [
142
+ "name",
143
+ "kind",
144
+ "value_type",
145
+ "required",
146
+ "repeatable",
147
+ "default",
148
+ "enum_values",
149
+ "conflicts",
150
+ "requires",
151
+ "shared_group",
152
+ "description",
153
+ "spelling"
154
+ ],
155
+ "properties": {
156
+ "name": {
157
+ "type": "string"
158
+ },
159
+ "kind": {
160
+ "enum": [
161
+ "flag",
162
+ "value"
163
+ ]
164
+ },
165
+ "value_type": {
166
+ "$ref": "Perttool.Common.v1.schema.json#/$defs/nullableString"
167
+ },
168
+ "required": {
169
+ "type": "boolean"
170
+ },
171
+ "repeatable": {
172
+ "type": "boolean"
173
+ },
174
+ "default": {
175
+ "oneOf": [
176
+ {
177
+ "type": "string"
178
+ },
179
+ {
180
+ "type": "number"
181
+ },
182
+ {
183
+ "type": "boolean"
184
+ },
185
+ {
186
+ "type": "null"
187
+ }
188
+ ]
189
+ },
190
+ "enum_values": {
191
+ "$ref": "Perttool.Common.v1.schema.json#/$defs/stringArray"
192
+ },
193
+ "conflicts": {
194
+ "$ref": "Perttool.Common.v1.schema.json#/$defs/stringArray"
195
+ },
196
+ "requires": {
197
+ "$ref": "Perttool.Common.v1.schema.json#/$defs/stringArray"
198
+ },
199
+ "shared_group": {
200
+ "type": [
201
+ "string",
202
+ "null"
203
+ ],
204
+ "enum": [
205
+ "diagnostics",
206
+ "governance",
207
+ "guide",
208
+ "preview",
209
+ "result",
210
+ "write",
211
+ null
212
+ ]
213
+ },
214
+ "description": {
215
+ "$ref": "Perttool.Common.v1.schema.json#/$defs/nullableString"
216
+ },
217
+ "spelling": {
218
+ "type": "object",
219
+ "required": [
220
+ "cli",
221
+ "dsl",
222
+ "json"
223
+ ],
224
+ "properties": {
225
+ "cli": {
226
+ "type": "string"
227
+ },
228
+ "dsl": {
229
+ "$ref": "Perttool.Common.v1.schema.json#/$defs/nullableString"
230
+ },
231
+ "json": {
232
+ "type": "string"
233
+ }
234
+ },
235
+ "additionalProperties": false
236
+ }
237
+ },
238
+ "additionalProperties": false
239
+ }
240
+ },
241
+ "input": {
242
+ "enum": [
243
+ "none",
244
+ "document",
245
+ "artifact"
246
+ ]
247
+ },
248
+ "output": {
249
+ "type": "object",
250
+ "required": [
251
+ "formats",
252
+ "payload",
253
+ "file_effect"
254
+ ],
255
+ "properties": {
256
+ "formats": {
257
+ "type": "array",
258
+ "items": {
259
+ "enum": [
260
+ "text",
261
+ "json"
262
+ ]
263
+ },
264
+ "minItems": 1,
265
+ "uniqueItems": true
266
+ },
267
+ "payload": {
268
+ "enum": [
269
+ "result",
270
+ "candidate-document",
271
+ "artifact"
272
+ ]
273
+ },
274
+ "file_effect": {
275
+ "enum": [
276
+ "none",
277
+ "optional-create",
278
+ "optional-write-or-create"
279
+ ]
280
+ }
281
+ },
282
+ "additionalProperties": false
283
+ },
284
+ "stdin": {
285
+ "type": "object",
286
+ "required": [
287
+ "document",
288
+ "artifact",
289
+ "request",
290
+ "mutually_exclusive"
291
+ ],
292
+ "properties": {
293
+ "document": {
294
+ "type": "boolean"
295
+ },
296
+ "artifact": {
297
+ "type": "boolean"
298
+ },
299
+ "request": {
300
+ "type": "boolean"
301
+ },
302
+ "mutually_exclusive": {
303
+ "type": "boolean"
304
+ }
305
+ },
306
+ "additionalProperties": false
307
+ },
308
+ "effect": {
309
+ "enum": [
310
+ "read",
311
+ "preview",
312
+ "write-or-create"
313
+ ]
314
+ },
315
+ "result_schemas": {
316
+ "$ref": "Perttool.Common.v1.schema.json#/$defs/stringArray"
317
+ },
318
+ "exit_statuses": {
319
+ "type": "array",
320
+ "items": {
321
+ "type": "object",
322
+ "required": [
323
+ "code",
324
+ "meaning"
325
+ ],
326
+ "properties": {
327
+ "code": {
328
+ "enum": [
329
+ 0,
330
+ 1,
331
+ 2,
332
+ 3,
333
+ 4,
334
+ 5,
335
+ 70
336
+ ]
337
+ },
338
+ "meaning": {
339
+ "type": "string"
340
+ }
341
+ },
342
+ "additionalProperties": false
343
+ }
344
+ },
345
+ "examples": {
346
+ "type": "array",
347
+ "items": {
348
+ "type": "object",
349
+ "required": [
350
+ "id",
351
+ "invocation",
352
+ "summary"
353
+ ],
354
+ "properties": {
355
+ "id": {
356
+ "type": "string"
357
+ },
358
+ "invocation": {
359
+ "type": "string"
360
+ },
361
+ "summary": {
362
+ "type": "string"
363
+ }
364
+ },
365
+ "additionalProperties": false
366
+ }
367
+ }
368
+ },
369
+ "additionalProperties": false
370
+ }
371
+ },
372
+ "diagnostics": {
373
+ "$ref": "Perttool.Common.v1.schema.json#/$defs/diagnostics"
374
+ }
375
+ },
376
+ "additionalProperties": false
377
+ }