@n8n/frontend-module-sdk 0.15.4 → 0.16.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/package.json CHANGED
@@ -1,17 +1,17 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@n8n/frontend-module-sdk",
4
- "version": "0.15.4",
4
+ "version": "0.16.0",
5
5
  "main": "src/index.ts",
6
6
  "import": "src/index.ts",
7
7
  "exports": {
8
8
  ".": "./src/index.ts"
9
9
  },
10
10
  "dependencies": {
11
- "@n8n/api-types": "1.45.3",
12
- "@n8n/design-system": "2.44.4",
13
- "@n8n/utils": "1.52.0",
14
- "n8n-workflow": "2.45.1",
11
+ "@n8n/api-types": "1.46.0",
12
+ "@n8n/design-system": "2.45.0",
13
+ "@n8n/utils": "1.53.0",
14
+ "n8n-workflow": "2.46.0",
15
15
  "vue": "^3.5.13",
16
16
  "vue-router": "^4.5.0"
17
17
  },
@@ -21,7 +21,7 @@
21
21
  "@n8n/vitest-config": "1.24.0",
22
22
  "typescript": "6.0.2",
23
23
  "unplugin-icons": "^23.0.1",
24
- "vite": "^8.0.2",
24
+ "vite": "^8.1.6",
25
25
  "vitest": "5.0.1",
26
26
  "vue-tsc": "^2.2.8"
27
27
  },
@@ -0,0 +1,7 @@
1
+ import { declareCapability } from '../declareCapability';
2
+ import type { SelfHealingChatHandoff } from '../types/capability';
3
+
4
+ /** Call during component setup so the shell can capture its router and toast context. */
5
+ export const createSelfHealingChatHandoff = declareCapability<() => SelfHealingChatHandoff>(
6
+ 'create-self-healing-chat-handoff',
7
+ );
@@ -1,3 +1,4 @@
1
+ export { createSelfHealingChatHandoff } from './createSelfHealingChatHandoff';
1
2
  export { mcpExposeAllOffer } from './mcpExposeAllOffer';
2
3
  // Experiment cleanup (123_surface_mcp_to_claude_trial_users)
3
4
  export { mcpDiscoverySettings } from './mcpDiscoverySettings';
@@ -1,3 +1,6 @@
1
+ import type { SelfHealingResultDetail } from '@n8n/api-types';
2
+ import type { ComputedRef } from 'vue';
3
+
1
4
  /**
2
5
  * A typed key for a capability. `declareCapability()` is the only way to make
3
6
  * one, and the token is the only way to read or write its slot in the registry.
@@ -30,3 +33,25 @@ export interface McpExposeAllOffer {
30
33
  */
31
34
  offer(onExposed: () => Promise<void> | void): Promise<boolean>;
32
35
  }
36
+
37
+ export type SelfHealingChatInput = Pick<
38
+ SelfHealingResultDetail,
39
+ 'resultId' | 'workflowId' | 'report' | 'outcome' | 'reviewState' | 'execution'
40
+ >;
41
+
42
+ /**
43
+ * `started` means the chat opened and the report is on its way, so do not start it again.
44
+ * `busy` and `failed` mean no chat started, so the caller can offer another try.
45
+ */
46
+ export type SelfHealingChatStartOutcome = 'started' | 'busy' | 'failed' | 'unavailable';
47
+
48
+ export interface SelfHealingChatHandoff {
49
+ available: ComputedRef<boolean>;
50
+ /**
51
+ * Returns the current user's personal project, or null if it cannot load.
52
+ * A reviewer can lack read access to the result's project.
53
+ */
54
+ resolveProjectId(): Promise<string | null>;
55
+ /** Opens a chat in the project and sends the report through the normal Assistant handoff. */
56
+ start(projectId: string, input: SelfHealingChatInput): Promise<SelfHealingChatStartOutcome>;
57
+ }
@@ -12,8 +12,10 @@ import type { WorkflowReviewVersionSnapshot } from '@n8n/api-types';
12
12
  * `features/collaboration/projects`, which sits above the module layer. A module
