ltcai 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.md CHANGED
@@ -353,29 +353,29 @@ Supported routes include OpenAI-compatible APIs, OpenRouter, Groq, Together, xAI
353
353
 
354
354
  ## Current release
355
355
 
356
- **2.0.0 — Agentic Workspace Platform.** Lattice AI graduates from a local-first
357
- AI *workspace* to a local-first **Agentic Workspace Platform**: four new
358
- subsystems land as one cohesive, fully integrated platform — all additive, with
359
- every v1.x surface preserved.
360
-
361
- - **Plugin SDK** — versioned, permissioned plugins (`plugin.json` manifest,
362
- allow-listed permissions, lifecycle, validation, and a safe execution
363
- boundary) that **extend** existing skills/tools/workflows rather than replace
364
- them. Ships two example plugins. See [docs/PLUGIN_SDK.md](docs/PLUGIN_SDK.md).
365
- - **Workflow Designer** node-based workflows (trigger · tool · skill · plugin ·
366
- agent · condition · output) with validation, execution, run history, and
367
- export/import. Pre-2.0 workflow history keeps working.
368
- See [docs/WORKFLOW_DESIGNER.md](docs/WORKFLOW_DESIGNER.md).
369
- - **Multi-Agent Runtime 2.0** Planner · Executor · Reviewer · Researcher ·
370
- Release roles with handoff, retry, and an observable timeline, connected to
371
- workspace, memory, graph, and workflow runs.
372
- See [docs/MULTI_AGENT_RUNTIME.md](docs/MULTI_AGENT_RUNTIME.md).
373
- - **Realtime Collaboration** — presence + an activity feed over SSE, fed
374
- automatically from every workspace timeline event; single-user local mode and
375
- workspace isolation preserved. See [docs/REALTIME_COLLABORATION.md](docs/REALTIME_COLLABORATION.md).
376
- - **Cross-system integration** — workflows run plugins/skills/agents, agent runs
377
- run plugins/workflows, and all activity surfaces in the realtime feed, the
378
- knowledge graph, and the workspace timeline. See [docs/V2_ARCHITECTURE.md](docs/V2_ARCHITECTURE.md).
356
+ **2.1.0 — Agent Platform Maturity Release.** Lattice AI operationalizes the
357
+ v2.0 platform without replacing it: agent handoff, context packets, review/retry,
358
+ planning, memory, replay, marketplace templates, and realtime execution
359
+ observability are now first-class and still additive.
360
+
361
+ - **Agent handoff + context packets** — handoffs now carry `handoff_id`,
362
+ source/target agent ids, reason, status, timestamps, and safe structured
363
+ context packets for replayable role transfer.
364
+ - **Review / retry loops** Planner -> Executor -> Reviewer records plan
365
+ review, reviewer notes, retry history, retry limits, and failure propagation.
366
+ - **Timeline / replay** agent and workflow runs expose replay frames showing
367
+ who acted, when, why, input, output, and decisions.
368
+ - **Agent memory + planning** — short-term, workspace, and long-term memory
369
+ kinds are supported with workspace-scoped snapshots; plans are persisted with
370
+ run history and plan-review metadata.
371
+ - **Workflow / agent / plugin hardening** — plugin outputs enter agent context,
372
+ agent outputs enter workflow outputs, and plugin/workflow/agent failures emit
373
+ observable execution events.
374
+ - **Marketplace foundation** local Plugin, Workflow, and Agent templates have
375
+ metadata, export/import, install hooks, and a registry. No cloud marketplace
376
+ service is introduced.
377
+ - **Realtime execution observability** existing SSE feed now emits agent,
378
+ handoff, review, retry, workflow, plugin, and execution failure events.
379
379
  - **Compatibility preserved** — API schemas, `server:app`,
380
380
  `latticeai.server_app.app`, CLI, MCP, model, workspace, chat, KG, existing
381
381
  skills/snapshots/memories/agent history, and the VS Code extension remain
@@ -383,7 +383,8 @@ every v1.x surface preserved.
383
383
 
384
384
  | Version | Theme |
385
385
  |---|---|
386
- | **2.0.0** | Agentic Workspace Platform (Plugin SDK, Workflow Designer, Multi-Agent Runtime, Realtime) |
386
+ | **2.1.0** | Agent Platform Maturity Release (handoff, context packets, review/retry, replay, memory, planning, marketplace foundation) |
387
+ | 2.0.0 | Agentic Workspace Platform (Plugin SDK, Workflow Designer, Multi-Agent Runtime, Realtime) |
387
388
  | 1.7.0 | Graph & Collaboration Release |
