Skip to content

Commit a59f026

Browse files
Shawclaude
andcommitted
feat(automations,n8n): apply PRs #7316 + #7317 from elizaOS/eliza
PR #7316 — feat(n8n): clarification roundtrip route - n8n-clarification.ts/test: new clarification round-trip API route - connector-target-catalog.ts/test: catalog of connector targets - discord-target-source.ts/test: Discord channel/guild target source - n8n-runtime-context-provider.ts: refactored to use new catalog+source model - n8n-routes.ts: wire generateWorkflowDraft with optional triggerContext opts - client-types-chat.ts, eliza.ts: supporting type/runtime wiring PR #7317 — feat(automations): hero centerpiece overview + UX restoration - AutomationsView.tsx: hero centerpiece layout + UX restoration Also resolves 45 pre-existing package.json version-bump conflicts (alpha.X → alpha.X+1) left over from a prior merge by taking theirs. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2 parents 127ab96 + e4f02fa commit a59f026

103 files changed

Lines changed: 5457 additions & 2790 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

cloud/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -295,9 +295,9 @@
295295
"@walletconnect/core": "2.23.9",
296296
"@walletconnect/logger": "3.0.2",
297297
"@walletconnect/sign-client": "2.23.9",
298-
"@walletconnect/types": "2.22.4",
299-
"@walletconnect/universal-provider": "2.22.4",
300-
"@walletconnect/utils": "2.22.4",
298+
"@walletconnect/types": "2.23.9",
299+
"@walletconnect/universal-provider": "2.23.9",
300+
"@walletconnect/utils": "2.23.9",
301301
"pino": "10.0.0",
302302
"pino-std-serializers": "7.0.0",
303303
"on-exit-leak-free": "2.1.2",
@@ -308,7 +308,7 @@
308308
"base-x": "3.0.11",
309309
"@hono/node-server": "2.0.1",
310310
"axios": "1.15.0",
311-
"dompurify": "3.3.2",
311+
"dompurify": "3.4.2",
312312
"bn.js": "5.2.3",
313313
"express-rate-limit": "8.3.0",
314314
"fast-xml-parser": "5.4.2",

