Commit Graph

5371 Commits

Author SHA1 Message Date
Robin Braumann
f3269e1396 Merge branch 'n8n-agents' into toolchains-spike
Resolves conflicts to keep:
- Apps toolset surface from toolchains-spike (registry, factory, normalizer,
  AppDefinition, /catalog/apps/:kind/operations endpoint, FE registry +
  modals + list panel + tool-step labels).
- Builder/integration polish from n8n-agents (i18n-keyed help/connected
  copy, narrower default chat column, agent RBAC resource).

Drops the inline displayHelpText/displayConnectedText fields on
ChatIntegrationDescriptor and the per-platform classes — the strings now
live in the FE i18n catalog keyed by integration type.

Adds the missing 'agent' entry to rbac.store.ts scopesByResourceId so the
new Resource union type compiles.
2026-04-28 10:12:27 +02:00
Robin Braumann
63eb10cd38 Add Slack integration 2026-04-27 14:59:01 +02:00
bjorger
d2bc913cd7
feat(agents): Polish agent builder UI and tighten builder/chat reliability (#29047)
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-27 14:31:14 +02:00
Robin Braumann
58bcf5d800 add google sheets support 2026-04-27 14:22:04 +02:00
Robin Braumann
cdab0f0356 refactor(agents): unify @n8n/agents imports; FE owns its own toolsets copy
Restore the agents SDK to a single canonical import path
(`from '@n8n/agents'`) for backend consumers, and decouple the editor-ui
from the SDK entirely so the package stays server-only.

The previous split via `exports` + `typesVersions` made `toolsets` a
second-class subpath while every other SDK export lived at the package
root. The asymmetry papered over the real issue: the SDK is server-side
(pulls undici via MCP/AI-SDK), so the editor-ui shouldn't depend on it.

- editor-ui: new `features/agents/utils/appToolsets.ts` mirrors the
  registry data + walker + types the FE needs (~200 lines). Drop the
  `@n8n/agents` workspace dep. Drift between this and the BE registry
  is enforced by code review when adding new apps.
- `@n8n/agents`: drop the `exports` and `typesVersions` blocks. Restore
  flat re-exports of `APP_REGISTRY`, `findAppDefinition`,
  `buildOperationsFromDescription`, `buildManifest`, and toolsets types
  from `src/index.ts` so cli can keep `from '@n8n/agents'` for
  everything.
- cli: consolidate imports back to `@n8n/agents`. No subpath imports.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-27 13:22:57 +02:00
Robin Braumann
e9cbbef10f refactor(agents): address review follow-ups on the toolsets cleanup
Three small follow-ups from the cleanup's final review:

- `app-toolset-factory.ts`: drop the hand-rolled `zodObjectToJson` /
  `zodTypeNameToJson` helpers and use `zodToJsonSchema` from `@n8n/agents`.
  The hand-rolled walker was non-recursive and dropped nested object
  structure for `collection` / `fixedCollection` params; the shared
  utility recurses correctly via `zod-to-json-schema`.
- `useCredentialScopes`: add a 30s TTL to the module-level scope cache so
  re-opening the modal after re-OAuth surfaces refreshed scopes within
  the window. Failures are still uncached. Also export an
  `invalidateCredentialScopes(id)` for explicit invalidation when callers
  know the scopes have changed.
- `buildOperationsFromDescription`: emit one OperationEntry per resource
  when an operation group declares multiple in `displayOptions.show.resource`,
  rather than dropping all but the first. Dedupe by `resource:operation`
  to handle the rare case of overlapping operation groups. Two new tests
  cover the multi-resource and dedupe paths.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-27 13:09:26 +02:00
Robin Braumann
e1b3229403 fix(agents): split @n8n/agents into FE-safe and full-SDK entries
The agents toolsets cleanup made editor-ui import from @n8n/agents for
the registry, which transitively bundled the full server SDK (MCP client,
AI SDK adapters) and pulled `undici` into the browser bundle, breaking
`pnpm build`. Tree-shaking can't help here — the package compiles to CJS
and isn't marked side-effect-free.

Declare the boundary at the package surface instead:

- `exports` field: `.` continues to expose the full SDK; new `./toolsets`
  entry exposes only the pure-data + pure-algorithm surface
  (`AppDefinition`, `OperationEntry`, `buildOperationsFromDescription`,
  `buildManifest`, `APP_REGISTRY`, `findAppDefinition`).
- `typesVersions` mirrors the subpath so TypeScript resolves it under
  the repo's `moduleResolution: "node"` (legacy mode ignores `exports`).
- Drop the flat re-exports of toolsets symbols from `src/index.ts`. The
  registry now has exactly one canonical import path,
  `@n8n/agents/toolsets`. Backend code that wants the namespace can keep
  using `import { toolsets } from '@n8n/agents'`.
- Update cli (`agents.service`, `app-toolset-factory` + its test) and
  editor-ui (`AgentAppsModal`, `AgentAppConfigModal`, `AgentAppsListPanel`,
  `AgentChatToolSteps`) to import from `@n8n/agents/toolsets`.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-27 13:02:30 +02:00
Robin Braumann
1b6430d466 refactor(agents): generalize Gmail toolset POC into a per-app registry
Restructure the Gmail-only "apps/toolsets" POC so adding a second app is a
one-file change. Each integration ships as an `AppDefinition` in
`@n8n/agents/src/toolsets/registry/`; backend and frontend consume the
registry through the same flat re-exports off `@n8n/agents`.

- New `@n8n/agents/toolsets/` module: `AppDefinition` + `OperationEntry`
  types, `buildOperationsFromDescription` (single source of truth for the
  registry walk + scope-based status classification), `buildManifest`
  (string/function/default-deriver resolution), and `APP_REGISTRY` with
  Gmail as the first entry.
- Generic `buildAppToolset` factory in cli replaces the Gmail-specific
  `buildGmailToolset`. `agents.service.attachAppToolsets` now resolves
  app kinds via `findAppDefinition` and skips unknown kinds with a warn
  log instead of rejecting at save time.
- New `GET /credentials/:credentialId/oauth-scopes` endpoint +
  `CredentialsService.getOAuthGrantedScopes` helper. Reads
  `oauthTokenData.scope` (post-grant) with a fallback to declared
  `scope` (pre-grant). Distinct from the existing RBAC `getCredentialScopes`.
- New `useCredentialScopes` FE composable feeds the App config modal so
  per-operation status badges classify against the credential's
  actually-granted scopes.
- `AgentJsonAppRef.kind` widened from the `'gmail'` literal to plain
  string. Forward-compat: a config saved with an unknown kind loads
  cleanly.
- Editor-ui: `AgentAppsModal` rebuilt on `Modal.vue` + `NodeCredentials`
  (drops the hand-rolled backdrop and raw select). `AgentAppConfigModal`,
  `AgentAppsListPanel`, and `AgentChatToolSteps` resolve icon, label, and
  dispatcher names from the registry.
- Drop the Gmail-only `gmail-toolset.ts` and `gmailOperations.ts`.

Tests: 10 new in `@n8n/agents/toolsets`, 6 in
`cli/src/modules/agents/toolsets`, 4 in `cli/src/credentials`.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-27 12:25:11 +02:00
Robin Braumann
79fc8614f0 feat(agents): improve interactive cards (compact history + auto-resolve)
Stage 1 — frontend rendering
- Resolved interactive cards (ask_question / ask_credential / ask_llm) used to
  vanish from chat history; now they leave a compact "→ tool · answer" trace
  in AgentChatToolSteps, matching how non-interactive tool calls render.
- ToolCall carries an optional displaySummary populated on tool-result, on
  the optimistic resume flip, and rolled back on resume failure.
- New summariseInteractiveOutput helper + 7 unit tests.

Stage 2 — server-side auto-resolve
- ask_question: auto-resolves when options.length === 1 (schema relaxed
  from min(2) to min(1) so the LLM can actually pass single-option
  questions).
- ask_credential: auto-resolves when exactly one credential of the
  requested type is available to the user.
- ask_llm: auto-resolves when exactly one LLM-provider credential exists,
  using a new LLM_PROVIDER_DEFAULTS table for the canonical default model
  per provider (Anthropic, OpenAI, Google, xAI, Groq, Mistral, DeepSeek,
  Cohere).
- CredentialProvider threaded through getJsonTools to the interactive
  factories. 12 new unit tests (cli) covering suspend-vs-auto-resolve.

Lint
- AgentAdvancedPanel.test.ts: hoist @vueuse/core type alias to a top-level
  `import type * as` so the inline `typeof import(...)` annotation goes
  away (consistent-type-imports).
- AgentConfigJsonEditor.vue: move `void debouncedJsonSave(text)` from
  expression to statement form so no-void stops complaining.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-26 20:33:30 +02:00
Robin Braumann
b2929893a1 chore(agents): annotate JSON-rehydration casts
Schema is persisted as JSON; the as unknown as cast in two services rehydrates to the typed config. One-line comments make the rationale explicit so future readers don't try to tighten the type without addressing the storage boundary.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-26 17:54:07 +02:00
Robin Braumann
f03e8ae281 refactor(agents): extract magic strings to typed constants
- CHAT_MESSAGE_STATUS / TOOL_CALL_STATE in features/agents/constants.ts; replace ~30 literal occurrences in useAgentChatStream, agentChatMessages, AgentChatMessageList. ToolCallState type now lives next to its values; agentChatMessages re-exports for callers.
- CONTINUE_SESSION_ID_PARAM for the URL-deeplink query key, used in AgentBuilderView and AgentSessionTimelineView.
- Backend: BUILDER_TOOLS + AGENT_THREAD_PREFIX in builder/builder-tool-names.ts; replace literals in agents.controller, agents-builder-tools.service, agents.service, agents-builder.service.
- Add missing agents.sort.* i18n keys (lastUpdated, lastCreated, nameAsc, nameDesc) — ResourcesListLayout looks them up via resource-key="agents".

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-26 17:03:24 +02:00
Robin Braumann
8c5762549e Merge branch 'n8n-agents' into agent-32-feature-redesign-agent-builder-with-three-column-config
# Conflicts:
#	packages/cli/src/modules/agents/agents.controller.ts
#	packages/frontend/editor-ui/src/features/agents/__tests__/AgentBuilderView.test.ts
#	packages/frontend/editor-ui/src/features/agents/components/AgentChatMessageList.vue
#	packages/frontend/editor-ui/src/features/agents/components/AgentChatPanel.vue
#	packages/frontend/editor-ui/src/features/agents/composables/agentChatMessages.ts
#	packages/frontend/editor-ui/src/features/agents/composables/useAgentApi.ts
#	packages/frontend/editor-ui/src/features/agents/views/AgentBuilderView.vue
2026-04-24 17:07:28 +02:00
Robin Braumann
282004508d feat(agents): expose ChatIntegrationRegistry via API and consume in FE
- Add display metadata fields (displayLabel, displayIcon, displayHelpText,
  displayConnectedText) to AgentChatIntegration abstract class and all
  three platform implementations (Slack, Telegram, Linear)
- Add ChatIntegrationDescriptor DTO to @n8n/api-types
- Add GET /catalog/integrations endpoint on AgentsController backed by
  AgentsService.listChatIntegrations()
- Add listAgentIntegrations() API client and useAgentIntegrationsCatalog
  composable (module-scoped singleton with dedup in-flight logic)
- Replace hardcoded KNOWN_TRIGGER_TYPES in AgentBuilderView with dynamic
  catalog fetch; add tests for the new composable and update view test mock

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-24 09:09:42 +02:00
yehorkardash
b388c0d9ef
Merge remote-tracking branch 'origin/master' into n8n-agents 2026-04-23 17:16:19 +02:00
yehorkardash
4ba59ecda5
feat: Add interactive tools to builder agent (#28915) 2026-04-23 17:13:02 +02:00
Guillaume Jacquart
5af4e1cc19
feat(API): Add encryption key management endpoints (#28897)
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-23 13:27:57 +00:00
Arvin A
20d72ec89a
feat(editor): tools browse modal + Add-tool entry point (AGENT-26 4/4) (#28885) 2026-04-23 15:19:02 +02:00
Ali Elkhateeb
f931b17a93
feat(core): Add delete folder endpoint to public API (#28984)
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
2026-04-23 13:13:13 +00:00
Dimitri Lavrenük
71b2b88eb8
fix: Correctly rename all temporal binary files after execution (#28960) 2026-04-23 13:02:41 +00:00
Eugene
e9e9be1305
feat(agents): prevent multiple agents from sharing a Telegram credential (#28820)
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-23 13:40:44 +02:00
José Braulio González Valido
89e9117d39
fix(ai-builder): Expose outputCount when eval node output is truncated (no-changelog) (#28977)
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-23 11:06:27 +00:00
Michael Drury
6afbb757d9
fix(agents): Polish for builder, provider tool fixes and UX polish (#28913)
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-23 11:57:34 +01:00
oleg
7a64bd23d7
test(instance-ai): add memory benchmark harness with heap snapshot analysis (no-changelog) (#27972)
Signed-off-by: Oleg Ivaniv <me@olegivaniv.com>
2026-04-23 10:36:02 +00:00
Arvin A
79048b8dee
feat(cli): ephemeral node-tool executor for agents (AGENT-26 1/4) (#28882) 2026-04-23 12:35:57 +02:00
Mutasem Aldmour
09d4756ef3
feat(core): Annotate LangSmith traces with user feedback from Instance AI (no-changelog) (#28874)
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-23 10:31:52 +00:00
Csaba Tuncsik
c662862d7f
fix(core): Clean up project mapping rules on provisioning strategy switch (#28726) 2026-04-23 10:29:14 +00:00
RomanDavydchuk
7e3a2f6885
fix(core): Can't install community nodes on Windows (#28481)
Co-authored-by: Shireen Missi <94372015+ShireenMissi@users.noreply.github.com>
2026-04-23 10:06:31 +00:00
Csaba Tuncsik
c55b95ff06
fix(core): Shift existing rules on create to avoid order conflict (#28722) 2026-04-23 08:50:55 +00:00
Ali Elkhateeb
a757ddd4a8
fix(core): Support mixed bracket/dot notation in external secrets expressions (#28711)
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-23 08:48:57 +00:00
Andreas Fitzek
d8a951dee8
test(core): Add instance registry schema and cluster membership tests (no-changelog) (#28723) 2026-04-23 08:26:13 +00:00
bjorger
7ce4591806
feat(agents): Stream tool-call lifecycle for immediate agent UI feedback (#28910)
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-23 09:53:52 +02:00
Csaba Tuncsik
e25a78e346
fix(core)!: Unify role mapping feature flag across backend and frontend (#28718) 2026-04-23 07:48:52 +00:00
Konstantin Tieber
bb6a5e47b0
feat(core): Add audit logs for webhook waiting and resuming (#28204) 2026-04-23 07:43:43 +00:00
Sandra Zollner
1eea62629a
fix(core): Fixes user search functionality in ProjectSettings for pr… (#28914) 2026-04-23 07:38:03 +00:00
Andreas Fitzek
0c021116bc
feat(core): Add AES-256-GCM cipher support (#28916) 2026-04-23 07:31:37 +00:00
oleg
7a47fddd90
refactor(ai-builder): Streamline instance-ai prompt surface (no-changelog) (#28754) 2026-04-23 07:05:57 +00:00
Markus Corazzione
5ee534c3b8
fix(core): Preserve manual scopes for inherited generic OAuth2 credentials (#27858)
Co-authored-by: Guillaume Jacquart <jacquart.guillaume@gmail.com>
2026-04-23 06:54:25 +00:00
Guillaume Jacquart
828d0ee906
fix(core): Allow SAML connection test without saving config first (#28702)
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-23 06:53:06 +00:00
Stephen Wright
1b02a0dbf4
fix: Disable until we encrypt (#28875) 2026-04-23 06:43:22 +00:00
Eugene
0a33248ccf
feat(agents): Add Linear platform integration (#28871) 2026-04-23 07:51:05 +02:00
Jean Ibarz
41424b3e99
fix(core): Declare credentialType on MCP workflow-builder autoAssignedCredentials schema (#28353) 2026-04-22 19:53:19 +00:00
Sandra Zollner
ff9d7d6756
feat(core): Add public API endpoints for folder management (#28760) 2026-04-22 12:21:53 +00:00
Michael Drury
6dba8d0eaf Merge branch 'n8n-agents' of github.com:n8n-io/n8n into n8n-agents 2026-04-22 13:07:54 +01:00
Michael Drury
df7aff6641 Merge branch 'master' of github.com:n8n-io/n8n into n8n-agents 2026-04-22 13:07:32 +01:00
Eugene
9c6832ab94
feat(agents): disable streaming for Telegram integration (#28888)
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-22 14:03:22 +02:00
Michael Drury
08393235a5
chore(agents): Tidy up sandbox implementation and use sucrase to convert Typescript to JS (#28826) 2026-04-22 12:02:07 +01:00
Daria
b6eabb4ce5
fix(core): Fix health endpoint cross-origin requests (#28878) 2026-04-22 10:55:34 +00:00
yehorkardash
c6c362c77a
feat: Support more model providers (#28704) 2026-04-22 12:34:15 +02:00
Andreas Fitzek
f2f76d0ebd
feat(core): Expose instance registry via proxy service (no-changelog) (#28691) 2026-04-22 10:00:24 +00:00
Andreas Fitzek
fd124420f1
test(core): Add E2E tests for token exchange delegation flow (#28434) 2026-04-22 09:31:19 +00:00