388
389
  | 1.6.0 | Product Experience Deepening (UX + real screenshots) |
389
390
  | 1.5.0 | Unified Product Release (CI/VSIX recovery, model recommendation, Enterprise PoC) |
package/docs/CHANGELOG.md CHANGED
@@ -1,5 +1,59 @@
1
1
  # Changelog
2
2
 
3
+ ## [2.1.0] - 2026-06-01
4
+
5
+ > Agent Platform Maturity Release — v2.1 operationalizes the v2.0 platform
6
+ > without redesigning it. Agent handoff, context packets, review/retry loops,
7
+ > timeline replay, memory snapshots, planning records, marketplace templates,
8
+ > and realtime execution observability are now first-class and additive.
9
+
10
+ ### Added
11
+
12
+ - **Explicit agent handoff** — handoff records now include `handoff_id`,
13
+ source/target agent ids, reason, task summary, context packet, status, and
14
+ timestamps. Handoffs are workspace-scoped, persisted, inspectable, and replayable.
15
+ - **Agent context packets** — structured transfer packets include objective,
16
+ task summary, workspace/graph/memory/workflow context, plugin outputs,
17
+ constraints, reviewer notes, and retry metadata with obvious secret fields
18
+ redacted before persistence.
19
+ - **Review / retry loops** — Planner -> Executor -> Reviewer records plan review,
20
+ reviewer outcomes (`approve`, `reject`, `retry`), retry history, retry limits,
21
+ reviewer notes, and failure propagation.
22
+ - **Timeline / replay** — agent and workflow runs expose replay support through
23
+ persisted frames that show actor, time, reason, input, output, and decision.
24
+ UI pages add replay viewers for agent and workflow runs.
25
+ - **Agent memory and planning** — `short_term`, `workspace`, and `long_term`
26
+ memory scopes are supported, memory snapshots are workspace-scoped and
27
+ replayable, and agent plans persist with plan-review metadata.
28
+ - **Workflow / agent / plugin hardening** — plugin output enters agent context,
29
+ agent output enters workflow output, retry paths are bounded, and failures
30
+ propagate into run status and realtime events.
31
+ - **Marketplace foundation** — local Plugin, Workflow, and Agent templates with
32
+ metadata, export/import, install hooks, and a template registry. No cloud
33
+ marketplace service is introduced.
34
+ - **Realtime execution observability** — existing SSE feed emits
35
+ `agent_started`, `handoff_created`, `handoff_accepted`, `handoff_completed`,
36
+ `review_requested`, `review_approved`, `retry_requested`,
37
+ `workflow_started`, `plugin_started`, `plugin_completed`, `execution_failed`,
38
+ and related workspace-scoped events.
39
+
40
+ ### Changed
41
+
42
+ - Python package, npm package, VS Code extension, Workspace OS, FastAPI app, and
43
+ `/health` version metadata aligned at `2.1.0`.
44
+ - Multi-Agent Runtime, Plugin SDK, Workflow Engine, and Realtime surface
45
+ versions now report `2.1.0`.
46
+ - Platform UI pages for agents, workflows, plugins, and activity now expose
47
+ handoff chains, review panels, retry history, replay, templates, and plugin
48
+ execution visibility.
49
+
50
+ ### Validation
51
+
52
+ - Unit coverage added for handoff/context persistence, review/retry history,
53
+ memory snapshots, replay, workflow-agent-plugin output propagation,
54
+ marketplace template install, and realtime execution events.
55
+ - Package-store publishing remains manual; release artifacts are version-scoped.
56
+
3
57
  ## [2.0.0] - 2026-06-01
4
58
 
5
59
  > Agentic Workspace Platform — Lattice AI becomes a local-first **Agentic
@@ -1,19 +1,37 @@
1
- # Lattice AI Multi-Agent Runtime 2.0
1
+ # Lattice AI Multi-Agent Runtime 2.1
2
2
 
3
- The Multi-Agent Runtime is the **orchestration layer** introduced in v2.0.0. It sits
3
+ The Multi-Agent Runtime is the **orchestration layer** introduced in v2.0.0 and
4
+ operationalized in v2.1.0. It sits
4
5
  *above* the v1.x single-agent state machine ([`AgentRuntime`](../latticeai/core/agent.py))
5
6
  and coordinates a pipeline of named **roles** that hand off work to one another,
6
- retry on a failing review, and emit a fully observable timeline.
7
+ retry on a failing review, and emit a fully observable, replayable timeline.
7
8
 