lerna.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": "2.0.0-alpha.535",
2+
"version": "2.0.0-alpha.536",
33
"packages": [
44
"packages/*",
55
"packages/native-plugins/*",

packages/agent/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@elizaos/agent",
3-
"version": "2.0.0-alpha.535",
3+
"version": "2.0.0-alpha.536",
44
"description": "Standalone elizaOS-based agent and backend server package.",
55
"type": "module",
66
"license": "MIT",
@@ -144,14 +144,14 @@
144144
"@elizaos/core": "workspace:*",
145145
"@elizaos/plugin-agent-orchestrator": "workspace:*",
146146
"@elizaos/plugin-agent-skills": "workspace:*",
147-
"@elizaos/plugin-wallet": "workspace:*",
148-
"@elizaos/plugin-streaming": "workspace:*",
149147
"@elizaos/plugin-browser-bridge": "workspace:*",
150148
"@elizaos/plugin-local-embedding": "workspace:*",
151149
"@elizaos/plugin-ollama": "workspace:*",
152150
"@elizaos/plugin-pdf": "workspace:*",
153-
"@elizaos/plugin-video": "workspace:*",
154151
"@elizaos/plugin-sql": "workspace:*",
152+
"@elizaos/plugin-streaming": "workspace:*",
153+
"@elizaos/plugin-video": "workspace:*",
154+
"@elizaos/plugin-wallet": "workspace:*",
155155
"@elizaos/plugin-wechat": "workspace:*",
156156
"@elizaos/shared": "workspace:*",
157157
"@elizaos/skills": "workspace:*",

packages/app-core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@elizaos/app-core",
3-
"version": "2.0.0-alpha.535",
3+
"version": "2.0.0-alpha.536",
44
"description": "Shared application core for elizaOS white-label agent apps.",
55
"type": "module",
66
"license": "MIT",

packages/app-core/src/api/client-types-chat.ts

Lines changed: 79 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -459,9 +459,74 @@ export interface N8nWorkflowMissingCredentialsResponse {
459459
warning: "missing credentials";
460460
}
461461

462+
/**
463+
* Structured clarification request emitted by the plugin's workflow generator
464+
* when a node parameter cannot be resolved from the runtime context. The host
465+
* surfaces these as quick-pick buttons; on click the host calls
466+
* `/api/n8n/workflows/resolve-clarification` with the chosen value, which
467+
* patches the draft at `paramPath` and deploys — no LLM regeneration.
468+
*
469+
* Mirrors the plugin's `ClarificationRequest` (see
470+
* @elizaos/plugin-n8n-workflow `src/types/index.ts`). Re-declared here to
471+
* avoid a host → plugin import cycle.
472+
*/
473+
export interface N8nClarificationRequest {
474+
kind:
475+
| "target_channel"
476+
| "target_server"
477+
| "recipient"
478+
| "value"
479+
| "free_text";
480+
platform?: string;
481+
scope?: { guildId?: string };
482+
question: string;
483+
paramPath: string;
484+
}
485+
486+
/** One server / workspace / contact-collection from a connector catalog. */
487+
export interface N8nClarificationTargetGroup {
488+
platform: string;
489+
groupId: string;
490+
groupName: string;
491+
targets: Array<{
492+
id: string;
493+
name: string;
494+
kind: "channel" | "recipient" | "chat";
495+
}>;
496+
}
497+
498+
/**
499+
* Returned by `POST /api/n8n/workflows/generate` when the LLM emitted one or
500+
* more `ClarificationRequest`s and the host needs the user to pick a target
501+
* before deploying. The `draft` is the unmodified workflow JSON from the
502+
* plugin (with the unresolved parameters left absent); `catalog` is a
503+
* snapshot of the relevant connector-target-catalog scoped to the
504+
* platforms referenced by the clarifications.
505+
*/
506+
export interface N8nWorkflowNeedsClarificationResponse {
507+
status: "needs_clarification";
508+
draft: Record<string, unknown>;
509+
clarifications: N8nClarificationRequest[];
510+
catalog: N8nClarificationTargetGroup[];
511+
}
512+
513+
/** Resolution payload sent to /api/n8n/workflows/resolve-clarification. */
514+
export interface N8nClarificationResolution {
515+
paramPath: string;
516+
value: string;
517+
}
518+
519+
export interface N8nWorkflowResolveClarificationRequest {
520+
draft: Record<string, unknown>;
521+
resolutions: N8nClarificationResolution[];
522+
name?: string;
523+
workflowId?: string;
524+
}
525+
462526
export type N8nWorkflowGenerateResponse =
463527
| N8nWorkflow
464-
| N8nWorkflowMissingCredentialsResponse;
528+
| N8nWorkflowMissingCredentialsResponse
529+
| N8nWorkflowNeedsClarificationResponse;
465530

466531
export function isMissingCredentialsResponse(
467532
res: N8nWorkflowGenerateResponse,
@@ -473,6 +538,19 @@ export function isMissingCredentialsResponse(
473538
);
474539
}
475540

541+
export function isNeedsClarificationResponse(
542+
res: N8nWorkflowGenerateResponse,
543+
): res is N8nWorkflowNeedsClarificationResponse {
544+
const candidate = res as N8nWorkflowNeedsClarificationResponse;
545+
return (
546+
candidate.status === "needs_clarification" &&
547+
Array.isArray(candidate.clarifications) &&
548+
Array.isArray(candidate.catalog) &&
549+
typeof candidate.draft === "object" &&
550+
candidate.draft !== null
551+
);
552+
}
553+
476554
export interface N8nWorkflowWriteNode {
477555
id?: string;
478556
name: string;

0 commit comments

Comments
 (0)