@nac3/forge-cli 1.0.56 → 1.0.58
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/dist/chat/flow_bpmn.d.ts +73 -0
- package/dist/chat/flow_bpmn.d.ts.map +1 -0
- package/dist/chat/flow_bpmn.js +229 -0
- package/dist/chat/flow_bpmn.js.map +1 -0
- package/dist/chat/server.d.ts.map +1 -1
- package/dist/chat/server.js +21 -0
- package/dist/chat/server.js.map +1 -1
- package/dist/chat/tools/pizarron.d.ts.map +1 -1
- package/dist/chat/tools/pizarron.js +22 -2
- package/dist/chat/tools/pizarron.js.map +1 -1
- package/dist/docs/doctrine/pizarron.md +22 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/docs/doctrine/pizarron.md +22 -0
- package/package.json +115 -115
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* flow_bpmn.ts -- server-side enforcement of the pizarron KIND SELECTION rule
|
|
3
|
+
* for process/flow diagrams.
|
|
4
|
+
*
|
|
5
|
+
* Problem (Pablo, 2026-07-04): even though the always-on doctrine digest AND
|
|
6
|
+
* the create-tab verb description AND the pizarron doctrine all say "a FLUJO /
|
|
7
|
+
* proceso / flowchart -> kind=bpmn, NEVER kind=graph", some brains keep
|
|
8
|
+
* creating a process as kind='graph' -- a force-directed node web that looks
|
|
9
|
+
* awful for an ordered flow. The instruction is already there and the model
|
|
10
|
+
* ignores it, so more prompt text will not fix it. We enforce it server-side.
|
|
11
|
+
*
|
|
12
|
+
* TWO layers (the "combo"):
|
|
13
|
+
* B (nudge) -- the FIRST time a graph-for-a-flow arrives, we REJECT the tab
|
|
14
|
+
* with a precise tool-result telling the brain to re-create it
|
|
15
|
+
* as kind='bpmn' (native BPMN: proper events / gateways /
|
|
16
|
+
* lanes). Most brains comply in the same tool-calling loop.
|
|
17
|
+
* A (safety) -- if the brain RESENDS the same graph (reincidence) instead of
|
|
18
|
+
* obeying, we deterministically convert {nodes,edges} into a
|
|
19
|
+
* BPMN {nodes,flows} model and render it. No LLM round-trip,
|
|
20
|
+
* so the user NEVER ends up with an ugly flow, whatever the
|
|
21
|
+
* brain does.
|
|
22
|
+
*
|
|
23
|
+
* Detection does NOT rely only on flow-words in the title: a broadened title
|
|
24
|
+
* lexicon PLUS a structural test (a graph that is an acyclic, sparse, ordered
|
|
25
|
+
* sequence -- or has labelled decision branches -- reads as a flow even when
|
|
26
|
+
* the title has no flow-word, e.g. "Alta de cliente"). Real relationship /
|
|
27
|
+
* dependency graphs (title says grafo / relaciones / dependencias / organigrama
|
|
28
|
+
* / entidad-relacion, or the structure is a dense web) are left untouched.
|
|
29
|
+
*
|
|
30
|
+
* ASCII-only.
|
|
31
|
+
*/
|
|
32
|
+
/** Does the tab title read like a process/flow request? */
|
|
33
|
+
export declare function looksLikeFlowTitle(title: string): boolean;
|
|
34
|
+
/** True when the graph STRUCTURE reads like an ordered flow even if the title
|
|
35
|
+
* is neutral: acyclic + sparse + (a simple chain OR a labelled decision OR at
|
|
36
|
+
* least one labelled edge). A dense or cyclic web returns false. */
|
|
37
|
+
export declare function graphLooksLikeFlow(content: string): boolean;
|
|
38
|
+
/** Combined decision: is this graph tab actually a process/flow? Title veto
|
|
39
|
+
* (relationship words) wins; then flow-words; then structure. */
|
|
40
|
+
export declare function isFlowContext(title: string, content: string): boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Convert a graph `{nodes,edges}` JSON string into a BPMN `{nodes,flows}` JSON
|
|
43
|
+
* string. Returns null when the content is not a parseable, connected graph.
|
|
44
|
+
* Heuristics: source node -> preceded by a synthetic startEvent; sink -> a
|
|
45
|
+
* synthetic endEvent; node with 2+ outgoing AND a labelled branch -> exclusive
|
|
46
|
+
* gateway; everything else -> task.
|
|
47
|
+
*/
|
|
48
|
+
export declare function graphToBpmn(content: string): string | null;
|
|
49
|
+
/** The nudge shown to the brain when it draws a flow as a graph. */
|
|
50
|
+
export declare const FLOW_NUDGE_MESSAGE: string;
|
|
51
|
+
/** For tests: forget every remembered nudge. */
|
|
52
|
+
export declare function _resetFlowNudges(): void;
|
|
53
|
+
export type FlowDecision = {
|
|
54
|
+
action: 'passthrough';
|
|
55
|
+
} | {
|
|
56
|
+
action: 'reject';
|
|
57
|
+
message: string;
|
|
58
|
+
} | {
|
|
59
|
+
action: 'convert';
|
|
60
|
+
kind: 'bpmn';
|
|
61
|
+
content: string;
|
|
62
|
+
};
|
|
63
|
+
/**
|
|
64
|
+
* Decide what to do with a create-tab. Passthrough for anything that is not a
|
|
65
|
+
* graph-drawn flow. For a graph-drawn flow: nudge the brain to redo it as BPMN
|
|
66
|
+
* the first time (B); on reincidence, convert it deterministically (A).
|
|
67
|
+
*/
|
|
68
|
+
export declare function decideFlowTab(input: {
|
|
69
|
+
kind: string;
|
|
70
|
+
content: string;
|
|
71
|
+
title?: string;
|
|
72
|
+
}): FlowDecision;
|
|
73
|
+
//# sourceMappingURL=flow_bpmn.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flow_bpmn.d.ts","sourceRoot":"","sources":["../../src/chat/flow_bpmn.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAiCH,2DAA2D;AAC3D,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAIzD;AA+BD;;qEAEqE;AACrE,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAqB3D;AAoBD;kEACkE;AAClE,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAKrE;AAOD;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAiC1D;AAID,oEAAoE;AACpE,eAAO,MAAM,kBAAkB,QAM6E,CAAC;AAgB7G,gDAAgD;AAChD,wBAAgB,gBAAgB,IAAI,IAAI,CAAoB;AAE5D,MAAM,MAAM,YAAY,GACpB;IAAE,MAAM,EAAE,aAAa,CAAA;CAAE,GACzB;IAAE,MAAM,EAAE,QAAQ,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GACrC;IAAE,MAAM,EAAE,SAAS,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAEzD;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,YAAY,CAUpG"}
|
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* flow_bpmn.ts -- server-side enforcement of the pizarron KIND SELECTION rule
|
|
3
|
+
* for process/flow diagrams.
|
|
4
|
+
*
|
|
5
|
+
* Problem (Pablo, 2026-07-04): even though the always-on doctrine digest AND
|
|
6
|
+
* the create-tab verb description AND the pizarron doctrine all say "a FLUJO /
|
|
7
|
+
* proceso / flowchart -> kind=bpmn, NEVER kind=graph", some brains keep
|
|
8
|
+
* creating a process as kind='graph' -- a force-directed node web that looks
|
|
9
|
+
* awful for an ordered flow. The instruction is already there and the model
|
|
10
|
+
* ignores it, so more prompt text will not fix it. We enforce it server-side.
|
|
11
|
+
*
|
|
12
|
+
* TWO layers (the "combo"):
|
|
13
|
+
* B (nudge) -- the FIRST time a graph-for-a-flow arrives, we REJECT the tab
|
|
14
|
+
* with a precise tool-result telling the brain to re-create it
|
|
15
|
+
* as kind='bpmn' (native BPMN: proper events / gateways /
|
|
16
|
+
* lanes). Most brains comply in the same tool-calling loop.
|
|
17
|
+
* A (safety) -- if the brain RESENDS the same graph (reincidence) instead of
|
|
18
|
+
* obeying, we deterministically convert {nodes,edges} into a
|
|
19
|
+
* BPMN {nodes,flows} model and render it. No LLM round-trip,
|
|
20
|
+
* so the user NEVER ends up with an ugly flow, whatever the
|
|
21
|
+
* brain does.
|
|
22
|
+
*
|
|
23
|
+
* Detection does NOT rely only on flow-words in the title: a broadened title
|
|
24
|
+
* lexicon PLUS a structural test (a graph that is an acyclic, sparse, ordered
|
|
25
|
+
* sequence -- or has labelled decision branches -- reads as a flow even when
|
|
26
|
+
* the title has no flow-word, e.g. "Alta de cliente"). Real relationship /
|
|
27
|
+
* dependency graphs (title says grafo / relaciones / dependencias / organigrama
|
|
28
|
+
* / entidad-relacion, or the structure is a dense web) are left untouched.
|
|
29
|
+
*
|
|
30
|
+
* ASCII-only.
|
|
31
|
+
*/
|
|
32
|
+
/* ------------------------------- detection ------------------------------- */
|
|
33
|
+
/** Title reads like an ordered process/flow. Broad on purpose (Pablo asked to
|
|
34
|
+
* catch "flow / chart / grafico de procesos / etc"). */
|
|
35
|
+
const FLOW_TITLE_RE = new RegExp('\\b(' + [
|
|
36
|
+
'flujo', 'flujos', 'flujograma', 'flow', 'flow\\s*chart', 'flowchart',
|
|
37
|
+
'cursograma', 'chart', 'proceso', 'procesos', 'process', 'procedimiento',
|
|
38
|
+
'procedimientos', 'workflow', 'work\\s*flow', 'circuito', 'pipeline',
|
|
39
|
+
'secuencia', 'sequence', 'paso', 'pasos', 'steps', 'etapa', 'etapas',
|
|
40
|
+
'fase', 'fases', 'ciclo', 'tramite', 'bpmn', 'journey', 'recorrido',
|
|
41
|
+
'itinerario', 'ruta', 'diagrama de (flujo|proceso|procesos)',
|
|
42
|
+
'grafico de (proceso|procesos)', 'mapa de (proceso|procesos)',
|
|
43
|
+
].join('|') + ')\\b', 'i');
|
|
44
|
+
/** Title clearly names a relationship / dependency / hierarchy graph -- these
|
|
45
|
+
* are NOT flows and must never be promoted. Checked BEFORE FLOW_TITLE_RE. */
|
|
46
|
+
const RELATION_TITLE_RE = new RegExp('\\b(' + [
|
|
47
|
+
'grafo', 'relaciones', 'relacion', 'relación', 'dependencias', 'dependencia',
|
|
48
|
+
'dependency', 'dependencies', 'relationship', 'network', 'red de',
|
|
49
|
+
'topologia', 'topología', 'topology', 'entidad[- ]relacion',
|
|
50
|
+
'entity[- ]relationship', 'er\\s*diagram', 'organigrama', 'org\\s*chart',
|
|
51
|
+
'organization\\s*chart', 'jerarquia', 'jerarquía', 'hierarchy',
|
|
52
|
+
'mapa mental', 'mind\\s*map', 'que usa (que|a que)',
|
|
53
|
+
].join('|') + ')\\b', 'i');
|
|
54
|
+
/** Does the tab title read like a process/flow request? */
|
|
55
|
+
export function looksLikeFlowTitle(title) {
|
|
56
|
+
const t = String(title || '');
|
|
57
|
+
if (RELATION_TITLE_RE.test(t))
|
|
58
|
+
return false;
|
|
59
|
+
return FLOW_TITLE_RE.test(t);
|
|
60
|
+
}
|
|
61
|
+
function parseGraph(content) {
|
|
62
|
+
let g;
|
|
63
|
+
try {
|
|
64
|
+
g = JSON.parse(content);
|
|
65
|
+
}
|
|
66
|
+
catch {
|
|
67
|
+
return null;
|
|
68
|
+
}
|
|
69
|
+
if (!g || !Array.isArray(g.nodes) || g.nodes.length === 0)
|
|
70
|
+
return null;
|
|
71
|
+
const nodes = g.nodes
|
|
72
|
+
.filter((n) => n && n.id != null)
|
|
73
|
+
.map((n) => ({ id: String(n.id), label: String(n.label ?? n.id) }));
|
|
74
|
+
if (nodes.length === 0)
|
|
75
|
+
return null;
|
|
76
|
+
const ids = new Set(nodes.map((n) => n.id));
|
|
77
|
+
const edges = (Array.isArray(g.edges) ? g.edges : [])
|
|
78
|
+
.filter((e) => e && e.from != null && e.to != null)
|
|
79
|
+
.map((e) => ({
|
|
80
|
+
from: String(e.from),
|
|
81
|
+
to: String(e.to),
|
|
82
|
+
label: e.label != null && String(e.label).trim() ? String(e.label) : undefined,
|
|
83
|
+
}))
|
|
84
|
+
.filter((e) => ids.has(e.from) && ids.has(e.to));
|
|
85
|
+
return { nodes, edges };
|
|
86
|
+
}
|
|
87
|
+
/** True when the graph STRUCTURE reads like an ordered flow even if the title
|
|
88
|
+
* is neutral: acyclic + sparse + (a simple chain OR a labelled decision OR at
|
|
89
|
+
* least one labelled edge). A dense or cyclic web returns false. */
|
|
90
|
+
export function graphLooksLikeFlow(content) {
|
|
91
|
+
const g = parseGraph(content);
|
|
92
|
+
if (!g || g.nodes.length < 2 || g.edges.length < 1)
|
|
93
|
+
return false;
|
|
94
|
+
const outDeg = {};
|
|
95
|
+
const inDeg = {};
|
|
96
|
+
const outLabeled = {};
|
|
97
|
+
g.nodes.forEach((n) => { outDeg[n.id] = 0; inDeg[n.id] = 0; outLabeled[n.id] = 0; });
|
|
98
|
+
g.edges.forEach((e) => {
|
|
99
|
+
outDeg[e.from] = (outDeg[e.from] ?? 0) + 1;
|
|
100
|
+
inDeg[e.to] = (inDeg[e.to] ?? 0) + 1;
|
|
101
|
+
if (e.label)
|
|
102
|
+
outLabeled[e.from] = (outLabeled[e.from] ?? 0) + 1;
|
|
103
|
+
});
|
|
104
|
+
const sources = g.nodes.filter((n) => (inDeg[n.id] ?? 0) === 0).length;
|
|
105
|
+
const sinks = g.nodes.filter((n) => (outDeg[n.id] ?? 0) === 0).length;
|
|
106
|
+
if (sources === 0 || sinks === 0)
|
|
107
|
+
return false; // no clean start/end
|
|
108
|
+
if (g.edges.length > g.nodes.length * 1.4)
|
|
109
|
+
return false; // dense web, not a flow
|
|
110
|
+
if (!isAcyclic(g))
|
|
111
|
+
return false;
|
|
112
|
+
const isChain = g.nodes.every((n) => (outDeg[n.id] ?? 0) <= 1);
|
|
113
|
+
const hasDecision = g.nodes.some((n) => (outDeg[n.id] ?? 0) >= 2 && (outLabeled[n.id] ?? 0) >= 1);
|
|
114
|
+
const anyLabeled = g.edges.some((e) => e.label);
|
|
115
|
+
return isChain || hasDecision || anyLabeled;
|
|
116
|
+
}
|
|
117
|
+
function isAcyclic(g) {
|
|
118
|
+
const inDeg = {};
|
|
119
|
+
const adj = {};
|
|
120
|
+
g.nodes.forEach((n) => { inDeg[n.id] = 0; adj[n.id] = []; });
|
|
121
|
+
g.edges.forEach((e) => { (adj[e.from] ??= []).push(e.to); inDeg[e.to] = (inDeg[e.to] ?? 0) + 1; });
|
|
122
|
+
const queue = g.nodes.filter((n) => (inDeg[n.id] ?? 0) === 0).map((n) => n.id);
|
|
123
|
+
let seen = 0;
|
|
124
|
+
while (queue.length) {
|
|
125
|
+
const id = queue.shift();
|
|
126
|
+
seen++;
|
|
127
|
+
for (const to of (adj[id] ?? [])) {
|
|
128
|
+
inDeg[to] = (inDeg[to] ?? 0) - 1;
|
|
129
|
+
if ((inDeg[to] ?? 0) === 0)
|
|
130
|
+
queue.push(to);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
return seen === g.nodes.length;
|
|
134
|
+
}
|
|
135
|
+
/** Combined decision: is this graph tab actually a process/flow? Title veto
|
|
136
|
+
* (relationship words) wins; then flow-words; then structure. */
|
|
137
|
+
export function isFlowContext(title, content) {
|
|
138
|
+
const t = String(title || '');
|
|
139
|
+
if (RELATION_TITLE_RE.test(t))
|
|
140
|
+
return false;
|
|
141
|
+
if (FLOW_TITLE_RE.test(t))
|
|
142
|
+
return true;
|
|
143
|
+
return graphLooksLikeFlow(content);
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Convert a graph `{nodes,edges}` JSON string into a BPMN `{nodes,flows}` JSON
|
|
147
|
+
* string. Returns null when the content is not a parseable, connected graph.
|
|
148
|
+
* Heuristics: source node -> preceded by a synthetic startEvent; sink -> a
|
|
149
|
+
* synthetic endEvent; node with 2+ outgoing AND a labelled branch -> exclusive
|
|
150
|
+
* gateway; everything else -> task.
|
|
151
|
+
*/
|
|
152
|
+
export function graphToBpmn(content) {
|
|
153
|
+
const g = parseGraph(content);
|
|
154
|
+
if (!g || g.nodes.length === 0 || g.edges.length === 0)
|
|
155
|
+
return null;
|
|
156
|
+
const outDeg = {};
|
|
157
|
+
const inDeg = {};
|
|
158
|
+
const outLabeled = {};
|
|
159
|
+
g.nodes.forEach((n) => { outDeg[n.id] = 0; inDeg[n.id] = 0; outLabeled[n.id] = 0; });
|
|
160
|
+
g.edges.forEach((e) => {
|
|
161
|
+
outDeg[e.from] = (outDeg[e.from] ?? 0) + 1;
|
|
162
|
+
inDeg[e.to] = (inDeg[e.to] ?? 0) + 1;
|
|
163
|
+
if (e.label)
|
|
164
|
+
outLabeled[e.from] = (outLabeled[e.from] ?? 0) + 1;
|
|
165
|
+
});
|
|
166
|
+
const bpmnNodes = g.nodes.map((n) => ((outDeg[n.id] ?? 0) >= 2 && (outLabeled[n.id] ?? 0) >= 1)
|
|
167
|
+
? { id: n.id, type: 'gateway', gateway: 'exclusive', label: n.label }
|
|
168
|
+
: { id: n.id, type: 'task', label: n.label });
|
|
169
|
+
const flows = g.edges.map((e) => (e.label ? { from: e.from, to: e.to, label: e.label } : { from: e.from, to: e.to }));
|
|
170
|
+
const starts = g.nodes.filter((n) => (inDeg[n.id] ?? 0) === 0).map((n) => n.id);
|
|
171
|
+
const ends = g.nodes.filter((n) => (outDeg[n.id] ?? 0) === 0).map((n) => n.id);
|
|
172
|
+
if (starts.length >= 1 && starts.length < g.nodes.length) {
|
|
173
|
+
bpmnNodes.unshift({ id: '_start', type: 'startEvent', label: 'Inicio' });
|
|
174
|
+
starts.forEach((s) => flows.unshift({ from: '_start', to: s }));
|
|
175
|
+
}
|
|
176
|
+
if (ends.length >= 1 && ends.length < g.nodes.length) {
|
|
177
|
+
bpmnNodes.push({ id: '_end', type: 'endEvent', label: 'Fin' });
|
|
178
|
+
ends.forEach((e) => flows.push({ from: e, to: '_end' }));
|
|
179
|
+
}
|
|
180
|
+
return JSON.stringify({ nodes: bpmnNodes, flows });
|
|
181
|
+
}
|
|
182
|
+
/* --------------------------- decision (A + B) ---------------------------- */
|
|
183
|
+
/** The nudge shown to the brain when it draws a flow as a graph. */
|
|
184
|
+
export const FLOW_NUDGE_MESSAGE = 'El pizarron NO renderiza un flujo/proceso como grafo de nodos (kind="graph"): '
|
|
185
|
+
+ 'queda ilegible. Volve a crear ESTE tab con kind="bpmn" y content JSON: '
|
|
186
|
+
+ '{"nodes":[{"id","type","label","lane"?,"gateway"?}],"flows":[{"from","to","label"?}],"lanes"?:[{"id","label"}]}. '
|
|
187
|
+
+ 'type en startEvent|endEvent|task|userTask|serviceTask|scriptTask|sendTask|receiveTask|gateway; '
|
|
188
|
+
+ 'para una decision usa type="gateway" + gateway="exclusive" (o "parallel"). '
|
|
189
|
+
+ 'Empeza con un startEvent y termina con endEvent. Hacelo AHORA en esta misma respuesta -- no lo narres.';
|
|
190
|
+
/* Bounded memory of graph contents we already nudged, so a reincidence (the
|
|
191
|
+
* brain re-sends the same graph instead of obeying) falls back to the
|
|
192
|
+
* deterministic conversion instead of nudging forever. */
|
|
193
|
+
const nudged = new Set();
|
|
194
|
+
function rememberNudge(hash) {
|
|
195
|
+
if (nudged.size > 512)
|
|
196
|
+
nudged.clear();
|
|
197
|
+
nudged.add(hash);
|
|
198
|
+
}
|
|
199
|
+
function hashContent(s) {
|
|
200
|
+
let h = 5381;
|
|
201
|
+
for (let i = 0; i < s.length; i++)
|
|
202
|
+
h = ((h << 5) + h + s.charCodeAt(i)) | 0;
|
|
203
|
+
return String(h >>> 0) + ':' + s.length;
|
|
204
|
+
}
|
|
205
|
+
/** For tests: forget every remembered nudge. */
|
|
206
|
+
export function _resetFlowNudges() { nudged.clear(); }
|
|
207
|
+
/**
|
|
208
|
+
* Decide what to do with a create-tab. Passthrough for anything that is not a
|
|
209
|
+
* graph-drawn flow. For a graph-drawn flow: nudge the brain to redo it as BPMN
|
|
210
|
+
* the first time (B); on reincidence, convert it deterministically (A).
|
|
211
|
+
*/
|
|
212
|
+
export function decideFlowTab(input) {
|
|
213
|
+
const kind = String(input.kind || '').trim().toLowerCase();
|
|
214
|
+
if (kind !== 'graph')
|
|
215
|
+
return { action: 'passthrough' };
|
|
216
|
+
if (!isFlowContext(input.title || '', input.content))
|
|
217
|
+
return { action: 'passthrough' };
|
|
218
|
+
const bpmn = graphToBpmn(input.content);
|
|
219
|
+
if (!bpmn)
|
|
220
|
+
return { action: 'passthrough' }; // not convertible -> leave as-is
|
|
221
|
+
const h = hashContent(input.content);
|
|
222
|
+
if (nudged.has(h)) {
|
|
223
|
+
nudged.delete(h);
|
|
224
|
+
return { action: 'convert', kind: 'bpmn', content: bpmn };
|
|
225
|
+
}
|
|
226
|
+
rememberNudge(h);
|
|
227
|
+
return { action: 'reject', message: FLOW_NUDGE_MESSAGE };
|
|
228
|
+
}
|
|
229
|
+
//# sourceMappingURL=flow_bpmn.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flow_bpmn.js","sourceRoot":"","sources":["../../src/chat/flow_bpmn.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,+EAA+E;AAE/E;yDACyD;AACzD,MAAM,aAAa,GAAG,IAAI,MAAM,CAC9B,MAAM,GAAG;IACP,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,EAAE,eAAe,EAAE,WAAW;IACrE,YAAY,EAAE,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,eAAe;IACxE,gBAAgB,EAAE,UAAU,EAAE,cAAc,EAAE,UAAU,EAAE,UAAU;IACpE,WAAW,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ;IACpE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,WAAW;IACnE,YAAY,EAAE,MAAM,EAAE,sCAAsC;IAC5D,+BAA+B,EAAE,4BAA4B;CAC9D,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,MAAM,EACpB,GAAG,CACJ,CAAC;AAEF;8EAC8E;AAC9E,MAAM,iBAAiB,GAAG,IAAI,MAAM,CAClC,MAAM,GAAG;IACP,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,cAAc,EAAE,aAAa;IAC5E,YAAY,EAAE,cAAc,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M,CAoB5F"}
|
package/dist/chat/server.js
CHANGED
|
@@ -3625,6 +3625,27 @@ async function handlePanelInvoke(req, res, ctx) {
|
|
|
3625
3625
|
const payload = (result.server_payload && typeof result.server_payload === 'object')
|
|
3626
3626
|
? result.server_payload : null;
|
|
3627
3627
|
const shortVerb = String(verb.id || '').replace(/^yujin\./, '');
|
|
3628
|
+
/* Enforce KIND SELECTION server-side for a create-tab `graph` that is
|
|
3629
|
+
* really a flow/proceso. First time -> reject with a nudge so the brain
|
|
3630
|
+
* redoes it as native BPMN (B); on reincidence -> convert deterministically
|
|
3631
|
+
* (A). Done BEFORE enqueue + board_artifacts persistence, so the panel and
|
|
3632
|
+
* the disk never see the graph-drawn flow. */
|
|
3633
|
+
if (shortVerb === 'pizarron.create-tab') {
|
|
3634
|
+
const { decideFlowTab } = await import('./flow_bpmn.js');
|
|
3635
|
+
const decision = decideFlowTab({
|
|
3636
|
+
kind: String(dispatchArgs.kind || ''),
|
|
3637
|
+
content: String(dispatchArgs.content || ''),
|
|
3638
|
+
title: String(dispatchArgs.title || ''),
|
|
3639
|
+
});
|
|
3640
|
+
if (decision.action === 'reject') {
|
|
3641
|
+
sendJson(res, 200, { ok: false, text: decision.message });
|
|
3642
|
+
return;
|
|
3643
|
+
}
|
|
3644
|
+
if (decision.action === 'convert') {
|
|
3645
|
+
dispatchArgs.kind = decision.kind;
|
|
3646
|
+
dispatchArgs.content = decision.content;
|
|
3647
|
+
}
|
|
3648
|
+
}
|
|
3628
3649
|
const { enqueuePanelDispatch } = await import('./panel_queue.js');
|
|
3629
3650
|
const seq = enqueuePanelDispatch(shortVerb, payload ? { ...dispatchArgs, server_payload: payload } : dispatchArgs, new Date().toISOString());
|
|
3630
3651
|
/* PND -- if it is a pizarron DOCUMENT, also relay it to the phone
|