@yagr/agent 0.2.9 → 0.2.11
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/dist/cli.js +251 -9
- package/dist/cli.js.map +1 -1
- package/dist/config/n8n-config-service.d.ts +2 -1
- package/dist/config/n8n-config-service.d.ts.map +1 -1
- package/dist/config/n8n-config-service.js +2 -1
- package/dist/config/n8n-config-service.js.map +1 -1
- package/dist/config/yagr-config-service.d.ts +1 -1
- package/dist/config/yagr-config-service.d.ts.map +1 -1
- package/dist/config/yagr-home.d.ts +7 -0
- package/dist/config/yagr-home.d.ts.map +1 -1
- package/dist/config/yagr-home.js +19 -0
- package/dist/config/yagr-home.js.map +1 -1
- package/dist/gateway/format-message.d.ts +3 -0
- package/dist/gateway/format-message.d.ts.map +1 -1
- package/dist/gateway/format-message.js +63 -10
- package/dist/gateway/format-message.js.map +1 -1
- package/dist/gateway/interactive-ui.d.ts.map +1 -1
- package/dist/gateway/interactive-ui.js +49 -4
- package/dist/gateway/interactive-ui.js.map +1 -1
- package/dist/gateway/local-open-bridge.d.ts +3 -0
- package/dist/gateway/local-open-bridge.d.ts.map +1 -0
- package/dist/gateway/local-open-bridge.js +54 -0
- package/dist/gateway/local-open-bridge.js.map +1 -0
- package/dist/gateway/webui.d.ts.map +1 -1
- package/dist/gateway/webui.js +50 -53
- package/dist/gateway/webui.js.map +1 -1
- package/dist/gateway/workflow-links.d.ts +12 -0
- package/dist/gateway/workflow-links.d.ts.map +1 -0
- package/dist/gateway/workflow-links.js +53 -0
- package/dist/gateway/workflow-links.js.map +1 -0
- package/dist/llm/anthropic-account.d.ts +20 -0
- package/dist/llm/anthropic-account.d.ts.map +1 -0
- package/dist/llm/anthropic-account.js +111 -0
- package/dist/llm/anthropic-account.js.map +1 -0
- package/dist/llm/copilot-account.d.ts +36 -0
- package/dist/llm/copilot-account.d.ts.map +1 -0
- package/dist/llm/copilot-account.js +573 -0
- package/dist/llm/copilot-account.js.map +1 -0
- package/dist/llm/create-language-model.d.ts +2 -2
- package/dist/llm/create-language-model.d.ts.map +1 -1
- package/dist/llm/create-language-model.js +187 -38
- package/dist/llm/create-language-model.js.map +1 -1
- package/dist/llm/google-account.d.ts +31 -0
- package/dist/llm/google-account.d.ts.map +1 -0
- package/dist/llm/google-account.js +851 -0
- package/dist/llm/google-account.js.map +1 -0
- package/dist/llm/model-catalog-cache.d.ts +4 -0
- package/dist/llm/model-catalog-cache.d.ts.map +1 -0
- package/dist/llm/model-catalog-cache.js +46 -0
- package/dist/llm/model-catalog-cache.js.map +1 -0
- package/dist/llm/openai-account.d.ts +33 -0
- package/dist/llm/openai-account.d.ts.map +1 -0
- package/dist/llm/openai-account.js +578 -0
- package/dist/llm/openai-account.js.map +1 -0
- package/dist/llm/provider-discovery.d.ts +3 -0
- package/dist/llm/provider-discovery.d.ts.map +1 -0
- package/dist/llm/provider-discovery.js +40 -0
- package/dist/llm/provider-discovery.js.map +1 -0
- package/dist/llm/provider-registry.d.ts +37 -0
- package/dist/llm/provider-registry.d.ts.map +1 -0
- package/dist/llm/provider-registry.js +186 -0
- package/dist/llm/provider-registry.js.map +1 -0
- package/dist/llm/proxy-runtime.d.ts +37 -0
- package/dist/llm/proxy-runtime.d.ts.map +1 -0
- package/dist/llm/proxy-runtime.js +462 -0
- package/dist/llm/proxy-runtime.js.map +1 -0
- package/dist/llm/test-model-policy.d.ts +3 -0
- package/dist/llm/test-model-policy.d.ts.map +1 -0
- package/dist/llm/test-model-policy.js +16 -0
- package/dist/llm/test-model-policy.js.map +1 -0
- package/dist/n8n-local/bootstrap.d.ts +12 -0
- package/dist/n8n-local/bootstrap.d.ts.map +1 -0
- package/dist/n8n-local/bootstrap.js +281 -0
- package/dist/n8n-local/bootstrap.js.map +1 -0
- package/dist/n8n-local/browser-auth.d.ts +12 -0
- package/dist/n8n-local/browser-auth.d.ts.map +1 -0
- package/dist/n8n-local/browser-auth.js +159 -0
- package/dist/n8n-local/browser-auth.js.map +1 -0
- package/dist/n8n-local/detect.d.ts +50 -0
- package/dist/n8n-local/detect.d.ts.map +1 -0
- package/dist/n8n-local/detect.js +207 -0
- package/dist/n8n-local/detect.js.map +1 -0
- package/dist/n8n-local/direct-manager.d.ts +15 -0
- package/dist/n8n-local/direct-manager.d.ts.map +1 -0
- package/dist/n8n-local/direct-manager.js +232 -0
- package/dist/n8n-local/direct-manager.js.map +1 -0
- package/dist/n8n-local/docker-manager.d.ts +18 -0
- package/dist/n8n-local/docker-manager.d.ts.map +1 -0
- package/dist/n8n-local/docker-manager.js +217 -0
- package/dist/n8n-local/docker-manager.js.map +1 -0
- package/dist/n8n-local/managed-runtime.d.ts +17 -0
- package/dist/n8n-local/managed-runtime.d.ts.map +1 -0
- package/dist/n8n-local/managed-runtime.js +122 -0
- package/dist/n8n-local/managed-runtime.js.map +1 -0
- package/dist/n8n-local/owner-credentials.d.ts +15 -0
- package/dist/n8n-local/owner-credentials.d.ts.map +1 -0
- package/dist/n8n-local/owner-credentials.js +50 -0
- package/dist/n8n-local/owner-credentials.js.map +1 -0
- package/dist/n8n-local/plan.d.ts +16 -0
- package/dist/n8n-local/plan.d.ts.map +1 -0
- package/dist/n8n-local/plan.js +48 -0
- package/dist/n8n-local/plan.js.map +1 -0
- package/dist/n8n-local/state.d.ts +42 -0
- package/dist/n8n-local/state.d.ts.map +1 -0
- package/dist/n8n-local/state.js +108 -0
- package/dist/n8n-local/state.js.map +1 -0
- package/dist/n8n-local/workflow-open.d.ts +21 -0
- package/dist/n8n-local/workflow-open.d.ts.map +1 -0
- package/dist/n8n-local/workflow-open.js +50 -0
- package/dist/n8n-local/workflow-open.js.map +1 -0
- package/dist/runtime/context-compaction.d.ts.map +1 -1
- package/dist/runtime/context-compaction.js +7 -0
- package/dist/runtime/context-compaction.js.map +1 -1
- package/dist/runtime/run-engine.d.ts.map +1 -1
- package/dist/runtime/run-engine.js +52 -1
- package/dist/runtime/run-engine.js.map +1 -1
- package/dist/setup/setup-wizard.d.ts +36 -3
- package/dist/setup/setup-wizard.d.ts.map +1 -1
- package/dist/setup/setup-wizard.js +470 -62
- package/dist/setup/setup-wizard.js.map +1 -1
- package/dist/setup.d.ts +2 -1
- package/dist/setup.d.ts.map +1 -1
- package/dist/setup.js +204 -89
- package/dist/setup.js.map +1 -1
- package/dist/system/open-external.d.ts +2 -0
- package/dist/system/open-external.d.ts.map +1 -0
- package/dist/system/open-external.js +25 -0
- package/dist/system/open-external.js.map +1 -0
- package/dist/system/package-manager.d.ts +6 -0
- package/dist/system/package-manager.d.ts.map +1 -0
- package/dist/system/package-manager.js +13 -0
- package/dist/system/package-manager.js.map +1 -0
- package/dist/tools/build-tools.d.ts +110 -65
- package/dist/tools/build-tools.d.ts.map +1 -1
- package/dist/tools/deploy.d.ts +14 -14
- package/dist/tools/generate-workflow.d.ts +5 -5
- package/dist/tools/n8nac.d.ts +96 -53
- package/dist/tools/n8nac.d.ts.map +1 -1
- package/dist/tools/n8nac.js +52 -20
- package/dist/tools/n8nac.js.map +1 -1
- package/dist/tools/observer.d.ts +1 -0
- package/dist/tools/observer.d.ts.map +1 -1
- package/dist/tools/observer.js.map +1 -1
- package/dist/tools/present-workflow-result.d.ts +2 -0
- package/dist/tools/present-workflow-result.d.ts.map +1 -1
- package/dist/tools/present-workflow-result.js +11 -2
- package/dist/tools/present-workflow-result.js.map +1 -1
- package/dist/tools/request-required-action.d.ts +7 -7
- package/dist/tools/request-required-action.js +4 -4
- package/dist/tools/request-required-action.js.map +1 -1
- package/dist/tools/validate.d.ts +14 -14
- package/dist/tools/write-workspace-file.d.ts +5 -5
- package/dist/types.d.ts +1 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/webui/app.js +14 -1
- package/dist/webui/app.js.map +2 -2
- package/package.json +15 -2
|
@@ -0,0 +1,281 @@
|
|
|
1
|
+
import crypto from 'node:crypto';
|
|
2
|
+
import { ManagedN8nOwnerCredentialService } from './owner-credentials.js';
|
|
3
|
+
import { markManagedN8nBootstrapStage } from './state.js';
|
|
4
|
+
const OWNER_SETUP_PATH = '/rest/owner/setup';
|
|
5
|
+
const LOGIN_PATH = '/rest/login';
|
|
6
|
+
const API_KEYS_PATH = '/rest/api-keys';
|
|
7
|
+
const SURVEY_PATH = '/rest/me/survey';
|
|
8
|
+
const COMMUNITY_LICENSE_PATH = '/rest/license/enterprise/community-registered';
|
|
9
|
+
const DEFAULT_API_KEY_SCOPES = ['workflow:read'];
|
|
10
|
+
const DEFAULT_BOOTSTRAP_TIMEOUT_MS = 45_000;
|
|
11
|
+
const DEFAULT_RETRY_DELAY_MS = 1_500;
|
|
12
|
+
export async function bootstrapManagedLocalN8n(options) {
|
|
13
|
+
const credentialService = options.ownerCredentialService ?? new ManagedN8nOwnerCredentialService();
|
|
14
|
+
const storedCredentials = credentialService.get(options.url);
|
|
15
|
+
const ownerCredentials = storedCredentials ?? buildGeneratedOwnerCredentials(options.url);
|
|
16
|
+
try {
|
|
17
|
+
const sessionCookie = await retryBootstrapStep(storedCredentials ? 'owner login' : 'owner setup', async () => storedCredentials
|
|
18
|
+
? await loginOwner(options.url, storedCredentials)
|
|
19
|
+
: await setupOwner(options.url, ownerCredentials));
|
|
20
|
+
if (!storedCredentials) {
|
|
21
|
+
credentialService.save(ownerCredentials);
|
|
22
|
+
}
|
|
23
|
+
const apiKey = await retryBootstrapStep('api key creation', async () => await createApiKey(options.url, sessionCookie));
|
|
24
|
+
await finalizeManagedLocalN8nReadiness({
|
|
25
|
+
url: options.url,
|
|
26
|
+
sessionCookie,
|
|
27
|
+
ownerCredentials,
|
|
28
|
+
});
|
|
29
|
+
markManagedN8nBootstrapStage(options.url, 'api-key-pending');
|
|
30
|
+
return {
|
|
31
|
+
mode: 'silent',
|
|
32
|
+
apiKey,
|
|
33
|
+
ownerCredentials,
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
catch (error) {
|
|
37
|
+
return {
|
|
38
|
+
mode: 'assisted',
|
|
39
|
+
reason: error instanceof Error ? error.message : String(error),
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
async function setupOwner(url, credentials) {
|
|
44
|
+
const response = await fetch(buildUrl(url, OWNER_SETUP_PATH), {
|
|
45
|
+
method: 'POST',
|
|
46
|
+
headers: {
|
|
47
|
+
'content-type': 'application/json',
|
|
48
|
+
},
|
|
49
|
+
body: JSON.stringify({
|
|
50
|
+
email: credentials.email,
|
|
51
|
+
firstName: credentials.firstName,
|
|
52
|
+
lastName: credentials.lastName,
|
|
53
|
+
password: credentials.password,
|
|
54
|
+
}),
|
|
55
|
+
});
|
|
56
|
+
if (!response.ok) {
|
|
57
|
+
throw new Error(`Owner setup failed with ${response.status} ${response.statusText}.`);
|
|
58
|
+
}
|
|
59
|
+
const cookieHeader = response.headers.get('set-cookie');
|
|
60
|
+
const authCookie = extractCookie(cookieHeader, 'n8n-auth');
|
|
61
|
+
if (!authCookie) {
|
|
62
|
+
return await loginOwner(url, credentials);
|
|
63
|
+
}
|
|
64
|
+
return authCookie;
|
|
65
|
+
}
|
|
66
|
+
async function createApiKey(url, sessionCookie) {
|
|
67
|
+
let lastError;
|
|
68
|
+
for (let attempt = 0; attempt < 3; attempt += 1) {
|
|
69
|
+
try {
|
|
70
|
+
return await createApiKeyAttempt(url, sessionCookie, buildApiKeyLabel(attempt));
|
|
71
|
+
}
|
|
72
|
+
catch (error) {
|
|
73
|
+
lastError = error instanceof Error ? error : new Error(String(error));
|
|
74
|
+
if (!lastError.message.includes('There is already an entry with this name')) {
|
|
75
|
+
throw lastError;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
throw lastError ?? new Error('API key creation failed.');
|
|
80
|
+
}
|
|
81
|
+
async function createApiKeyAttempt(url, sessionCookie, label) {
|
|
82
|
+
const response = await fetch(buildUrl(url, API_KEYS_PATH), {
|
|
83
|
+
method: 'POST',
|
|
84
|
+
headers: {
|
|
85
|
+
'content-type': 'application/json',
|
|
86
|
+
cookie: sessionCookie,
|
|
87
|
+
},
|
|
88
|
+
body: JSON.stringify({
|
|
89
|
+
label,
|
|
90
|
+
scopes: DEFAULT_API_KEY_SCOPES,
|
|
91
|
+
expiresAt: null,
|
|
92
|
+
}),
|
|
93
|
+
});
|
|
94
|
+
if (!response.ok) {
|
|
95
|
+
const body = await safeReadText(response);
|
|
96
|
+
throw new Error(`API key creation failed with ${response.status} ${response.statusText}${body ? `: ${body}` : ''}.`);
|
|
97
|
+
}
|
|
98
|
+
const payload = await response.json();
|
|
99
|
+
const apiKey = payload.data?.rawApiKey;
|
|
100
|
+
if (!apiKey) {
|
|
101
|
+
throw new Error('API key creation succeeded but no raw API key was returned.');
|
|
102
|
+
}
|
|
103
|
+
return apiKey;
|
|
104
|
+
}
|
|
105
|
+
async function loginOwner(url, credentials) {
|
|
106
|
+
const response = await fetch(buildUrl(url, LOGIN_PATH), {
|
|
107
|
+
method: 'POST',
|
|
108
|
+
headers: {
|
|
109
|
+
'content-type': 'application/json',
|
|
110
|
+
},
|
|
111
|
+
body: JSON.stringify({
|
|
112
|
+
emailOrLdapLoginId: credentials.email,
|
|
113
|
+
password: credentials.password,
|
|
114
|
+
}),
|
|
115
|
+
});
|
|
116
|
+
if (!response.ok) {
|
|
117
|
+
const body = await safeReadText(response);
|
|
118
|
+
throw new Error(`Owner login failed with ${response.status} ${response.statusText}${body ? `: ${body}` : ''}.`);
|
|
119
|
+
}
|
|
120
|
+
const cookieHeader = response.headers.get('set-cookie');
|
|
121
|
+
const authCookie = extractCookie(cookieHeader, 'n8n-auth');
|
|
122
|
+
if (!authCookie) {
|
|
123
|
+
throw new Error('Owner login did not return an authenticated n8n session cookie.');
|
|
124
|
+
}
|
|
125
|
+
return authCookie;
|
|
126
|
+
}
|
|
127
|
+
async function finalizeManagedLocalN8nReadiness(options) {
|
|
128
|
+
await retryBootstrapStep('personalization survey submission', async () => await submitPersonalizationSurvey(options.url, options.sessionCookie, options.ownerCredentials.email));
|
|
129
|
+
await retryBootstrapStep('community license registration', async () => await registerCommunityEdition(options.url, options.sessionCookie, options.ownerCredentials.email)).catch(() => {
|
|
130
|
+
// The "free forever" license prompt is skippable in the UI, so registration must not block local readiness.
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
async function submitPersonalizationSurvey(url, sessionCookie, email) {
|
|
134
|
+
const response = await fetch(buildUrl(url, SURVEY_PATH), {
|
|
135
|
+
method: 'POST',
|
|
136
|
+
headers: {
|
|
137
|
+
'content-type': 'application/json',
|
|
138
|
+
cookie: sessionCookie,
|
|
139
|
+
},
|
|
140
|
+
body: JSON.stringify({
|
|
141
|
+
version: 'v4',
|
|
142
|
+
personalization_survey_submitted_at: new Date().toISOString(),
|
|
143
|
+
personalization_survey_n8n_version: 'yagr-managed',
|
|
144
|
+
companySize: 'personalUser',
|
|
145
|
+
companyType: 'personal',
|
|
146
|
+
role: 'engineering',
|
|
147
|
+
reportedSource: 'other',
|
|
148
|
+
reportedSourceOther: 'yagr-managed-local',
|
|
149
|
+
usageModes: ['own'],
|
|
150
|
+
companyIndustryExtended: ['technology'],
|
|
151
|
+
email,
|
|
152
|
+
}),
|
|
153
|
+
});
|
|
154
|
+
if (!response.ok) {
|
|
155
|
+
const body = await safeReadText(response);
|
|
156
|
+
throw new Error(`Survey submission failed with ${response.status} ${response.statusText}${body ? `: ${body}` : ''}.`);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
async function registerCommunityEdition(url, sessionCookie, email) {
|
|
160
|
+
const response = await fetch(buildUrl(url, COMMUNITY_LICENSE_PATH), {
|
|
161
|
+
method: 'POST',
|
|
162
|
+
headers: {
|
|
163
|
+
'content-type': 'application/json',
|
|
164
|
+
cookie: sessionCookie,
|
|
165
|
+
},
|
|
166
|
+
body: JSON.stringify({ email }),
|
|
167
|
+
});
|
|
168
|
+
if (response.ok) {
|
|
169
|
+
return;
|
|
170
|
+
}
|
|
171
|
+
const body = await safeReadText(response);
|
|
172
|
+
const lowerBody = body.toLowerCase();
|
|
173
|
+
if (response.status === 409
|
|
174
|
+
|| lowerBody.includes('already registered')
|
|
175
|
+
|| lowerBody.includes('already exists')
|
|
176
|
+
|| lowerBody.includes('already activated')) {
|
|
177
|
+
return;
|
|
178
|
+
}
|
|
179
|
+
throw new Error(`Community registration failed with ${response.status} ${response.statusText}${body ? `: ${body}` : ''}.`);
|
|
180
|
+
}
|
|
181
|
+
function buildGeneratedOwnerCredentials(url) {
|
|
182
|
+
const suffix = crypto.randomBytes(6).toString('hex');
|
|
183
|
+
return {
|
|
184
|
+
url,
|
|
185
|
+
email: `yagr-local-${suffix}@local.yagr`,
|
|
186
|
+
password: `Yagr${crypto.randomBytes(8).toString('hex').toUpperCase()}1`,
|
|
187
|
+
firstName: 'Yagr',
|
|
188
|
+
lastName: 'Local',
|
|
189
|
+
createdAt: new Date().toISOString(),
|
|
190
|
+
};
|
|
191
|
+
}
|
|
192
|
+
function buildApiKeyLabel(attempt) {
|
|
193
|
+
if (attempt === 0) {
|
|
194
|
+
return 'Yagr Local Managed';
|
|
195
|
+
}
|
|
196
|
+
return `Yagr Local Managed ${attempt + 1}`;
|
|
197
|
+
}
|
|
198
|
+
function buildUrl(baseUrl, pathname) {
|
|
199
|
+
const url = new URL(baseUrl);
|
|
200
|
+
url.pathname = pathname;
|
|
201
|
+
url.search = '';
|
|
202
|
+
url.hash = '';
|
|
203
|
+
return url.toString();
|
|
204
|
+
}
|
|
205
|
+
function extractCookie(headerValue, cookieName) {
|
|
206
|
+
if (!headerValue) {
|
|
207
|
+
return undefined;
|
|
208
|
+
}
|
|
209
|
+
const targetPrefix = `${cookieName}=`;
|
|
210
|
+
const parts = headerValue.split(/,(?=[^;]+=[^;]+)/);
|
|
211
|
+
for (const part of parts) {
|
|
212
|
+
const firstSegment = part.split(';', 1)[0]?.trim();
|
|
213
|
+
if (firstSegment?.startsWith(targetPrefix)) {
|
|
214
|
+
return firstSegment;
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
return undefined;
|
|
218
|
+
}
|
|
219
|
+
async function safeReadText(response) {
|
|
220
|
+
try {
|
|
221
|
+
return (await response.text()).trim();
|
|
222
|
+
}
|
|
223
|
+
catch {
|
|
224
|
+
return '';
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
async function retryBootstrapStep(stepName, action, timeoutMs = DEFAULT_BOOTSTRAP_TIMEOUT_MS, retryDelayMs = DEFAULT_RETRY_DELAY_MS) {
|
|
228
|
+
const deadline = Date.now() + timeoutMs;
|
|
229
|
+
let lastError;
|
|
230
|
+
while (Date.now() < deadline) {
|
|
231
|
+
try {
|
|
232
|
+
return await action();
|
|
233
|
+
}
|
|
234
|
+
catch (error) {
|
|
235
|
+
lastError = error instanceof Error ? error : new Error(String(error));
|
|
236
|
+
if (!isRetryableBootstrapError(lastError)) {
|
|
237
|
+
throw lastError;
|
|
238
|
+
}
|
|
239
|
+
await delay(retryDelayMs);
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
throw new Error(`${stepName} timed out: ${lastError?.message ?? 'unknown error'}`);
|
|
243
|
+
}
|
|
244
|
+
function isRetryableBootstrapError(error) {
|
|
245
|
+
const message = error.message.toLowerCase();
|
|
246
|
+
return (message.includes('failed to fetch')
|
|
247
|
+
|| message.includes('fetch failed')
|
|
248
|
+
|| message.includes('timed out')
|
|
249
|
+
|| message.includes('unauthorized')
|
|
250
|
+
|| message.includes('bad gateway')
|
|
251
|
+
|| message.includes('service unavailable')
|
|
252
|
+
|| message.includes('internal server error')
|
|
253
|
+
|| message.includes('owner setup failed with 404')
|
|
254
|
+
|| message.includes('owner setup failed with 502')
|
|
255
|
+
|| message.includes('owner setup failed with 503')
|
|
256
|
+
|| message.includes('owner setup did not return an authenticated n8n session cookie')
|
|
257
|
+
|| message.includes('owner login failed with 404')
|
|
258
|
+
|| message.includes('owner login failed with 429')
|
|
259
|
+
|| message.includes('owner login failed with 502')
|
|
260
|
+
|| message.includes('owner login failed with 503')
|
|
261
|
+
|| message.includes('owner login did not return an authenticated n8n session cookie')
|
|
262
|
+
|| message.includes('api key creation failed with 401')
|
|
263
|
+
|| message.includes('api key creation failed with 404')
|
|
264
|
+
|| message.includes('api key creation failed with 429')
|
|
265
|
+
|| message.includes('api key creation failed with 502')
|
|
266
|
+
|| message.includes('api key creation failed with 503')
|
|
267
|
+
|| message.includes('survey submission failed with 401')
|
|
268
|
+
|| message.includes('survey submission failed with 404')
|
|
269
|
+
|| message.includes('survey submission failed with 429')
|
|
270
|
+
|| message.includes('survey submission failed with 502')
|
|
271
|
+
|| message.includes('survey submission failed with 503')
|
|
272
|
+
|| message.includes('community registration failed with 401')
|
|
273
|
+
|| message.includes('community registration failed with 404')
|
|
274
|
+
|| message.includes('community registration failed with 429')
|
|
275
|
+
|| message.includes('community registration failed with 502')
|
|
276
|
+
|| message.includes('community registration failed with 503'));
|
|
277
|
+
}
|
|
278
|
+
async function delay(ms) {
|
|
279
|
+
await new Promise((resolve) => setTimeout(resolve, ms));
|
|
280
|
+
}
|
|
281
|
+
//# sourceMappingURL=bootstrap.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bootstrap.js","sourceRoot":"","sources":["../../src/n8n-local/bootstrap.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,gCAAgC,EAAmC,MAAM,wBAAwB,CAAC;AAC3G,OAAO,EAAE,4BAA4B,EAAE,MAAM,YAAY,CAAC;AAE1D,MAAM,gBAAgB,GAAG,mBAAmB,CAAC;AAC7C,MAAM,UAAU,GAAG,aAAa,CAAC;AACjC,MAAM,aAAa,GAAG,gBAAgB,CAAC;AACvC,MAAM,WAAW,GAAG,iBAAiB,CAAC;AACtC,MAAM,sBAAsB,GAAG,+CAA+C,CAAC;AAC/E,MAAM,sBAAsB,GAAG,CAAC,eAAe,CAAC,CAAC;AACjD,MAAM,4BAA4B,GAAG,MAAM,CAAC;AAC5C,MAAM,sBAAsB,GAAG,KAAK,CAAC;AASrC,MAAM,CAAC,KAAK,UAAU,wBAAwB,CAAC,OAG9C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AAE,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC;AAC1D,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ManagedN8nOwnerCredentials } from './owner-credentials.js';
|
|
2
|
+
export declare function buildManagedN8nWorkflowOpenPage(input: {
|
|
3
|
+
targetUrl: string;
|
|
4
|
+
loginUrl: string;
|
|
5
|
+
credentials: ManagedN8nOwnerCredentials;
|
|
6
|
+
}): string;
|
|
7
|
+
export declare function buildManagedN8nWorkflowOpenDataUrl(input: {
|
|
8
|
+
targetUrl: string;
|
|
9
|
+
loginUrl: string;
|
|
10
|
+
credentials: ManagedN8nOwnerCredentials;
|
|
11
|
+
}): string;
|
|
12
|
+
//# sourceMappingURL=browser-auth.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"browser-auth.d.ts","sourceRoot":"","sources":["../../src/n8n-local/browser-auth.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,wBAAwB,CAAC;AAEzE,wBAAgB,+BAA+B,CAAC,KAAK,EAAE;IACrD,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,0BAA0B,CAAC;CACzC,GAAG,MAAM,CAmJT;AAED,wBAAgB,kCAAkC,CAAC,KAAK,EAAE;IACxD,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,0BAA0B,CAAC;CACzC,GAAG,MAAM,CAET"}
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
export function buildManagedN8nWorkflowOpenPage(input) {
|
|
2
|
+
const pageTitle = escapeHtml(`Open ${input.targetUrl}`);
|
|
3
|
+
const escapedTargetUrl = escapeHtml(input.targetUrl);
|
|
4
|
+
const escapedLoginUrl = escapeHtml(input.loginUrl);
|
|
5
|
+
const escapedEmail = escapeHtml(input.credentials.email);
|
|
6
|
+
const escapedPassword = escapeHtml(input.credentials.password);
|
|
7
|
+
return `<!doctype html>
|
|
8
|
+
<html lang="en">
|
|
9
|
+
<head>
|
|
10
|
+
<meta charset="utf-8" />
|
|
11
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
12
|
+
<title>${pageTitle}</title>
|
|
13
|
+
<style>
|
|
14
|
+
:root {
|
|
15
|
+
color-scheme: dark;
|
|
16
|
+
--bg: #101418;
|
|
17
|
+
--panel: #171d23;
|
|
18
|
+
--text: #eef3f7;
|
|
19
|
+
--muted: #9aa7b3;
|
|
20
|
+
--accent: #ff6d5a;
|
|
21
|
+
--accent-strong: #ff8d6b;
|
|
22
|
+
--border: rgba(255,255,255,0.08);
|
|
23
|
+
}
|
|
24
|
+
* { box-sizing: border-box; }
|
|
25
|
+
body {
|
|
26
|
+
margin: 0;
|
|
27
|
+
min-height: 100vh;
|
|
28
|
+
display: grid;
|
|
29
|
+
place-items: center;
|
|
30
|
+
background:
|
|
31
|
+
radial-gradient(circle at top right, rgba(255,109,90,0.22), transparent 34%),
|
|
32
|
+
radial-gradient(circle at bottom left, rgba(95,160,255,0.16), transparent 30%),
|
|
33
|
+
var(--bg);
|
|
34
|
+
color: var(--text);
|
|
35
|
+
font: 16px/1.5 ui-sans-serif, system-ui, sans-serif;
|
|
36
|
+
}
|
|
37
|
+
.panel {
|
|
38
|
+
width: min(680px, calc(100vw - 32px));
|
|
39
|
+
background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01)), var(--panel);
|
|
40
|
+
border: 1px solid var(--border);
|
|
41
|
+
border-radius: 18px;
|
|
42
|
+
padding: 28px;
|
|
43
|
+
box-shadow: 0 20px 60px rgba(0,0,0,0.35);
|
|
44
|
+
}
|
|
45
|
+
h1 {
|
|
46
|
+
margin: 0 0 8px;
|
|
47
|
+
font-size: 24px;
|
|
48
|
+
}
|
|
49
|
+
p { margin: 0 0 14px; color: var(--muted); }
|
|
50
|
+
.status {
|
|
51
|
+
margin: 18px 0;
|
|
52
|
+
padding: 12px 14px;
|
|
53
|
+
border-radius: 12px;
|
|
54
|
+
background: rgba(255,255,255,0.04);
|
|
55
|
+
border: 1px solid var(--border);
|
|
56
|
+
}
|
|
57
|
+
.actions {
|
|
58
|
+
display: flex;
|
|
59
|
+
gap: 12px;
|
|
60
|
+
flex-wrap: wrap;
|
|
61
|
+
margin-top: 18px;
|
|
62
|
+
}
|
|
63
|
+
a, button {
|
|
64
|
+
appearance: none;
|
|
65
|
+
border: 0;
|
|
66
|
+
border-radius: 999px;
|
|
67
|
+
padding: 10px 16px;
|
|
68
|
+
font: inherit;
|
|
69
|
+
cursor: pointer;
|
|
70
|
+
text-decoration: none;
|
|
71
|
+
}
|
|
72
|
+
.primary {
|
|
73
|
+
background: linear-gradient(135deg, var(--accent), var(--accent-strong));
|
|
74
|
+
color: #111;
|
|
75
|
+
font-weight: 700;
|
|
76
|
+
}
|
|
77
|
+
.secondary {
|
|
78
|
+
background: rgba(255,255,255,0.06);
|
|
79
|
+
color: var(--text);
|
|
80
|
+
}
|
|
81
|
+
.secret {
|
|
82
|
+
margin-top: 16px;
|
|
83
|
+
padding: 14px;
|
|
84
|
+
border-radius: 12px;
|
|
85
|
+
border: 1px solid var(--border);
|
|
86
|
+
background: rgba(0,0,0,0.18);
|
|
87
|
+
}
|
|
88
|
+
code {
|
|
89
|
+
font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
|
|
90
|
+
font-size: 13px;
|
|
91
|
+
word-break: break-all;
|
|
92
|
+
}
|
|
93
|
+
.hidden { display: none; }
|
|
94
|
+
</style>
|
|
95
|
+
</head>
|
|
96
|
+
<body>
|
|
97
|
+
<main class="panel">
|
|
98
|
+
<h1>Opening n8n workflow</h1>
|
|
99
|
+
<p>Yagr is signing you into its managed local n8n instance, then redirecting you to the workflow.</p>
|
|
100
|
+
<div class="status" id="status">Starting secure browser session…</div>
|
|
101
|
+
<div class="actions">
|
|
102
|
+
<a class="primary" href="${escapedTargetUrl}" id="open-link">Open workflow now</a>
|
|
103
|
+
<button class="secondary" type="button" id="show-creds">Show login credentials</button>
|
|
104
|
+
</div>
|
|
105
|
+
<section class="secret hidden" id="credentials">
|
|
106
|
+
<p>If automatic sign-in does not complete, use these local n8n owner credentials:</p>
|
|
107
|
+
<p>Email<br /><code>${escapedEmail}</code></p>
|
|
108
|
+
<p>Password<br /><code>${escapedPassword}</code></p>
|
|
109
|
+
</section>
|
|
110
|
+
<iframe class="hidden" name="n8n-login-bridge" title="n8n login bridge"></iframe>
|
|
111
|
+
<form class="hidden" id="login-form" method="post" action="${escapedLoginUrl}" target="n8n-login-bridge">
|
|
112
|
+
<input type="hidden" name="emailOrLdapLoginId" value="${escapedEmail}" />
|
|
113
|
+
<input type="hidden" name="password" value="${escapedPassword}" />
|
|
114
|
+
</form>
|
|
115
|
+
</main>
|
|
116
|
+
<script>
|
|
117
|
+
const targetUrl = ${JSON.stringify(input.targetUrl)};
|
|
118
|
+
const loginForm = document.getElementById('login-form');
|
|
119
|
+
const status = document.getElementById('status');
|
|
120
|
+
const credentials = document.getElementById('credentials');
|
|
121
|
+
const showCredsButton = document.getElementById('show-creds');
|
|
122
|
+
|
|
123
|
+
showCredsButton?.addEventListener('click', () => {
|
|
124
|
+
credentials?.classList.remove('hidden');
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
try {
|
|
128
|
+
if (!(loginForm instanceof HTMLFormElement)) {
|
|
129
|
+
throw new Error('Login form is unavailable.');
|
|
130
|
+
}
|
|
131
|
+
loginForm.submit();
|
|
132
|
+
window.setTimeout(() => {
|
|
133
|
+
status.textContent = 'Opening workflow…';
|
|
134
|
+
window.location.replace(targetUrl);
|
|
135
|
+
}, 900);
|
|
136
|
+
window.setTimeout(() => {
|
|
137
|
+
status.textContent = 'If the workflow still asks for login, reveal the credentials below and sign in once.';
|
|
138
|
+
credentials?.classList.remove('hidden');
|
|
139
|
+
}, 3000);
|
|
140
|
+
} catch (error) {
|
|
141
|
+
status.textContent = error instanceof Error ? error.message : 'Automatic sign-in could not start.';
|
|
142
|
+
credentials?.classList.remove('hidden');
|
|
143
|
+
}
|
|
144
|
+
</script>
|
|
145
|
+
</body>
|
|
146
|
+
</html>`;
|
|
147
|
+
}
|
|
148
|
+
export function buildManagedN8nWorkflowOpenDataUrl(input) {
|
|
149
|
+
return `data:text/html;charset=utf-8,${encodeURIComponent(buildManagedN8nWorkflowOpenPage(input))}`;
|
|
150
|
+
}
|
|
151
|
+
function escapeHtml(value) {
|
|
152
|
+
return value
|
|
153
|
+
.replace(/&/g, '&')
|
|
154
|
+
.replace(/</g, '<')
|
|
155
|
+
.replace(/>/g, '>')
|
|
156
|
+
.replace(/"/g, '"')
|
|
157
|
+
.replace(/'/g, ''');
|
|
158
|
+
}
|
|
159
|
+
//# sourceMappingURL=browser-auth.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"browser-auth.js","sourceRoot":"","sources":["../../src/n8n-local/browser-auth.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,+BAA+B,CAAC,KAI/C;IACC,MAAM,SAAS,GAAG,UAAU,CAAC,QAAQ,KAAK,CAAC,SAAS,EAAE,CAAC,CAAC;IACxD,MAAM,gBAAgB,GAAG,UAAU,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;IACrD,MAAM,eAAe,GAAG,UAAU,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IACnD,MAAM,YAAY,GAAG,UAAU,CAAC,KAAK,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;IACzD,MAAM,eAAe,GAAG,UAAU,CAAC,KAAK,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;IAE/D,OAAO;;;;;aAKI,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mCA0Fa,gBAAgB;;;;;8BAKrB,YAAY;iCACT,eAAe;;;mEAGmB,eAAe;gEAClB,YAAY;sDACtB,eAAe;;;;0BAI3C,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,SAAS,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QA6BjD,CAAC;AACT,CAAC;AAED,MAAM,UAAU,kCAAkC,CAAC,KAIlD;IACC,OAAO,gCAAgC,kBAAkB,CAAC,+BAA+B,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC;AACtG,CAAC;AAED,SAAS,UAAU,CAAC,KAAa;IAC/B,OAAO,KAAK;SACT,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC;SACtB,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC;SACrB,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC;SACrB,OAAO,CAAC,IAAI,EAAE,QAAQ,CAAC;SACvB,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AAC5B,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
export declare const DEFAULT_N8N_PORT = 5678;
|
|
2
|
+
export declare const MAX_PORT_SCAN_ATTEMPTS = 10;
|
|
3
|
+
export declare const MINIMUM_DIRECT_RUNTIME_NODE_VERSION = "22.16.0";
|
|
4
|
+
export type LocalN8nBootstrapStrategy = 'docker' | 'direct' | 'manual';
|
|
5
|
+
export interface CommandAvailability {
|
|
6
|
+
available: boolean;
|
|
7
|
+
version?: string;
|
|
8
|
+
reachable?: boolean;
|
|
9
|
+
statusMessage?: string;
|
|
10
|
+
}
|
|
11
|
+
export interface LocalN8nBootstrapAssessment {
|
|
12
|
+
platform: NodeJS.Platform;
|
|
13
|
+
docker: CommandAvailability;
|
|
14
|
+
node: CommandAvailability & {
|
|
15
|
+
supportedForDirectRuntime: boolean;
|
|
16
|
+
majorVersion?: number;
|
|
17
|
+
};
|
|
18
|
+
preferredPort: number;
|
|
19
|
+
preferredUrl: string;
|
|
20
|
+
recommendedStrategy: LocalN8nBootstrapStrategy;
|
|
21
|
+
blockers: string[];
|
|
22
|
+
notes: string[];
|
|
23
|
+
}
|
|
24
|
+
interface DetectDependencies {
|
|
25
|
+
platform: NodeJS.Platform;
|
|
26
|
+
detectCommand(command: string, versionArgs: string[]): Promise<CommandAvailability>;
|
|
27
|
+
isPortAvailable(port: number): Promise<boolean>;
|
|
28
|
+
}
|
|
29
|
+
export declare function normalizeCommandVersion(output: string | undefined): string | undefined;
|
|
30
|
+
export declare function parseNodeMajorVersion(version: string | undefined): number | undefined;
|
|
31
|
+
export declare function parseNodeVersion(version: string | undefined): {
|
|
32
|
+
major: number;
|
|
33
|
+
minor: number;
|
|
34
|
+
patch: number;
|
|
35
|
+
} | undefined;
|
|
36
|
+
export declare function isSupportedDirectRuntimeNodeVersion(version: string | undefined): boolean;
|
|
37
|
+
export declare function chooseLocalN8nBootstrapStrategy(input: {
|
|
38
|
+
dockerAvailable: boolean;
|
|
39
|
+
nodeVersion?: string;
|
|
40
|
+
}): LocalN8nBootstrapStrategy;
|
|
41
|
+
export declare function buildLocalN8nBootstrapAssessment(input: {
|
|
42
|
+
platform: NodeJS.Platform;
|
|
43
|
+
docker: CommandAvailability;
|
|
44
|
+
node: CommandAvailability;
|
|
45
|
+
preferredPort: number;
|
|
46
|
+
}): LocalN8nBootstrapAssessment;
|
|
47
|
+
export declare function formatLocalN8nBootstrapAssessment(assessment: LocalN8nBootstrapAssessment): string;
|
|
48
|
+
export declare function inspectLocalN8nBootstrap(dependencies?: Partial<DetectDependencies>): Promise<LocalN8nBootstrapAssessment>;
|
|
49
|
+
export {};
|
|
50
|
+
//# sourceMappingURL=detect.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"detect.d.ts","sourceRoot":"","sources":["../../src/n8n-local/detect.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,gBAAgB,OAAO,CAAC;AACrC,eAAO,MAAM,sBAAsB,KAAK,CAAC;AACzC,eAAO,MAAM,mCAAmC,YAAY,CAAC;AAE7D,MAAM,MAAM,yBAAyB,GAAG,QAAQ,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