loopengine 0.5.1 → 0.5.3

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.
@@ -66,6 +66,9 @@ export interface RunTrace {
66
66
  workflow_version: number | null;
67
67
  workflow_version_id: string | null;
68
68
  status: WorkflowRun['status'];
69
+ /** What started it: the console, an app's API call, a schedule, a
70
+ * webhook, an assignment or another workflow. */
71
+ source: WorkflowRun['source'];
69
72
  started_at: string;
70
73
  finished_at: string | null;
71
74
  input: {
@@ -52,6 +52,7 @@ export function buildRunTrace(input) {
52
52
  workflow_version: version,
53
53
  workflow_version_id: version ? `${run.workflow_id}@v${version}` : null,
54
54
  status: run.status,
55
+ source: run.source,
55
56
  started_at: run.started_at,
56
57
  finished_at: run.finished_at ?? null,
57
58
  input: { params: run.params ?? {}, message: run.message },
@@ -3,6 +3,6 @@ export declare function workflowAuditReportHtml(audit: WorkflowAudit, options: {
3
3
  generatedAt: string;
4
4
  by: string;
5
5
  jsonHref: string;
6
- caseHref: (runId: string) => string;
6
+ traceHref: (runId: string) => string;
7
7
  pageHref: string;
8
8
  }): string;
@@ -28,9 +28,9 @@ export function workflowAuditReportHtml(audit, options) {
28
28
  const overruled = audit.overruled.map((d) => `<tr>
29
29
  <td>${esc(when(d.at))}</td><td>${d.approved ? 'Changed, then approved' : 'Denied'}</td><td><code>${esc(d.tool)}</code></td><td>${esc(d.by ?? '')}</td>
30
30
  <td>${d.reason ? `“${esc(d.reason)}”` : ''}${(d.changes ?? []).map((ch) => `<div><code>${esc(ch.field)}</code>: <del>${esc(ch.from)}</del> → <ins>${esc(ch.to)}</ins></div>`).join('')}</td>
31
- <td><a href="${esc(options.caseHref(d.runId))}">case</a></td></tr>`).join('');
31
+ <td><a href="${esc(options.traceHref(d.runId))}">trace</a></td></tr>`).join('');
32
32
  const people = audit.people.map((p) => `<tr><td>${esc(p.by)}</td><td>${p.approved}</td><td>${p.changed}</td><td>${p.denied}</td><td>${p.answered}</td></tr>`).join('');
33
- const cases = audit.cases.slice(0, 500).map((k) => `<tr><td>${esc(when(k.at))}</td><td>${STATUS[k.status] ?? esc(k.status)}</td><td>${esc(k.inputs)}</td><td>${k.workflowVersion ? `v${k.workflowVersion}` : ''}</td><td>${esc(k.decidedBy.join(', '))}</td><td class="ar-outcome">${esc(k.outcome)}</td><td><a href="${esc(options.caseHref(k.runId))}">open</a></td></tr>`).join('');
33
+ const cases = audit.cases.slice(0, 500).map((k) => `<tr><td>${esc(when(k.at))}</td><td>${STATUS[k.status] ?? esc(k.status)}</td><td>${esc(k.inputs)}</td><td>${k.workflowVersion ? `v${k.workflowVersion}` : ''}</td><td>${esc(k.decidedBy.join(', '))}</td><td class="ar-outcome">${esc(k.outcome)}</td><td><a href="${esc(options.traceHref(k.runId))}">trace</a></td></tr>`).join('');
34
34
  const changes = audit.changes.map((ch) => `<li>${esc(when(ch.at))} · ${esc(ch.label)}${ch.by ? ` · ${esc(ch.by)}` : ''}${(ch.fields ?? []).map((f) => (f.added || f.removed
35
35
  ? `<div class="ar-diff"><div class="hint">${esc(f.field)}</div>${(f.removed ?? []).map((l) => `<div class="del">− ${esc(l)}</div>`).join('')}${(f.added ?? []).map((l) => `<div class="ins">+ ${esc(l)}</div>`).join('')}</div>`
36
36
  : `<div class="hint">${esc(f.field)}: <del>${esc(f.from)}</del> → <ins>${esc(f.to)}</ins></div>`)).join('')}</li>`).join('');
@@ -41,6 +41,8 @@ export interface WorkflowDraft {
41
41
  savedBy?: string;
42
42
  /** The published version it was started from. */
43
43
  basedOn?: number;
44
+ /** The earlier version restored into it, for publishing's default note. */
45
+ restoredFrom?: number;
44
46
  }
45
47
  export declare function readDraft(projectDir: string, agent: string, workflowId: string): WorkflowDraft | undefined;
46
48
  /** A draft with nothing in it. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "loopengine",
3
- "version": "0.5.1",
3
+ "version": "0.5.3",
4
4
  "type": "module",
5
5
  "description": "Runtime for tool-using AI agents with a transparent ReAct loop.",
6
6
  "license": "MIT",