@pmelab/gtd 3.0.0 → 3.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/schema.json CHANGED
@@ -4,12 +4,111 @@
4
4
  "required": [],
5
5
  "properties": {
6
6
  "workflow": {
7
- "$id": "/schemas/unknown",
8
- "title": "unknown"
7
+ "type": "object",
8
+ "description": "The whole machine definition: named states (plus the workflow's own vars: defaults). Compiled and validated by gtd at load time; content strings starting with ./ or ../ are file references inlined from the config file's directory.",
9
+ "additionalProperties": false,
10
+ "required": ["states"],
11
+ "properties": {
12
+ "vars": {
13
+ "type": "object",
14
+ "description": "Flat name -> scalar map merged into every template's it.vars. Scalars are coerced to strings.",
15
+ "additionalProperties": {
16
+ "type": ["string", "number", "boolean"]
17
+ }
18
+ },
19
+ "states": {
20
+ "type": "object",
21
+ "description": "The workflow's named states. At least one; exactly one with initial: true.",
22
+ "minProperties": 1,
23
+ "additionalProperties": {
24
+ "type": "object",
25
+ "description": "One workflow state. Declare exactly one content kind (script/prompt/message/commit). A commit state is final: no actor, no on.",
26
+ "additionalProperties": false,
27
+ "properties": {
28
+ "actor": {
29
+ "type": "string",
30
+ "description": "Who acts at this state. Required on every non-commit state; forbidden on a commit state."
31
+ },
32
+ "script": {
33
+ "type": "string",
34
+ "description": "Content kind: a shell script (Eta template). `gtd run` executes it verbatim via bash, then steps this state's actor."
35
+ },
36
+ "prompt": {
37
+ "type": "string",
38
+ "description": "Content kind: an agent prompt (Eta template), emitted by `gtd next`."
39
+ },
40
+ "message": {
41
+ "type": "string",
42
+ "description": "Content kind: a human-facing message (Eta template), emitted by `gtd next`."
43
+ },
44
+ "commit": {
45
+ "type": "string",
46
+ "description": "Content kind: entering this state ends the process by squashing it into one commit with this message (Eta template). Final — no actor, no on."
47
+ },
48
+ "on": {
49
+ "type": "object",
50
+ "description": "Ordered map of change pattern -> target state. Patterns: \"C\" (clean tree) or \"<A|M|D|*> <glob>\" over the pending diff; first declared match wins. Every target must name a defined state, and every non-initial state must be reachable through these edges (or a retry.otherwise).",
51
+ "additionalProperties": {
52
+ "type": "string"
53
+ }
54
+ },
55
+ "initial": {
56
+ "type": "boolean",
57
+ "description": "Exactly one state in the workflow must declare initial: true (and it must not be a commit state)."
58
+ },
59
+ "retry": {
60
+ "type": "object",
61
+ "description": "Redirect transitions INTO this state once it has been entered `max` times in the current process.",
62
+ "additionalProperties": false,
63
+ "required": ["max", "otherwise"],
64
+ "properties": {
65
+ "max": {
66
+ "type": "integer",
67
+ "minimum": 0,
68
+ "description": "Entries allowed this process before redirecting."
69
+ },
70
+ "otherwise": {
71
+ "type": "string",
72
+ "description": "Defined state to redirect to once over the cap."
73
+ }
74
+ }
75
+ },
76
+ "model": {
77
+ "type": "string",
78
+ "description": "Opaque harness hint passed through `gtd next --json`/`gtd status --json` (e.g. \"smart\"). Never interpreted by gtd. Forbidden on a commit state."
79
+ },
80
+ "file": {
81
+ "type": "string",
82
+ "description": "The state's steering file: an Eta template naming the file a human/editor should look at while the machine rests here. Forbidden on a commit state."
83
+ },
84
+ "mode": {
85
+ "type": "string",
86
+ "enum": ["qa", "review"],
87
+ "description": "The steering file's format, dispatched on by the LSP. Requires a sibling `file:`. Forbidden on a commit state."
88
+ },
89
+ "reviewWindow": {
90
+ "type": "boolean",
91
+ "description": "When true, gtd opens a review checkout window while the machine rests here — HEAD/index are rewound to the review base so the whole base..HEAD diff surfaces as uncommitted changes in the editor. Forbidden on a commit state."
92
+ },
93
+ "reviewBase": {
94
+ "type": "boolean",
95
+ "description": "Marks the state whose most-recent in-process commit anchors the review window's diff base; absent any, the base is the process start. Forbidden on a commit state."
96
+ }
97
+ }
98
+ }
99
+ }
100
+ }
9
101
  },
10
102
  "vars": {
11
- "$id": "/schemas/unknown",
12
- "title": "unknown"
103
+ "type": "object",
104
+ "description": "Flat name -> scalar map merged into every template's it.vars. Scalars are coerced to strings.",
105
+ "additionalProperties": {
106
+ "type": ["string", "number", "boolean"]
107
+ }
108
+ },
109
+ "$schema": {
110
+ "type": "string",
111
+ "description": "Editor-only pointer at this schema. Stripped by gtd before validation."
13
112
  }
14
113
  },
15
114
  "additionalProperties": false