@granular-software/sdk 0.4.3 â 0.4.4
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/README.md +4 -42
- package/dist/cli/index.js +49 -56
- package/dist/index.d.mts +726 -3
- package/dist/index.d.ts +726 -3
- package/dist/index.js +54 -46
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +54 -46
- package/dist/index.mjs.map +1 -1
- package/package.json +6 -52
- package/dist/adapters/anthropic.d.mts +0 -64
- package/dist/adapters/anthropic.d.ts +0 -64
- package/dist/adapters/anthropic.js +0 -77
- package/dist/adapters/anthropic.js.map +0 -1
- package/dist/adapters/anthropic.mjs +0 -72
- package/dist/adapters/anthropic.mjs.map +0 -1
- package/dist/adapters/langchain.d.mts +0 -31
- package/dist/adapters/langchain.d.ts +0 -31
- package/dist/adapters/langchain.js +0 -49
- package/dist/adapters/langchain.js.map +0 -1
- package/dist/adapters/langchain.mjs +0 -46
- package/dist/adapters/langchain.mjs.map +0 -1
- package/dist/adapters/mastra.d.mts +0 -23
- package/dist/adapters/mastra.d.ts +0 -23
- package/dist/adapters/mastra.js +0 -26
- package/dist/adapters/mastra.js.map +0 -1
- package/dist/adapters/mastra.mjs +0 -24
- package/dist/adapters/mastra.mjs.map +0 -1
- package/dist/adapters/openai.d.mts +0 -76
- package/dist/adapters/openai.d.ts +0 -76
- package/dist/adapters/openai.js +0 -81
- package/dist/adapters/openai.js.map +0 -1
- package/dist/adapters/openai.mjs +0 -76
- package/dist/adapters/openai.mjs.map +0 -1
- package/dist/types-C0AVRsVR.d.mts +0 -726
- package/dist/types-C0AVRsVR.d.ts +0 -726
package/README.md
CHANGED
|
@@ -11,7 +11,6 @@ The official TypeScript SDK for Granular.
|
|
|
11
11
|
- đ¤ **Domain Synthesis** â Auto-generated TypeScript classes with `find()`, relationship accessors, and typed methods
|
|
12
12
|
- đ **Secure Execution** â Run AI-generated code in isolated sandboxes
|
|
13
13
|
- đĨ **User Permissions** â Control what each user can access
|
|
14
|
-
- đ **Framework Adapters** â Helpers for OpenAI, LangChain, Anthropic, Mastra
|
|
15
14
|
- ⥠**Real-time** â WebSocket-based streaming and events
|
|
16
15
|
- âŠī¸ **Reverse RPC** â Sandbox code calls tools that execute on your server
|
|
17
16
|
|
|
@@ -27,12 +26,14 @@ bun add @granular-software/sdk
|
|
|
27
26
|
npm install @granular-software/sdk
|
|
28
27
|
```
|
|
29
28
|
|
|
29
|
+
Inside this monorepo, prefer the workspace package instead of installing from npm separately.
|
|
30
|
+
|
|
30
31
|
## Endpoint Modes
|
|
31
32
|
|
|
32
33
|
By default, the SDK resolves endpoints like this:
|
|
33
34
|
|
|
34
35
|
- Local mode (`NODE_ENV=development`): `ws://localhost:8787/granular`
|
|
35
|
-
- Production mode (default): `wss://
|
|
36
|
+
- Production mode (default): `wss://api.granular.dev/v2/ws`
|
|
36
37
|
|
|
37
38
|
Overrides:
|
|
38
39
|
|
|
@@ -404,43 +405,7 @@ console.log(env.apiEndpoint);
|
|
|
404
405
|
|
|
405
406
|
## Framework Adapters
|
|
406
407
|
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
### Option A: Codegen Tool (Recommended)
|
|
410
|
-
|
|
411
|
-
Pass a **single tool** to the LLM that executes code in the sandbox. The LLM receives the typed class documentation and writes code against it:
|
|
412
|
-
|
|
413
|
-
```typescript
|
|
414
|
-
import { createCodegenTool, executeCodegenToolCall } from '@granular-software/sdk/openai';
|
|
415
|
-
|
|
416
|
-
// Get auto-generated TypeScript class declarations
|
|
417
|
-
const docs = await environment.getDomainDocumentation();
|
|
418
|
-
|
|
419
|
-
// Create a single "codegen" tool for the LLM
|
|
420
|
-
const codegenTool = createCodegenTool(docs);
|
|
421
|
-
|
|
422
|
-
// Pass to OpenAI â the LLM writes typed code using Author, Book, etc.
|
|
423
|
-
const response = await openai.chat.completions.create({
|
|
424
|
-
model: 'gpt-4',
|
|
425
|
-
messages: [...],
|
|
426
|
-
tools: [codegenTool],
|
|
427
|
-
});
|
|
428
|
-
|
|
429
|
-
// Execute the code the LLM generates
|
|
430
|
-
const result = await executeCodegenToolCall(toolCall, environment);
|
|
431
|
-
```
|
|
432
|
-
|
|
433
|
-
### Option B: Schema Conversion (Legacy)
|
|
434
|
-
|
|
435
|
-
Convert tool schemas for compatibility:
|
|
436
|
-
|
|
437
|
-
```typescript
|
|
438
|
-
import { toOpenAITools } from '@granular-software/sdk/openai';
|
|
439
|
-
import { toAnthropicTools } from '@granular-software/sdk/anthropic';
|
|
440
|
-
import { fromLangChainTools } from '@granular-software/sdk/langchain';
|
|
441
|
-
|
|
442
|
-
const openaiTools = toOpenAITools(myGranularTools);
|
|
443
|
-
```
|
|
408
|
+
Framework-specific adapters are temporarily unavailable while the SDK build and release flow is being stabilized in the monorepo.
|
|
444
409
|
|
|
445
410
|
## Examples
|
|
446
411
|
|
|
@@ -448,9 +413,6 @@ See [examples/](./examples/) for runnable code:
|
|
|
448
413
|
|
|
449
414
|
- **[basic.ts](./examples/basic.ts)** â Ontology + class-based tools + domain synthesis + job execution
|
|
450
415
|
- **[management.ts](./examples/management.ts)** â Sandbox, permission profiles, and user management
|
|
451
|
-
- **[adapter-openai.ts](./examples/adapter-openai.ts)** â OpenAI integration with codegen tool
|
|
452
|
-
- **[adapter-anthropic.ts](./examples/adapter-anthropic.ts)** â Anthropic/Claude integration
|
|
453
|
-
- **[adapter-langchain.ts](./examples/adapter-langchain.ts)** â LangChain integration
|
|
454
416
|
- **[interactive.ts](./examples/interactive.ts)** â Human-in-the-loop prompts
|
|
455
417
|
|
|
456
418
|
## API Reference
|
package/dist/cli/index.js
CHANGED
|
@@ -71,9 +71,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
71
71
|
mod
|
|
72
72
|
));
|
|
73
73
|
|
|
74
|
-
// ../../node_modules
|
|
74
|
+
// ../../node_modules/commander/lib/error.js
|
|
75
75
|
var require_error = __commonJS({
|
|
76
|
-
"../../node_modules
|
|
76
|
+
"../../node_modules/commander/lib/error.js"(exports) {
|
|
77
77
|
var CommanderError2 = class extends Error {
|
|
78
78
|
/**
|
|
79
79
|
* Constructs the CommanderError class
|
|
@@ -106,9 +106,9 @@ var require_error = __commonJS({
|
|
|
106
106
|
}
|
|
107
107
|
});
|
|
108
108
|
|
|
109
|
-
// ../../node_modules
|
|
109
|
+
// ../../node_modules/commander/lib/argument.js
|
|
110
110
|
var require_argument = __commonJS({
|
|
111
|
-
"../../node_modules
|
|
111
|
+
"../../node_modules/commander/lib/argument.js"(exports) {
|
|
112
112
|
var { InvalidArgumentError: InvalidArgumentError2 } = require_error();
|
|
113
113
|
var Argument2 = class {
|
|
114
114
|
/**
|
|
@@ -233,9 +233,9 @@ var require_argument = __commonJS({
|
|
|
233
233
|
}
|
|
234
234
|
});
|
|
235
235
|
|
|
236
|
-
// ../../node_modules
|
|
236
|
+
// ../../node_modules/commander/lib/help.js
|
|
237
237
|
var require_help = __commonJS({
|
|
238
|
-
"../../node_modules
|
|
238
|
+
"../../node_modules/commander/lib/help.js"(exports) {
|
|
239
239
|
var { humanReadableArgName } = require_argument();
|
|
240
240
|
var Help2 = class {
|
|
241
241
|
constructor() {
|
|
@@ -802,9 +802,9 @@ ${itemIndentStr}`);
|
|
|
802
802
|
}
|
|
803
803
|
});
|
|
804
804
|
|
|
805
|
-
// ../../node_modules
|
|
805
|
+
// ../../node_modules/commander/lib/option.js
|
|
806
806
|
var require_option = __commonJS({
|
|
807
|
-
"../../node_modules
|
|
807
|
+
"../../node_modules/commander/lib/option.js"(exports) {
|
|
808
808
|
var { InvalidArgumentError: InvalidArgumentError2 } = require_error();
|
|
809
809
|
var Option2 = class {
|
|
810
810
|
/**
|
|
@@ -1103,9 +1103,9 @@ var require_option = __commonJS({
|
|
|
1103
1103
|
}
|
|
1104
1104
|
});
|
|
1105
1105
|
|
|
1106
|
-
// ../../node_modules
|
|
1106
|
+
// ../../node_modules/commander/lib/suggestSimilar.js
|
|
1107
1107
|
var require_suggestSimilar = __commonJS({
|
|
1108
|
-
"../../node_modules
|
|
1108
|
+
"../../node_modules/commander/lib/suggestSimilar.js"(exports) {
|
|
1109
1109
|
var maxDistance = 3;
|
|
1110
1110
|
function editDistance(a, b) {
|
|
1111
1111
|
if (Math.abs(a.length - b.length) > maxDistance)
|
|
@@ -1183,9 +1183,9 @@ var require_suggestSimilar = __commonJS({
|
|
|
1183
1183
|
}
|
|
1184
1184
|
});
|
|
1185
1185
|
|
|
1186
|
-
// ../../node_modules
|
|
1186
|
+
// ../../node_modules/commander/lib/command.js
|
|
1187
1187
|
var require_command = __commonJS({
|
|
1188
|
-
"../../node_modules
|
|
1188
|
+
"../../node_modules/commander/lib/command.js"(exports) {
|
|
1189
1189
|
var EventEmitter = __require("events").EventEmitter;
|
|
1190
1190
|
var childProcess = __require("child_process");
|
|
1191
1191
|
var path4 = __require("path");
|
|
@@ -3341,9 +3341,9 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
3341
3341
|
}
|
|
3342
3342
|
});
|
|
3343
3343
|
|
|
3344
|
-
// ../../node_modules
|
|
3344
|
+
// ../../node_modules/commander/index.js
|
|
3345
3345
|
var require_commander = __commonJS({
|
|
3346
|
-
"../../node_modules
|
|
3346
|
+
"../../node_modules/commander/index.js"(exports) {
|
|
3347
3347
|
var { Argument: Argument2 } = require_argument();
|
|
3348
3348
|
var { Command: Command2 } = require_command();
|
|
3349
3349
|
var { CommanderError: CommanderError2, InvalidArgumentError: InvalidArgumentError2 } = require_error();
|
|
@@ -3363,9 +3363,9 @@ var require_commander = __commonJS({
|
|
|
3363
3363
|
}
|
|
3364
3364
|
});
|
|
3365
3365
|
|
|
3366
|
-
// ../../node_modules
|
|
3366
|
+
// ../../node_modules/dotenv/package.json
|
|
3367
3367
|
var require_package = __commonJS({
|
|
3368
|
-
"../../node_modules
|
|
3368
|
+
"../../node_modules/dotenv/package.json"(exports, module) {
|
|
3369
3369
|
module.exports = {
|
|
3370
3370
|
name: "dotenv",
|
|
3371
3371
|
version: "16.6.1",
|
|
@@ -3431,9 +3431,9 @@ var require_package = __commonJS({
|
|
|
3431
3431
|
}
|
|
3432
3432
|
});
|
|
3433
3433
|
|
|
3434
|
-
// ../../node_modules
|
|
3434
|
+
// ../../node_modules/dotenv/lib/main.js
|
|
3435
3435
|
var require_main = __commonJS({
|
|
3436
|
-
"../../node_modules
|
|
3436
|
+
"../../node_modules/dotenv/lib/main.js"(exports, module) {
|
|
3437
3437
|
var fs5 = __require("fs");
|
|
3438
3438
|
var path4 = __require("path");
|
|
3439
3439
|
var os2 = __require("os");
|
|
@@ -3721,9 +3721,9 @@ var require_main = __commonJS({
|
|
|
3721
3721
|
}
|
|
3722
3722
|
});
|
|
3723
3723
|
|
|
3724
|
-
// ../../node_modules
|
|
3724
|
+
// ../../node_modules/cli-spinners/spinners.json
|
|
3725
3725
|
var require_spinners = __commonJS({
|
|
3726
|
-
"../../node_modules
|
|
3726
|
+
"../../node_modules/cli-spinners/spinners.json"(exports, module) {
|
|
3727
3727
|
module.exports = {
|
|
3728
3728
|
dots: {
|
|
3729
3729
|
interval: 80,
|
|
@@ -5349,9 +5349,9 @@ var require_spinners = __commonJS({
|
|
|
5349
5349
|
}
|
|
5350
5350
|
});
|
|
5351
5351
|
|
|
5352
|
-
// ../../node_modules
|
|
5352
|
+
// ../../node_modules/cli-spinners/index.js
|
|
5353
5353
|
var require_cli_spinners = __commonJS({
|
|
5354
|
-
"../../node_modules
|
|
5354
|
+
"../../node_modules/cli-spinners/index.js"(exports, module) {
|
|
5355
5355
|
var spinners = Object.assign({}, require_spinners());
|
|
5356
5356
|
var spinnersList = Object.keys(spinners);
|
|
5357
5357
|
Object.defineProperty(spinners, "random", {
|
|
@@ -5365,7 +5365,7 @@ var require_cli_spinners = __commonJS({
|
|
|
5365
5365
|
}
|
|
5366
5366
|
});
|
|
5367
5367
|
|
|
5368
|
-
// ../../node_modules
|
|
5368
|
+
// ../../node_modules/commander/esm.mjs
|
|
5369
5369
|
var import_index = __toESM(require_commander(), 1);
|
|
5370
5370
|
var {
|
|
5371
5371
|
program,
|
|
@@ -5387,7 +5387,7 @@ var import_dotenv = __toESM(require_main());
|
|
|
5387
5387
|
|
|
5388
5388
|
// src/endpoints.ts
|
|
5389
5389
|
var LOCAL_API_URL = "ws://localhost:8787/granular";
|
|
5390
|
-
var PRODUCTION_API_URL = "wss://
|
|
5390
|
+
var PRODUCTION_API_URL = "wss://api.granular.dev/v2/ws";
|
|
5391
5391
|
var LOCAL_AUTH_URL = "http://localhost:3000";
|
|
5392
5392
|
var PRODUCTION_AUTH_URL = "https://app.granular.software";
|
|
5393
5393
|
function readEnv(name) {
|
|
@@ -5775,9 +5775,6 @@ var ApiClient = class {
|
|
|
5775
5775
|
return false;
|
|
5776
5776
|
}
|
|
5777
5777
|
}
|
|
5778
|
-
async validateKeyOrThrow() {
|
|
5779
|
-
await this.request("/control/sandboxes");
|
|
5780
|
-
}
|
|
5781
5778
|
// ââ Sandboxes ââ
|
|
5782
5779
|
async listSandboxes() {
|
|
5783
5780
|
const result = await this.request("/control/sandboxes");
|
|
@@ -6227,7 +6224,7 @@ async function loginWithBrowser(options) {
|
|
|
6227
6224
|
}
|
|
6228
6225
|
}
|
|
6229
6226
|
|
|
6230
|
-
// ../../node_modules
|
|
6227
|
+
// ../../node_modules/chalk/source/vendor/ansi-styles/index.js
|
|
6231
6228
|
var ANSI_BACKGROUND_OFFSET = 10;
|
|
6232
6229
|
var wrapAnsi16 = (offset = 0) => (code) => `\x1B[${code + offset}m`;
|
|
6233
6230
|
var wrapAnsi256 = (offset = 0) => (code) => `\x1B[${38 + offset};5;${code}m`;
|
|
@@ -6534,7 +6531,7 @@ var supportsColor = {
|
|
|
6534
6531
|
};
|
|
6535
6532
|
var supports_color_default = supportsColor;
|
|
6536
6533
|
|
|
6537
|
-
// ../../node_modules
|
|
6534
|
+
// ../../node_modules/chalk/source/utilities.js
|
|
6538
6535
|
function stringReplaceAll(string, substring, replacer) {
|
|
6539
6536
|
let index = string.indexOf(substring);
|
|
6540
6537
|
if (index === -1) {
|
|
@@ -6564,7 +6561,7 @@ function stringEncaseCRLFWithFirstIndex(string, prefix, postfix, index) {
|
|
|
6564
6561
|
return returnValue;
|
|
6565
6562
|
}
|
|
6566
6563
|
|
|
6567
|
-
// ../../node_modules
|
|
6564
|
+
// ../../node_modules/chalk/source/index.js
|
|
6568
6565
|
var { stdout: stdoutColor, stderr: stderrColor } = supports_color_default;
|
|
6569
6566
|
var GENERATOR = Symbol("GENERATOR");
|
|
6570
6567
|
var STYLER = Symbol("STYLER");
|
|
@@ -6711,7 +6708,7 @@ var chalk = createChalk();
|
|
|
6711
6708
|
createChalk({ level: stderrColor ? stderrColor.level : 0 });
|
|
6712
6709
|
var source_default = chalk;
|
|
6713
6710
|
|
|
6714
|
-
// ../../node_modules
|
|
6711
|
+
// ../../node_modules/mimic-function/index.js
|
|
6715
6712
|
var copyProperty = (to, from, property, ignoreNonConfigurable) => {
|
|
6716
6713
|
if (property === "length" || property === "prototype") {
|
|
6717
6714
|
return;
|
|
@@ -6757,7 +6754,7 @@ function mimicFunction(to, from, { ignoreNonConfigurable = false } = {}) {
|
|
|
6757
6754
|
return to;
|
|
6758
6755
|
}
|
|
6759
6756
|
|
|
6760
|
-
// ../../node_modules
|
|
6757
|
+
// ../../node_modules/restore-cursor/node_modules/onetime/index.js
|
|
6761
6758
|
var calledFunctions = /* @__PURE__ */ new WeakMap();
|
|
6762
6759
|
var onetime = (function_, options = {}) => {
|
|
6763
6760
|
if (typeof function_ !== "function") {
|
|
@@ -6788,7 +6785,7 @@ onetime.callCount = (function_) => {
|
|
|
6788
6785
|
};
|
|
6789
6786
|
var onetime_default = onetime;
|
|
6790
6787
|
|
|
6791
|
-
// ../../node_modules
|
|
6788
|
+
// ../../node_modules/signal-exit/dist/mjs/signals.js
|
|
6792
6789
|
var signals = [];
|
|
6793
6790
|
signals.push("SIGHUP", "SIGINT", "SIGTERM");
|
|
6794
6791
|
if (process.platform !== "win32") {
|
|
@@ -6812,7 +6809,7 @@ if (process.platform === "linux") {
|
|
|
6812
6809
|
signals.push("SIGIO", "SIGPOLL", "SIGPWR", "SIGSTKFLT");
|
|
6813
6810
|
}
|
|
6814
6811
|
|
|
6815
|
-
// ../../node_modules
|
|
6812
|
+
// ../../node_modules/signal-exit/dist/mjs/index.js
|
|
6816
6813
|
var processOk = (process10) => !!process10 && typeof process10 === "object" && typeof process10.removeListener === "function" && typeof process10.emit === "function" && typeof process10.reallyExit === "function" && typeof process10.listeners === "function" && typeof process10.kill === "function" && typeof process10.pid === "number" && typeof process10.on === "function";
|
|
6817
6814
|
var kExitEmitter = Symbol.for("signal-exit emitter");
|
|
6818
6815
|
var global = globalThis;
|
|
@@ -7022,7 +7019,7 @@ var {
|
|
|
7022
7019
|
*/
|
|
7023
7020
|
onExit} = signalExitWrap(processOk(process3) ? new SignalExit(process3) : new SignalExitFallback());
|
|
7024
7021
|
|
|
7025
|
-
// ../../node_modules
|
|
7022
|
+
// ../../node_modules/restore-cursor/index.js
|
|
7026
7023
|
var terminal = process6__default.default.stderr.isTTY ? process6__default.default.stderr : process6__default.default.stdout.isTTY ? process6__default.default.stdout : void 0;
|
|
7027
7024
|
var restoreCursor = terminal ? onetime_default(() => {
|
|
7028
7025
|
onExit(() => {
|
|
@@ -7032,7 +7029,7 @@ var restoreCursor = terminal ? onetime_default(() => {
|
|
|
7032
7029
|
};
|
|
7033
7030
|
var restore_cursor_default = restoreCursor;
|
|
7034
7031
|
|
|
7035
|
-
// ../../node_modules
|
|
7032
|
+
// ../../node_modules/cli-cursor/index.js
|
|
7036
7033
|
var isHidden = false;
|
|
7037
7034
|
var cliCursor = {};
|
|
7038
7035
|
cliCursor.show = (writableStream = process6__default.default.stderr) => {
|
|
@@ -7062,7 +7059,7 @@ cliCursor.toggle = (force, writableStream) => {
|
|
|
7062
7059
|
};
|
|
7063
7060
|
var cli_cursor_default = cliCursor;
|
|
7064
7061
|
|
|
7065
|
-
// ../../node_modules
|
|
7062
|
+
// ../../node_modules/ora/index.js
|
|
7066
7063
|
var import_cli_spinners = __toESM(require_cli_spinners(), 1);
|
|
7067
7064
|
function isUnicodeSupported() {
|
|
7068
7065
|
if (process6__default.default.platform !== "win32") {
|
|
@@ -7071,7 +7068,7 @@ function isUnicodeSupported() {
|
|
|
7071
7068
|
return Boolean(process6__default.default.env.CI) || Boolean(process6__default.default.env.WT_SESSION) || Boolean(process6__default.default.env.TERMINUS_SUBLIME) || process6__default.default.env.ConEmuTask === "{cmd::Cmder}" || process6__default.default.env.TERM_PROGRAM === "Terminus-Sublime" || process6__default.default.env.TERM_PROGRAM === "vscode" || process6__default.default.env.TERM === "xterm-256color" || process6__default.default.env.TERM === "alacritty" || process6__default.default.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
|
|
7072
7069
|
}
|
|
7073
7070
|
|
|
7074
|
-
// ../../node_modules
|
|
7071
|
+
// ../../node_modules/log-symbols/index.js
|
|
7075
7072
|
var main = {
|
|
7076
7073
|
info: source_default.blue("\u2139"),
|
|
7077
7074
|
success: source_default.green("\u2714"),
|
|
@@ -7087,7 +7084,7 @@ var fallback = {
|
|
|
7087
7084
|
var logSymbols = isUnicodeSupported() ? main : fallback;
|
|
7088
7085
|
var log_symbols_default = logSymbols;
|
|
7089
7086
|
|
|
7090
|
-
// ../../node_modules
|
|
7087
|
+
// ../../node_modules/ansi-regex/index.js
|
|
7091
7088
|
function ansiRegex({ onlyFirst = false } = {}) {
|
|
7092
7089
|
const ST = "(?:\\u0007|\\u001B\\u005C|\\u009C)";
|
|
7093
7090
|
const pattern = [
|
|
@@ -7097,7 +7094,7 @@ function ansiRegex({ onlyFirst = false } = {}) {
|
|
|
7097
7094
|
return new RegExp(pattern, onlyFirst ? void 0 : "g");
|
|
7098
7095
|
}
|
|
7099
7096
|
|
|
7100
|
-
// ../../node_modules
|
|
7097
|
+
// ../../node_modules/strip-ansi/index.js
|
|
7101
7098
|
var regex = ansiRegex();
|
|
7102
7099
|
function stripAnsi(string) {
|
|
7103
7100
|
if (typeof string !== "string") {
|
|
@@ -7106,7 +7103,7 @@ function stripAnsi(string) {
|
|
|
7106
7103
|
return string.replace(regex, "");
|
|
7107
7104
|
}
|
|
7108
7105
|
|
|
7109
|
-
// ../../node_modules
|
|
7106
|
+
// ../../node_modules/get-east-asian-width/lookup.js
|
|
7110
7107
|
function isAmbiguous(x) {
|
|
7111
7108
|
return x === 161 || x === 164 || x === 167 || x === 168 || x === 170 || x === 173 || x === 174 || x >= 176 && x <= 180 || x >= 182 && x <= 186 || x >= 188 && x <= 191 || x === 198 || x === 208 || x === 215 || x === 216 || x >= 222 && x <= 225 || x === 230 || x >= 232 && x <= 234 || x === 236 || x === 237 || x === 240 || x === 242 || x === 243 || x >= 247 && x <= 250 || x === 252 || x === 254 || x === 257 || x === 273 || x === 275 || x === 283 || x === 294 || x === 295 || x === 299 || x >= 305 && x <= 307 || x === 312 || x >= 319 && x <= 322 || x === 324 || x >= 328 && x <= 331 || x === 333 || x === 338 || x === 339 || x === 358 || x === 359 || x === 363 || x === 462 || x === 464 || x === 466 || x === 468 || x === 470 || x === 472 || x === 474 || x === 476 || x === 593 || x === 609 || x === 708 || x === 711 || x >= 713 && x <= 715 || x === 717 || x === 720 || x >= 728 && x <= 731 || x === 733 || x === 735 || x >= 768 && x <= 879 || x >= 913 && x <= 929 || x >= 931 && x <= 937 || x >= 945 && x <= 961 || x >= 963 && x <= 969 || x === 1025 || x >= 1040 && x <= 1103 || x === 1105 || x === 8208 || x >= 8211 && x <= 8214 || x === 8216 || x === 8217 || x === 8220 || x === 8221 || x >= 8224 && x <= 8226 || x >= 8228 && x <= 8231 || x === 8240 || x === 8242 || x === 8243 || x === 8245 || x === 8251 || x === 8254 || x === 8308 || x === 8319 || x >= 8321 && x <= 8324 || x === 8364 || x === 8451 || x === 8453 || x === 8457 || x === 8467 || x === 8470 || x === 8481 || x === 8482 || x === 8486 || x === 8491 || x === 8531 || x === 8532 || x >= 8539 && x <= 8542 || x >= 8544 && x <= 8555 || x >= 8560 && x <= 8569 || x === 8585 || x >= 8592 && x <= 8601 || x === 8632 || x === 8633 || x === 8658 || x === 8660 || x === 8679 || x === 8704 || x === 8706 || x === 8707 || x === 8711 || x === 8712 || x === 8715 || x === 8719 || x === 8721 || x === 8725 || x === 8730 || x >= 8733 && x <= 8736 || x === 8739 || x === 8741 || x >= 8743 && x <= 8748 || x === 8750 || x >= 8756 && x <= 8759 || x === 8764 || x === 8765 || x === 8776 || x === 8780 || x === 8786 || x === 8800 || x === 8801 || x >= 8804 && x <= 8807 || x === 8810 || x === 8811 || x === 8814 || x === 8815 || x === 8834 || x === 8835 || x === 8838 || x === 8839 || x === 8853 || x === 8857 || x === 8869 || x === 8895 || x === 8978 || x >= 9312 && x <= 9449 || x >= 9451 && x <= 9547 || x >= 9552 && x <= 9587 || x >= 9600 && x <= 9615 || x >= 9618 && x <= 9621 || x === 9632 || x === 9633 || x >= 9635 && x <= 9641 || x === 9650 || x === 9651 || x === 9654 || x === 9655 || x === 9660 || x === 9661 || x === 9664 || x === 9665 || x >= 9670 && x <= 9672 || x === 9675 || x >= 9678 && x <= 9681 || x >= 9698 && x <= 9701 || x === 9711 || x === 9733 || x === 9734 || x === 9737 || x === 9742 || x === 9743 || x === 9756 || x === 9758 || x === 9792 || x === 9794 || x === 9824 || x === 9825 || x >= 9827 && x <= 9829 || x >= 9831 && x <= 9834 || x === 9836 || x === 9837 || x === 9839 || x === 9886 || x === 9887 || x === 9919 || x >= 9926 && x <= 9933 || x >= 9935 && x <= 9939 || x >= 9941 && x <= 9953 || x === 9955 || x === 9960 || x === 9961 || x >= 9963 && x <= 9969 || x === 9972 || x >= 9974 && x <= 9977 || x === 9979 || x === 9980 || x === 9982 || x === 9983 || x === 10045 || x >= 10102 && x <= 10111 || x >= 11094 && x <= 11097 || x >= 12872 && x <= 12879 || x >= 57344 && x <= 63743 || x >= 65024 && x <= 65039 || x === 65533 || x >= 127232 && x <= 127242 || x >= 127248 && x <= 127277 || x >= 127280 && x <= 127337 || x >= 127344 && x <= 127373 || x === 127375 || x === 127376 || x >= 127387 && x <= 127404 || x >= 917760 && x <= 917999 || x >= 983040 && x <= 1048573 || x >= 1048576 && x <= 1114109;
|
|
7112
7109
|
}
|
|
@@ -7117,7 +7114,7 @@ function isWide(x) {
|
|
|
7117
7114
|
return x >= 4352 && x <= 4447 || x === 8986 || x === 8987 || x === 9001 || x === 9002 || x >= 9193 && x <= 9196 || x === 9200 || x === 9203 || x === 9725 || x === 9726 || x === 9748 || x === 9749 || x >= 9776 && x <= 9783 || x >= 9800 && x <= 9811 || x === 9855 || x >= 9866 && x <= 9871 || x === 9875 || x === 9889 || x === 9898 || x === 9899 || x === 9917 || x === 9918 || x === 9924 || x === 9925 || x === 9934 || x === 9940 || x === 9962 || x === 9970 || x === 9971 || x === 9973 || x === 9978 || x === 9981 || x === 9989 || x === 9994 || x === 9995 || x === 10024 || x === 10060 || x === 10062 || x >= 10067 && x <= 10069 || x === 10071 || x >= 10133 && x <= 10135 || x === 10160 || x === 10175 || x === 11035 || x === 11036 || x === 11088 || x === 11093 || x >= 11904 && x <= 11929 || x >= 11931 && x <= 12019 || x >= 12032 && x <= 12245 || x >= 12272 && x <= 12287 || x >= 12289 && x <= 12350 || x >= 12353 && x <= 12438 || x >= 12441 && x <= 12543 || x >= 12549 && x <= 12591 || x >= 12593 && x <= 12686 || x >= 12688 && x <= 12773 || x >= 12783 && x <= 12830 || x >= 12832 && x <= 12871 || x >= 12880 && x <= 42124 || x >= 42128 && x <= 42182 || x >= 43360 && x <= 43388 || x >= 44032 && x <= 55203 || x >= 63744 && x <= 64255 || x >= 65040 && x <= 65049 || x >= 65072 && x <= 65106 || x >= 65108 && x <= 65126 || x >= 65128 && x <= 65131 || x >= 94176 && x <= 94180 || x >= 94192 && x <= 94198 || x >= 94208 && x <= 101589 || x >= 101631 && x <= 101662 || x >= 101760 && x <= 101874 || x >= 110576 && x <= 110579 || x >= 110581 && x <= 110587 || x === 110589 || x === 110590 || x >= 110592 && x <= 110882 || x === 110898 || x >= 110928 && x <= 110930 || x === 110933 || x >= 110948 && x <= 110951 || x >= 110960 && x <= 111355 || x >= 119552 && x <= 119638 || x >= 119648 && x <= 119670 || x === 126980 || x === 127183 || x === 127374 || x >= 127377 && x <= 127386 || x >= 127488 && x <= 127490 || x >= 127504 && x <= 127547 || x >= 127552 && x <= 127560 || x === 127568 || x === 127569 || x >= 127584 && x <= 127589 || x >= 127744 && x <= 127776 || x >= 127789 && x <= 127797 || x >= 127799 && x <= 127868 || x >= 127870 && x <= 127891 || x >= 127904 && x <= 127946 || x >= 127951 && x <= 127955 || x >= 127968 && x <= 127984 || x === 127988 || x >= 127992 && x <= 128062 || x === 128064 || x >= 128066 && x <= 128252 || x >= 128255 && x <= 128317 || x >= 128331 && x <= 128334 || x >= 128336 && x <= 128359 || x === 128378 || x === 128405 || x === 128406 || x === 128420 || x >= 128507 && x <= 128591 || x >= 128640 && x <= 128709 || x === 128716 || x >= 128720 && x <= 128722 || x >= 128725 && x <= 128728 || x >= 128732 && x <= 128735 || x === 128747 || x === 128748 || x >= 128756 && x <= 128764 || x >= 128992 && x <= 129003 || x === 129008 || x >= 129292 && x <= 129338 || x >= 129340 && x <= 129349 || x >= 129351 && x <= 129535 || x >= 129648 && x <= 129660 || x >= 129664 && x <= 129674 || x >= 129678 && x <= 129734 || x === 129736 || x >= 129741 && x <= 129756 || x >= 129759 && x <= 129770 || x >= 129775 && x <= 129784 || x >= 131072 && x <= 196605 || x >= 196608 && x <= 262141;
|
|
7118
7115
|
}
|
|
7119
7116
|
|
|
7120
|
-
// ../../node_modules
|
|
7117
|
+
// ../../node_modules/get-east-asian-width/index.js
|
|
7121
7118
|
function validate(codePoint) {
|
|
7122
7119
|
if (!Number.isSafeInteger(codePoint)) {
|
|
7123
7120
|
throw new TypeError(`Expected a code point, got \`${typeof codePoint}\`.`);
|
|
@@ -7131,12 +7128,12 @@ function eastAsianWidth(codePoint, { ambiguousAsWide = false } = {}) {
|
|
|
7131
7128
|
return 1;
|
|
7132
7129
|
}
|
|
7133
7130
|
|
|
7134
|
-
// ../../node_modules
|
|
7131
|
+
// ../../node_modules/emoji-regex/index.mjs
|
|
7135
7132
|
var emoji_regex_default = () => {
|
|
7136
7133
|
return /[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E-\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED8\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])))?))?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3C-\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC2\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF]|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g;
|
|
7137
7134
|
};
|
|
7138
7135
|
|
|
7139
|
-
// ../../node_modules
|
|
7136
|
+
// ../../node_modules/string-width/index.js
|
|
7140
7137
|
var segmenter = new Intl.Segmenter();
|
|
7141
7138
|
var defaultIgnorableCodePointRegex = /^\p{Default_Ignorable_Code_Point}$/u;
|
|
7142
7139
|
function stringWidth(string, options = {}) {
|
|
@@ -7184,7 +7181,7 @@ function stringWidth(string, options = {}) {
|
|
|
7184
7181
|
return width;
|
|
7185
7182
|
}
|
|
7186
7183
|
|
|
7187
|
-
// ../../node_modules
|
|
7184
|
+
// ../../node_modules/is-interactive/index.js
|
|
7188
7185
|
function isInteractive({ stream = process.stdout } = {}) {
|
|
7189
7186
|
return Boolean(
|
|
7190
7187
|
stream && stream.isTTY && process.env.TERM !== "dumb" && !("CI" in process.env)
|
|
@@ -7241,7 +7238,7 @@ var StdinDiscarder = class {
|
|
|
7241
7238
|
var stdinDiscarder = new StdinDiscarder();
|
|
7242
7239
|
var stdin_discarder_default = stdinDiscarder;
|
|
7243
7240
|
|
|
7244
|
-
// ../../node_modules
|
|
7241
|
+
// ../../node_modules/ora/index.js
|
|
7245
7242
|
__toESM(require_cli_spinners(), 1);
|
|
7246
7243
|
var Ora = class {
|
|
7247
7244
|
#linesToClear = 0;
|
|
@@ -7850,11 +7847,9 @@ async function initCommand(projectName, options) {
|
|
|
7850
7847
|
const apiUrl = loadApiUrl();
|
|
7851
7848
|
const api = new ApiClient(apiKey, apiUrl);
|
|
7852
7849
|
const validating = spinner("Validating API key...");
|
|
7853
|
-
|
|
7854
|
-
|
|
7855
|
-
|
|
7856
|
-
const detail = err?.message ? ` (${err.message})` : "";
|
|
7857
|
-
validating.fail(` API key validation failed${detail}.`);
|
|
7850
|
+
const isValid = await api.validateKey();
|
|
7851
|
+
if (!isValid) {
|
|
7852
|
+
validating.fail(" Invalid API key. Please check your key and try again.");
|
|
7858
7853
|
process.exit(1);
|
|
7859
7854
|
}
|
|
7860
7855
|
validating.succeed(" API key validated.");
|
|
@@ -8020,11 +8015,9 @@ async function loginCommand(options = {}) {
|
|
|
8020
8015
|
}
|
|
8021
8016
|
const spinner2 = spinner("Validating...");
|
|
8022
8017
|
const api = new ApiClient(apiKey, apiUrl);
|
|
8023
|
-
|
|
8024
|
-
|
|
8025
|
-
|
|
8026
|
-
const detail = err?.message ? ` (${err.message})` : "";
|
|
8027
|
-
spinner2.fail(` API key validation failed${detail}.`);
|
|
8018
|
+
const valid = await api.validateKey();
|
|
8019
|
+
if (!valid) {
|
|
8020
|
+
spinner2.fail(" Invalid API key.");
|
|
8028
8021
|
process.exit(1);
|
|
8029
8022
|
}
|
|
8030
8023
|
saveApiKey(apiKey);
|