perttool 0.5.0 → 0.5.1

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 +20 -1
  2. package/README.md +51 -28
  3. package/dist/cli.js +24 -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 +68 -11
  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 +36 -0
  17. package/dist/schema/registry.d.ts.map +1 -0
  18. package/dist/schema/registry.js +156 -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 +152 -0
  24. package/schemas/Perttool.AnalysisResult.v4.schema.json +124 -0
  25. package/schemas/Perttool.CheckResult.v3.schema.json +159 -0
  26. package/schemas/Perttool.CliError.v1.schema.json +83 -0
  27. package/schemas/Perttool.CommandHelpResult.v1.schema.json +165 -0
  28. package/schemas/Perttool.Common.v1.schema.json +508 -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 +104 -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 +143 -0
  35. package/schemas/Perttool.NextResult.v5.schema.json +139 -0
  36. package/schemas/Perttool.OverrideDecision.v1.schema.json +170 -0
  37. package/schemas/Perttool.ProjectHistoryResult.v1.schema.json +139 -0
  38. package/schemas/Perttool.ProjectResult.v3.schema.json +144 -0
  39. package/schemas/Perttool.SchemaResult.v1.schema.json +84 -0
  40. package/schemas/Perttool.UnitMigrationResult.v3.schema.json +205 -0
  41. package/schemas/Perttool.VelocityObservationResult.v1.schema.json +102 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "perttool",
3
- "version": "0.5.0",
3
+ "version": "0.5.1",
4
4
  "description": "Document-based PERT/CPM and resource scheduling CLI",
5
5
  "keywords": [
6
6
  "pert",
@@ -26,6 +26,7 @@
26
26
  "type": "module",
27
27
  "files": [
28
28
  "dist",
29
+ "schemas",
29
30
  "CHANGELOG.md"
30
31
  ],
31
32
  "bin": {
@@ -37,7 +38,8 @@
37
38
  ".": {
38
39
  "types": "./dist/index.d.ts",
39
40
  "import": "./dist/index.js"
40
- }
41
+ },
42
+ "./schemas/*": "./schemas/*"
41
43
  },
42
44
  "engines": {
43
45
  "node": ">=22"
@@ -57,6 +59,7 @@
57
59
  },
58
60
  "devDependencies": {
59
61
  "@types/node": "22.20.1",
62
+ "ajv": "^8.20.0",
60
63
  "typescript": "7.0.2"
61
64
  }
62
65
  }