8
9
  - **Source of truth:** `latticeai/core/multi_agent.py`
9
10
  - **HTTP surface:** `latticeai/api/agents.py`
10
11
  - **Persistence / Knowledge Graph integration:** `latticeai/core/workspace_os.py`
11
- (`WorkspaceOSStore.record_agent_run`)
12
+ (`WorkspaceOSStore.record_agent_run`, `replay_agent_run`, `list_handoffs`)
12
13
 
13
14
  ```python
14
- MULTI_AGENT_VERSION = "2.0.0"
15
+ MULTI_AGENT_VERSION = "2.1.0"
15
16
  ```
16
17
 
18
+ ## What v2.1 adds
19
+
20
+ v2.1 does not replace the v2.0 runtime; it makes the runtime's operational
21
+ objects durable and inspectable:
22
+
23
+ - **Explicit handoff records**: `handoff_id`, source/target agent ids, reason,
24
+ task summary, context packet, status, and timestamps.
25
+ - **Agent context packets**: objective, task summary, workspace/graph/memory/
26
+ workflow context, plugin outputs, constraints, reviewer notes, and retry
27
+ metadata with obvious secret keys redacted.
28
+ - **Review / retry history**: reviewer outcomes normalize to `approve`,
29
+ `reject`, or `retry`; retry reasons, notes, counts, and limits are persisted.
30
+ - **Planning records**: plans include a `plan_id`, ordered executable steps, and
31
+ plan-review metadata.
32
+ - **Replay**: persisted runs can be replayed as frames showing actor, time,
33
+ reason, input, output, and decision via `/agents/api/runs/{run_id}/replay`.
34
+
17
35
  ## How it relates to the v1 single-agent runtime
18
36
 
19
37
  v1.x shipped a single-agent state machine — `AgentRuntime` driving
@@ -1,9 +1,11 @@
1
1
  # Lattice AI Plugin SDK
2
2
 
3
- The Plugin SDK is the v2.0.0 extension layer for the Lattice AI Agentic Workspace
4
- Platform. It lets you package skills, tools, workflow templates, and actions into
5
- one versioned, permissioned unit a *plugin*. A plugin is a directory under the
6
- configured `plugins` root that ships a `plugin.json` manifest.
3
+ The Plugin SDK is the extension layer for the Lattice AI Agentic Workspace
4
+ Platform. v2.1.0 keeps the v2.0 plugin model and adds execution observability plus
5
+ local marketplace-template foundations. It lets you package skills, tools,
6
+ workflow templates, and actions into one versioned, permissioned unit — a
7
+ *plugin*. A plugin is a directory under the configured `plugins` root that ships
8
+ a `plugin.json` manifest.
7
9
 
8
10
  The SDK is intentionally **additive**. Plugins *extend* the existing Skill, Tool,
9
11
  and Workflow surfaces; they never replace them. Standalone skills that are already
@@ -20,9 +22,19 @@ through the existing skill registry rather than owning a parallel one.
20
22
  The host SDK version is exposed as:
21
23
 
22
24
  ```python
23
- PLUGIN_SDK_VERSION = "2.0.0"
25
+ PLUGIN_SDK_VERSION = "2.1.0"
24
26
  ```
25
27
 
28
+ ## v2.1 additions
29
+
30
+ - `execute_action(...)` emits `plugin_started`, `plugin_completed`, and
31
+ `execution_failed` through the existing Workspace OS timeline/realtime feed.
32
+ - Plugin outputs can be carried inside agent context packets and replayed from
33
+ agent/workflow run history.
34
+ - The local template catalog (`latticeai.core.marketplace`) adds Plugin,
35
+ Workflow, and Agent template metadata, export/import, install hooks, and a
36
+ template registry without introducing a cloud marketplace service.
37
+
26
38
  ---
27
39
 
28
40
  ## The `plugin.json` manifest
@@ -39,7 +51,7 @@ parsed and validated into an immutable `PluginManifest`.
39
51
  | `version` | string | yes | Semantic version (`^\d+\.\d+\.\d+([.-][0-9A-Za-z.]+)?$`). |
40
52
  | `description` | string | no | Short summary. |
41
53
  | `author` | string | no | Author or organization. |
