aimeat 1.23.3 → 1.24.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/dist/locales/en.json +44 -0
- package/dist/locales/fi.json +44 -0
- package/dist/public/css/views/workflows.css +111 -0
- package/dist/public/js/services/workflows.js +57 -0
- package/dist/public/llms-template.txt +7 -0
- package/dist/public/spa.html +3 -1
- package/dist/public/views/profile/landing-page.js +1 -0
- package/dist/public/views/profile/workflows-form.js +220 -0
- package/dist/public/views/profile/workflows-tab.js +244 -0
- package/dist/public/views/profile.js +2 -0
- package/dist/src/cli/connect/mcp/tools/index.d.ts.map +1 -1
- package/dist/src/cli/connect/mcp/tools/index.js +2 -0
- package/dist/src/cli/connect/mcp/tools/index.js.map +1 -1
- package/dist/src/cli/connect/mcp/tools/workflows.d.ts +12 -0
- package/dist/src/cli/connect/mcp/tools/workflows.d.ts.map +1 -0
- package/dist/src/cli/connect/mcp/tools/workflows.js +37 -0
- package/dist/src/cli/connect/mcp/tools/workflows.js.map +1 -0
- package/dist/src/cli/connect/tool-call.d.ts.map +1 -1
- package/dist/src/cli/connect/tool-call.js +37 -0
- package/dist/src/cli/connect/tool-call.js.map +1 -1
- package/dist/src/generated/api-types.d.ts +569 -0
- package/dist/src/generated/api-types.d.ts.map +1 -1
- package/dist/src/mcp/annotations.d.ts.map +1 -1
- package/dist/src/mcp/annotations.js +3 -0
- package/dist/src/mcp/annotations.js.map +1 -1
- package/dist/src/mcp/catalog/definitions.d.ts.map +1 -1
- package/dist/src/mcp/catalog/definitions.js +27 -0
- package/dist/src/mcp/catalog/definitions.js.map +1 -1
- package/dist/src/mcp/catalog/scopes.d.ts.map +1 -1
- package/dist/src/mcp/catalog/scopes.js +5 -1
- package/dist/src/mcp/catalog/scopes.js.map +1 -1
- package/dist/src/mcp/catalog/surfaces.d.ts.map +1 -1
- package/dist/src/mcp/catalog/surfaces.js +1 -0
- package/dist/src/mcp/catalog/surfaces.js.map +1 -1
- package/dist/src/mcp/index.d.ts.map +1 -1
- package/dist/src/mcp/index.js +2 -0
- package/dist/src/mcp/index.js.map +1 -1
- package/dist/src/mcp/workflows.d.ts +18 -0
- package/dist/src/mcp/workflows.d.ts.map +1 -0
- package/dist/src/mcp/workflows.js +68 -0
- package/dist/src/mcp/workflows.js.map +1 -0
- package/dist/src/models/offer-schemas.d.ts +7 -0
- package/dist/src/models/offer-schemas.d.ts.map +1 -1
- package/dist/src/models/offer-schemas.js +12 -0
- package/dist/src/models/offer-schemas.js.map +1 -1
- package/dist/src/models/workflow-schemas.d.ts +220 -0
- package/dist/src/models/workflow-schemas.d.ts.map +1 -0
- package/dist/src/models/workflow-schemas.js +102 -0
- package/dist/src/models/workflow-schemas.js.map +1 -0
- package/dist/src/routes/agent-tasks.d.ts.map +1 -1
- package/dist/src/routes/agent-tasks.js +16 -0
- package/dist/src/routes/agent-tasks.js.map +1 -1
- package/dist/src/routes/memory.d.ts.map +1 -1
- package/dist/src/routes/memory.js +5 -0
- package/dist/src/routes/memory.js.map +1 -1
- package/dist/src/routes/stats.d.ts.map +1 -1
- package/dist/src/routes/stats.js +13 -0
- package/dist/src/routes/stats.js.map +1 -1
- package/dist/src/routes/workflows.d.ts +30 -0
- package/dist/src/routes/workflows.d.ts.map +1 -0
- package/dist/src/routes/workflows.js +178 -0
- package/dist/src/routes/workflows.js.map +1 -0
- package/dist/src/server-bootstrap/routes-loader.d.ts +2 -0
- package/dist/src/server-bootstrap/routes-loader.d.ts.map +1 -1
- package/dist/src/server-bootstrap/routes-loader.js +7 -1
- package/dist/src/server-bootstrap/routes-loader.js.map +1 -1
- package/dist/src/server-bootstrap/service-init.d.ts +2 -0
- package/dist/src/server-bootstrap/service-init.d.ts.map +1 -1
- package/dist/src/server-bootstrap/service-init.js +6 -0
- package/dist/src/server-bootstrap/service-init.js.map +1 -1
- package/dist/src/server.d.ts.map +1 -1
- package/dist/src/server.js +1 -0
- package/dist/src/server.js.map +1 -1
- package/dist/src/services/handbooks/agent.d.ts +1 -1
- package/dist/src/services/handbooks/agent.d.ts.map +1 -1
- package/dist/src/services/handbooks/agent.js +10 -0
- package/dist/src/services/handbooks/agent.js.map +1 -1
- package/dist/src/services/scheduler.d.ts +6 -0
- package/dist/src/services/scheduler.d.ts.map +1 -1
- package/dist/src/services/scheduler.js +22 -0
- package/dist/src/services/scheduler.js.map +1 -1
- package/dist/src/services/schema-validator.d.ts +9 -0
- package/dist/src/services/schema-validator.d.ts.map +1 -1
- package/dist/src/services/schema-validator.js +16 -0
- package/dist/src/services/schema-validator.js.map +1 -1
- package/dist/src/services/workflow/engine.d.ts +84 -0
- package/dist/src/services/workflow/engine.d.ts.map +1 -0
- package/dist/src/services/workflow/engine.js +545 -0
- package/dist/src/services/workflow/engine.js.map +1 -0
- package/dist/src/services/workflow/eval-context.d.ts +23 -0
- package/dist/src/services/workflow/eval-context.d.ts.map +1 -0
- package/dist/src/services/workflow/eval-context.js +52 -0
- package/dist/src/services/workflow/eval-context.js.map +1 -0
- package/dist/src/services/workflow/lifecycle.d.ts +38 -0
- package/dist/src/services/workflow/lifecycle.d.ts.map +1 -0
- package/dist/src/services/workflow/lifecycle.js +99 -0
- package/dist/src/services/workflow/lifecycle.js.map +1 -0
- package/dist/src/services/workflow/signal-eval.d.ts +70 -0
- package/dist/src/services/workflow/signal-eval.d.ts.map +1 -0
- package/dist/src/services/workflow/signal-eval.js +174 -0
- package/dist/src/services/workflow/signal-eval.js.map +1 -0
- package/dist/src/services/workflow/store.d.ts +89 -0
- package/dist/src/services/workflow/store.d.ts.map +1 -0
- package/dist/src/services/workflow/store.js +284 -0
- package/dist/src/services/workflow/store.js.map +1 -0
- package/dist/src/storage/interface.d.ts +2 -2
- package/dist/src/storage/interface.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file workflows-tab.js
|
|
3
|
+
* @description Profile › Workflows — the owner-facing surface for Agent Workflows (declared, ordered
|
|
4
|
+
* agent pipelines with per-step input/output signals). Three views: a list of workflows with a
|
|
5
|
+
* health sparkline; a detail view showing the derived blueprint (the "whole workflow" graph) + the
|
|
6
|
+
* recent runs; and a single-run view with the per-step timeline (state + expected-vs-observed).
|
|
7
|
+
* Run-now offers a signals-only health check or a full live run. Reads the /v1/workflows API; the
|
|
8
|
+
* deterministic engine is node-owned. See docs/plans/2026-06-13-agent-workflows-node-plan.md §12.
|
|
9
|
+
* @structure WorkflowsTab (default) — view state machine (list | detail | run)
|
|
10
|
+
* @usage Registered in profile.js TABS as { id:'workflows', component: WorkflowsTab }.
|
|
11
|
+
* @version-history
|
|
12
|
+
* v1.0.0 -- 2026-06-13 -- Phase 9: list + blueprint + runs + run-now + health.
|
|
13
|
+
*/
|
|
14
|
+
import { h } from 'preact';
|
|
15
|
+
import { useState, useEffect, useRef, useCallback } from 'preact/hooks';
|
|
16
|
+
import htm from 'htm';
|
|
17
|
+
import { t } from '/js/i18n.js';
|
|
18
|
+
import { timeAgo } from '/js/utils.js';
|
|
19
|
+
import { listWorkflows, getWorkflow, getBlueprint, getHealth, listRuns, getRun, runWorkflow } from '/js/services/workflows.js';
|
|
20
|
+
import WorkflowForm from './workflows-form.js';
|
|
21
|
+
|
|
22
|
+
const html = htm.bind(h);
|
|
23
|
+
|
|
24
|
+
/** Pick a display string from a localized value (string | { locale: text }). */
|
|
25
|
+
function loc(s) {
|
|
26
|
+
if (!s) return '';
|
|
27
|
+
if (typeof s === 'string') return s;
|
|
28
|
+
return s.en_US || s.fi_FI || Object.values(s)[0] || '';
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function triggerSummary(trigger) {
|
|
32
|
+
if (!trigger) return '';
|
|
33
|
+
if (trigger.kind === 'schedule') return `${t('profile.workflows.trigger.schedule')} · ${trigger.cron}${trigger.timezone ? ` (${trigger.timezone})` : ''}`;
|
|
34
|
+
if (trigger.kind === 'event') return `${t('profile.workflows.trigger.event')} · ${trigger.on}`;
|
|
35
|
+
return t('profile.workflows.trigger.manual');
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/** Map a run/step status to a badge CSS modifier. */
|
|
39
|
+
function statusClass(status) {
|
|
40
|
+
if (status === 'done' || status === 'green') return 'wf-badge--ok';
|
|
41
|
+
if (status === 'partial' || status === 'red' || (typeof status === 'string' && status.endsWith('-red')) || status === 'timed-out') return 'wf-badge--err';
|
|
42
|
+
if (status === 'skipped') return 'wf-badge--muted';
|
|
43
|
+
return 'wf-badge--run';
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function StatusBadge({ status }) {
|
|
47
|
+
if (!status) return html`<span class="wf-muted">—</span>`;
|
|
48
|
+
return html`<span class="wf-badge ${statusClass(status)}">${status}</span>`;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/** A tiny sparkline of the last-N run states for one step (green/red bars). */
|
|
52
|
+
function Sparkline({ steps }) {
|
|
53
|
+
if (!steps || steps.length === 0) return html`<span class="wf-muted">—</span>`;
|
|
54
|
+
return html`<span class="wf-spark" title=${t('profile.workflows.health.title')}>
|
|
55
|
+
${steps.map(s => {
|
|
56
|
+
const total = s.green + s.red;
|
|
57
|
+
const cls = total === 0 ? 'wf-spark-bar--none' : s.red > 0 ? 'wf-spark-bar--err' : 'wf-spark-bar--ok';
|
|
58
|
+
return html`<span class="wf-spark-bar ${cls}" title=${`${s.stepId}: ${s.green}✓ / ${s.red}✗`}></span>`;
|
|
59
|
+
})}
|
|
60
|
+
</span>`;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export default function WorkflowsTab({ showToast }) {
|
|
64
|
+
// view: { name:'list' } | { name:'detail', id } | { name:'run', id, runId }
|
|
65
|
+
const [view, setView] = useState({ name: 'list' });
|
|
66
|
+
const [items, setItems] = useState([]); // [{ def, health }]
|
|
67
|
+
const [loading, setLoading] = useState(true);
|
|
68
|
+
const [error, setError] = useState(null);
|
|
69
|
+
|
|
70
|
+
const loadList = useCallback(async () => {
|
|
71
|
+
try {
|
|
72
|
+
const res = await listWorkflows();
|
|
73
|
+
const defs = res?.data?.workflows || [];
|
|
74
|
+
const withHealth = await Promise.all(defs.map(async (def) => {
|
|
75
|
+
const hr = await getHealth(def.id).catch(() => null);
|
|
76
|
+
return { def, health: hr?.data || null };
|
|
77
|
+
}));
|
|
78
|
+
setItems(withHealth);
|
|
79
|
+
setError(null);
|
|
80
|
+
} catch (e) {
|
|
81
|
+
setError(e.message || 'Failed to load workflows');
|
|
82
|
+
} finally {
|
|
83
|
+
setLoading(false);
|
|
84
|
+
}
|
|
85
|
+
}, []);
|
|
86
|
+
|
|
87
|
+
const loadRef = useRef(loadList);
|
|
88
|
+
loadRef.current = loadList;
|
|
89
|
+
useEffect(() => {
|
|
90
|
+
loadList();
|
|
91
|
+
const handler = () => { if (view.name === 'list') loadRef.current(); };
|
|
92
|
+
window.addEventListener('aimeat-live-update', handler);
|
|
93
|
+
return () => window.removeEventListener('aimeat-live-update', handler);
|
|
94
|
+
}, [loadList, view.name]);
|
|
95
|
+
|
|
96
|
+
const doRun = async (id, mode) => {
|
|
97
|
+
try {
|
|
98
|
+
const res = await runWorkflow(id, mode);
|
|
99
|
+
const runId = res?.data?.runId;
|
|
100
|
+
showToast?.(t('profile.workflows.runStarted'), 'success');
|
|
101
|
+
if (runId) setView({ name: 'run', id, runId });
|
|
102
|
+
else loadList();
|
|
103
|
+
} catch (e) {
|
|
104
|
+
showToast?.(e.message || 'Run failed', 'error');
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
if (loading) return html`<div class="wf-loading">${t('profile.workflows.loading')}</div>`;
|
|
109
|
+
if (view.name === 'create') return html`<${WorkflowForm} existing=${null} showToast=${showToast}
|
|
110
|
+
onCancel=${() => setView({ name: 'list' })} onSaved=${(id) => { setView({ name: 'detail', id }); }} />`;
|
|
111
|
+
if (view.name === 'edit') return html`<${EditFormView} id=${view.id} showToast=${showToast}
|
|
112
|
+
onCancel=${() => setView({ name: 'detail', id: view.id })} onSaved=${(id) => setView({ name: 'detail', id })} />`;
|
|
113
|
+
if (view.name === 'detail') return html`<${DetailView} id=${view.id} onBack=${() => { setView({ name: 'list' }); loadList(); }} onOpenRun=${(runId) => setView({ name: 'run', id: view.id, runId })} onRun=${doRun} onEdit=${() => setView({ name: 'edit', id: view.id })} />`;
|
|
114
|
+
if (view.name === 'run') return html`<${RunView} id=${view.id} runId=${view.runId} onBack=${() => setView({ name: 'detail', id: view.id })} />`;
|
|
115
|
+
|
|
116
|
+
// ── list ──
|
|
117
|
+
return html`
|
|
118
|
+
<div class="wf-tab">
|
|
119
|
+
<div class="wf-head">
|
|
120
|
+
<div>
|
|
121
|
+
<div class="section-title">${t('profile.workflows.title')}</div>
|
|
122
|
+
<div class="section-desc">${t('profile.workflows.desc')}</div>
|
|
123
|
+
</div>
|
|
124
|
+
<button class="btn-primary" onClick=${() => setView({ name: 'create' })}>+ ${t('profile.workflows.new')}</button>
|
|
125
|
+
</div>
|
|
126
|
+
${error && html`<div class="wf-error">${error}</div>`}
|
|
127
|
+
${items.length === 0
|
|
128
|
+
? html`<div class="wf-empty">${t('profile.workflows.empty')}</div>`
|
|
129
|
+
: html`<div class="wf-card-list">
|
|
130
|
+
${items.map(({ def, health }) => html`
|
|
131
|
+
<div class="wf-card" key=${def.id}>
|
|
132
|
+
<div class="wf-card-main" onClick=${() => setView({ name: 'detail', id: def.id })}>
|
|
133
|
+
<div class="wf-card-title">
|
|
134
|
+
${loc(def.title) || def.id}
|
|
135
|
+
<${StatusBadge} status=${health?.lastStatus} />
|
|
136
|
+
</div>
|
|
137
|
+
<div class="wf-card-meta">${triggerSummary(def.trigger)}</div>
|
|
138
|
+
<div class="wf-card-meta">
|
|
139
|
+
${t('profile.workflows.stepCount', { count: def.steps?.length || 0 })}
|
|
140
|
+
${health?.lastRunAt ? html` · ${t('profile.workflows.lastRun')} ${timeAgo(health.lastRunAt)}` : ''}
|
|
141
|
+
</div>
|
|
142
|
+
<${Sparkline} steps=${health?.steps} />
|
|
143
|
+
</div>
|
|
144
|
+
<div class="wf-card-actions">
|
|
145
|
+
<button class="btn-outline" onClick=${() => doRun(def.id, 'signals-only')}>${t('profile.workflows.check')}</button>
|
|
146
|
+
<button class="btn-primary" onClick=${() => doRun(def.id, 'full')}>${t('profile.workflows.run')}</button>
|
|
147
|
+
</div>
|
|
148
|
+
</div>`)}
|
|
149
|
+
</div>`}
|
|
150
|
+
</div>`;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
// ── Detail: blueprint + recent runs ─────────────────────────────────────────────
|
|
154
|
+
function EditFormView({ id, onCancel, onSaved, showToast }) {
|
|
155
|
+
const [def, setDef] = useState(null);
|
|
156
|
+
const [err, setErr] = useState(null);
|
|
157
|
+
useEffect(() => { getWorkflow(id).then(r => setDef(r?.data || null)).catch(e => setErr(e.message)); }, [id]);
|
|
158
|
+
if (err) return html`<div class="wf-tab"><div class="wf-error">${err}</div></div>`;
|
|
159
|
+
if (!def) return html`<div class="wf-loading">${t('profile.workflows.loading')}</div>`;
|
|
160
|
+
return html`<${WorkflowForm} existing=${def} showToast=${showToast} onCancel=${onCancel} onSaved=${onSaved} />`;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
function DetailView({ id, onBack, onOpenRun, onRun, onEdit }) {
|
|
164
|
+
const [blueprint, setBlueprint] = useState(null);
|
|
165
|
+
const [runs, setRuns] = useState([]);
|
|
166
|
+
const [err, setErr] = useState(null);
|
|
167
|
+
|
|
168
|
+
const load = useCallback(async () => {
|
|
169
|
+
const [bp, rr] = await Promise.all([getBlueprint(id).catch(e => ({ _err: e.message })), listRuns(id).catch(() => null)]);
|
|
170
|
+
if (bp?._err) setErr(bp._err); else setBlueprint(bp?.data || null);
|
|
171
|
+
setRuns(rr?.data?.runs || []);
|
|
172
|
+
}, [id]);
|
|
173
|
+
useEffect(() => { load(); }, [load]);
|
|
174
|
+
|
|
175
|
+
return html`
|
|
176
|
+
<div class="wf-tab">
|
|
177
|
+
<div class="wf-detail-head">
|
|
178
|
+
<button class="btn-ghost" onClick=${onBack}>← ${t('profile.workflows.back')}</button>
|
|
179
|
+
<div class="wf-detail-title">${id}</div>
|
|
180
|
+
<div class="wf-detail-actions">
|
|
181
|
+
<button class="btn-ghost" onClick=${onEdit}>${t('profile.workflows.edit')}</button>
|
|
182
|
+
<button class="btn-outline" onClick=${() => onRun(id, 'signals-only')}>${t('profile.workflows.check')}</button>
|
|
183
|
+
<button class="btn-primary" onClick=${() => onRun(id, 'full')}>${t('profile.workflows.run')}</button>
|
|
184
|
+
</div>
|
|
185
|
+
</div>
|
|
186
|
+
|
|
187
|
+
${err && html`<div class="wf-error">${err}</div>`}
|
|
188
|
+
|
|
189
|
+
<div class="wf-section-title">${t('profile.workflows.blueprint')}</div>
|
|
190
|
+
${blueprint && html`<div class="wf-graph">
|
|
191
|
+
${blueprint.nodes.map(n => html`<div class="wf-node" key=${n.stepId}>
|
|
192
|
+
<div class="wf-node-id">${n.stepId}</div>
|
|
193
|
+
<div class="wf-node-agent">${(n.agents || []).join(', ')} · ${n.offerId}</div>
|
|
194
|
+
${n.reads.length > 0 && html`<div class="wf-node-io">↘ ${n.reads.join(', ')}</div>`}
|
|
195
|
+
${n.writes.length > 0 && html`<div class="wf-node-io">↗ ${n.writes.join(', ')}</div>`}
|
|
196
|
+
${(() => {
|
|
197
|
+
const deps = (blueprint.edges || []).filter(e => e.to === n.stepId).map(e => e.from);
|
|
198
|
+
return deps.length > 0 ? html`<div class="wf-node-dep">${t('profile.workflows.after')}: ${deps.join(', ')}</div>` : '';
|
|
199
|
+
})()}
|
|
200
|
+
</div>`)}
|
|
201
|
+
</div>`}
|
|
202
|
+
|
|
203
|
+
<div class="wf-section-title">${t('profile.workflows.recentRuns')}</div>
|
|
204
|
+
${runs.length === 0
|
|
205
|
+
? html`<div class="wf-empty">${t('profile.workflows.noRuns')}</div>`
|
|
206
|
+
: html`<table class="wf-table"><tbody>
|
|
207
|
+
${runs.map(r => html`<tr key=${r.runId} class="wf-run-row" onClick=${() => onOpenRun(r.runId)}>
|
|
208
|
+
<td>${timeAgo(r.startedAt)}</td>
|
|
209
|
+
<td><${StatusBadge} status=${r.status} /></td>
|
|
210
|
+
<td class="wf-muted">${r.mode}</td>
|
|
211
|
+
</tr>`)}
|
|
212
|
+
</tbody></table>`}
|
|
213
|
+
</div>`;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
// ── Run: per-step timeline ──────────────────────────────────────────────────────
|
|
217
|
+
function RunView({ id, runId, onBack }) {
|
|
218
|
+
const [run, setRun] = useState(null);
|
|
219
|
+
const [err, setErr] = useState(null);
|
|
220
|
+
useEffect(() => { getRun(id, runId).then(r => setRun(r?.data || null)).catch(e => setErr(e.message)); }, [id, runId]);
|
|
221
|
+
|
|
222
|
+
return html`
|
|
223
|
+
<div class="wf-tab">
|
|
224
|
+
<div class="wf-detail-head">
|
|
225
|
+
<button class="btn-ghost" onClick=${onBack}>← ${t('profile.workflows.back')}</button>
|
|
226
|
+
<div class="wf-detail-title">${t('profile.workflows.run')} · ${run ? timeAgo(run.startedAt) : runId.slice(0, 8)}</div>
|
|
227
|
+
${run && html`<${StatusBadge} status=${run.status} />`}
|
|
228
|
+
</div>
|
|
229
|
+
${err && html`<div class="wf-error">${err}</div>`}
|
|
230
|
+
${run && html`<div class="wf-steps">
|
|
231
|
+
${Object.entries(run.steps).map(([stepId, s]) => html`<div class="wf-step" key=${stepId}>
|
|
232
|
+
<div class="wf-step-row">
|
|
233
|
+
<${StatusBadge} status=${s.state} />
|
|
234
|
+
<span class="wf-step-id">${stepId}</span>
|
|
235
|
+
${s.reads?.length > 0 && html`<span class="wf-muted">↘ ${s.reads.length}</span>`}
|
|
236
|
+
${s.writes?.length > 0 && html`<span class="wf-muted">↗ ${s.writes.length}</span>`}
|
|
237
|
+
${s.attempt > 0 && html`<span class="wf-muted">${t('profile.workflows.attempt')} ${s.attempt + 1}</span>`}
|
|
238
|
+
</div>
|
|
239
|
+
${(s.outputObserved || s.inputObserved) && html`<pre class="wf-observed">${JSON.stringify(s.outputObserved || s.inputObserved, null, 2)}</pre>`}
|
|
240
|
+
</div>`)}
|
|
241
|
+
${(run.inspections || []).length > 0 && html`<div class="wf-inspections">${t('profile.workflows.inspectorDispatched', { count: run.inspections.length })}</div>`}
|
|
242
|
+
</div>`}
|
|
243
|
+
</div>`;
|
|
244
|
+
}
|
|
@@ -66,6 +66,7 @@ import CalibratorTab from './profile/calibrator-tab.js';
|
|
|
66
66
|
import PackagesTab from './profile/packages-tab.js';
|
|
67
67
|
import CapabilitiesTab from './profile/capabilities-tab.js';
|
|
68
68
|
import SchedulerTab from './profile/scheduler-tab.js';
|
|
69
|
+
import WorkflowsTab from './profile/workflows-tab.js';
|
|
69
70
|
|
|
70
71
|
// Each tab has a minTier: 'new' | 'active' | 'experienced'
|
|
71
72
|
// Tabs with minTier <= current tier are visible in the tab bar.
|
|
@@ -75,6 +76,7 @@ const TABS = [
|
|
|
75
76
|
{ id: 'agents', key: 'profile.tabs.agents', component: AgentsTab, minTier: 'active' },
|
|
76
77
|
{ id: 'offers', key: 'profile.tabs.offers', component: OffersTab, minTier: 'active' },
|
|
77
78
|
{ id: 'scheduler', key: 'profile.tabs.scheduler', component: SchedulerTab, minTier: 'active' },
|
|
79
|
+
{ id: 'workflows', key: 'profile.tabs.workflows', component: WorkflowsTab, minTier: 'active' },
|
|
78
80
|
{ id: 'chatsessions', key: 'profile.tabs.chatSessions', component: ChatSessionsTab, minTier: 'active' },
|
|
79
81
|
{ id: 'mcp', key: 'profile.tabs.mcp', component: McpTab, minTier: 'active' },
|
|
80
82
|
{ id: 'wallet', key: 'profile.tabs.wallet', component: WalletTab, minTier: 'new' },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/cli/connect/mcp/tools/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/cli/connect/mcp/tools/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AA4B7D,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,SAAS,EAAE,QAAQ,EAAE,aAAa,GAAG,IAAI,CA0B9E"}
|
|
@@ -14,6 +14,7 @@ import { registerKnowledgeTools } from './knowledge.js';
|
|
|
14
14
|
import { registerOrganismsTools } from './organisms.js';
|
|
15
15
|
import { registerWorkspaceTools } from './workspaces.js';
|
|
16
16
|
import { registerSchedulesTools } from './schedules.js';
|
|
17
|
+
import { registerWorkflowTools } from './workflows.js';
|
|
17
18
|
import { registerConsentTools } from './consent.js';
|
|
18
19
|
import { registerGroupsTools } from './groups.js';
|
|
19
20
|
import { registerInstancesTools } from './instances.js';
|
|
@@ -39,6 +40,7 @@ export function registerAllTools(mcp, registry) {
|
|
|
39
40
|
registerOrganismsTools(mcp, registry);
|
|
40
41
|
registerWorkspaceTools(mcp, registry);
|
|
41
42
|
registerSchedulesTools(mcp, registry);
|
|
43
|
+
registerWorkflowTools(mcp, registry);
|
|
42
44
|
registerConsentTools(mcp, registry);
|
|
43
45
|
registerGroupsTools(mcp, registry);
|
|
44
46
|
registerInstancesTools(mcp, registry);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/cli/connect/mcp/tools/index.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAC9C,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EAAE,0BAA0B,EAAE,MAAM,qBAAqB,CAAC;AACjE,OAAO,EAAE,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C,CAAC;IACtC,sBAAsB,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;IACtC,kBAAkB,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;IAClC,qBAAqB,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;IACrC,uBAAuB,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;AACzC,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file workflows.ts
|
|
3
|
+
* @description Connector MCP registrations for the Agent Workflows tools — parity with the server
|
|
4
|
+
* MCP (src/mcp/workflows.ts) so `aimeat connect serve --surface agent` exposes the same
|
|
5
|
+
* save/get/run tools locally. Thin REST wrappers over /v1/workflows.
|
|
6
|
+
* @version-history
|
|
7
|
+
* v1.0.0 -- 2026-06-13 -- Close the connector-surface gap for workflow_save/get/run.
|
|
8
|
+
*/
|
|
9
|
+
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
10
|
+
import type { AgentRegistry } from '../../agent-registry.js';
|
|
11
|
+
export declare function registerWorkflowTools(mcp: McpServer, registry: AgentRegistry): void;
|
|
12
|
+
//# sourceMappingURL=workflows.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflows.d.ts","sourceRoot":"","sources":["../../../../../../src/cli/connect/mcp/tools/workflows.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEpE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAI7D,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,SAAS,EAAE,QAAQ,EAAE,aAAa,GAAG,IAAI,CAmCnF"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { annotationsFor } from '../../../../mcp/annotations.js';
|
|
3
|
+
import { descriptionFor } from '../../../../mcp/catalog/shape.js';
|
|
4
|
+
export function registerWorkflowTools(mcp, registry) {
|
|
5
|
+
const { client } = registry.resolve();
|
|
6
|
+
const out = (resp) => ({ content: [{ type: 'text', text: JSON.stringify(resp.data ?? resp, null, 2) }], ...(resp.ok === false ? { isError: true } : {}) });
|
|
7
|
+
mcp.tool('aimeat_workflow_save', descriptionFor('aimeat_workflow_save'), {
|
|
8
|
+
id: z.string().describe('Workflow id (lowercase slug); existing id = update.'),
|
|
9
|
+
definition: z.record(z.string(), z.unknown()).describe('The workflow descriptor: { title, description, trigger, vars[], steps[], on_step_fail:"inspect", llm?{approved} }. Validated against the offer contract + DAG on save.'),
|
|
10
|
+
}, annotationsFor('aimeat_workflow_save'), async ({ id, definition }) => {
|
|
11
|
+
return out(await client.put(`/v1/workflows/${encodeURIComponent(id)}`, definition));
|
|
12
|
+
});
|
|
13
|
+
mcp.tool('aimeat_workflow_get', descriptionFor('aimeat_workflow_get'), {
|
|
14
|
+
id: z.string().optional().describe('Omit to list all your workflows; pass an id for its definition + derived blueprint + recent runs.'),
|
|
15
|
+
}, annotationsFor('aimeat_workflow_get'), async ({ id }) => {
|
|
16
|
+
if (!id)
|
|
17
|
+
return out(await client.get('/v1/workflows'));
|
|
18
|
+
const enc = encodeURIComponent(id);
|
|
19
|
+
const [def, bp, runs] = await Promise.all([
|
|
20
|
+
client.get(`/v1/workflows/${enc}`),
|
|
21
|
+
client.get(`/v1/workflows/${enc}/blueprint`),
|
|
22
|
+
client.get(`/v1/workflows/${enc}/runs`),
|
|
23
|
+
]);
|
|
24
|
+
const recentRuns = ((runs.data?.runs) ?? []).slice(0, 5);
|
|
25
|
+
return {
|
|
26
|
+
content: [{ type: 'text', text: JSON.stringify({ definition: def.data ?? def, blueprint: bp.ok === false ? null : (bp.data ?? null), recentRuns }, null, 2) }],
|
|
27
|
+
...(def.ok === false ? { isError: true } : {}),
|
|
28
|
+
};
|
|
29
|
+
});
|
|
30
|
+
mcp.tool('aimeat_workflow_run', descriptionFor('aimeat_workflow_run'), {
|
|
31
|
+
id: z.string().describe('The workflow id.'),
|
|
32
|
+
mode: z.enum(['signals-only', 'full']).describe('signals-only = evaluate each step\'s signals against existing memory (no dispatch — an instant health check); full = execute the steps live.'),
|
|
33
|
+
}, annotationsFor('aimeat_workflow_run'), async ({ id, mode }) => {
|
|
34
|
+
return out(await client.post(`/v1/workflows/${encodeURIComponent(id)}/run`, { mode }));
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=workflows.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflows.js","sourceRoot":"","sources":["../../../../../../src/cli/connect/mcp/tools/workflows.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAChE,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAElE,MAAM,UAAU,qBAAqB,CAAC,GAAc,EAAE,QAAuB;IAC3E,MAAM,EAAE,MAAM,EAAE,GAAG,QAAQ,CAAC,OAAO,EAAE,CAAC;IACtC,MAAM,GAAG,GAAG,CAAC,IAAsC,EAAE,EAAE,CACrD,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,IAAI,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,IAAI,CAAC,EAAE,KAAK,KAAK,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;IAEhJ,GAAG,CAAC,IAAI,CAAC,sBAAsB,EAAE,cAAc,CAAC,sBAAsB,CAAC,EAAE;QACvE,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,qDAAqD,CAAC;QAC9E,UAAU,EAAE,C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AO,CAAC,WAAW,CAAC,CAAC;CAC9E;AAED,UAAU,eAAe;IACrB,MAAM,EAAE,YAAY,CAAC;IACrB,MAAM,EAAE,mBAAmB,CAAC;IAC5B,SAAS,EAAE,MAAM,CAAC;CACrB;AAkHD,eAAO,MAAM,iBAAiB,EAAE,wBAAwB,EAihCvD,CAAC;AAyDF,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,CAS/D;AAED,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAahE;AAED,wBAAsB,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAyD5G"}
|
|
@@ -1194,6 +1194,43 @@ export const CONNECT_CLI_TOOLS = [
|
|
|
1194
1194
|
input: { name: { type: 'string', required: true, description: 'Cortex name.' } },
|
|
1195
1195
|
handler: ({ client }, input) => client.delete(`/v1/cortex/${encodeURIComponent(requiredString(input, 'name'))}`),
|
|
1196
1196
|
},
|
|
1197
|
+
// ── Agent Workflows (shell-callable parity with the MCP + connector surfaces) ──
|
|
1198
|
+
{
|
|
1199
|
+
name: 'aimeat_workflow_save',
|
|
1200
|
+
description: 'Create/update a workflow. `definition` is the full descriptor (title, description, trigger, vars[], steps[], on_step_fail, llm?); validated against the offer contract + DAG on save.',
|
|
1201
|
+
input: {
|
|
1202
|
+
id: { type: 'string', required: true, description: 'Workflow id (lowercase slug); existing id = update.' },
|
|
1203
|
+
definition: { type: 'object', required: true, description: 'The workflow descriptor.' },
|
|
1204
|
+
},
|
|
1205
|
+
handler: ({ client }, input) => client.put(`/v1/workflows/${encodeURIComponent(requiredString(input, 'id'))}`, requiredRecord(input, 'definition')),
|
|
1206
|
+
},
|
|
1207
|
+
{
|
|
1208
|
+
name: 'aimeat_workflow_get',
|
|
1209
|
+
description: 'Inspect workflows. Omit id to list; pass an id for its definition + derived blueprint + recent runs.',
|
|
1210
|
+
input: { id: { type: 'string', description: 'Omit to list; pass for one workflow.' } },
|
|
1211
|
+
handler: async ({ client }, input) => {
|
|
1212
|
+
const id = optionalString(input, 'id');
|
|
1213
|
+
if (!id)
|
|
1214
|
+
return client.get('/v1/workflows');
|
|
1215
|
+
const enc = encodeURIComponent(id);
|
|
1216
|
+
const [def, bp, runs] = await Promise.all([
|
|
1217
|
+
client.get(`/v1/workflows/${enc}`),
|
|
1218
|
+
client.get(`/v1/workflows/${enc}/blueprint`),
|
|
1219
|
+
client.get(`/v1/workflows/${enc}/runs`),
|
|
1220
|
+
]);
|
|
1221
|
+
const recentRuns = ((runs.data?.runs) ?? []).slice(0, 5);
|
|
1222
|
+
return { ok: def.ok, data: { definition: def.data ?? def, blueprint: bp.ok === false ? null : (bp.data ?? null), recentRuns } };
|
|
1223
|
+
},
|
|
1224
|
+
},
|
|
1225
|
+
{
|
|
1226
|
+
name: 'aimeat_workflow_run',
|
|
1227
|
+
description: 'Run a workflow. mode="signals-only" evaluates signals against memory (no dispatch — instant health check); mode="full" executes the steps.',
|
|
1228
|
+
input: {
|
|
1229
|
+
id: { type: 'string', required: true, description: 'The workflow id.' },
|
|
1230
|
+
mode: { type: 'string', required: true, description: 'signals-only | full' },
|
|
1231
|
+
},
|
|
1232
|
+
handler: ({ client }, input) => client.post(`/v1/workflows/${encodeURIComponent(requiredString(input, 'id'))}/run`, { mode: requiredString(input, 'mode') }),
|
|
1233
|
+
},
|
|
1197
1234
|
];
|
|
1198
1235
|
function getTool(name) {
|
|
1199
1236
|
return CONNECT_CLI_TOOLS.find(tool => tool.name === name);
|