13
13
  * that needs to filter by project renders this instead of importing any of it.
14
14
  * `workflow-diff` renders plain workflow snapshots with the editor canvas.
15
+ * `promotion-changes` lists what a promotion review changes. It loads the changes itself, so
16
+ * the module needs no knowledge of the promotion types.
15
17
  */
16
- export type ModuleComponentSlot = 'project-filter' | 'workflow-diff';
18
+ export type ModuleComponentSlot = 'project-filter' | 'workflow-diff' | 'promotion-changes';
17
19
 
18
20
  /**
19
21
  * The `v-model` value of the `project-filter` slot. `null` means "all projects".
@@ -25,14 +27,33 @@ export type ModuleComponentSlot = 'project-filter' | 'workflow-diff';
25
27
  export type SlotProjectSelection = { id: string } | null;
26
28
 
27
29
  /** Plain snapshots keep the editor canvas types inside the shell. */
30
+ export type SlotWorkflowDiffSnapshot = Pick<
31
+ WorkflowReviewVersionSnapshot,
32
+ 'nodes' | 'connections'
33
+ > &
34
+ Partial<Pick<WorkflowReviewVersionSnapshot, 'versionId' | 'createdAt' | 'nodeGroups'>>;
35
+
28
36
  export type SlotWorkflowDiffProps = {
29
37
  workflowId: string;
30
38
  workflowName: string;
31
- sourceSnapshot?: WorkflowReviewVersionSnapshot;
32
- targetSnapshot?: WorkflowReviewVersionSnapshot;
39
+ sourceSnapshot?: SlotWorkflowDiffSnapshot;
40
+ targetSnapshot?: SlotWorkflowDiffSnapshot;
33
41
  sourceLabel?: string;
34
42
  targetLabel?: string;
35
43
  showFullscreenButton?: boolean;
36
44
  canvasIdPrefix?: string;
37
45
  hideTitle?: boolean;
38
46
  };
47
+
48
+ export type SlotPromotionChangesProps = {
49
+ reviewId: string;
50
+ };
51
+
52
+ /**
53
+ * What the `promotion-changes` slot shows, emitted as `state`. Approve sends the head commit of
54
+ * the changes that the reviewer saw, so it waits for `ready`.
55
+ */
56
+ export type PromotionChangesState =
57
+ | { status: 'loading' }
58
+ | { status: 'ready'; headCommitSha: string }
59
+ | { status: 'unavailable' };
@@ -24,14 +24,32 @@ export type ModulePlaceholderPage = {
24
24
  component: () => Promise<Component>;
25
25
  };
26
26
 
27
+ /**
28
+ * A heading in the settings sidebar. The shell lists them in this order:
29
+ * Personal, People & access, AI, Integrations, Security, Operations, Billing.
30
+ */
31
+ export type SettingsSectionId =
32
+ | 'personal'
33
+ | 'people'
34
+ | 'ai'
35
+ | 'integrations'
36
+ | 'security'
37
+ | 'operations'
38
+ | 'billing';
39
+
27
40
  /** A link in the settings sidebar. Shell and modules both use it. */
28
41
  export type IMenuSettingItem = IMenuItem & {
29
42
  /**
30
- * @description Sort position, low to high. Shell links use 10, 20, 30, ... so pick a number
31
- * between two of them to land between them. No `order` means last. Equal values
32
- * keep registration order.
43
+ * @description Sort position inside the section, low to high. Shell links use 10, 20, 30, ...
44
+ * in each section, so pick a number between two of them to land between them. No `order`
45
+ * means last in the section. Equal values keep registration order.
33
46
  */
34
47
  order?: number;
48
+ /**
49
+ * @description Heading the link is listed under. No `section` means the link is listed before
50
+ * the first heading.
51
+ */
52
+ section?: SettingsSectionId;
35
53
  };
36
54
 
37
55
  /**