@yagr/agent 0.2.5 → 0.2.7
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/agent.d.ts +15 -1
- package/dist/agent.d.ts.map +1 -1
- package/dist/agent.js +35 -4
- package/dist/agent.js.map +1 -1
- package/dist/cli.js +124 -36
- package/dist/cli.js.map +1 -1
- package/dist/config/gateway-daemon.d.ts +10 -0
- package/dist/config/gateway-daemon.d.ts.map +1 -0
- package/dist/config/gateway-daemon.js +42 -0
- package/dist/config/gateway-daemon.js.map +1 -0
- package/dist/config/init-yagr-home.js +5 -4
- package/dist/config/init-yagr-home.js.map +1 -1
- package/dist/config/local-state.js +2 -2
- package/dist/config/local-state.js.map +1 -1
- package/dist/config/n8n-config-service.d.ts +10 -0
- package/dist/config/n8n-config-service.d.ts.map +1 -1
- package/dist/config/n8n-config-service.js +52 -4
- package/dist/config/n8n-config-service.js.map +1 -1
- package/dist/config/yagr-home.d.ts +4 -0
- package/dist/config/yagr-home.d.ts.map +1 -1
- package/dist/config/yagr-home.js +12 -4
- package/dist/config/yagr-home.js.map +1 -1
- package/dist/gateway/format-message.d.ts +25 -0
- package/dist/gateway/format-message.d.ts.map +1 -0
- package/dist/gateway/format-message.js +166 -0
- package/dist/gateway/format-message.js.map +1 -0
- package/dist/gateway/interactive-ui.d.ts.map +1 -1
- package/dist/gateway/interactive-ui.js +127 -15
- package/dist/gateway/interactive-ui.js.map +1 -1
- package/dist/gateway/manager.d.ts +7 -0
- package/dist/gateway/manager.d.ts.map +1 -1
- package/dist/gateway/manager.js +76 -0
- package/dist/gateway/manager.js.map +1 -1
- package/dist/gateway/telegram.d.ts.map +1 -1
- package/dist/gateway/telegram.js +70 -13
- package/dist/gateway/telegram.js.map +1 -1
- package/dist/gateway/webui.d.ts.map +1 -1
- package/dist/gateway/webui.js +19 -7
- package/dist/gateway/webui.js.map +1 -1
- package/dist/prompt/build-system-prompt.d.ts +11 -0
- package/dist/prompt/build-system-prompt.d.ts.map +1 -1
- package/dist/prompt/build-system-prompt.js +99 -55
- package/dist/prompt/build-system-prompt.js.map +1 -1
- package/dist/runtime/completion-gate.d.ts.map +1 -1
- package/dist/runtime/completion-gate.js +3 -2
- package/dist/runtime/completion-gate.js.map +1 -1
- package/dist/runtime/context-compaction.d.ts.map +1 -1
- package/dist/runtime/context-compaction.js +2 -7
- package/dist/runtime/context-compaction.js.map +1 -1
- package/dist/runtime/outcome.d.ts.map +1 -1
- package/dist/runtime/outcome.js +3 -0
- package/dist/runtime/outcome.js.map +1 -1
- package/dist/runtime/policy-hooks.d.ts +2 -0
- package/dist/runtime/policy-hooks.d.ts.map +1 -1
- package/dist/runtime/policy-hooks.js +42 -0
- package/dist/runtime/policy-hooks.js.map +1 -1
- package/dist/runtime/run-engine.d.ts +15 -1
- package/dist/runtime/run-engine.d.ts.map +1 -1
- package/dist/runtime/run-engine.js +264 -112
- package/dist/runtime/run-engine.js.map +1 -1
- package/dist/setup/setup-wizard.d.ts +1 -1
- package/dist/setup/setup-wizard.d.ts.map +1 -1
- package/dist/setup/setup-wizard.js +40 -5
- package/dist/setup/setup-wizard.js.map +1 -1
- package/dist/setup/start-launcher.d.ts +2 -21
- package/dist/setup/start-launcher.d.ts.map +1 -1
- package/dist/setup/start-launcher.js +14 -63
- package/dist/setup/start-launcher.js.map +1 -1
- package/dist/setup.d.ts +1 -0
- package/dist/setup.d.ts.map +1 -1
- package/dist/setup.js +31 -7
- package/dist/setup.js.map +1 -1
- package/dist/tools/build-tools.d.ts +9 -3
- package/dist/tools/build-tools.d.ts.map +1 -1
- package/dist/tools/n8nac.d.ts +7 -3
- package/dist/tools/n8nac.d.ts.map +1 -1
- package/dist/tools/n8nac.js +30 -5
- package/dist/tools/n8nac.js.map +1 -1
- package/dist/tools/present-workflow-result.d.ts +7 -0
- package/dist/tools/present-workflow-result.d.ts.map +1 -1
- package/dist/tools/present-workflow-result.js +84 -2
- package/dist/tools/present-workflow-result.js.map +1 -1
- package/dist/tools/workspace-utils.js +2 -2
- package/dist/tools/workspace-utils.js.map +1 -1
- package/dist/types.d.ts +2 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/webui/app.js +23 -15
- package/dist/webui/app.js.map +2 -2
- package/dist/webui/styles.css +106 -34
- package/dist/webui/styles.css.map +2 -2
- package/package.json +2 -2
package/dist/webui/app.js
CHANGED
|
@@ -26123,8 +26123,11 @@
|
|
|
26123
26123
|
] })
|
|
26124
26124
|
] });
|
|
26125
26125
|
}
|
|
26126
|
+
function normalizeWorkflowMapLine(line) {
|
|
26127
|
+
return line.replace(/^\s*\/\*+\s?/, "").replace(/^\s*\*\/?\s?/, "").replace(/^\s*\/\/?\s?/, "").replace(/\s*\*\/\s*$/, "").trimEnd();
|
|
26128
|
+
}
|
|
26126
26129
|
function parseWorkflowMap(diagram) {
|
|
26127
|
-
const lines = diagram.split("\n").map(
|
|
26130
|
+
const lines = diagram.split("\n").map(normalizeWorkflowMapLine);
|
|
26128
26131
|
const nodeIndex = /* @__PURE__ */ new Map();
|
|
26129
26132
|
let inNodeIndex = false;
|
|
26130
26133
|
for (const line of lines) {
|
|
@@ -26136,7 +26139,7 @@
|
|
|
26136
26139
|
inNodeIndex = false;
|
|
26137
26140
|
continue;
|
|
26138
26141
|
}
|
|
26139
|
-
if (line.trim()
|
|
26142
|
+
if (/^[\s\-_=─]+$/.test(line.trim()) || line.trim().startsWith("Property name")) continue;
|
|
26140
26143
|
if (!inNodeIndex) continue;
|
|
26141
26144
|
const match = line.match(/^\s*(\S+)\s{2,}(\S+)/);
|
|
26142
26145
|
if (match) nodeIndex.set(match[1], match[2]);
|
|
@@ -26150,11 +26153,12 @@
|
|
|
26150
26153
|
inRouting = true;
|
|
26151
26154
|
continue;
|
|
26152
26155
|
}
|
|
26153
|
-
if (line.trim().startsWith("
|
|
26156
|
+
if (line.trim().startsWith("<workflow-map>") || line.trim().startsWith("</workflow-map>")) continue;
|
|
26157
|
+
if (line.trim().startsWith("AI CONNECTIONS")) break;
|
|
26154
26158
|
if (!inRouting) continue;
|
|
26155
|
-
if (line.trim()
|
|
26159
|
+
if (/^[\s\-_=─]+$/.test(line.trim()) || !line.trim()) continue;
|
|
26156
26160
|
const isLoop = line.includes("(\u21A9 loop)");
|
|
26157
|
-
const arrowMatch = line.match(/^(\s*)\.out\(\d+\)\s
|
|
26161
|
+
const arrowMatch = line.match(/^(\s*)\.out\(\d+\)\s+(?:→|->)\s*(\S+)/) ?? line.match(/^(\s*)(?:→|->)\s*(\S+)/);
|
|
26158
26162
|
if (arrowMatch) {
|
|
26159
26163
|
const depth = Math.floor(arrowMatch[1].length / 2);
|
|
26160
26164
|
const name2 = arrowMatch[2];
|
|
@@ -26175,6 +26179,9 @@
|
|
|
26175
26179
|
}
|
|
26176
26180
|
}
|
|
26177
26181
|
}
|
|
26182
|
+
if (orderedNames.length === 0) {
|
|
26183
|
+
orderedNames.push(...nodeIndex.keys());
|
|
26184
|
+
}
|
|
26178
26185
|
if (orderedNames.length === 0) return null;
|
|
26179
26186
|
const layerMap = /* @__PURE__ */ new Map();
|
|
26180
26187
|
for (const name2 of orderedNames) {
|
|
@@ -26260,8 +26267,8 @@
|
|
|
26260
26267
|
height: svgH,
|
|
26261
26268
|
children: [
|
|
26262
26269
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("defs", { children: [
|
|
26263
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("marker", { id: "wf-arrow", markerWidth: "8", markerHeight: "6", refX: "8", refY: "3", orient: "auto", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", { d: "M0,0 L8,3 L0,6", fill: "
|
|
26264
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("marker", { id: "wf-loop-arrow", markerWidth: "8", markerHeight: "6", refX: "8", refY: "3", orient: "auto", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", { d: "M0,0 L8,3 L0,6", fill: "
|
|
26270
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("marker", { id: "wf-arrow", markerWidth: "8", markerHeight: "6", refX: "8", refY: "3", orient: "auto", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", { d: "M0,0 L8,3 L0,6", fill: "var(--workflow-graph-edge)" }) }),
|
|
26271
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("marker", { id: "wf-loop-arrow", markerWidth: "8", markerHeight: "6", refX: "8", refY: "3", orient: "auto", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", { d: "M0,0 L8,3 L0,6", fill: "var(--workflow-graph-loop)" }) })
|
|
26265
26272
|
] }),
|
|
26266
26273
|
graph.edges.map((e, i) => {
|
|
26267
26274
|
const src = graph.nodes.find((n) => n.id === e.from);
|
|
@@ -26280,7 +26287,7 @@
|
|
|
26280
26287
|
{
|
|
26281
26288
|
d: `M${x12},${y12} C${x12},${cpY} ${x22},${cpY} ${x22},${y22}`,
|
|
26282
26289
|
fill: "none",
|
|
26283
|
-
stroke: "
|
|
26290
|
+
stroke: "var(--workflow-graph-loop)",
|
|
26284
26291
|
strokeWidth: 1.5,
|
|
26285
26292
|
strokeDasharray: "5 3",
|
|
26286
26293
|
markerEnd: "url(#wf-loop-arrow)"
|
|
@@ -26298,7 +26305,7 @@
|
|
|
26298
26305
|
{
|
|
26299
26306
|
d: `M${x1},${y1} C${cx},${y1} ${cx},${y2} ${x2},${y2}`,
|
|
26300
26307
|
fill: "none",
|
|
26301
|
-
stroke: "
|
|
26308
|
+
stroke: "var(--workflow-graph-edge)",
|
|
26302
26309
|
strokeWidth: 2,
|
|
26303
26310
|
markerEnd: "url(#wf-arrow)"
|
|
26304
26311
|
},
|
|
@@ -26318,7 +26325,7 @@
|
|
|
26318
26325
|
height: NODE_H,
|
|
26319
26326
|
rx: 10,
|
|
26320
26327
|
ry: 10,
|
|
26321
|
-
fill: "
|
|
26328
|
+
fill: "var(--workflow-graph-node-bg)",
|
|
26322
26329
|
stroke: color2,
|
|
26323
26330
|
strokeWidth: 2
|
|
26324
26331
|
}
|
|
@@ -26331,7 +26338,7 @@
|
|
|
26331
26338
|
textAnchor: "middle",
|
|
26332
26339
|
fontSize: 11,
|
|
26333
26340
|
fontWeight: 600,
|
|
26334
|
-
fill: "
|
|
26341
|
+
fill: "var(--workflow-graph-node-text)",
|
|
26335
26342
|
children: n.label.length > 18 ? `${n.label.slice(0, 16)}\u2026` : n.label
|
|
26336
26343
|
}
|
|
26337
26344
|
),
|
|
@@ -26342,7 +26349,7 @@
|
|
|
26342
26349
|
y: p.y + 36,
|
|
26343
26350
|
textAnchor: "middle",
|
|
26344
26351
|
fontSize: 9,
|
|
26345
|
-
fill: "
|
|
26352
|
+
fill: "var(--workflow-graph-node-muted)",
|
|
26346
26353
|
children: n.type
|
|
26347
26354
|
}
|
|
26348
26355
|
)
|
|
@@ -26386,8 +26393,8 @@
|
|
|
26386
26393
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "workGlyphRing workGlyphRingB" })
|
|
26387
26394
|
] }),
|
|
26388
26395
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "workMeta", children: [
|
|
26389
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("strong", { children: message.statusLabel ?? "Yagr is working" }),
|
|
26390
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "muted", children:
|
|
26396
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("strong", { children: message.statusLabel ?? "Yagr is working\u2026" }),
|
|
26397
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "muted", children: elapsed ? `Running for ${elapsed}` : "Thinking, planning, and executing\u2026" })
|
|
26391
26398
|
] })
|
|
26392
26399
|
] }) : null,
|
|
26393
26400
|
showProgress && visibleProgress.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "progressTicker", children: visibleProgress.map((entry) => /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: `progressTickerEntry ${entry.tone}`, children: [
|
|
@@ -26915,11 +26922,12 @@
|
|
|
26915
26922
|
return;
|
|
26916
26923
|
}
|
|
26917
26924
|
if (streamEvent.type === "final") {
|
|
26925
|
+
const statusLabel = streamEvent.finalState === "stopped" ? "Stopped" : streamEvent.finalState === "failed_terminal" ? "Run failed" : streamEvent.finalState === "completed" ? "Completed" : "Needs attention";
|
|
26918
26926
|
patchMessage(pendingId, {
|
|
26919
26927
|
text: streamEvent.response,
|
|
26920
26928
|
streaming: false,
|
|
26921
26929
|
finalState: streamEvent.finalState,
|
|
26922
|
-
statusLabel
|
|
26930
|
+
statusLabel,
|
|
26923
26931
|
phase: void 0
|
|
26924
26932
|
});
|
|
26925
26933
|
setBusyLabel(void 0);
|