@@ -0,0 +1,152 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://github.com/mako10k/perttool/schemas/Perttool.AgentGuidanceResult.v1.schema.json",
4
+ "title": "Perttool.AgentGuidanceResult.v1",
5
+ "type": "object",
6
+ "required": [
7
+ "schema_version",
8
+ "cli_contract_version",
9
+ "guidance_interface_version",
10
+ "profile_schema_version",
11
+ "profile_data_version",
12
+ "guidance_taxonomy_version",
13
+ "risk_taxonomy_version",
14
+ "description_registry_version",
15
+ "description_locale",
16
+ "staleness_policy_version",
17
+ "tool_version",
18
+ "operation",
19
+ "ok",
20
+ "profile_digest",
21
+ "snapshot_as_of",
22
+ "query",
23
+ "providers",
24
+ "guidance_records",
25
+ "risk_records",
26
+ "sources",
27
+ "capabilities",
28
+ "diagnostics"
29
+ ],
30
+ "properties": {
31
+ "schema_version": {
32
+ "const": "Perttool.AgentGuidanceResult.v1"
33
+ },
34
+ "cli_contract_version": {
35
+ "const": 6
36
+ },
37
+ "guidance_interface_version": {
38
+ "const": 1
39
+ },
40
+ "profile_schema_version": {
41
+ "type": "string"
42
+ },
43
+ "profile_data_version": {
44
+ "type": "integer",
45
+ "minimum": 1
46
+ },
47
+ "guidance_taxonomy_version": {
48
+ "type": "integer",
49
+ "minimum": 1
50
+ },
51
+ "risk_taxonomy_version": {
52
+ "type": "integer",
53
+ "minimum": 1
54
+ },
55
+ "description_registry_version": {
56
+ "type": "integer",
57
+ "minimum": 1
58
+ },
59
+ "description_locale": {
60
+ "const": "en"
61
+ },
62
+ "staleness_policy_version": {
63
+ "type": "integer",
64
+ "minimum": 1
65
+ },
66
+ "tool_version": {
67
+ "type": "string"
68
+ },
69
+ "operation": {
70
+ "const": "agent.help"
71
+ },
72
+ "ok": {
73
+ "type": "boolean"
74
+ },
75
+ "profile_digest": {
76
+ "$ref": "Perttool.Common.v1.schema.json#/$defs/digest"
77
+ },
78
+ "snapshot_as_of": {
79
+ "type": "string"
80
+ },
81
+ "query": {
82
+ "type": "object"
83
+ },
84
+ "providers": {
85
+ "type": "array",
86
+ "items": {
87
+ "type": "object"
88
+ }
89
+ },
90
+ "guidance_records": {
91
+ "type": "array",
92
+ "items": {
93
+ "type": "object"
94
+ }
95
+ },
96
+ "risk_records": {
97
+ "type": "array",
98
+ "items": {
99
+ "type": "object"
100
+ }
101
+ },
102
+ "sources": {
103
+ "type": "array",
104
+ "items": {
105
+ "type": "object"
106
+ }
107
+ },
108
+ "capabilities": {
109
+ "type": "object",
110
+ "required": [
111
+ "reads_project_files",
112
+ "writes_files",
113
+ "executes_hooks",
114
+ "executes_commands",
115
+ "accesses_network",
116
+ "reads_provider_state",
117
+ "writes_provider_state"
118
+ ],
119
+ "properties": {
120
+ "reads_project_files": {
121
+ "type": "boolean"
122
+ },
123
+ "writes_files": {
124
+ "type": "boolean"
125
+ },
126
+ "executes_hooks": {
127
+ "type": "boolean"
128
+ },
129
+ "executes_commands": {
130
+ "type": "boolean"
131
+ },
132
+ "accesses_network": {
133
+ "type": "boolean"
134
+ },
135
+ "reads_provider_state": {
136
+ "type": "boolean"
137
+ },
138
+ "writes_provider_state": {
139
+ "type": "boolean"
140
+ }
141
+ },
142
+ "additionalProperties": false
143
+ },
144
+ "diagnostics": {
145
+ "type": "array",
146
+ "items": {
147
+ "type": "object"
148
+ }
149
+ }
150
+ },
151
+ "additionalProperties": false
152
+ }
@@ -0,0 +1,124 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://github.com/mako10k/perttool/schemas/Perttool.AnalysisResult.v4.schema.json",
4
+ "title": "Perttool.AnalysisResult.v4",
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
+ "task_actuals",
19
+ "mode",
20
+ "precision",
21
+ "precedence",
22
+ "resource",
23
+ "temporal"
24
+ ],
25
+ "properties": {
26
+ "schema_version": {
27
+ "const": "Perttool.AnalysisResult.v4"
28
+ },
29
+ "cli_contract_version": {
30
+ "const": 6
31
+ },
32
+ "tool_version": {
33
+ "type": "string"
34
+ },
35
+ "operation": {
36
+ "const": "dag.analyze"
37
+ },
38
+ "ok": {
39
+ "type": "boolean"
40
+ },
41
+ "document_id": {
42
+ "$ref": "Perttool.Common.v1.schema.json#/$defs/nullableString"
43
+ },
44
+ "source": {
45
+ "type": "string"
46
+ },
47
+ "source_digest": {
48
+ "$ref": "Perttool.Common.v1.schema.json#/$defs/digest"
49
+ },
50
+ "diagnostics": {
51
+ "$ref": "Perttool.Common.v1.schema.json#/$defs/diagnostics"
52
+ },
53
+ "diagnostics_truncated": {
54
+ "type": "boolean"
55
+ },
56
+ "grammar_version": {
57
+ "type": [
58
+ "integer",
59
+ "null"
60
+ ],
61
+ "minimum": 1,
62
+ "maximum": 5
63
+ },
64
+ "task_actuals": {
65
+ "type": "array",
66
+ "items": {
67
+ "type": "object"
68
+ }
69
+ },
70
+ "mode": {
71
+ "enum": [
72
+ "precedence",
73
+ "resource",
74
+ "both"
75
+ ]
76
+ },
77
+ "precision": {
78
+ "type": "integer",
79
+ "minimum": 0,
80
+ "maximum": 9
81
+ },
82
+ "duration_unit": {
83
+ "enum": [
84
+ "day",
85
+ "hour",
86
+ "point"
87
+ ]
88
+ },
89
+ "critical_epsilon": {
90
+ "type": "object"
91
+ },
92
+ "velocity": {
93
+ "type": [
94
+ "object",
95
+ "null"
96
+ ]
97
+ },
98
+ "velocity_forecast": {
99
+ "type": [
100
+ "object",
101
+ "null"
102
+ ]
103
+ },
104
+ "precedence": {
105
+ "type": [
106
+ "object",
107
+ "null"
108
+ ]
109
+ },
110
+ "resource": {
111
+ "type": [
112
+ "object",
113
+ "null"
114
+ ]
115
+ },
116
+ "temporal": {
117
+ "type": [
118
+ "object",
119
+ "null"
120
+ ]
121
+ }
122
+ },
123
+ "additionalProperties": false
124
+ }
@@ -0,0 +1,159 @@
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
+ }
125
+ },
126
+ "task_constraints": {
127
+ "type": "array",
128
+ "items": {
129
+ "type": "object"
130
+ }
131
+ }
132
+ },
133
+ "additionalProperties": false
134
+ },
135
+ "actuals_inputs": {
136
+ "type": [
137
+ "object",
138
+ "null"
139
+ ],
140
+ "required": [
141
+ "model_version",
142
+ "events"
143
+ ],
144
+ "properties": {
145
+ "model_version": {
146
+ "const": 1
147
+ },
148
+ "events": {
149
+ "type": "array",
150
+ "items": {
151
+ "$ref": "Perttool.Common.v1.schema.json#/$defs/workEvent"
152
+ }
153
+ }
154
+ },
155
+ "additionalProperties": false
156
+ }
157
+ },
158
+ "additionalProperties": false
159
+ }
@@ -0,0 +1,83 @@
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
+ "type": "string"
65
+ },
66
+ "token": {
67
+ "$ref": "Perttool.Common.v1.schema.json#/$defs/nullableString"
68
+ },
69
+ "suggestion": {
70
+ "type": [
71
+ "object",
72
+ "null"
73
+ ]
74
+ }
75
+ },
76
+ "additionalProperties": false
77
+ },
78
+ "diagnostics": {
79
+ "$ref": "Perttool.Common.v1.schema.json#/$defs/diagnostics"
80
+ }
81
+ },
82
+ "additionalProperties": false
83
+ }
@@ -0,0 +1,165 @@
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
+ }
114
+ },
115
+ "options": {
116
+ "type": "array",
117
+ "items": {
118
+ "type": "object"
119
+ }
120
+ },
121
+ "input": {
122
+ "enum": [
123
+ "none",
124
+ "document",
125
+ "artifact"
126
+ ]
127
+ },
128
+ "output": {
129
+ "type": "object"
130
+ },
131
+ "stdin": {
132
+ "type": "object"
133
+ },
134
+ "effect": {
135
+ "enum": [
136
+ "read",
137
+ "preview",
138
+ "write-or-create"
139
+ ]
140
+ },
141
+ "result_schemas": {
142
+ "$ref": "Perttool.Common.v1.schema.json#/$defs/stringArray"
143
+ },
144
+ "exit_statuses": {
145
+ "type": "array",
146
+ "items": {
147
+ "type": "object"
148
+ }
149
+ },
150
+ "examples": {
151
+ "type": "array",
152
+ "items": {
153
+ "type": "object"
154
+ }
155
+ }
156
+ },
157
+ "additionalProperties": false
158
+ }
159
+ },
160
+ "diagnostics": {
161
+ "$ref": "Perttool.Common.v1.schema.json#/$defs/diagnostics"
162
+ }
163
+ },
164
+ "additionalProperties": false
165
+ }