@gtrabanco/agentic-workflow-schema 2.0.0 → 2.1.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/README.es.md CHANGED
@@ -103,6 +103,7 @@ forma libre, cualquier valor del tipo indicado.
103
103
  | `next.recommended` | string | abierto (una invocación de skill) | El único mejor comando siguiente. |
104
104
  | `next.alternatives[]` | array de string | abierto | Las otras elecciones defendibles. |
105
105
  | `next.tier` | enum | **cerrado** — `strong` · `cheap` | Qué clase de modelo merece el siguiente paso — juicio vs. mecánico. |
106
+ | `next.suggested[]` | array de objetos, opcional | items: `command`/`trigger`/`source_skill` (todos strings abiertos) | Sugerencias atribuidas a un disparador (solo `workflow-status`) — cada entrada nombra el comando, la condición exacta que lo disparó, y la skill dueña de esa condición; con fuente única, nunca una segunda copia de la lógica del disparador. Ausente en sobres que no lo emiten. |
106
107
  | `detail` | any | abierto (específico de la skill) | Carga útil por skill — p. ej. `workflow-status` lleva aquí el árbol completo del proyecto (`features`, `fixes`, `startable_now`, `blocked_units`, `crash_recovery`, …). |
107
108
 
108
109
  ### La tabla de enrutamiento de `state` (cerrada — exactamente estos 11)
@@ -198,3 +199,8 @@ repositorio: cambio disruptivo del esquema (clave eliminada/renombrada,
198
199
  estado eliminado) → major; aditivo (clave opcional nueva, estado nuevo) →
199
200
  minor; arreglos/docs → patch. Cuando cambia la skill
200
201
  `orchestration-envelope`, este paquete cambia en el mismo PR.
202
+
203
+ **2.1.0** — aditivo, minor: `next.suggested[]` opcional (ver la tabla de
204
+ campos arriba), publicado junto con la exposición de señales de driver de
205
+ `workflow-status` (fix #79). Ninguna clave requerida cambió; los sobres
206
+ antiguos sin este campo siguen validando.
package/README.md CHANGED
@@ -99,6 +99,7 @@ rejects anything else); **open** = free-form, any value of the stated type.
99
99
  | `next.recommended` | string | open (a skill invocation) | The single best next command. |
100
100
  | `next.alternatives[]` | string array | open | The other defensible choices. |
101
101
  | `next.tier` | enum | **closed** — `strong` · `cheap` | Which model class the next step deserves — judgment vs mechanical. |
102
+ | `next.suggested[]` | object array, optional | items: `command`/`trigger`/`source_skill` (all open strings) | Trigger-attributed suggestions (`workflow-status` only) — each entry names the command, the exact condition that fired it, and the skill that owns that condition; single-sourced, never a second copy of the trigger logic. Absent on envelopes that don't emit it. |
102
103
  | `detail` | any | open (skill-specific) | Per-skill payload — e.g. `workflow-status` carries the full project tree (`features`, `fixes`, `startable_now`, `blocked_units`, `crash_recovery`, …) here. |
103
104
 
104
105
  ### The `state` routing table (closed — exactly these 11)
@@ -189,3 +190,7 @@ This package's semver tracks the **envelope contract**, not the repo:
189
190
  breaking schema change (key removed/renamed, state removed) → major;
190
191
  additive (new optional key, new state) → minor; fixes/docs → patch. When the
191
192
  `orchestration-envelope` skill changes, this package changes in the same PR.
193
+
194
+ **2.1.0** — additive minor: optional `next.suggested[]` (see the field table
195
+ above), landed with `workflow-status`'s driver-signal exposure (fix #79). No
196
+ required key changed; older envelopes without the field still validate.
package/dist/index.d.ts CHANGED
@@ -81,10 +81,17 @@ export interface EnvelopeNeedsInput {
81
81
  question: string;
82
82
  options: string[];
83
83
  }
84
+ export interface EnvelopeSuggestion {
85
+ command: string;
86
+ trigger: string;
87
+ source_skill: string;
88
+ }
84
89
  export interface EnvelopeNext {
85
90
  recommended: string;
86
91
  alternatives: string[];
87
92
  tier: Tier;
93
+ /** Optional trigger-attributed suggestions (workflow-status only). */
94
+ suggested?: EnvelopeSuggestion[];
88
95
  }
89
96
  export interface Envelope {
90
97
  skill: string;
package/dist/index.js CHANGED
@@ -273,6 +273,25 @@ export function validateEnvelope(value) {
273
273
  if (value.next.tier !== "strong" && value.next.tier !== "cheap") {
274
274
  errors.push(`next.tier must be strong|cheap (got: ${String(value.next.tier)})`);
275
275
  }
276
+ if (value.next.suggested !== undefined) {
277
+ if (!Array.isArray(value.next.suggested)) {
278
+ errors.push("next.suggested must be an array when present");
279
+ }
280
+ else {
281
+ value.next.suggested.forEach((s, i) => {
282
+ if (!isObj(s)) {
283
+ errors.push(`next.suggested[${i}] must be an object`);
284
+ return;
285
+ }
286
+ if (typeof s.command !== "string")
287
+ errors.push(`next.suggested[${i}].command must be a string`);
288
+ if (typeof s.trigger !== "string")
289
+ errors.push(`next.suggested[${i}].trigger must be a string`);
290
+ if (typeof s.source_skill !== "string")
291
+ errors.push(`next.suggested[${i}].source_skill must be a string`);
292
+ });
293
+ }
294
+ }
276
295
  }
277
296
  if (value.needs_input !== null && value.needs_input !== undefined) {
278
297
  if (!isObj(value.needs_input) ||
@@ -152,7 +152,19 @@
152
152
  "properties": {
153
153
  "recommended": { "type": "string" },
154
154
  "alternatives": { "type": "array", "items": { "type": "string" } },
155
- "tier": { "enum": ["strong", "cheap"] }
155
+ "tier": { "enum": ["strong", "cheap"] },
156
+ "suggested": {
157
+ "type": "array",
158
+ "items": {
159
+ "type": "object",
160
+ "required": ["command", "trigger", "source_skill"],
161
+ "properties": {
162
+ "command": { "type": "string" },
163
+ "trigger": { "type": "string" },
164
+ "source_skill": { "type": "string" }
165
+ }
166
+ }
167
+ }
156
168
  }
157
169
  },
158
170
  "detail": {}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gtrabanco/agentic-workflow-schema",
3
- "version": "2.0.0",
3
+ "version": "2.1.0",
4
4
  "description": "Types, JSON Schema, and parser/validator for the agentic-workflow machine envelope — the fixed JSON block a driven agent turn ends with (workflow-status always; other skills under the driver-injected snippet), for programmatic orchestration.",
5
5
  "keywords": [
6
6
  "agentic-workflow",