@amaster.ai/runtime-cli 1.0.0-beta.72

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/index.cjs ADDED
@@ -0,0 +1,1045 @@
1
+ 'use strict';
2
+
3
+ var fs = require('fs');
4
+ var path = require('path');
5
+ var os = require('os');
6
+ var commander = require('commander');
7
+ var chalk7 = require('chalk');
8
+ var client = require('@amaster.ai/client');
9
+ var ora2 = require('ora');
10
+ var yaml = require('yaml');
11
+
12
+ var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
13
+ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
14
+
15
+ var chalk7__default = /*#__PURE__*/_interopDefault(chalk7);
16
+ var ora2__default = /*#__PURE__*/_interopDefault(ora2);
17
+ var yaml__default = /*#__PURE__*/_interopDefault(yaml);
18
+
19
+ var __defProp = Object.defineProperty;
20
+ var __getOwnPropNames = Object.getOwnPropertyNames;
21
+ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
22
+ get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
23
+ }) : x)(function(x) {
24
+ if (typeof require !== "undefined") return require.apply(this, arguments);
25
+ throw Error('Dynamic require of "' + x + '" is not supported');
26
+ });
27
+ var __esm = (fn, res) => function __init() {
28
+ return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
29
+ };
30
+ var __export = (target, all) => {
31
+ for (var name in all)
32
+ __defProp(target, name, { get: all[name], enumerable: true });
33
+ };
34
+
35
+ // src/config.ts
36
+ var config_exports = {};
37
+ __export(config_exports, {
38
+ addApp: () => addApp,
39
+ clearAuthSession: () => clearAuthSession,
40
+ getAccessToken: () => getAccessToken,
41
+ getAppConfig: () => getAppConfig,
42
+ getAuthSession: () => getAuthSession,
43
+ getBaseURL: () => getBaseURL,
44
+ getConfig: () => getConfig,
45
+ getCurrentApp: () => getCurrentApp,
46
+ isAuthenticated: () => isAuthenticated,
47
+ listApps: () => listApps,
48
+ removeApp: () => removeApp,
49
+ saveAuthSession: () => saveAuthSession,
50
+ saveConfig: () => saveConfig,
51
+ setCurrentApp: () => setCurrentApp,
52
+ shouldRefreshToken: () => shouldRefreshToken
53
+ });
54
+ function getConfig() {
55
+ if (!fs.existsSync(CONFIG_FILE)) {
56
+ return { apps: {} };
57
+ }
58
+ try {
59
+ return JSON.parse(fs.readFileSync(CONFIG_FILE, "utf-8"));
60
+ } catch {
61
+ return { apps: {} };
62
+ }
63
+ }
64
+ function saveConfig(config) {
65
+ if (!fs.existsSync(AMASTER_CONFIG_DIR)) {
66
+ const fs = __require("fs");
67
+ fs.mkdirSync(AMASTER_CONFIG_DIR, { recursive: true });
68
+ }
69
+ fs.writeFileSync(CONFIG_FILE, JSON.stringify(config, null, 2));
70
+ }
71
+ function getAppConfig(appCode) {
72
+ const config = getConfig();
73
+ return config.apps[appCode] || null;
74
+ }
75
+ function addApp(appCode, appConfig) {
76
+ const config = getConfig();
77
+ config.apps[appCode] = appConfig;
78
+ if (!config.currentApp) {
79
+ config.currentApp = appCode;
80
+ }
81
+ saveConfig(config);
82
+ }
83
+ function removeApp(appCode) {
84
+ const config = getConfig();
85
+ if (config.apps[appCode]) {
86
+ delete config.apps[appCode];
87
+ const authFile = path.join(AMASTER_CONFIG_DIR, `auth-${appCode}.json`);
88
+ if (fs.existsSync(authFile)) {
89
+ fs.rmSync(authFile, { force: true });
90
+ }
91
+ if (config.currentApp === appCode) {
92
+ const remainingApps = Object.keys(config.apps);
93
+ config.currentApp = remainingApps.length > 0 ? remainingApps[0] : void 0;
94
+ }
95
+ saveConfig(config);
96
+ }
97
+ }
98
+ function setCurrentApp(appCode) {
99
+ const config = getConfig();
100
+ if (!config.apps[appCode]) {
101
+ return false;
102
+ }
103
+ config.currentApp = appCode;
104
+ saveConfig(config);
105
+ return true;
106
+ }
107
+ function getCurrentApp() {
108
+ const config = getConfig();
109
+ return config.currentApp || null;
110
+ }
111
+ function listApps() {
112
+ const config = getConfig();
113
+ return Object.keys(config.apps);
114
+ }
115
+ function getBaseURL(appCode) {
116
+ const code = appCode || getCurrentApp();
117
+ if (!code) return null;
118
+ const appConfig = getAppConfig(code);
119
+ return appConfig?.baseURL || null;
120
+ }
121
+ function getAuthSession(appCode) {
122
+ const authFile = path.join(AMASTER_CONFIG_DIR, `auth-${appCode}.json`);
123
+ if (!fs.existsSync(authFile)) {
124
+ return null;
125
+ }
126
+ try {
127
+ const content = fs.readFileSync(authFile, "utf-8");
128
+ return JSON.parse(content);
129
+ } catch {
130
+ return null;
131
+ }
132
+ }
133
+ function saveAuthSession(appCode, session) {
134
+ if (!fs.existsSync(AMASTER_CONFIG_DIR)) {
135
+ const fs = __require("fs");
136
+ fs.mkdirSync(AMASTER_CONFIG_DIR, { recursive: true });
137
+ }
138
+ const authFile = path.join(AMASTER_CONFIG_DIR, `auth-${appCode}.json`);
139
+ fs.writeFileSync(authFile, JSON.stringify(session, null, 2), { mode: 384 });
140
+ }
141
+ function clearAuthSession(appCode) {
142
+ const authFile = path.join(AMASTER_CONFIG_DIR, `auth-${appCode}.json`);
143
+ if (fs.existsSync(authFile)) {
144
+ fs.rmSync(authFile, { force: true });
145
+ }
146
+ }
147
+ function isAuthenticated(appCode) {
148
+ const session = getAuthSession(appCode);
149
+ if (!session) return false;
150
+ if (session.expiresAt) {
151
+ const expiresAt = new Date(session.expiresAt);
152
+ if (expiresAt < /* @__PURE__ */ new Date()) {
153
+ return false;
154
+ }
155
+ }
156
+ return true;
157
+ }
158
+ function getAccessToken(appCode) {
159
+ const session = getAuthSession(appCode);
160
+ return session?.accessToken || null;
161
+ }
162
+ function shouldRefreshToken(appCode) {
163
+ const session = getAuthSession(appCode);
164
+ if (!session?.expiresAt) return false;
165
+ const expiresAt = new Date(session.expiresAt);
166
+ const now = /* @__PURE__ */ new Date();
167
+ const fiveMinutes = 5 * 60 * 1e3;
168
+ return expiresAt.getTime() - now.getTime() < fiveMinutes;
169
+ }
170
+ var AMASTER_CONFIG_DIR, CONFIG_FILE;
171
+ var init_config = __esm({
172
+ "src/config.ts"() {
173
+ AMASTER_CONFIG_DIR = path.join(os.homedir(), ".amaster");
174
+ CONFIG_FILE = path.join(AMASTER_CONFIG_DIR, "config.json");
175
+ }
176
+ });
177
+
178
+ // src/index.ts
179
+ init_config();
180
+
181
+ // src/cli.ts
182
+ init_config();
183
+
184
+ // src/commands/auth.ts
185
+ init_config();
186
+ async function login(appCode, options) {
187
+ const spinner = ora2__default.default(`Logging in to ${appCode}...`).start();
188
+ try {
189
+ const appConfig = getAppConfig(appCode);
190
+ if (!appConfig) {
191
+ spinner.fail(`App not configured: ${appCode}`);
192
+ console.error(chalk7__default.default.red(`
193
+ \u274C App not found: ${appCode}`));
194
+ console.log(chalk7__default.default.yellow(`Initialize it first: amaster init --app-code ${appCode} --url <url>`));
195
+ process.exit(1);
196
+ }
197
+ let email = options.email;
198
+ let password = options.password;
199
+ if (!email || !password) {
200
+ const { default: inquirer } = await import('inquirer');
201
+ const answers = await inquirer.prompt([
202
+ {
203
+ type: "input",
204
+ name: "email",
205
+ message: "Email:",
206
+ when: !email
207
+ },
208
+ {
209
+ type: "password",
210
+ name: "password",
211
+ message: "Password:",
212
+ when: !password
213
+ }
214
+ ]);
215
+ email = email || answers.email;
216
+ password = password || answers.password;
217
+ }
218
+ const client$1 = client.createClient({ baseURL: appConfig.baseURL });
219
+ const result = await client$1.auth.login({ email, password });
220
+ if (result.error) {
221
+ spinner.fail("Login failed");
222
+ console.error(chalk7__default.default.red(result.error.message));
223
+ process.exit(1);
224
+ }
225
+ const loginData = result.data;
226
+ if (!loginData?.accessToken) {
227
+ spinner.fail("Login failed: No access token received");
228
+ process.exit(1);
229
+ }
230
+ saveAuthSession(appCode, {
231
+ accessToken: loginData.accessToken,
232
+ refreshToken: loginData.refreshToken,
233
+ expiresAt: loginData.expiresAt,
234
+ user: loginData.user,
235
+ loggedInAt: (/* @__PURE__ */ new Date()).toISOString()
236
+ });
237
+ spinner.succeed(`Login successful: ${appCode}`);
238
+ console.log(chalk7__default.default.green(`
239
+ Welcome, ${loginData.user?.name || loginData.user?.email || email}!`));
240
+ console.log(chalk7__default.default.gray(`App: ${appCode}`));
241
+ console.log(chalk7__default.default.gray(`URL: ${appConfig.baseURL}`));
242
+ if (loginData.expiresAt) {
243
+ const expires = new Date(loginData.expiresAt);
244
+ console.log(chalk7__default.default.gray(`Session expires: ${expires.toLocaleString()}`));
245
+ }
246
+ } catch (error) {
247
+ spinner.fail("Login failed");
248
+ throw error;
249
+ }
250
+ }
251
+ async function logout(appCode) {
252
+ const spinner = ora2__default.default(`Logging out from ${appCode}...`).start();
253
+ try {
254
+ const appConfig = getAppConfig(appCode);
255
+ if (appConfig) {
256
+ const { getAccessToken: getAccessToken2 } = await Promise.resolve().then(() => (init_config(), config_exports));
257
+ const token = getAccessToken2(appCode);
258
+ if (token) {
259
+ const client$1 = client.createClient({
260
+ baseURL: appConfig.baseURL,
261
+ headers: { Authorization: `Bearer ${token}` }
262
+ });
263
+ await client$1.auth.logout().catch(() => {
264
+ });
265
+ }
266
+ }
267
+ clearAuthSession(appCode);
268
+ spinner.succeed(`Logout successful: ${appCode}`);
269
+ } catch (error) {
270
+ spinner.fail("Logout failed");
271
+ throw error;
272
+ }
273
+ }
274
+ async function getMe(getClient) {
275
+ const spinner = ora2__default.default("Fetching user info...").start();
276
+ try {
277
+ const client = getClient();
278
+ const result = await client.auth.getMe();
279
+ if (result.error) {
280
+ spinner.fail("Failed to fetch user info");
281
+ console.error(chalk7__default.default.red(result.error.message));
282
+ process.exit(1);
283
+ }
284
+ spinner.succeed("User info retrieved");
285
+ const user = result.data;
286
+ console.log(chalk7__default.default.blue("\n\u{1F464} User Profile\n"));
287
+ console.log(` ${chalk7__default.default.bold("UID:")} ${user?.uid}`);
288
+ console.log(` ${chalk7__default.default.bold("Email:")} ${user?.email}`);
289
+ console.log(` ${chalk7__default.default.bold("Name:")} ${user?.name || "N/A"}`);
290
+ console.log(` ${chalk7__default.default.bold("Status:")} ${user?.status || "N/A"}`);
291
+ } catch (error) {
292
+ spinner.fail("Failed to fetch user info");
293
+ throw error;
294
+ }
295
+ }
296
+ async function listEntities(client, options) {
297
+ const spinner = ora2__default.default(`Fetching ${options.entity}...`).start();
298
+ try {
299
+ const result = await client.entity.list(options.namespace, options.entity, {
300
+ page: options.page || 1,
301
+ pageSize: options.pageSize || 10
302
+ });
303
+ if (result.error) {
304
+ spinner.fail("Failed to fetch entities");
305
+ console.error(chalk7__default.default.red(result.error.message));
306
+ process.exit(1);
307
+ }
308
+ spinner.succeed(`Found ${result.data?.total || 0} ${options.entity}`);
309
+ const items = result.data?.list || [];
310
+ console.log(chalk7__default.default.blue(`
311
+ \u{1F4E6} ${options.entity} in ${options.namespace}
312
+ `));
313
+ for (const item of items.slice(0, 10)) {
314
+ const id = item.id || item.uid || item._id;
315
+ console.log(` ${chalk7__default.default.green("\u2022")} ${chalk7__default.default.bold(id)}`);
316
+ const entries = Object.entries(item).slice(0, 5);
317
+ for (const [key, value] of entries) {
318
+ if (key !== "id" && key !== "uid" && key !== "_id") {
319
+ const displayValue = typeof value === "object" ? JSON.stringify(value).slice(0, 50) : String(value).slice(0, 50);
320
+ console.log(` ${chalk7__default.default.gray(key + ":")} ${displayValue}`);
321
+ }
322
+ }
323
+ if (Object.keys(item).length > 6) {
324
+ console.log(` ${chalk7__default.default.gray("...")}`);
325
+ }
326
+ console.log();
327
+ }
328
+ if (items.length > 10) {
329
+ console.log(chalk7__default.default.gray(` ... and ${items.length - 10} more`));
330
+ }
331
+ } catch (error) {
332
+ spinner.fail("Failed to fetch entities");
333
+ throw error;
334
+ }
335
+ }
336
+ async function getEntity(client, options) {
337
+ const spinner = ora2__default.default(`Fetching ${options.entity}...`).start();
338
+ try {
339
+ const result = await client.entity.get(options.namespace, options.entity, options.id);
340
+ if (result.error) {
341
+ spinner.fail("Failed to fetch entity");
342
+ console.error(chalk7__default.default.red(result.error.message));
343
+ process.exit(1);
344
+ }
345
+ spinner.succeed("Entity retrieved");
346
+ console.log(chalk7__default.default.blue(`
347
+ \u{1F4C4} ${options.entity}
348
+ `));
349
+ console.log(JSON.stringify(result.data, null, 2));
350
+ } catch (error) {
351
+ spinner.fail("Failed to fetch entity");
352
+ throw error;
353
+ }
354
+ }
355
+ async function createEntity(client, options) {
356
+ const spinner = ora2__default.default(`Creating ${options.entity}...`).start();
357
+ try {
358
+ let data = {};
359
+ if (options.data) {
360
+ data = JSON.parse(options.data);
361
+ } else {
362
+ const { default: inquirer } = await import('inquirer');
363
+ const { jsonData } = await inquirer.prompt([
364
+ {
365
+ type: "editor",
366
+ name: "jsonData",
367
+ message: "Enter JSON data:",
368
+ default: "{}"
369
+ }
370
+ ]);
371
+ data = JSON.parse(jsonData);
372
+ }
373
+ const result = await client.entity.create(options.namespace, options.entity, data);
374
+ if (result.error) {
375
+ spinner.fail("Failed to create entity");
376
+ console.error(chalk7__default.default.red(result.error.message));
377
+ process.exit(1);
378
+ }
379
+ spinner.succeed("Entity created");
380
+ console.log(chalk7__default.default.green("\nCreated entity:"));
381
+ console.log(JSON.stringify(result.data, null, 2));
382
+ } catch (error) {
383
+ spinner.fail("Failed to create entity");
384
+ throw error;
385
+ }
386
+ }
387
+ async function updateEntity(client, options) {
388
+ const spinner = ora2__default.default(`Updating ${options.entity}...`).start();
389
+ try {
390
+ let data = {};
391
+ if (options.data) {
392
+ data = JSON.parse(options.data);
393
+ } else {
394
+ const { default: inquirer } = await import('inquirer');
395
+ const { jsonData } = await inquirer.prompt([
396
+ {
397
+ type: "editor",
398
+ name: "jsonData",
399
+ message: "Enter JSON data:",
400
+ default: "{}"
401
+ }
402
+ ]);
403
+ data = JSON.parse(jsonData);
404
+ }
405
+ const result = await client.entity.update(options.namespace, options.entity, options.id, data);
406
+ if (result.error) {
407
+ spinner.fail("Failed to update entity");
408
+ console.error(chalk7__default.default.red(result.error.message));
409
+ process.exit(1);
410
+ }
411
+ spinner.succeed("Entity updated");
412
+ console.log(chalk7__default.default.green("\nUpdated entity:"));
413
+ console.log(JSON.stringify(result.data, null, 2));
414
+ } catch (error) {
415
+ spinner.fail("Failed to update entity");
416
+ throw error;
417
+ }
418
+ }
419
+ async function deleteEntity(client, options) {
420
+ const spinner = ora2__default.default(`Deleting ${options.entity}...`).start();
421
+ try {
422
+ const result = await client.entity.delete(options.namespace, options.entity, options.id);
423
+ if (result.error) {
424
+ spinner.fail("Failed to delete entity");
425
+ console.error(chalk7__default.default.red(result.error.message));
426
+ process.exit(1);
427
+ }
428
+ spinner.succeed("Entity deleted");
429
+ console.log(chalk7__default.default.green(`
430
+ Deleted ${options.entity} with ID: ${options.id}`));
431
+ } catch (error) {
432
+ spinner.fail("Failed to delete entity");
433
+ throw error;
434
+ }
435
+ }
436
+ async function listProcesses(client) {
437
+ const spinner = ora2__default.default("Fetching process definitions...").start();
438
+ try {
439
+ const result = await client.bpm.getProcessDefinitions();
440
+ if (result.error) {
441
+ spinner.fail("Failed to fetch processes");
442
+ console.error(chalk7__default.default.red(result.error.message));
443
+ process.exit(1);
444
+ }
445
+ spinner.succeed(`Found ${result.data?.length || 0} process definitions`);
446
+ const processes = result.data || [];
447
+ console.log(chalk7__default.default.blue("\n\u{1F4CA} Process Definitions\n"));
448
+ for (const proc of processes) {
449
+ console.log(` ${chalk7__default.default.green("\u2022")} ${chalk7__default.default.bold(proc.key)}`);
450
+ console.log(` ${chalk7__default.default.gray("Name:")} ${proc.name || "N/A"}`);
451
+ console.log(` ${chalk7__default.default.gray("Version:")} ${proc.version || "N/A"}`);
452
+ console.log();
453
+ }
454
+ } catch (error) {
455
+ spinner.fail("Failed to fetch processes");
456
+ throw error;
457
+ }
458
+ }
459
+ async function startProcess(client, options) {
460
+ const spinner = ora2__default.default(`Starting process: ${options.key}...`).start();
461
+ try {
462
+ const variables = options.variables ? JSON.parse(options.variables) : {};
463
+ const result = await client.bpm.startProcess({
464
+ processKey: options.key,
465
+ variables
466
+ });
467
+ if (result.error) {
468
+ spinner.fail("Failed to start process");
469
+ console.error(chalk7__default.default.red(result.error.message));
470
+ process.exit(1);
471
+ }
472
+ spinner.succeed("Process started");
473
+ console.log(chalk7__default.default.green("\nProcess Instance:"));
474
+ console.log(` ${chalk7__default.default.bold("ID:")} ${result.data?.id}`);
475
+ console.log(` ${chalk7__default.default.bold("Definition ID:")} ${result.data?.definitionId}`);
476
+ console.log(` ${chalk7__default.default.bold("Business Key:")} ${result.data?.businessKey || "N/A"}`);
477
+ console.log(` ${chalk7__default.default.bold("Status:")} ${result.data?.suspended ? "Suspended" : "Active"}`);
478
+ } catch (error) {
479
+ spinner.fail("Failed to start process");
480
+ throw error;
481
+ }
482
+ }
483
+ async function listTasks(client, options) {
484
+ const spinner = ora2__default.default("Fetching tasks...").start();
485
+ try {
486
+ const params = {};
487
+ if (options.assignee) {
488
+ params.assignee = options.assignee;
489
+ }
490
+ const result = await client.bpm.getMyTasks(params);
491
+ if (result.error) {
492
+ spinner.fail("Failed to fetch tasks");
493
+ console.error(chalk7__default.default.red(result.error.message));
494
+ process.exit(1);
495
+ }
496
+ spinner.succeed(`Found ${result.data?.length || 0} tasks`);
497
+ const tasks = result.data || [];
498
+ console.log(chalk7__default.default.blue("\n\u{1F4DD} Tasks\n"));
499
+ for (const task of tasks) {
500
+ console.log(` ${chalk7__default.default.green("\u2022")} ${chalk7__default.default.bold(task.name || task.id)}`);
501
+ console.log(` ${chalk7__default.default.gray("ID:")} ${task.id}`);
502
+ console.log(` ${chalk7__default.default.gray("Assignee:")} ${task.assignee || "Unassigned"}`);
503
+ console.log(` ${chalk7__default.default.gray("Created:")} ${task.created || "N/A"}`);
504
+ console.log();
505
+ }
506
+ } catch (error) {
507
+ spinner.fail("Failed to fetch tasks");
508
+ throw error;
509
+ }
510
+ }
511
+ async function completeTask(client, options) {
512
+ const spinner = ora2__default.default(`Completing task: ${options.id}...`).start();
513
+ try {
514
+ const variables = options.variables ? JSON.parse(options.variables) : {};
515
+ const result = await client.bpm.completeTask(options.id, { variables });
516
+ if (result.error) {
517
+ spinner.fail("Failed to complete task");
518
+ console.error(chalk7__default.default.red(result.error.message));
519
+ process.exit(1);
520
+ }
521
+ spinner.succeed("Task completed");
522
+ } catch (error) {
523
+ spinner.fail("Failed to complete task");
524
+ throw error;
525
+ }
526
+ }
527
+ async function listWorkflows(client) {
528
+ const spinner = ora2__default.default("Fetching workflows...").start();
529
+ try {
530
+ const result = await client.workflow.listWorkflows();
531
+ if (result.error) {
532
+ spinner.fail("Failed to fetch workflows");
533
+ console.error(chalk7__default.default.red(result.error.message));
534
+ process.exit(1);
535
+ }
536
+ spinner.succeed(`Found ${result.data?.length || 0} workflows`);
537
+ const workflows = result.data || [];
538
+ console.log(chalk7__default.default.blue("\n\u26A1 Workflows\n"));
539
+ for (const workflow of workflows) {
540
+ console.log(` ${chalk7__default.default.green("\u2022")} ${chalk7__default.default.bold(workflow.code || workflow.id)}`);
541
+ console.log(` ${chalk7__default.default.gray("Name:")} ${workflow.name || "N/A"}`);
542
+ console.log(` ${chalk7__default.default.gray("Description:")} ${workflow.description || "N/A"}`);
543
+ console.log(` ${chalk7__default.default.gray("Status:")} ${workflow.status || "N/A"}`);
544
+ console.log();
545
+ }
546
+ } catch (error) {
547
+ spinner.fail("Failed to fetch workflows");
548
+ throw error;
549
+ }
550
+ }
551
+ async function executeWorkflow(client, options) {
552
+ const spinner = ora2__default.default(`Executing workflow: ${options.id}...`).start();
553
+ try {
554
+ const input = options.input ? JSON.parse(options.input) : {};
555
+ const result = await client.workflow.execute(options.id, {
556
+ input,
557
+ version: options.version
558
+ });
559
+ if (result.error) {
560
+ spinner.fail("Failed to execute workflow");
561
+ console.error(chalk7__default.default.red(result.error.message));
562
+ process.exit(1);
563
+ }
564
+ spinner.succeed("Workflow executed");
565
+ console.log(chalk7__default.default.green("\nExecution Result:"));
566
+ console.log(JSON.stringify(result.data, null, 2));
567
+ } catch (error) {
568
+ spinner.fail("Failed to execute workflow");
569
+ throw error;
570
+ }
571
+ }
572
+ async function uploadFile(client, options) {
573
+ const spinner = ora2__default.default("Uploading file...").start();
574
+ try {
575
+ const filePath = path.resolve(options.file);
576
+ if (!fs.existsSync(filePath)) {
577
+ spinner.fail(`File not found: ${options.file}`);
578
+ process.exit(1);
579
+ }
580
+ const result = await client.s3.uploadFile(filePath, {
581
+ key: options.key,
582
+ bucket: options.bucket,
583
+ isPublic: options.public
584
+ });
585
+ if (result.error) {
586
+ spinner.fail("Upload failed");
587
+ console.error(chalk7__default.default.red(result.error.message));
588
+ process.exit(1);
589
+ }
590
+ spinner.succeed("Upload complete");
591
+ console.log(chalk7__default.default.green("\nFile uploaded:"));
592
+ console.log(` ${chalk7__default.default.bold("Key:")} ${result.data?.key}`);
593
+ console.log(` ${chalk7__default.default.bold("URL:")} ${result.data?.url || "N/A"}`);
594
+ console.log(` ${chalk7__default.default.bold("Bucket:")} ${result.data?.bucket || options.bucket || "default"}`);
595
+ } catch (error) {
596
+ spinner.fail("Upload failed");
597
+ throw error;
598
+ }
599
+ }
600
+ async function listFiles(client, options) {
601
+ const spinner = ora2__default.default("Fetching files...").start();
602
+ try {
603
+ const result = await client.s3.listFiles({
604
+ bucket: options.bucket,
605
+ prefix: options.prefix,
606
+ page: options.page || 1,
607
+ pageSize: options.pageSize || 10
608
+ });
609
+ if (result.error) {
610
+ spinner.fail("Failed to fetch files");
611
+ console.error(chalk7__default.default.red(result.error.message));
612
+ process.exit(1);
613
+ }
614
+ spinner.succeed(`Found ${result.data?.total || 0} files`);
615
+ const files = result.data?.list || [];
616
+ console.log(chalk7__default.default.blue(`
617
+ \u{1F4C1} Files${options.bucket ? ` in ${options.bucket}` : ""}
618
+ `));
619
+ for (const file of files) {
620
+ console.log(` ${chalk7__default.default.green("\u2022")} ${chalk7__default.default.bold(file.key)}`);
621
+ console.log(` ${chalk7__default.default.gray("Size:")} ${formatBytes(file.size || 0)}`);
622
+ console.log(` ${chalk7__default.default.gray("Modified:")} ${file.lastModified || "N/A"}`);
623
+ console.log();
624
+ }
625
+ } catch (error) {
626
+ spinner.fail("Failed to fetch files");
627
+ throw error;
628
+ }
629
+ }
630
+ function formatBytes(bytes) {
631
+ if (bytes === 0) return "0 B";
632
+ const k = 1024;
633
+ const sizes = ["B", "KB", "MB", "GB", "TB"];
634
+ const i = Math.floor(Math.log(bytes) / Math.log(k));
635
+ return parseFloat((bytes / Math.pow(k, i)).toFixed(2)) + " " + sizes[i];
636
+ }
637
+
638
+ // src/commands/openclaw.ts
639
+ init_config();
640
+ var OPENCLAW_CONFIG_DIR = path.join(os.homedir(), ".openclaw");
641
+ var OPENCLAW_CONFIG_FILE = path.join(OPENCLAW_CONFIG_DIR, "config.json");
642
+ var OPENCLAW_SKILLS_DIR = path.join(OPENCLAW_CONFIG_DIR, "skills");
643
+ var DEFAULT_OSS_ENDPOINT = "https://amaster.oss-cn-hangzhou.aliyuncs.com";
644
+ function getOpenClawConfig() {
645
+ if (fs.existsSync(OPENCLAW_CONFIG_FILE)) {
646
+ return JSON.parse(fs.readFileSync(OPENCLAW_CONFIG_FILE, "utf-8"));
647
+ }
648
+ return {};
649
+ }
650
+ function saveOpenClawConfig(config) {
651
+ if (!fs.existsSync(OPENCLAW_CONFIG_DIR)) {
652
+ fs.mkdirSync(OPENCLAW_CONFIG_DIR, { recursive: true });
653
+ }
654
+ fs.writeFileSync(OPENCLAW_CONFIG_FILE, JSON.stringify(config, null, 2));
655
+ }
656
+ function getAppSkillsPath(appCode) {
657
+ return `/openclaw/apps/${appCode}/skills`;
658
+ }
659
+ function getAppMcpConfigPath(appCode) {
660
+ return `/openclaw/apps/${appCode}/mcp-config.yaml`;
661
+ }
662
+ async function initOpenClaw(options) {
663
+ const spinner = ora2__default.default(`Initializing app: ${options.appCode}...`).start();
664
+ try {
665
+ const existingConfig = getAppConfig(options.appCode);
666
+ if (existingConfig && !options.force) {
667
+ spinner.fail(`App already exists: ${options.appCode}`);
668
+ console.log(chalk7__default.default.yellow(`Use --force to reinitialize`));
669
+ console.log(chalk7__default.default.gray(`Current URL: ${existingConfig.baseURL}`));
670
+ process.exit(1);
671
+ }
672
+ if (!fs.existsSync(OPENCLAW_CONFIG_DIR)) {
673
+ spinner.fail("OpenClaw not detected");
674
+ console.log(chalk7__default.default.yellow("\n\u26A0\uFE0F Please install OpenClaw first:"));
675
+ console.log(chalk7__default.default.gray(" npm install -g openclaw"));
676
+ process.exit(1);
677
+ }
678
+ addApp(options.appCode, {
679
+ baseURL: options.baseURL,
680
+ ossEndpoint: options.ossEndpoint || DEFAULT_OSS_ENDPOINT,
681
+ initializedAt: (/* @__PURE__ */ new Date()).toISOString()
682
+ });
683
+ spinner.succeed(`App initialized: ${options.appCode}`);
684
+ console.log(chalk7__default.default.blue("\n\u{1F4CB} Configuration:\n"));
685
+ console.log(` App Code: ${chalk7__default.default.green(options.appCode)}`);
686
+ console.log(` Base URL: ${chalk7__default.default.gray(options.baseURL)}`);
687
+ console.log();
688
+ const ossEndpoint = options.ossEndpoint || DEFAULT_OSS_ENDPOINT;
689
+ spinner.start("Downloading skills...");
690
+ try {
691
+ const skills = await downloadSkillManifest(ossEndpoint, options.appCode);
692
+ if (skills.length === 0) {
693
+ spinner.warn("No skills found");
694
+ } else {
695
+ spinner.text = `Installing ${skills.length} skills...`;
696
+ const appSkillsDir = path.join(OPENCLAW_SKILLS_DIR, options.appCode);
697
+ if (options.force && fs.existsSync(appSkillsDir)) {
698
+ fs.rmSync(appSkillsDir, { recursive: true, force: true });
699
+ }
700
+ if (!fs.existsSync(appSkillsDir)) {
701
+ fs.mkdirSync(appSkillsDir, { recursive: true });
702
+ }
703
+ for (const skill of skills) {
704
+ spinner.text = `Installing: ${skill.name}...`;
705
+ await downloadSkill(skill, ossEndpoint, options.appCode, appSkillsDir);
706
+ }
707
+ spinner.succeed(`Installed ${skills.length} skills`);
708
+ }
709
+ } catch (error) {
710
+ spinner.warn("Skills download failed (optional)");
711
+ }
712
+ spinner.start("Configuring MCP servers...");
713
+ try {
714
+ const mcpServers = await downloadMcpConfig(ossEndpoint, options.appCode);
715
+ if (Object.keys(mcpServers).length > 0) {
716
+ const openClawConfig = getOpenClawConfig();
717
+ if (!openClawConfig.mcpServers) {
718
+ openClawConfig.mcpServers = {};
719
+ }
720
+ for (const [name, config] of Object.entries(mcpServers)) {
721
+ openClawConfig.mcpServers[`${options.appCode}-${name}`] = config;
722
+ }
723
+ saveOpenClawConfig(openClawConfig);
724
+ spinner.succeed(`Configured ${Object.keys(mcpServers).length} MCP servers`);
725
+ } else {
726
+ spinner.succeed("No MCP servers to configure");
727
+ }
728
+ } catch (error) {
729
+ spinner.warn("MCP configuration failed (optional)");
730
+ }
731
+ console.log();
732
+ console.log(chalk7__default.default.green("\u2705 Initialization complete!"));
733
+ console.log();
734
+ console.log(`Next step: Login to your app`);
735
+ console.log(chalk7__default.default.gray(` amaster login --app ${options.appCode}`));
736
+ console.log();
737
+ const apps = listApps();
738
+ if (apps.length > 1) {
739
+ console.log(chalk7__default.default.blue("Configured apps:"));
740
+ for (const app of apps) {
741
+ const config = getAppConfig(app);
742
+ console.log(` ${chalk7__default.default.gray("\u2022")} ${app} - ${config?.baseURL}`);
743
+ }
744
+ console.log();
745
+ }
746
+ } catch (error) {
747
+ spinner.fail("Initialization failed");
748
+ throw error;
749
+ }
750
+ }
751
+ async function downloadSkillManifest(ossEndpoint, appCode) {
752
+ const manifestUrl = `${ossEndpoint}${getAppSkillsPath(appCode)}/manifest.json`;
753
+ try {
754
+ const response = await fetch(manifestUrl);
755
+ if (!response.ok) {
756
+ if (response.status === 404) {
757
+ return [];
758
+ }
759
+ throw new Error(`Failed to download manifest: ${response.statusText}`);
760
+ }
761
+ return await response.json();
762
+ } catch (error) {
763
+ if (error instanceof Error && error.message.includes("404")) {
764
+ return [];
765
+ }
766
+ throw error;
767
+ }
768
+ }
769
+ async function downloadSkill(skill, ossEndpoint, appCode, targetDir) {
770
+ const skillUrl = `${ossEndpoint}${getAppSkillsPath(appCode)}/${skill.id}.zip`;
771
+ try {
772
+ const response = await fetch(skillUrl);
773
+ if (!response.ok) {
774
+ throw new Error(`Failed to download skill ${skill.id}: ${response.statusText}`);
775
+ }
776
+ const skillDir = path.join(targetDir, skill.id);
777
+ if (!fs.existsSync(skillDir)) {
778
+ fs.mkdirSync(skillDir, { recursive: true });
779
+ }
780
+ await response.arrayBuffer();
781
+ const skillContent = skill.content || generateSkillContent(skill, appCode);
782
+ fs.writeFileSync(path.join(skillDir, "SKILL.md"), skillContent);
783
+ fs.writeFileSync(
784
+ path.join(skillDir, ".amaster-meta.json"),
785
+ JSON.stringify(
786
+ {
787
+ id: skill.id,
788
+ name: skill.name,
789
+ version: skill.version,
790
+ appCode,
791
+ installedAt: (/* @__PURE__ */ new Date()).toISOString()
792
+ },
793
+ null,
794
+ 2
795
+ )
796
+ );
797
+ } catch (error) {
798
+ throw new Error(`Failed to download skill ${skill.id}: ${error instanceof Error ? error.message : error}`);
799
+ }
800
+ }
801
+ function generateSkillContent(skill, appCode) {
802
+ return `---
803
+ name: ${skill.name}
804
+ description: ${skill.description}
805
+ metadata:
806
+ appCode: ${appCode}
807
+ ---
808
+
809
+ # ${skill.name}
810
+
811
+ ${skill.description}
812
+
813
+ ## Usage
814
+
815
+ This skill is configured for application: **${appCode}**
816
+ `;
817
+ }
818
+ async function downloadMcpConfig(ossEndpoint, appCode) {
819
+ const configUrl = `${ossEndpoint}${getAppMcpConfigPath(appCode)}`;
820
+ try {
821
+ const response = await fetch(configUrl);
822
+ if (!response.ok) {
823
+ if (response.status === 404) {
824
+ return {};
825
+ }
826
+ throw new Error(`Failed to download MCP config: ${response.statusText}`);
827
+ }
828
+ const content = await response.text();
829
+ const parsed = yaml__default.default.parse(content);
830
+ return parsed.mcpServers || {};
831
+ } catch (error) {
832
+ if (error instanceof Error && error.message.includes("404")) {
833
+ return {};
834
+ }
835
+ throw error;
836
+ }
837
+ }
838
+
839
+ // src/cli.ts
840
+ function resolveAppCode(optionsApp) {
841
+ if (optionsApp) {
842
+ return optionsApp;
843
+ }
844
+ const defaultApp = getCurrentApp();
845
+ if (defaultApp) {
846
+ return defaultApp;
847
+ }
848
+ console.error(chalk7__default.default.red("\u274C No app specified."));
849
+ console.log(chalk7__default.default.yellow("Use one of:"));
850
+ console.log(chalk7__default.default.gray(" 1. Add --app <app-code> to the command"));
851
+ console.log(chalk7__default.default.gray(" 2. Set a default app: amaster use <app-code>"));
852
+ process.exit(1);
853
+ }
854
+ function createAmasterClient(appCode) {
855
+ const appConfig = getAppConfig(appCode);
856
+ if (!appConfig) {
857
+ console.error(chalk7__default.default.red(`\u274C App not configured: ${appCode}`));
858
+ console.log(chalk7__default.default.yellow(`Initialize it first: amaster init --app-code ${appCode} --url <url>`));
859
+ process.exit(1);
860
+ }
861
+ const token = getAccessToken(appCode);
862
+ if (!token) {
863
+ console.error(chalk7__default.default.red(`\u274C Not authenticated for app: ${appCode}`));
864
+ console.log(chalk7__default.default.yellow(`Login first: amaster login --app ${appCode}`));
865
+ process.exit(1);
866
+ }
867
+ if (shouldRefreshToken(appCode)) {
868
+ console.log(chalk7__default.default.yellow("\u26A0\uFE0F Session expiring soon. Please login again."));
869
+ }
870
+ return client.createClient({
871
+ baseURL: appConfig.baseURL,
872
+ headers: {
873
+ Authorization: `Bearer ${token}`
874
+ },
875
+ onUnauthorized: () => {
876
+ console.error(chalk7__default.default.red("\n\u274C Session expired. Please login again."));
877
+ console.log(chalk7__default.default.yellow(`Run: amaster login --app ${appCode}`));
878
+ process.exit(1);
879
+ }
880
+ });
881
+ }
882
+ var program = new commander.Command();
883
+ program.name("amaster").description("CLI for Amaster SDK - Multi-app support for OpenClaw").version("1.0.0");
884
+ program.command("apps").description("List all configured apps").action(() => {
885
+ const apps = listApps();
886
+ const current = getCurrentApp();
887
+ console.log(chalk7__default.default.blue("\n\u{1F4F1} Configured Apps\n"));
888
+ if (apps.length === 0) {
889
+ console.log(chalk7__default.default.gray(" No apps configured"));
890
+ console.log(chalk7__default.default.gray(" Run: amaster init --app-code <code> --url <url>"));
891
+ } else {
892
+ for (const appCode of apps) {
893
+ const config = getAppConfig(appCode);
894
+ const isAuth = isAuthenticated(appCode);
895
+ const isCurrent = appCode === current;
896
+ let prefix = isCurrent ? chalk7__default.default.green("\u2192 ") : " ";
897
+ console.log(`${prefix}${chalk7__default.default.bold(appCode)}${isCurrent ? chalk7__default.default.green(" (current)") : ""}`);
898
+ console.log(` ${chalk7__default.default.gray(config?.baseURL || "No URL")}`);
899
+ console.log(` ${isAuth ? chalk7__default.default.green("\u25CF Authenticated") : chalk7__default.default.yellow("\u25CB Not authenticated")}`);
900
+ console.log();
901
+ }
902
+ }
903
+ console.log();
904
+ });
905
+ program.command("use <app-code>").description("Set the default app for subsequent commands").action((appCode) => {
906
+ if (setCurrentApp(appCode)) {
907
+ console.log(chalk7__default.default.green(`\u2705 Now using app: ${appCode}`));
908
+ } else {
909
+ console.error(chalk7__default.default.red(`\u274C App not found: ${appCode}`));
910
+ process.exit(1);
911
+ }
912
+ });
913
+ program.command("init").description("Initialize an app for OpenClaw integration").requiredOption("--app-code <code>", "Application code (e.g., fhv94bto1)").requiredOption("--url <url>", "Base URL (e.g., https://fhv94bto1.helige.cn)").option("--api-key <key>", "API Key for OSS access").option("--oss-endpoint <endpoint>", "OSS endpoint").action(async (options) => {
914
+ await initOpenClaw({
915
+ appCode: options.appCode,
916
+ baseURL: options.url,
917
+ apiKey: options.apiKey,
918
+ ossEndpoint: options.ossEndpoint
919
+ });
920
+ });
921
+ program.command("login").description("Authenticate with an app").option("--app <app-code>", "App code (uses default if not specified)").option("-e, --email <email>", "Email address").option("-p, --password <password>", "Password").action(async (options) => {
922
+ const appCode = resolveAppCode(options.app);
923
+ await login(appCode, { email: options.email, password: options.password });
924
+ });
925
+ program.command("logout").description("Logout from an app").option("--app <app-code>", "App code (uses default if not specified)").action(async (options) => {
926
+ const appCode = resolveAppCode(options.app);
927
+ await logout(appCode);
928
+ });
929
+ program.command("whoami").description("Show current user information").option("--app <app-code>", "App code (uses default if not specified)").action(async (options) => {
930
+ const appCode = resolveAppCode(options.app);
931
+ await getMe(() => createAmasterClient(appCode));
932
+ });
933
+ var entityCmd = program.command("entity").description("Manage entities");
934
+ entityCmd.command("list <namespace> <entity>").description("List entities").option("--app <app-code>", "App code (uses default if not specified)").option("--page <page>", "Page number", "1").option("--page-size <size>", "Page size", "10").action(async (namespace, entityName, options) => {
935
+ const appCode = resolveAppCode(options.app);
936
+ await listEntities(createAmasterClient(appCode), {
937
+ namespace,
938
+ entity: entityName,
939
+ page: parseInt(options.page),
940
+ pageSize: parseInt(options.pageSize)
941
+ });
942
+ });
943
+ entityCmd.command("get <namespace> <entity> <id>").description("Get entity by ID").option("--app <app-code>", "App code (uses default if not specified)").action(async (namespace, entityName, id, options) => {
944
+ const appCode = resolveAppCode(options.app);
945
+ await getEntity(createAmasterClient(appCode), { namespace, entity: entityName, id });
946
+ });
947
+ entityCmd.command("create <namespace> <entity>").description("Create new entity").option("--app <app-code>", "App code (uses default if not specified)").option("-d, --data <json>", "Entity data as JSON").action(async (namespace, entityName, options) => {
948
+ const appCode = resolveAppCode(options.app);
949
+ await createEntity(createAmasterClient(appCode), {
950
+ namespace,
951
+ entity: entityName,
952
+ data: options.data
953
+ });
954
+ });
955
+ entityCmd.command("update <namespace> <entity> <id>").description("Update entity").option("--app <app-code>", "App code (uses default if not specified)").option("-d, --data <json>", "Entity data as JSON").action(async (namespace, entityName, id, options) => {
956
+ const appCode = resolveAppCode(options.app);
957
+ await updateEntity(createAmasterClient(appCode), {
958
+ namespace,
959
+ entity: entityName,
960
+ id,
961
+ data: options.data
962
+ });
963
+ });
964
+ entityCmd.command("delete <namespace> <entity> <id>").description("Delete entity").option("--app <app-code>", "App code (uses default if not specified)").action(async (namespace, entityName, id, options) => {
965
+ const appCode = resolveAppCode(options.app);
966
+ await deleteEntity(createAmasterClient(appCode), {
967
+ namespace,
968
+ entity: entityName,
969
+ id
970
+ });
971
+ });
972
+ var bpmCmd = program.command("bpm").description("Manage BPM processes and tasks");
973
+ bpmCmd.command("processes").description("List process definitions").option("--app <app-code>", "App code (uses default if not specified)").action(async (options) => {
974
+ const appCode = resolveAppCode(options.app);
975
+ await listProcesses(createAmasterClient(appCode));
976
+ });
977
+ bpmCmd.command("start <key>").description("Start a process instance").option("--app <app-code>", "App code (uses default if not specified)").option("-v, --variables <json>", "Process variables as JSON").action(async (key, options) => {
978
+ const appCode = resolveAppCode(options.app);
979
+ await startProcess(createAmasterClient(appCode), {
980
+ key,
981
+ variables: options.variables
982
+ });
983
+ });
984
+ bpmCmd.command("tasks").description("List tasks").option("--app <app-code>", "App code (uses default if not specified)").option("-a, --assignee <assignee>", "Filter by assignee").action(async (options) => {
985
+ const appCode = resolveAppCode(options.app);
986
+ await listTasks(createAmasterClient(appCode), { assignee: options.assignee });
987
+ });
988
+ bpmCmd.command("complete <id>").description("Complete a task").option("--app <app-code>", "App code (uses default if not specified)").option("-v, --variables <json>", "Task variables as JSON").action(async (id, options) => {
989
+ const appCode = resolveAppCode(options.app);
990
+ await completeTask(createAmasterClient(appCode), {
991
+ id,
992
+ variables: options.variables
993
+ });
994
+ });
995
+ var workflowCmd = program.command("workflow").description("Manage workflows");
996
+ workflowCmd.command("list").description("List workflows").option("--app <app-code>", "App code (uses default if not specified)").action(async (options) => {
997
+ const appCode = resolveAppCode(options.app);
998
+ await listWorkflows(createAmasterClient(appCode));
999
+ });
1000
+ workflowCmd.command("execute <id>").description("Execute a workflow").option("--app <app-code>", "App code (uses default if not specified)").option("-i, --input <json>", "Workflow input as JSON").action(async (id, options) => {
1001
+ const appCode = resolveAppCode(options.app);
1002
+ await executeWorkflow(createAmasterClient(appCode), {
1003
+ id,
1004
+ input: options.input
1005
+ });
1006
+ });
1007
+ var s3Cmd = program.command("s3").description("Manage S3 files");
1008
+ s3Cmd.command("list").description("List files").option("--app <app-code>", "App code (uses default if not specified)").option("-b, --bucket <bucket>", "Bucket name").action(async (options) => {
1009
+ const appCode = resolveAppCode(options.app);
1010
+ await listFiles(createAmasterClient(appCode), {
1011
+ bucket: options.bucket
1012
+ });
1013
+ });
1014
+ s3Cmd.command("upload <file>").description("Upload a file").option("--app <app-code>", "App code (uses default if not specified)").option("-b, --bucket <bucket>", "Bucket name").option("-k, --key <key>", "Object key").action(async (file, options) => {
1015
+ const appCode = resolveAppCode(options.app);
1016
+ await uploadFile(createAmasterClient(appCode), {
1017
+ file,
1018
+ bucket: options.bucket,
1019
+ key: options.key
1020
+ });
1021
+ });
1022
+ var isMainModule = (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.cjs', document.baseURI).href)) === new URL(process.argv[1] || "", (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.cjs', document.baseURI).href))).href || (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.cjs', document.baseURI).href)).endsWith(process.argv[1] || "") || process.argv[1]?.includes("cli.js") || false;
1023
+ if (isMainModule) {
1024
+ program.parse();
1025
+ }
1026
+
1027
+ exports.addApp = addApp;
1028
+ exports.clearAuthSession = clearAuthSession;
1029
+ exports.createAmasterClient = createAmasterClient;
1030
+ exports.getAccessToken = getAccessToken;
1031
+ exports.getAppConfig = getAppConfig;
1032
+ exports.getAuthSession = getAuthSession;
1033
+ exports.getBaseURL = getBaseURL;
1034
+ exports.getConfig = getConfig;
1035
+ exports.getCurrentApp = getCurrentApp;
1036
+ exports.isAuthenticated = isAuthenticated;
1037
+ exports.listApps = listApps;
1038
+ exports.removeApp = removeApp;
1039
+ exports.resolveAppCode = resolveAppCode;
1040
+ exports.saveAuthSession = saveAuthSession;
1041
+ exports.saveConfig = saveConfig;
1042
+ exports.setCurrentApp = setCurrentApp;
1043
+ exports.shouldRefreshToken = shouldRefreshToken;
1044
+ //# sourceMappingURL=index.cjs.map
1045
+ //# sourceMappingURL=index.cjs.map