42
- | `lattice_version` | string | no | Minimum host version this plugin requires. May be bare (`"2.0.0"`) or prefixed (`">=2.0.0"`). Empty means "any host". |
54
+ | `lattice_version` | string | no | Minimum host version this plugin requires. May be bare (`"2.1.0"`) or prefixed (`">=2.1.0"`). Empty means "any host". |
43
55
  | `permissions` | string[] | no | Must be a subset of the [permission allow-list](#permissions). Unknown values are rejected. |
44
56
  | `provides` | object | no | What the plugin contributes. Keys must be in `("skills", "tools", "workflows", "actions")`; each value is a list of names. |
45
57
  | `entrypoint` | string | no | Reserved for an optional code entrypoint. |
@@ -193,12 +205,13 @@ identically:
193
205
  { "lattice_version": ">=2.0.0" }
194
206
  ```
195
207
 
196
- Examples against a host of `2.0.0`:
208
+ Examples against a host of `2.1.0`:
197
209
 
198
210
  | Required | Compatible | Why |
199
211
  | --- | --- | --- |
200
212
  | `""` (missing) | yes | Any host. |
201
213
  | `2.0.0` / `>=2.0.0` | yes | Same major, host `>=` required. |
214
+ | `2.1.0` / `>=2.1.0` | yes | Same major, exact current host. |
202
215
  | `2.1.0` | no | Host is lower than the required minimum. |
203
216
  | `1.0.0` | no | Major mismatch. |
204
217
  | `3.0.0` | no | Major mismatch. |
@@ -1,8 +1,10 @@
1
1
  # Lattice AI Realtime Collaboration
2
2
 
3
- Realtime Collaboration is the v2.0.0 subsystem that gives a Lattice AI workspace
4
- a live **presence** registry and an **activity feed**. It is delivered over
5
- Server-Sent Events (SSE) by an in-process pub/sub bus, the
3
+ Realtime Collaboration is the subsystem that gives a Lattice AI workspace a live
4
+ **presence** registry and an **activity feed**. In v2.1.0 it also carries
5
+ workspace-scoped execution observability for agents, handoffs, reviews,
6
+ workflows, plugins, retries, and failures. It is delivered over Server-Sent
7
+ Events (SSE) by an in-process pub/sub bus, the
6
8
  [`RealtimeBus`](../latticeai/core/realtime.py).
7
9
 
8
10
  The design goal is to surface "what is happening in the workspace right now"
@@ -10,6 +12,17 @@ The design goal is to surface "what is happening in the workspace right now"
10
12
  who is online) without adding a new transport, a new dependency, or a second
11
13
  event system.
12
14
 
15
+ The bus version is:
16
+
17
+ ```python
18
+ REALTIME_VERSION = "2.1.0"
19
+ ```
20
+
21
+ v2.1 execution event types include `agent_started`, `handoff_created`,
22
+ `handoff_accepted`, `handoff_completed`, `review_requested`, `review_approved`,
23
+ `retry_requested`, `workflow_started`, `workflow_completed`, `plugin_started`,
24
+ `plugin_completed`, `execution_failed`, and `execution_cancelled`.
25
+
13
26
  ---
14
27
 
15
28
  ## Why SSE
@@ -288,7 +301,7 @@ defaults to `50` and is clamped to the `200`-entry buffer. Returns newest-first:
288
301
  {
289
302
  "events": [ /* enriched events, newest first */ ],
290
303
  "stats": {
291
- "version": "2.0.0",
304
+ "version": "2.1.0",
292
305
  "subscribers": 1,
293
306
  "presence": 2,
294
307
  "feed_size": 17,
@@ -312,7 +325,7 @@ Returns the scope-filtered presence registry plus the same `stats` block:
312
325
  "last_seen": "2026-06-01T10:15:30"
313
326
  }
314
327
  ],
315
- "stats": { "version": "2.0.0", "subscribers": 1, "presence": 1, "feed_size": 17, "transport": "sse" }
328
+ "stats": { "version": "2.1.0", "subscribers": 1, "presence": 1, "feed_size": 17, "transport": "sse" }
316
329
  }
317
330
  ```
318
331
 
@@ -406,5 +419,5 @@ no client-side filtering is needed.
406
419
  on top of it, not a replacement.
407
420
  - **Single process.** The bus is in-process by design for the local-first
408
421
  deployment; it does not coordinate across multiple server processes.
409
- - **`stats()`** reports `version` (`2.0.0`), live `subscribers`, `presence`
422
+ - **`stats()`** reports `version` (`2.1.0`), live `subscribers`, `presence`
410
423
  count, `feed_size`, and the `transport` (`"sse"`) for health/observability.
@@ -1,9 +1,11 @@
1
- # Lattice AI v2.0 Architecture — Agentic Workspace Platform
1
+ # Lattice AI v2 Architecture — Agentic Workspace Platform
2
2
 
3
- Lattice AI v2.0.0 turns the local-first Workspace OS into a full **Agentic
4
- Workspace Platform**: a single FastAPI application in which plugins, designed
5
- workflows, multi-agent runs, and a realtime collaboration feed all compose over
6
- the same local-first JSON store and Knowledge Graph.
3
+ Lattice AI v2.0.0 turned the local-first Workspace OS into a full **Agentic
4
+ Workspace Platform**. v2.1.0 keeps that architecture and matures the operational
5
+ layer: explicit handoffs, context packets, review/retry loops, memory snapshots,
6
+ planning records, replay, marketplace templates, and realtime execution
7
+ observability all compose over the same local-first JSON store and Knowledge
8
+ Graph.
7
9
 
8
10
  This document describes how the four v2.0 pillars fit together, the small set of
9
11
  **additive integration seams** that wire them, the cross-integration matrix that
@@ -17,6 +19,7 @@ on. Every claim below is grounded in the shipping source:
17
19
  - Workflow engine: `latticeai/core/workflow_engine.py`, `latticeai/api/workflow_designer.py`
18
20
  - Multi-Agent runtime: `latticeai/core/multi_agent.py`, `latticeai/api/agents.py`
19
21
  - Realtime bus: `latticeai/core/realtime.py`, `latticeai/api/realtime.py`
22
+ - Marketplace foundation: `latticeai/core/marketplace.py`, `latticeai/api/marketplace.py`
20
23
  - Project conventions: `AGENTS.md`
21
24
 
22
25
  All four subsystems share the same design rules from `AGENTS.md`: dependency
@@ -26,12 +29,13 @@ constructed by `server_app.py` and exposed through a router factory.
26
29
 
27
30
  ---
28
31
 
29
- ## 1. The Four v2.0 Pillars
32
+ ## 1. The Four v2 Pillars
30
33
 
31
34
  The platform version is the single source of truth `WORKSPACE_OS_VERSION =
32
- "2.0.0"` (`latticeai/core/workspace_os.py`). Each pillar module re-declares the
35
+ "2.1.0"` (`latticeai/core/workspace_os.py`). Each pillar module re-declares the
33
36
  same version for its own surface (`PLUGIN_SDK_VERSION`, `WORKFLOW_ENGINE_VERSION`,
34
- `MULTI_AGENT_VERSION`, `REALTIME_VERSION`).
37
+ `MULTI_AGENT_VERSION`, `REALTIME_VERSION`) and the marketplace foundation exposes
38
+ `MARKETPLACE_VERSION`.
35
39
 
36
40
  ### 1.1 Plugin SDK (`latticeai.core.plugins`)
37
41
 
@@ -418,9 +422,9 @@ guarantee every cross-system run terminates.
418
422
 
419
423
  ---
420
424
 
421
- ## 5. HTTP Surface (v2.0 additions)
425
+ ## 5. HTTP Surface (v2 additions)
422
426
 
423
- All v2.0 routes are namespaced so they never collide with existing paths
427
+ All v2 routes are namespaced so they never collide with existing paths
424
428
  (`/plugins/registry` vs. the marketplace `/plugins/directory`; `/workflows` vs.
425
429
  `/workspace/workflows`; `/agents` plural vs. the single-agent `/agent`).
426
430
 
@@ -435,10 +439,18 @@ All v2.0 routes are namespaced so they never collide with existing paths
435
439
  /workflows/api/definitions/{id}`, `POST /workflows/api/validate`,
436
440
  `POST /workflows/api/definitions/{id}/run`,
437
441
  `GET /workflows/api/definitions/{id}/runs`, `GET /workflows/api/runs`,
442
+ `GET /workflows/api/runs/{run_id}/replay`,
438
443
  `GET /workflows/api/export/{id}`, `POST /workflows/api/import`.
439
444
 
440
445
  **Multi-Agent Runtime** (`latticeai/api/agents.py`): `GET /agents`,
441
- `GET /agents/api/roles`, `GET /agents/api/runs`, `POST /agents/api/run`.
446
+ `GET /agents/api/roles`, `GET /agents/api/runs`,
447
+ `GET /agents/api/runs/{run_id}/replay`, `GET /agents/api/handoffs`,
448
+ `GET|POST /agents/api/memory/snapshots`, `POST /agents/api/run`.
449
+
450
+ **Marketplace foundation** (`latticeai/api/marketplace.py`):
451
+ `GET /marketplace/templates`, `GET /marketplace/templates/{kind}/{id}/export`,
452
+ `POST /marketplace/templates/import`, `POST /marketplace/templates/install`,
453
+ `GET /marketplace/templates/registry`.
442
454
 
443
455
  **Realtime Collaboration** (`latticeai/api/realtime.py`): `GET /activity`,
444
456
  `GET /realtime/stream` (SSE), `GET /realtime/feed`, `GET /realtime/presence`,
@@ -460,7 +472,7 @@ Representative run request/response (Workflow Designer):
460
472
 
461
473
  ```json
462
474
  // POST /agents/api/run
463
- { "goal": "Draft v2.0 release notes", "roles": ["planner", "executor", "reviewer"], "max_retries": 2 }
475
+ { "goal": "Draft v2.1 release notes", "roles": ["planner", "executor", "reviewer"], "max_retries": 2 }
464
476
  ```
465
477
 
466
478
  ```json
@@ -474,7 +486,7 @@ Representative run request/response (Workflow Designer):
474
486
 
475
487
  ## 6. Compatibility
476
488
 
477
- > **Compatibility note.** v2.0.0 is **additive**. All v1.x data and APIs are
489
+ > **Compatibility note.** v2.1.0 is **additive**. All v1.x and v2.0 data and APIs are
478
490
  > preserved; the platform layers new capabilities on top of unchanged surfaces.
479
491
 
480
492
  Preserved surfaces, verified against source:
@@ -482,7 +494,7 @@ Preserved surfaces, verified against source:
482
494
  - **ASGI entrypoints.** `server:app` and `latticeai.server_app.app` remain the
483
495
  application objects. `server_app.py` still exposes the module-level `app =
484
496
  FastAPI(...)` plus the `main()` / `uvicorn.run(app, ...)` entry point.
485
- - **Version wiring.** `WORKSPACE_OS_VERSION = "2.0.0"` drives both
497
+ - **Version wiring.** `WORKSPACE_OS_VERSION = "2.1.0"` drives both
486
498
  `APP_VERSION` (and thus the FastAPI `app.version`) and the `/health`
487
499
  response — the health router is constructed with `app_version=APP_VERSION`.
488
500
  - **Existing routes.** Every v1.x router (`auth`, `admin`, `security_dashboard`,
@@ -1,11 +1,11 @@
1
1
  # Lattice AI Workflow Designer
2
2
 
3
- The Workflow Designer (introduced in **v2.0.0**) lets you build, validate, run,
4
- inspect, export, and import automations as a small **directed graph of typed
5
- nodes**. A workflow starts from a single `trigger` node and walks node-to-node
6
- to an `output`, dispatching each executable node to an injected *runner* that
7
- calls the real tool registry, skill registry, plugin registry, or multi-agent
8
- orchestrator.
3
+ The Workflow Designer (introduced in **v2.0.0** and hardened in **v2.1.0**) lets
4
+ you build, validate, run, inspect, replay, export, and import automations as a
5
+ small **directed graph of typed nodes**. A workflow starts from a single
6
+ `trigger` node and walks node-to-node to an `output`, dispatching each executable
7
+ node to an injected *runner* that calls the real tool registry, skill registry,
8
+ plugin registry, or multi-agent orchestrator.
9
9
 
10
10
  The execution model lives in
11
11
  [`latticeai/core/workflow_engine.py`](../latticeai/core/workflow_engine.py)
@@ -17,9 +17,19 @@ is preserved.
17
17
  The engine version is exported as:
18
18
 
19
19
  ```python
20
- WORKFLOW_ENGINE_VERSION = "2.0.0"
20
+ WORKFLOW_ENGINE_VERSION = "2.1.0"
21
21
  ```
22
22
 
23
+ ## v2.1 hardening
24
+
25
+ - Agent node output is captured in workflow context and can flow into a later
26
+ plugin or output node through `last_output`.
27
+ - Plugin node failures mark the run failed and emit realtime execution events.
28
+ - Workflow runs are replayable via `/workflows/api/runs/{run_id}/replay`, with
29
+ frames for actor, time, reason, input, output, and decision.
30
+ - `record_workflow_run` emits `workflow_started`, `workflow_completed`, and
31
+ `execution_failed` events over the existing SSE activity feed.
32
+
23
33
  ---
24
34
 
25
35
  ## Node types
@@ -439,7 +449,7 @@ or scope), stamped with the engine version and stripped of the internal
439
449
 
440
450
  ```json
441
451
  {
442
- "lattice_workflow_export": "2.0.0",
452
+ "lattice_workflow_export": "2.1.0",
443
453
  "name": "Daily digest",
444
454
  "nodes": [ /* ... */ ],
445
455
  "metadata": {}
@@ -1,3 +1,3 @@
1
1
  """Lattice AI - modular server package."""
2
2
 
3
- __version__ = "2.0.0"
3
+ __version__ = "2.1.0"
@@ -1,4 +1,4 @@
1
- """Multi-Agent Runtime 2.0 API router (v2.0).
1
+ """Multi-Agent Runtime API router (v2).
2
2
 
3
3
  Exposes the built-in agent roles and an orchestrated run endpoint that connects
4
4
  to Workspace, Memory, Knowledge Graph, Workflow runs, and the Timeline. Paths
@@ -22,6 +22,12 @@ class AgentRunRequest(BaseModel):
22
22
  max_retries: int = 2
23
23
 
24
24
 
25
+ class MemorySnapshotRequest(BaseModel):
26
+ label: str = "agent memory snapshot"
27
+ reason: str = ""
28
+ memory_ids: List[str] = []
29
+
30
+
25
31
  def create_agents_router(
26
32
  *,
27
33
  store,
@@ -66,6 +72,49 @@ def create_agents_router(
66
72
  scope = gate_read(request)
67
73
  return store.list_agents(workspace_id=scope)
68
74
 
75
+ @router.get("/agents/api/handoffs")
76
+ async def agent_handoffs(request: Request, run_id: str = ""):
77
+ require_user(request)
78
+ scope = gate_read(request)
79
+ return store.list_handoffs(workspace_id=scope, run_id=run_id or None)
80
+
81
+ @router.get("/agents/api/runs/{run_id}")
82
+ async def agent_run_detail(run_id: str, request: Request):
83
+ require_user(request)
84
+ scope = gate_read(request)
85
+ try:
86
+ return {"run": store.get_agent_run(run_id, workspace_id=scope)}
87
+ except FileNotFoundError as exc:
88
+ raise HTTPException(status_code=404, detail=f"Agent run not found: {run_id}") from exc
89
+
90
+ @router.get("/agents/api/runs/{run_id}/replay")
91
+ async def agent_run_replay(run_id: str, request: Request):
92
+ require_user(request)
93
+ scope = gate_read(request)
94
+ try:
95
+ return {"replay": store.replay_agent_run(run_id, workspace_id=scope)}
96
+ except FileNotFoundError as exc:
97
+ raise HTTPException(status_code=404, detail=f"Agent run not found: {run_id}") from exc
98
+
99
+ @router.get("/agents/api/memory/snapshots")
100
+ async def agent_memory_snapshots(request: Request, limit: int = 50):
101
+ require_user(request)
102
+ scope = gate_read(request)
103
+ return store.list_memory_snapshots(workspace_id=scope, limit=limit)
104
+
105
+ @router.post("/agents/api/memory/snapshots")
106
+ async def agent_memory_snapshot(req: MemorySnapshotRequest, request: Request):
107
+ current_user = require_user(request)
108
+ scope = gate_write(request)
109
+ snapshot = store.create_memory_snapshot(
110
+ label=req.label,
111
+ reason=req.reason,
112
+ memory_ids=req.memory_ids or None,
113
+ user_email=current_user or None,
114
+ workspace_id=scope,
115
+ )
116
+ return {"snapshot": snapshot}
117
+
69
118
  @router.post("/agents/api/run")
70
119
  async def agent_run(req: AgentRunRequest, request: Request):
71
120
  current_user = require_user(request)
@@ -88,6 +137,13 @@ def create_agents_router(
88
137
  output_text=result.output,
89
138
  timeline=result.timeline,
90
139
  relationships=[ROLE_AGENT_IDS.get(r, f"agent:{r}") for r in result.roles_run],
140
+ handoffs=result.handoffs,
141
+ context_packets=result.context_packets,
142
+ plan=result.plan,
143
+ plan_review=result.plan_review,
144
+ review_history=result.review_history,
145
+ retry_history=result.retry_history,
146
+ memory_snapshots=result.memory_snapshots,
91
147
  user_email=current_user or None,
92
148
  graph=workspace_graph(),
93
149
  workspace_id=scope,
@@ -0,0 +1,81 @@
1
+ """Marketplace foundation API (local templates only)."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from typing import Any, Callable, Dict, Optional
6
+
7
+ from fastapi import APIRouter, HTTPException, Request
8
+ from pydantic import BaseModel
9
+
10
+
11
+ class TemplateImportRequest(BaseModel):
12
+ data: Dict[str, Any] = {}
13
+
14
+
15
+ class TemplateInstallRequest(BaseModel):
16
+ data: Dict[str, Any] = {}
17
+
18
+
19
+ def create_marketplace_router(
20
+ *,
21
+ store,
22
+ catalog,
23
+ require_user: Callable[[Request], str],
24
+ gate_read: Callable[[Request], Optional[str]],
25
+ gate_write: Callable[[Request], Optional[str]],
26
+ workspace_graph: Callable[[], Any],
27
+ ) -> APIRouter:
28
+ from latticeai.core.marketplace import MarketplaceError
29
+
30
+ router = APIRouter()
31
+
32
+ @router.get("/marketplace/templates")
33
+ async def list_templates(request: Request, kind: Optional[str] = None):
34
+ require_user(request)
35
+ gate_read(request)
36
+ try:
37
+ return catalog.list_templates(kind=kind)
38
+ except MarketplaceError as exc:
39
+ raise HTTPException(status_code=400, detail=str(exc)) from exc
40
+
41
+ @router.get("/marketplace/templates/{kind}/{template_id}/export")
42
+ async def export_template(kind: str, template_id: str, request: Request):
43
+ require_user(request)
44
+ gate_read(request)
45
+ try:
46
+ return catalog.export_template(kind, template_id)
47
+ except MarketplaceError as exc:
48
+ raise HTTPException(status_code=404, detail=str(exc)) from exc
49
+
50
+ @router.post("/marketplace/templates/import")
51
+ async def import_template(req: TemplateImportRequest, request: Request):
52
+ require_user(request)
53
+ gate_read(request)
54
+ try:
55
+ return {"template": catalog.import_template(req.data)}
56
+ except MarketplaceError as exc:
57
+ raise HTTPException(status_code=400, detail=str(exc)) from exc
58
+
59
+ @router.post("/marketplace/templates/install")
60
+ async def install_template(req: TemplateInstallRequest, request: Request):
61
+ user = require_user(request)
62
+ scope = gate_write(request)
63
+ try:
64
+ installed = catalog.install_template(
65
+ req.data,
66
+ store=store,
67
+ user_email=user or None,
68
+ workspace_id=scope,
69
+ graph=workspace_graph(),
70
+ )
71
+ except MarketplaceError as exc:
72
+ raise HTTPException(status_code=400, detail=str(exc)) from exc
73
+ return {"installed": installed}
74
+
75
+ @router.get("/marketplace/templates/registry")
76
+ async def template_registry(request: Request):
77
+ require_user(request)
78
+ gate_read(request)
79
+ return {"registry": store.list_template_registry()}
80
+
81
+ return router
@@ -1,4 +1,4 @@
1
- """Plugin SDK API router (v2.0).
1
+ """Plugin SDK API router (v2).
2
2
 
3
3
  Surfaces the :class:`latticeai.core.plugins.PluginRegistry` over HTTP using the
4
4
  same router-factory convention as the rest of ``latticeai.api`` (server_app
@@ -1,4 +1,4 @@
1
- """Realtime Collaboration API router (v2.0).
1
+ """Realtime Collaboration API router (v2).
2
2
 
3
3
  Server-Sent-Events stream + presence + activity feed over
4
4
  :class:`latticeai.core.realtime.RealtimeBus`. Workspace isolation is enforced by
@@ -1,4 +1,4 @@
1
- """Workflow Designer API router (v2.0).
1
+ """Workflow Designer API router (v2).
2
2
 
3
3
  Create / edit / validate / execute / inspect / export / import workflows plus
4
4
  run history, layered on :mod:`latticeai.core.workflow_engine` and the existing
@@ -174,6 +174,15 @@ def create_workflow_designer_router(
174
174
  scope = gate_read(request)
175
175
  return store.list_workflow_runs(limit=limit, workspace_id=scope)
176
176
 
177
+ @router.get("/workflows/api/runs/{run_id}/replay")
178
+ async def workflow_run_replay(run_id: str, request: Request):
179
+ require_user(request)
180
+ scope = gate_read(request)
181
+ try:
182
+ return {"replay": store.replay_workflow_run(run_id, workspace_id=scope)}
183
+ except FileNotFoundError as exc:
184
+ raise HTTPException(status_code=404, detail=f"Workflow run not found: {run_id}") from exc
185
+
177
186
  @router.get("/workflows/api/export/{workflow_id}")
178
187
  async def export_definition(workflow_id: str, request: Request):
179
188
  require_user(request)