@abloatai/ablo 0.9.11 → 0.9.13
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/CHANGELOG.md +12 -0
- package/README.md +4 -4
- package/dist/cli.cjs +795 -528
- package/dist/errorCodes.d.ts +2 -0
- package/dist/errorCodes.js +2 -0
- package/dist/schema/diff.d.ts +7 -1
- package/dist/schema/roles.d.ts +16 -0
- package/dist/schema/roles.js +18 -0
- package/llms.txt +4 -0
- package/package.json +1 -1
package/dist/cli.cjs
CHANGED
|
@@ -47784,13 +47784,13 @@ ${lanes.join("\n")}
|
|
|
47784
47784
|
optionTypeMismatchDiagnostic: Diagnostics.Build_option_0_requires_a_value_of_type_1
|
|
47785
47785
|
};
|
|
47786
47786
|
function parseBuildCommand(commandLine) {
|
|
47787
|
-
const { options, watchOptions, fileNames:
|
|
47787
|
+
const { options, watchOptions, fileNames: projects2, errors } = parseCommandLineWorker(
|
|
47788
47788
|
buildOptionsDidYouMeanDiagnostics,
|
|
47789
47789
|
commandLine
|
|
47790
47790
|
);
|
|
47791
47791
|
const buildOptions = options;
|
|
47792
|
-
if (
|
|
47793
|
-
|
|
47792
|
+
if (projects2.length === 0) {
|
|
47793
|
+
projects2.push(".");
|
|
47794
47794
|
}
|
|
47795
47795
|
if (buildOptions.clean && buildOptions.force) {
|
|
47796
47796
|
errors.push(createCompilerDiagnostic(Diagnostics.Options_0_and_1_cannot_be_combined, "clean", "force"));
|
|
@@ -47804,7 +47804,7 @@ ${lanes.join("\n")}
|
|
|
47804
47804
|
if (buildOptions.watch && buildOptions.dry) {
|
|
47805
47805
|
errors.push(createCompilerDiagnostic(Diagnostics.Options_0_and_1_cannot_be_combined, "watch", "dry"));
|
|
47806
47806
|
}
|
|
47807
|
-
return { buildOptions, watchOptions, projects, errors };
|
|
47807
|
+
return { buildOptions, watchOptions, projects: projects2, errors };
|
|
47808
47808
|
}
|
|
47809
47809
|
function getDiagnosticText(message, ...args) {
|
|
47810
47810
|
return cast(createCompilerDiagnostic(message, ...args).messageText, isString);
|
|
@@ -131409,7 +131409,7 @@ ${lanes.join("\n")}
|
|
|
131409
131409
|
return {
|
|
131410
131410
|
// public API
|
|
131411
131411
|
printNode,
|
|
131412
|
-
printList,
|
|
131412
|
+
printList: printList2,
|
|
131413
131413
|
printFile,
|
|
131414
131414
|
printBundle,
|
|
131415
131415
|
// internal API
|
|
@@ -131439,7 +131439,7 @@ ${lanes.join("\n")}
|
|
|
131439
131439
|
writeNode(hint, node, sourceFile, beginPrint());
|
|
131440
131440
|
return endPrint();
|
|
131441
131441
|
}
|
|
131442
|
-
function
|
|
131442
|
+
function printList2(format, nodes, sourceFile) {
|
|
131443
131443
|
writeList(format, nodes, sourceFile, beginPrint());
|
|
131444
131444
|
return endPrint();
|
|
131445
131445
|
}
|
|
@@ -145218,9 +145218,9 @@ ${lanes.join("\n")}
|
|
|
145218
145218
|
var _a;
|
|
145219
145219
|
updateCachedSystemWithFile(extendedConfigFileName, extendedConfigFilePath, eventKind);
|
|
145220
145220
|
if (extendedConfigCache) cleanExtendedConfigCache(extendedConfigCache, extendedConfigFilePath, toPath3);
|
|
145221
|
-
const
|
|
145222
|
-
if (!(
|
|
145223
|
-
|
|
145221
|
+
const projects2 = (_a = sharedExtendedConfigFileWatchers.get(extendedConfigFilePath)) == null ? void 0 : _a.projects;
|
|
145222
|
+
if (!(projects2 == null ? void 0 : projects2.size)) return;
|
|
145223
|
+
projects2.forEach((projectPath) => {
|
|
145224
145224
|
if (configFileName && toPath3(configFileName) === projectPath) {
|
|
145225
145225
|
updateLevel = 2;
|
|
145226
145226
|
} else {
|
|
@@ -147751,14 +147751,14 @@ ${lanes.join("\n")}
|
|
|
147751
147751
|
}
|
|
147752
147752
|
function executeCommandLine(system, cb, commandLineArgs) {
|
|
147753
147753
|
if (isBuildCommand(commandLineArgs)) {
|
|
147754
|
-
const { buildOptions, watchOptions, projects, errors } = parseBuildCommand(commandLineArgs);
|
|
147754
|
+
const { buildOptions, watchOptions, projects: projects2, errors } = parseBuildCommand(commandLineArgs);
|
|
147755
147755
|
if (buildOptions.generateCpuProfile && system.enableCPUProfiler) {
|
|
147756
147756
|
system.enableCPUProfiler(buildOptions.generateCpuProfile, () => performBuild(
|
|
147757
147757
|
system,
|
|
147758
147758
|
cb,
|
|
147759
147759
|
buildOptions,
|
|
147760
147760
|
watchOptions,
|
|
147761
|
-
|
|
147761
|
+
projects2,
|
|
147762
147762
|
errors
|
|
147763
147763
|
));
|
|
147764
147764
|
} else {
|
|
@@ -147767,7 +147767,7 @@ ${lanes.join("\n")}
|
|
|
147767
147767
|
cb,
|
|
147768
147768
|
buildOptions,
|
|
147769
147769
|
watchOptions,
|
|
147770
|
-
|
|
147770
|
+
projects2,
|
|
147771
147771
|
errors
|
|
147772
147772
|
);
|
|
147773
147773
|
}
|
|
@@ -147795,7 +147795,7 @@ ${lanes.join("\n")}
|
|
|
147795
147795
|
return false;
|
|
147796
147796
|
}
|
|
147797
147797
|
var defaultJSDocParsingMode = 2;
|
|
147798
|
-
function performBuild(sys2, cb, buildOptions, watchOptions,
|
|
147798
|
+
function performBuild(sys2, cb, buildOptions, watchOptions, projects2, errors) {
|
|
147799
147799
|
const reportDiagnostic = updateReportDiagnostic(
|
|
147800
147800
|
sys2,
|
|
147801
147801
|
createDiagnosticReporter(sys2),
|
|
@@ -147819,7 +147819,7 @@ ${lanes.join("\n")}
|
|
|
147819
147819
|
/* Success */
|
|
147820
147820
|
);
|
|
147821
147821
|
}
|
|
147822
|
-
if (
|
|
147822
|
+
if (projects2.length === 0) {
|
|
147823
147823
|
printVersion(sys2);
|
|
147824
147824
|
printBuildHelp(sys2, buildOpts);
|
|
147825
147825
|
return sys2.exit(
|
|
@@ -147855,7 +147855,7 @@ ${lanes.join("\n")}
|
|
|
147855
147855
|
reportSolutionBuilderTimes(builder2, solutionPerformance2);
|
|
147856
147856
|
}
|
|
147857
147857
|
};
|
|
147858
|
-
const builder2 = createSolutionBuilderWithWatch(buildHost2,
|
|
147858
|
+
const builder2 = createSolutionBuilderWithWatch(buildHost2, projects2, buildOptions, watchOptions);
|
|
147859
147859
|
builder2.build();
|
|
147860
147860
|
reportSolutionBuilderTimes(builder2, solutionPerformance2);
|
|
147861
147861
|
reportBuildStatistics = true;
|
|
@@ -147872,7 +147872,7 @@ ${lanes.join("\n")}
|
|
|
147872
147872
|
buildHost.jsDocParsingMode = defaultJSDocParsingMode;
|
|
147873
147873
|
const solutionPerformance = enableSolutionPerformance(sys2, buildOptions);
|
|
147874
147874
|
updateSolutionBuilderHost(sys2, cb, buildHost, solutionPerformance);
|
|
147875
|
-
const builder = createSolutionBuilder(buildHost,
|
|
147875
|
+
const builder = createSolutionBuilder(buildHost, projects2, buildOptions);
|
|
147876
147876
|
const exitStatus = buildOptions.clean ? builder.clean() : builder.build();
|
|
147877
147877
|
reportSolutionBuilderTimes(builder, solutionPerformance);
|
|
147878
147878
|
dumpTracingLegend();
|
|
@@ -180496,8 +180496,8 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
180496
180496
|
const symbolCompletion = getSymbolCompletionFromEntryId(program, log2, sourceFile, position, entryId, host, preferences);
|
|
180497
180497
|
switch (symbolCompletion.type) {
|
|
180498
180498
|
case "request": {
|
|
180499
|
-
const { request } = symbolCompletion;
|
|
180500
|
-
switch (
|
|
180499
|
+
const { request: request2 } = symbolCompletion;
|
|
180500
|
+
switch (request2.kind) {
|
|
180501
180501
|
case 1:
|
|
180502
180502
|
return ts_JsDoc_exports.getJSDocTagNameCompletionDetails(name);
|
|
180503
180503
|
case 2:
|
|
@@ -180505,14 +180505,14 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
180505
180505
|
case 3:
|
|
180506
180506
|
return ts_JsDoc_exports.getJSDocParameterNameCompletionDetails(name);
|
|
180507
180507
|
case 4:
|
|
180508
|
-
return some(
|
|
180508
|
+
return some(request2.keywordCompletions, (c) => c.name === name) ? createSimpleDetails(
|
|
180509
180509
|
name,
|
|
180510
180510
|
"keyword",
|
|
180511
180511
|
5
|
|
180512
180512
|
/* keyword */
|
|
180513
180513
|
) : void 0;
|
|
180514
180514
|
default:
|
|
180515
|
-
return Debug.assertNever(
|
|
180515
|
+
return Debug.assertNever(request2);
|
|
180516
180516
|
}
|
|
180517
180517
|
}
|
|
180518
180518
|
case "symbol": {
|
|
@@ -199601,13 +199601,13 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
199601
199601
|
this.sendResponse({ kind: ActionWatchTypingLocations, projectName, files: void 0 });
|
|
199602
199602
|
}
|
|
199603
199603
|
}
|
|
199604
|
-
createSetTypings(
|
|
199604
|
+
createSetTypings(request2, typings) {
|
|
199605
199605
|
return {
|
|
199606
|
-
projectName:
|
|
199607
|
-
typeAcquisition:
|
|
199608
|
-
compilerOptions:
|
|
199606
|
+
projectName: request2.projectName,
|
|
199607
|
+
typeAcquisition: request2.typeAcquisition,
|
|
199608
|
+
compilerOptions: request2.compilerOptions,
|
|
199609
199609
|
typings,
|
|
199610
|
-
unresolvedImports:
|
|
199610
|
+
unresolvedImports: request2.unresolvedImports,
|
|
199611
199611
|
kind: ActionSet
|
|
199612
199612
|
};
|
|
199613
199613
|
}
|
|
@@ -199618,10 +199618,10 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
199618
199618
|
executeWithThrottling() {
|
|
199619
199619
|
while (this.inFlightRequestCount < this.throttleLimit && this.pendingRunRequests.length) {
|
|
199620
199620
|
this.inFlightRequestCount++;
|
|
199621
|
-
const
|
|
199622
|
-
this.installWorker(
|
|
199621
|
+
const request2 = this.pendingRunRequests.pop();
|
|
199622
|
+
this.installWorker(request2.requestId, request2.packageNames, request2.cwd, (ok) => {
|
|
199623
199623
|
this.inFlightRequestCount--;
|
|
199624
|
-
|
|
199624
|
+
request2.onRequestCompleted(ok);
|
|
199625
199625
|
this.executeWithThrottling();
|
|
199626
199626
|
});
|
|
199627
199627
|
}
|
|
@@ -203065,8 +203065,8 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
203065
203065
|
// TODO: GH#18217
|
|
203066
203066
|
hasMixedContent: (x2) => !!x2.hasMixedContent
|
|
203067
203067
|
};
|
|
203068
|
-
function findProjectByName(projectName,
|
|
203069
|
-
for (const proj of
|
|
203068
|
+
function findProjectByName(projectName, projects2) {
|
|
203069
|
+
for (const proj of projects2) {
|
|
203070
203070
|
if (proj.getProjectName() === projectName) {
|
|
203071
203071
|
return proj;
|
|
203072
203072
|
}
|
|
@@ -203744,9 +203744,9 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
203744
203744
|
this.delayUpdateProjectGraph(project);
|
|
203745
203745
|
this.delayEnsureProjectForOpenFiles();
|
|
203746
203746
|
}
|
|
203747
|
-
delayUpdateProjectGraphs(
|
|
203748
|
-
if (
|
|
203749
|
-
for (const project of
|
|
203747
|
+
delayUpdateProjectGraphs(projects2, clearSourceMapperCache) {
|
|
203748
|
+
if (projects2.length) {
|
|
203749
|
+
for (const project of projects2) {
|
|
203750
203750
|
if (clearSourceMapperCache) project.clearSourceMapperCache();
|
|
203751
203751
|
this.delayUpdateProjectGraph(project);
|
|
203752
203752
|
}
|
|
@@ -203805,8 +203805,8 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
203805
203805
|
}
|
|
203806
203806
|
});
|
|
203807
203807
|
}
|
|
203808
|
-
getDefaultProjectForFile(fileName,
|
|
203809
|
-
return
|
|
203808
|
+
getDefaultProjectForFile(fileName, ensureProject2) {
|
|
203809
|
+
return ensureProject2 ? this.ensureDefaultProjectForFile(fileName) : this.tryGetDefaultProjectForFile(fileName);
|
|
203810
203810
|
}
|
|
203811
203811
|
/** @internal */
|
|
203812
203812
|
tryGetDefaultProjectForFile(fileNameOrScriptInfo) {
|
|
@@ -204311,8 +204311,8 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
204311
204311
|
this.ensureConfigFileWatcherForProject(configFileExistenceInfo, forProject);
|
|
204312
204312
|
}
|
|
204313
204313
|
ensureConfigFileWatcherForProject(configFileExistenceInfo, forProject) {
|
|
204314
|
-
const
|
|
204315
|
-
|
|
204314
|
+
const projects2 = configFileExistenceInfo.config.projects;
|
|
204315
|
+
projects2.set(forProject.canonicalConfigFilePath, projects2.get(forProject.canonicalConfigFilePath) || false);
|
|
204316
204316
|
}
|
|
204317
204317
|
/** @internal */
|
|
204318
204318
|
releaseParsedConfig(canonicalConfigFilePath, forProject) {
|
|
@@ -205166,7 +205166,7 @@ All files are: ${JSON.stringify(names)}`,
|
|
|
205166
205166
|
* @internal
|
|
205167
205167
|
*/
|
|
205168
205168
|
getSymlinkedProjects(info) {
|
|
205169
|
-
let
|
|
205169
|
+
let projects2;
|
|
205170
205170
|
if (this.realpathToScriptInfos) {
|
|
205171
205171
|
const realpath = info.getRealpathIfDifferent();
|
|
205172
205172
|
if (realpath) {
|
|
@@ -205174,16 +205174,16 @@ All files are: ${JSON.stringify(names)}`,
|
|
|
205174
205174
|
}
|
|
205175
205175
|
forEach(this.realpathToScriptInfos.get(info.path), combineProjects);
|
|
205176
205176
|
}
|
|
205177
|
-
return
|
|
205177
|
+
return projects2;
|
|
205178
205178
|
function combineProjects(toAddInfo) {
|
|
205179
205179
|
if (toAddInfo !== info) {
|
|
205180
205180
|
for (const project of toAddInfo.containingProjects) {
|
|
205181
205181
|
if (project.languageServiceEnabled && !project.isOrphan() && !project.getCompilerOptions().preserveSymlinks && !info.isAttached(project)) {
|
|
205182
|
-
if (!
|
|
205183
|
-
|
|
205184
|
-
|
|
205185
|
-
} else if (!forEachEntry(
|
|
205186
|
-
|
|
205182
|
+
if (!projects2) {
|
|
205183
|
+
projects2 = createMultiMap();
|
|
205184
|
+
projects2.add(toAddInfo.path, project);
|
|
205185
|
+
} else if (!forEachEntry(projects2, (projs, path) => path === toAddInfo.path ? false : contains(projs, project))) {
|
|
205186
|
+
projects2.add(toAddInfo.path, project);
|
|
205187
205187
|
}
|
|
205188
205188
|
}
|
|
205189
205189
|
}
|
|
@@ -205568,7 +205568,7 @@ Dynamic files must always be opened with service's current directory or service
|
|
|
205568
205568
|
this.hostConfiguration.preferences = { ...this.hostConfiguration.preferences, ...args.preferences };
|
|
205569
205569
|
if (lazyConfiguredProjectsFromExternalProject && !this.hostConfiguration.preferences.lazyConfiguredProjectsFromExternalProject) {
|
|
205570
205570
|
this.externalProjectToConfiguredProjectMap.forEach(
|
|
205571
|
-
(
|
|
205571
|
+
(projects2) => projects2.forEach((project) => {
|
|
205572
205572
|
if (!project.deferredClose && !project.isClosed() && project.pendingUpdateLevel === 2 && !this.hasPendingProjectUpdate(project)) {
|
|
205573
205573
|
project.updateGraph();
|
|
205574
205574
|
}
|
|
@@ -205658,9 +205658,9 @@ Dynamic files must always be opened with service's current directory or service
|
|
|
205658
205658
|
});
|
|
205659
205659
|
const reloadedConfiguredProjects = /* @__PURE__ */ new Map();
|
|
205660
205660
|
const delayReloadedConfiguredProjects = /* @__PURE__ */ new Set();
|
|
205661
|
-
this.externalProjectToConfiguredProjectMap.forEach((
|
|
205661
|
+
this.externalProjectToConfiguredProjectMap.forEach((projects2, externalProjectName) => {
|
|
205662
205662
|
const reason = `Reloading configured project in external project: ${externalProjectName}`;
|
|
205663
|
-
|
|
205663
|
+
projects2.forEach((project) => {
|
|
205664
205664
|
if (this.getHostPreferences().lazyConfiguredProjectsFromExternalProject) {
|
|
205665
205665
|
this.reloadConfiguredProjectOptimized(project, reason, reloadedConfiguredProjects);
|
|
205666
205666
|
} else {
|
|
@@ -206238,9 +206238,9 @@ Dynamic files must always be opened with service's current directory or service
|
|
|
206238
206238
|
if (!toRemoveConfiguredProjects.size) return toRemoveConfiguredProjects;
|
|
206239
206239
|
this.inferredProjects.forEach(markOriginalProjectsAsUsed);
|
|
206240
206240
|
this.externalProjects.forEach(markOriginalProjectsAsUsed);
|
|
206241
|
-
this.externalProjectToConfiguredProjectMap.forEach((
|
|
206241
|
+
this.externalProjectToConfiguredProjectMap.forEach((projects2, externalProjectName) => {
|
|
206242
206242
|
if (!(externalProjectsRetainingConfiguredProjects == null ? void 0 : externalProjectsRetainingConfiguredProjects.has(externalProjectName))) {
|
|
206243
|
-
|
|
206243
|
+
projects2.forEach(retainConfiguredProject);
|
|
206244
206244
|
}
|
|
206245
206245
|
});
|
|
206246
206246
|
if (!toRemoveConfiguredProjects.size) return toRemoveConfiguredProjects;
|
|
@@ -206436,8 +206436,8 @@ Dynamic files must always be opened with service's current directory or service
|
|
|
206436
206436
|
// eslint-disable-line @typescript-eslint/unified-signatures
|
|
206437
206437
|
closeExternalProject(uncheckedFileName, cleanupAfter) {
|
|
206438
206438
|
const fileName = toNormalizedPath(uncheckedFileName);
|
|
206439
|
-
const
|
|
206440
|
-
if (
|
|
206439
|
+
const projects2 = this.externalProjectToConfiguredProjectMap.get(fileName);
|
|
206440
|
+
if (projects2) {
|
|
206441
206441
|
this.externalProjectToConfiguredProjectMap.delete(fileName);
|
|
206442
206442
|
} else {
|
|
206443
206443
|
const externalProject = this.findExternalProjectByProjectName(uncheckedFileName);
|
|
@@ -206450,10 +206450,10 @@ Dynamic files must always be opened with service's current directory or service
|
|
|
206450
206450
|
this.printProjects();
|
|
206451
206451
|
}
|
|
206452
206452
|
}
|
|
206453
|
-
openExternalProjects(
|
|
206453
|
+
openExternalProjects(projects2) {
|
|
206454
206454
|
const projectsToClose = new Set(this.externalProjects.map((p2) => p2.getProjectName()));
|
|
206455
206455
|
this.externalProjectToConfiguredProjectMap.forEach((_3, externalProjectName) => projectsToClose.add(externalProjectName));
|
|
206456
|
-
for (const externalProject of
|
|
206456
|
+
for (const externalProject of projects2) {
|
|
206457
206457
|
this.openExternalProject(
|
|
206458
206458
|
externalProject,
|
|
206459
206459
|
/*cleanupAfter*/
|
|
@@ -207229,12 +207229,12 @@ ${json}${newLine}`;
|
|
|
207229
207229
|
body
|
|
207230
207230
|
};
|
|
207231
207231
|
}
|
|
207232
|
-
function combineProjectOutput(defaultValue, getValue,
|
|
207233
|
-
const outputs = flatMapToMutable(isArray(
|
|
207234
|
-
if (!isArray(
|
|
207235
|
-
|
|
207232
|
+
function combineProjectOutput(defaultValue, getValue, projects2, action) {
|
|
207233
|
+
const outputs = flatMapToMutable(isArray(projects2) ? projects2 : projects2.projects, (project) => action(project, defaultValue));
|
|
207234
|
+
if (!isArray(projects2) && projects2.symLinkedProjects) {
|
|
207235
|
+
projects2.symLinkedProjects.forEach((projects22, path) => {
|
|
207236
207236
|
const value = getValue(path);
|
|
207237
|
-
outputs.push(...flatMap(
|
|
207237
|
+
outputs.push(...flatMap(projects22, (project) => action(project, value)));
|
|
207238
207238
|
});
|
|
207239
207239
|
}
|
|
207240
207240
|
return deduplicate(outputs, equateValues);
|
|
@@ -207242,9 +207242,9 @@ ${json}${newLine}`;
|
|
|
207242
207242
|
function createDocumentSpanSet(useCaseSensitiveFileNames2) {
|
|
207243
207243
|
return createSet(({ textSpan }) => textSpan.start + 100003 * textSpan.length, getDocumentSpansEqualityComparer(useCaseSensitiveFileNames2));
|
|
207244
207244
|
}
|
|
207245
|
-
function getRenameLocationsWorker(
|
|
207245
|
+
function getRenameLocationsWorker(projects2, defaultProject, initialLocation, findInStrings, findInComments, preferences, useCaseSensitiveFileNames2) {
|
|
207246
207246
|
const perProjectResults = getPerProjectReferences(
|
|
207247
|
-
|
|
207247
|
+
projects2,
|
|
207248
207248
|
defaultProject,
|
|
207249
207249
|
initialLocation,
|
|
207250
207250
|
getDefinitionLocation(
|
|
@@ -207284,10 +207284,10 @@ ${json}${newLine}`;
|
|
|
207284
207284
|
const info = infos && firstOrUndefined(infos);
|
|
207285
207285
|
return info && !info.isLocal ? { fileName: info.fileName, pos: info.textSpan.start } : void 0;
|
|
207286
207286
|
}
|
|
207287
|
-
function getReferencesWorker(
|
|
207287
|
+
function getReferencesWorker(projects2, defaultProject, initialLocation, useCaseSensitiveFileNames2, logger) {
|
|
207288
207288
|
var _a, _b;
|
|
207289
207289
|
const perProjectResults = getPerProjectReferences(
|
|
207290
|
-
|
|
207290
|
+
projects2,
|
|
207291
207291
|
defaultProject,
|
|
207292
207292
|
initialLocation,
|
|
207293
207293
|
getDefinitionLocation(
|
|
@@ -207379,23 +207379,23 @@ ${json}${newLine}`;
|
|
|
207379
207379
|
});
|
|
207380
207380
|
return results.filter((o2) => o2.references.length !== 0);
|
|
207381
207381
|
}
|
|
207382
|
-
function forEachProjectInProjects(
|
|
207383
|
-
for (const project of isArray(
|
|
207382
|
+
function forEachProjectInProjects(projects2, path, cb) {
|
|
207383
|
+
for (const project of isArray(projects2) ? projects2 : projects2.projects) {
|
|
207384
207384
|
cb(project, path);
|
|
207385
207385
|
}
|
|
207386
|
-
if (!isArray(
|
|
207387
|
-
|
|
207386
|
+
if (!isArray(projects2) && projects2.symLinkedProjects) {
|
|
207387
|
+
projects2.symLinkedProjects.forEach((symlinkedProjects, symlinkedPath) => {
|
|
207388
207388
|
for (const project of symlinkedProjects) {
|
|
207389
207389
|
cb(project, symlinkedPath);
|
|
207390
207390
|
}
|
|
207391
207391
|
});
|
|
207392
207392
|
}
|
|
207393
207393
|
}
|
|
207394
|
-
function getPerProjectReferences(
|
|
207394
|
+
function getPerProjectReferences(projects2, defaultProject, initialLocation, defaultDefinition, mapDefinitionInProject2, getResultsForPosition, forPositionInResult) {
|
|
207395
207395
|
const resultsMap = /* @__PURE__ */ new Map();
|
|
207396
207396
|
const queue = createQueue();
|
|
207397
207397
|
queue.enqueue({ project: defaultProject, location: initialLocation });
|
|
207398
|
-
forEachProjectInProjects(
|
|
207398
|
+
forEachProjectInProjects(projects2, initialLocation.fileName, (project, path) => {
|
|
207399
207399
|
const location = { fileName: path, pos: initialLocation.pos };
|
|
207400
207400
|
queue.enqueue({ project, location });
|
|
207401
207401
|
});
|
|
@@ -207584,9 +207584,9 @@ ${json}${newLine}`;
|
|
|
207584
207584
|
[
|
|
207585
207585
|
"openExternalProject"
|
|
207586
207586
|
/* OpenExternalProject */
|
|
207587
|
-
]: (
|
|
207587
|
+
]: (request2) => {
|
|
207588
207588
|
this.projectService.openExternalProject(
|
|
207589
|
-
|
|
207589
|
+
request2.arguments,
|
|
207590
207590
|
/*cleanupAfter*/
|
|
207591
207591
|
true
|
|
207592
207592
|
);
|
|
@@ -207598,8 +207598,8 @@ ${json}${newLine}`;
|
|
|
207598
207598
|
[
|
|
207599
207599
|
"openExternalProjects"
|
|
207600
207600
|
/* OpenExternalProjects */
|
|
207601
|
-
]: (
|
|
207602
|
-
this.projectService.openExternalProjects(
|
|
207601
|
+
]: (request2) => {
|
|
207602
|
+
this.projectService.openExternalProjects(request2.arguments.projects);
|
|
207603
207603
|
return this.requiredResponse(
|
|
207604
207604
|
/*response*/
|
|
207605
207605
|
true
|
|
@@ -207608,9 +207608,9 @@ ${json}${newLine}`;
|
|
|
207608
207608
|
[
|
|
207609
207609
|
"closeExternalProject"
|
|
207610
207610
|
/* CloseExternalProject */
|
|
207611
|
-
]: (
|
|
207611
|
+
]: (request2) => {
|
|
207612
207612
|
this.projectService.closeExternalProject(
|
|
207613
|
-
|
|
207613
|
+
request2.arguments.projectFileName,
|
|
207614
207614
|
/*cleanupAfter*/
|
|
207615
207615
|
true
|
|
207616
207616
|
);
|
|
@@ -207622,8 +207622,8 @@ ${json}${newLine}`;
|
|
|
207622
207622
|
[
|
|
207623
207623
|
"synchronizeProjectList"
|
|
207624
207624
|
/* SynchronizeProjectList */
|
|
207625
|
-
]: (
|
|
207626
|
-
const result = this.projectService.synchronizeProjectList(
|
|
207625
|
+
]: (request2) => {
|
|
207626
|
+
const result = this.projectService.synchronizeProjectList(request2.arguments.knownProjects, request2.arguments.includeProjectReferenceRedirectInfo);
|
|
207627
207627
|
if (!result.some((p2) => p2.projectErrors && p2.projectErrors.length !== 0)) {
|
|
207628
207628
|
return this.requiredResponse(result);
|
|
207629
207629
|
}
|
|
@@ -207647,16 +207647,16 @@ ${json}${newLine}`;
|
|
|
207647
207647
|
[
|
|
207648
207648
|
"updateOpen"
|
|
207649
207649
|
/* UpdateOpen */
|
|
207650
|
-
]: (
|
|
207650
|
+
]: (request2) => {
|
|
207651
207651
|
this.changeSeq++;
|
|
207652
207652
|
this.projectService.applyChangesInOpenFiles(
|
|
207653
|
-
|
|
207653
|
+
request2.arguments.openFiles && mapIterator(request2.arguments.openFiles, (file) => ({
|
|
207654
207654
|
fileName: file.file,
|
|
207655
207655
|
content: file.fileContent,
|
|
207656
207656
|
scriptKind: file.scriptKindName,
|
|
207657
207657
|
projectRootPath: file.projectRootPath
|
|
207658
207658
|
})),
|
|
207659
|
-
|
|
207659
|
+
request2.arguments.changedFiles && mapIterator(request2.arguments.changedFiles, (file) => ({
|
|
207660
207660
|
fileName: file.fileName,
|
|
207661
207661
|
changes: mapDefinedIterator(arrayReverseIterator(file.textChanges), (change) => {
|
|
207662
207662
|
const scriptInfo = Debug.checkDefined(this.projectService.getScriptInfo(file.fileName));
|
|
@@ -207665,7 +207665,7 @@ ${json}${newLine}`;
|
|
|
207665
207665
|
return start >= 0 ? { span: { start, length: end - start }, newText: change.newText } : void 0;
|
|
207666
207666
|
})
|
|
207667
207667
|
})),
|
|
207668
|
-
|
|
207668
|
+
request2.arguments.closedFiles
|
|
207669
207669
|
);
|
|
207670
207670
|
return this.requiredResponse(
|
|
207671
207671
|
/*response*/
|
|
@@ -207675,16 +207675,16 @@ ${json}${newLine}`;
|
|
|
207675
207675
|
[
|
|
207676
207676
|
"applyChangedToOpenFiles"
|
|
207677
207677
|
/* ApplyChangedToOpenFiles */
|
|
207678
|
-
]: (
|
|
207678
|
+
]: (request2) => {
|
|
207679
207679
|
this.changeSeq++;
|
|
207680
207680
|
this.projectService.applyChangesInOpenFiles(
|
|
207681
|
-
|
|
207682
|
-
|
|
207681
|
+
request2.arguments.openFiles,
|
|
207682
|
+
request2.arguments.changedFiles && mapIterator(request2.arguments.changedFiles, (file) => ({
|
|
207683
207683
|
fileName: file.fileName,
|
|
207684
207684
|
// apply changes in reverse order
|
|
207685
207685
|
changes: arrayReverseIterator(file.changes)
|
|
207686
207686
|
})),
|
|
207687
|
-
|
|
207687
|
+
request2.arguments.closedFiles
|
|
207688
207688
|
);
|
|
207689
207689
|
return this.requiredResponse(
|
|
207690
207690
|
/*response*/
|
|
@@ -207704,9 +207704,9 @@ ${json}${newLine}`;
|
|
|
207704
207704
|
[
|
|
207705
207705
|
"definition"
|
|
207706
207706
|
/* Definition */
|
|
207707
|
-
]: (
|
|
207707
|
+
]: (request2) => {
|
|
207708
207708
|
return this.requiredResponse(this.getDefinition(
|
|
207709
|
-
|
|
207709
|
+
request2.arguments,
|
|
207710
207710
|
/*simplifiedResult*/
|
|
207711
207711
|
true
|
|
207712
207712
|
));
|
|
@@ -207714,9 +207714,9 @@ ${json}${newLine}`;
|
|
|
207714
207714
|
[
|
|
207715
207715
|
"definition-full"
|
|
207716
207716
|
/* DefinitionFull */
|
|
207717
|
-
]: (
|
|
207717
|
+
]: (request2) => {
|
|
207718
207718
|
return this.requiredResponse(this.getDefinition(
|
|
207719
|
-
|
|
207719
|
+
request2.arguments,
|
|
207720
207720
|
/*simplifiedResult*/
|
|
207721
207721
|
false
|
|
207722
207722
|
));
|
|
@@ -207724,9 +207724,9 @@ ${json}${newLine}`;
|
|
|
207724
207724
|
[
|
|
207725
207725
|
"definitionAndBoundSpan"
|
|
207726
207726
|
/* DefinitionAndBoundSpan */
|
|
207727
|
-
]: (
|
|
207727
|
+
]: (request2) => {
|
|
207728
207728
|
return this.requiredResponse(this.getDefinitionAndBoundSpan(
|
|
207729
|
-
|
|
207729
|
+
request2.arguments,
|
|
207730
207730
|
/*simplifiedResult*/
|
|
207731
207731
|
true
|
|
207732
207732
|
));
|
|
@@ -207734,9 +207734,9 @@ ${json}${newLine}`;
|
|
|
207734
207734
|
[
|
|
207735
207735
|
"definitionAndBoundSpan-full"
|
|
207736
207736
|
/* DefinitionAndBoundSpanFull */
|
|
207737
|
-
]: (
|
|
207737
|
+
]: (request2) => {
|
|
207738
207738
|
return this.requiredResponse(this.getDefinitionAndBoundSpan(
|
|
207739
|
-
|
|
207739
|
+
request2.arguments,
|
|
207740
207740
|
/*simplifiedResult*/
|
|
207741
207741
|
false
|
|
207742
207742
|
));
|
|
@@ -207744,27 +207744,27 @@ ${json}${newLine}`;
|
|
|
207744
207744
|
[
|
|
207745
207745
|
"findSourceDefinition"
|
|
207746
207746
|
/* FindSourceDefinition */
|
|
207747
|
-
]: (
|
|
207748
|
-
return this.requiredResponse(this.findSourceDefinition(
|
|
207747
|
+
]: (request2) => {
|
|
207748
|
+
return this.requiredResponse(this.findSourceDefinition(request2.arguments));
|
|
207749
207749
|
},
|
|
207750
207750
|
[
|
|
207751
207751
|
"emit-output"
|
|
207752
207752
|
/* EmitOutput */
|
|
207753
|
-
]: (
|
|
207754
|
-
return this.requiredResponse(this.getEmitOutput(
|
|
207753
|
+
]: (request2) => {
|
|
207754
|
+
return this.requiredResponse(this.getEmitOutput(request2.arguments));
|
|
207755
207755
|
},
|
|
207756
207756
|
[
|
|
207757
207757
|
"typeDefinition"
|
|
207758
207758
|
/* TypeDefinition */
|
|
207759
|
-
]: (
|
|
207760
|
-
return this.requiredResponse(this.getTypeDefinition(
|
|
207759
|
+
]: (request2) => {
|
|
207760
|
+
return this.requiredResponse(this.getTypeDefinition(request2.arguments));
|
|
207761
207761
|
},
|
|
207762
207762
|
[
|
|
207763
207763
|
"implementation"
|
|
207764
207764
|
/* Implementation */
|
|
207765
|
-
]: (
|
|
207765
|
+
]: (request2) => {
|
|
207766
207766
|
return this.requiredResponse(this.getImplementation(
|
|
207767
|
-
|
|
207767
|
+
request2.arguments,
|
|
207768
207768
|
/*simplifiedResult*/
|
|
207769
207769
|
true
|
|
207770
207770
|
));
|
|
@@ -207772,9 +207772,9 @@ ${json}${newLine}`;
|
|
|
207772
207772
|
[
|
|
207773
207773
|
"implementation-full"
|
|
207774
207774
|
/* ImplementationFull */
|
|
207775
|
-
]: (
|
|
207775
|
+
]: (request2) => {
|
|
207776
207776
|
return this.requiredResponse(this.getImplementation(
|
|
207777
|
-
|
|
207777
|
+
request2.arguments,
|
|
207778
207778
|
/*simplifiedResult*/
|
|
207779
207779
|
false
|
|
207780
207780
|
));
|
|
@@ -207782,9 +207782,9 @@ ${json}${newLine}`;
|
|
|
207782
207782
|
[
|
|
207783
207783
|
"references"
|
|
207784
207784
|
/* References */
|
|
207785
|
-
]: (
|
|
207785
|
+
]: (request2) => {
|
|
207786
207786
|
return this.requiredResponse(this.getReferences(
|
|
207787
|
-
|
|
207787
|
+
request2.arguments,
|
|
207788
207788
|
/*simplifiedResult*/
|
|
207789
207789
|
true
|
|
207790
207790
|
));
|
|
@@ -207792,9 +207792,9 @@ ${json}${newLine}`;
|
|
|
207792
207792
|
[
|
|
207793
207793
|
"references-full"
|
|
207794
207794
|
/* ReferencesFull */
|
|
207795
|
-
]: (
|
|
207795
|
+
]: (request2) => {
|
|
207796
207796
|
return this.requiredResponse(this.getReferences(
|
|
207797
|
-
|
|
207797
|
+
request2.arguments,
|
|
207798
207798
|
/*simplifiedResult*/
|
|
207799
207799
|
false
|
|
207800
207800
|
));
|
|
@@ -207802,9 +207802,9 @@ ${json}${newLine}`;
|
|
|
207802
207802
|
[
|
|
207803
207803
|
"rename"
|
|
207804
207804
|
/* Rename */
|
|
207805
|
-
]: (
|
|
207805
|
+
]: (request2) => {
|
|
207806
207806
|
return this.requiredResponse(this.getRenameLocations(
|
|
207807
|
-
|
|
207807
|
+
request2.arguments,
|
|
207808
207808
|
/*simplifiedResult*/
|
|
207809
207809
|
true
|
|
207810
207810
|
));
|
|
@@ -207812,9 +207812,9 @@ ${json}${newLine}`;
|
|
|
207812
207812
|
[
|
|
207813
207813
|
"renameLocations-full"
|
|
207814
207814
|
/* RenameLocationsFull */
|
|
207815
|
-
]: (
|
|
207815
|
+
]: (request2) => {
|
|
207816
207816
|
return this.requiredResponse(this.getRenameLocations(
|
|
207817
|
-
|
|
207817
|
+
request2.arguments,
|
|
207818
207818
|
/*simplifiedResult*/
|
|
207819
207819
|
false
|
|
207820
207820
|
));
|
|
@@ -207822,28 +207822,28 @@ ${json}${newLine}`;
|
|
|
207822
207822
|
[
|
|
207823
207823
|
"rename-full"
|
|
207824
207824
|
/* RenameInfoFull */
|
|
207825
|
-
]: (
|
|
207826
|
-
return this.requiredResponse(this.getRenameInfo(
|
|
207825
|
+
]: (request2) => {
|
|
207826
|
+
return this.requiredResponse(this.getRenameInfo(request2.arguments));
|
|
207827
207827
|
},
|
|
207828
207828
|
[
|
|
207829
207829
|
"open"
|
|
207830
207830
|
/* Open */
|
|
207831
|
-
]: (
|
|
207831
|
+
]: (request2) => {
|
|
207832
207832
|
this.openClientFile(
|
|
207833
|
-
toNormalizedPath(
|
|
207834
|
-
|
|
207835
|
-
convertScriptKindName(
|
|
207833
|
+
toNormalizedPath(request2.arguments.file),
|
|
207834
|
+
request2.arguments.fileContent,
|
|
207835
|
+
convertScriptKindName(request2.arguments.scriptKindName),
|
|
207836
207836
|
// TODO: GH#18217
|
|
207837
|
-
|
|
207837
|
+
request2.arguments.projectRootPath ? toNormalizedPath(request2.arguments.projectRootPath) : void 0
|
|
207838
207838
|
);
|
|
207839
|
-
return this.notRequired(
|
|
207839
|
+
return this.notRequired(request2);
|
|
207840
207840
|
},
|
|
207841
207841
|
[
|
|
207842
207842
|
"quickinfo"
|
|
207843
207843
|
/* Quickinfo */
|
|
207844
|
-
]: (
|
|
207844
|
+
]: (request2) => {
|
|
207845
207845
|
return this.requiredResponse(this.getQuickInfoWorker(
|
|
207846
|
-
|
|
207846
|
+
request2.arguments,
|
|
207847
207847
|
/*simplifiedResult*/
|
|
207848
207848
|
true
|
|
207849
207849
|
));
|
|
@@ -207851,9 +207851,9 @@ ${json}${newLine}`;
|
|
|
207851
207851
|
[
|
|
207852
207852
|
"quickinfo-full"
|
|
207853
207853
|
/* QuickinfoFull */
|
|
207854
|
-
]: (
|
|
207854
|
+
]: (request2) => {
|
|
207855
207855
|
return this.requiredResponse(this.getQuickInfoWorker(
|
|
207856
|
-
|
|
207856
|
+
request2.arguments,
|
|
207857
207857
|
/*simplifiedResult*/
|
|
207858
207858
|
false
|
|
207859
207859
|
));
|
|
@@ -207861,9 +207861,9 @@ ${json}${newLine}`;
|
|
|
207861
207861
|
[
|
|
207862
207862
|
"getOutliningSpans"
|
|
207863
207863
|
/* GetOutliningSpans */
|
|
207864
|
-
]: (
|
|
207864
|
+
]: (request2) => {
|
|
207865
207865
|
return this.requiredResponse(this.getOutliningSpans(
|
|
207866
|
-
|
|
207866
|
+
request2.arguments,
|
|
207867
207867
|
/*simplifiedResult*/
|
|
207868
207868
|
true
|
|
207869
207869
|
));
|
|
@@ -207871,9 +207871,9 @@ ${json}${newLine}`;
|
|
|
207871
207871
|
[
|
|
207872
207872
|
"outliningSpans"
|
|
207873
207873
|
/* GetOutliningSpansFull */
|
|
207874
|
-
]: (
|
|
207874
|
+
]: (request2) => {
|
|
207875
207875
|
return this.requiredResponse(this.getOutliningSpans(
|
|
207876
|
-
|
|
207876
|
+
request2.arguments,
|
|
207877
207877
|
/*simplifiedResult*/
|
|
207878
207878
|
false
|
|
207879
207879
|
));
|
|
@@ -207881,51 +207881,51 @@ ${json}${newLine}`;
|
|
|
207881
207881
|
[
|
|
207882
207882
|
"todoComments"
|
|
207883
207883
|
/* TodoComments */
|
|
207884
|
-
]: (
|
|
207885
|
-
return this.requiredResponse(this.getTodoComments(
|
|
207884
|
+
]: (request2) => {
|
|
207885
|
+
return this.requiredResponse(this.getTodoComments(request2.arguments));
|
|
207886
207886
|
},
|
|
207887
207887
|
[
|
|
207888
207888
|
"indentation"
|
|
207889
207889
|
/* Indentation */
|
|
207890
|
-
]: (
|
|
207891
|
-
return this.requiredResponse(this.getIndentation(
|
|
207890
|
+
]: (request2) => {
|
|
207891
|
+
return this.requiredResponse(this.getIndentation(request2.arguments));
|
|
207892
207892
|
},
|
|
207893
207893
|
[
|
|
207894
207894
|
"nameOrDottedNameSpan"
|
|
207895
207895
|
/* NameOrDottedNameSpan */
|
|
207896
|
-
]: (
|
|
207897
|
-
return this.requiredResponse(this.getNameOrDottedNameSpan(
|
|
207896
|
+
]: (request2) => {
|
|
207897
|
+
return this.requiredResponse(this.getNameOrDottedNameSpan(request2.arguments));
|
|
207898
207898
|
},
|
|
207899
207899
|
[
|
|
207900
207900
|
"breakpointStatement"
|
|
207901
207901
|
/* BreakpointStatement */
|
|
207902
|
-
]: (
|
|
207903
|
-
return this.requiredResponse(this.getBreakpointStatement(
|
|
207902
|
+
]: (request2) => {
|
|
207903
|
+
return this.requiredResponse(this.getBreakpointStatement(request2.arguments));
|
|
207904
207904
|
},
|
|
207905
207905
|
[
|
|
207906
207906
|
"braceCompletion"
|
|
207907
207907
|
/* BraceCompletion */
|
|
207908
|
-
]: (
|
|
207909
|
-
return this.requiredResponse(this.isValidBraceCompletion(
|
|
207908
|
+
]: (request2) => {
|
|
207909
|
+
return this.requiredResponse(this.isValidBraceCompletion(request2.arguments));
|
|
207910
207910
|
},
|
|
207911
207911
|
[
|
|
207912
207912
|
"docCommentTemplate"
|
|
207913
207913
|
/* DocCommentTemplate */
|
|
207914
|
-
]: (
|
|
207915
|
-
return this.requiredResponse(this.getDocCommentTemplate(
|
|
207914
|
+
]: (request2) => {
|
|
207915
|
+
return this.requiredResponse(this.getDocCommentTemplate(request2.arguments));
|
|
207916
207916
|
},
|
|
207917
207917
|
[
|
|
207918
207918
|
"getSpanOfEnclosingComment"
|
|
207919
207919
|
/* GetSpanOfEnclosingComment */
|
|
207920
|
-
]: (
|
|
207921
|
-
return this.requiredResponse(this.getSpanOfEnclosingComment(
|
|
207920
|
+
]: (request2) => {
|
|
207921
|
+
return this.requiredResponse(this.getSpanOfEnclosingComment(request2.arguments));
|
|
207922
207922
|
},
|
|
207923
207923
|
[
|
|
207924
207924
|
"fileReferences"
|
|
207925
207925
|
/* FileReferences */
|
|
207926
|
-
]: (
|
|
207926
|
+
]: (request2) => {
|
|
207927
207927
|
return this.requiredResponse(this.getFileReferences(
|
|
207928
|
-
|
|
207928
|
+
request2.arguments,
|
|
207929
207929
|
/*simplifiedResult*/
|
|
207930
207930
|
true
|
|
207931
207931
|
));
|
|
@@ -207933,9 +207933,9 @@ ${json}${newLine}`;
|
|
|
207933
207933
|
[
|
|
207934
207934
|
"fileReferences-full"
|
|
207935
207935
|
/* FileReferencesFull */
|
|
207936
|
-
]: (
|
|
207936
|
+
]: (request2) => {
|
|
207937
207937
|
return this.requiredResponse(this.getFileReferences(
|
|
207938
|
-
|
|
207938
|
+
request2.arguments,
|
|
207939
207939
|
/*simplifiedResult*/
|
|
207940
207940
|
false
|
|
207941
207941
|
));
|
|
@@ -207943,39 +207943,39 @@ ${json}${newLine}`;
|
|
|
207943
207943
|
[
|
|
207944
207944
|
"format"
|
|
207945
207945
|
/* Format */
|
|
207946
|
-
]: (
|
|
207947
|
-
return this.requiredResponse(this.getFormattingEditsForRange(
|
|
207946
|
+
]: (request2) => {
|
|
207947
|
+
return this.requiredResponse(this.getFormattingEditsForRange(request2.arguments));
|
|
207948
207948
|
},
|
|
207949
207949
|
[
|
|
207950
207950
|
"formatonkey"
|
|
207951
207951
|
/* Formatonkey */
|
|
207952
|
-
]: (
|
|
207953
|
-
return this.requiredResponse(this.getFormattingEditsAfterKeystroke(
|
|
207952
|
+
]: (request2) => {
|
|
207953
|
+
return this.requiredResponse(this.getFormattingEditsAfterKeystroke(request2.arguments));
|
|
207954
207954
|
},
|
|
207955
207955
|
[
|
|
207956
207956
|
"format-full"
|
|
207957
207957
|
/* FormatFull */
|
|
207958
|
-
]: (
|
|
207959
|
-
return this.requiredResponse(this.getFormattingEditsForDocumentFull(
|
|
207958
|
+
]: (request2) => {
|
|
207959
|
+
return this.requiredResponse(this.getFormattingEditsForDocumentFull(request2.arguments));
|
|
207960
207960
|
},
|
|
207961
207961
|
[
|
|
207962
207962
|
"formatonkey-full"
|
|
207963
207963
|
/* FormatonkeyFull */
|
|
207964
|
-
]: (
|
|
207965
|
-
return this.requiredResponse(this.getFormattingEditsAfterKeystrokeFull(
|
|
207964
|
+
]: (request2) => {
|
|
207965
|
+
return this.requiredResponse(this.getFormattingEditsAfterKeystrokeFull(request2.arguments));
|
|
207966
207966
|
},
|
|
207967
207967
|
[
|
|
207968
207968
|
"formatRange-full"
|
|
207969
207969
|
/* FormatRangeFull */
|
|
207970
|
-
]: (
|
|
207971
|
-
return this.requiredResponse(this.getFormattingEditsForRangeFull(
|
|
207970
|
+
]: (request2) => {
|
|
207971
|
+
return this.requiredResponse(this.getFormattingEditsForRangeFull(request2.arguments));
|
|
207972
207972
|
},
|
|
207973
207973
|
[
|
|
207974
207974
|
"completionInfo"
|
|
207975
207975
|
/* CompletionInfo */
|
|
207976
|
-
]: (
|
|
207976
|
+
]: (request2) => {
|
|
207977
207977
|
return this.requiredResponse(this.getCompletions(
|
|
207978
|
-
|
|
207978
|
+
request2.arguments,
|
|
207979
207979
|
"completionInfo"
|
|
207980
207980
|
/* CompletionInfo */
|
|
207981
207981
|
));
|
|
@@ -207983,9 +207983,9 @@ ${json}${newLine}`;
|
|
|
207983
207983
|
[
|
|
207984
207984
|
"completions"
|
|
207985
207985
|
/* Completions */
|
|
207986
|
-
]: (
|
|
207986
|
+
]: (request2) => {
|
|
207987
207987
|
return this.requiredResponse(this.getCompletions(
|
|
207988
|
-
|
|
207988
|
+
request2.arguments,
|
|
207989
207989
|
"completions"
|
|
207990
207990
|
/* Completions */
|
|
207991
207991
|
));
|
|
@@ -207993,9 +207993,9 @@ ${json}${newLine}`;
|
|
|
207993
207993
|
[
|
|
207994
207994
|
"completions-full"
|
|
207995
207995
|
/* CompletionsFull */
|
|
207996
|
-
]: (
|
|
207996
|
+
]: (request2) => {
|
|
207997
207997
|
return this.requiredResponse(this.getCompletions(
|
|
207998
|
-
|
|
207998
|
+
request2.arguments,
|
|
207999
207999
|
"completions-full"
|
|
208000
208000
|
/* CompletionsFull */
|
|
208001
208001
|
));
|
|
@@ -208003,9 +208003,9 @@ ${json}${newLine}`;
|
|
|
208003
208003
|
[
|
|
208004
208004
|
"completionEntryDetails"
|
|
208005
208005
|
/* CompletionDetails */
|
|
208006
|
-
]: (
|
|
208006
|
+
]: (request2) => {
|
|
208007
208007
|
return this.requiredResponse(this.getCompletionEntryDetails(
|
|
208008
|
-
|
|
208008
|
+
request2.arguments,
|
|
208009
208009
|
/*fullResult*/
|
|
208010
208010
|
false
|
|
208011
208011
|
));
|
|
@@ -208013,9 +208013,9 @@ ${json}${newLine}`;
|
|
|
208013
208013
|
[
|
|
208014
208014
|
"completionEntryDetails-full"
|
|
208015
208015
|
/* CompletionDetailsFull */
|
|
208016
|
-
]: (
|
|
208016
|
+
]: (request2) => {
|
|
208017
208017
|
return this.requiredResponse(this.getCompletionEntryDetails(
|
|
208018
|
-
|
|
208018
|
+
request2.arguments,
|
|
208019
208019
|
/*fullResult*/
|
|
208020
208020
|
true
|
|
208021
208021
|
));
|
|
@@ -208023,21 +208023,21 @@ ${json}${newLine}`;
|
|
|
208023
208023
|
[
|
|
208024
208024
|
"compileOnSaveAffectedFileList"
|
|
208025
208025
|
/* CompileOnSaveAffectedFileList */
|
|
208026
|
-
]: (
|
|
208027
|
-
return this.requiredResponse(this.getCompileOnSaveAffectedFileList(
|
|
208026
|
+
]: (request2) => {
|
|
208027
|
+
return this.requiredResponse(this.getCompileOnSaveAffectedFileList(request2.arguments));
|
|
208028
208028
|
},
|
|
208029
208029
|
[
|
|
208030
208030
|
"compileOnSaveEmitFile"
|
|
208031
208031
|
/* CompileOnSaveEmitFile */
|
|
208032
|
-
]: (
|
|
208033
|
-
return this.requiredResponse(this.emitFile(
|
|
208032
|
+
]: (request2) => {
|
|
208033
|
+
return this.requiredResponse(this.emitFile(request2.arguments));
|
|
208034
208034
|
},
|
|
208035
208035
|
[
|
|
208036
208036
|
"signatureHelp"
|
|
208037
208037
|
/* SignatureHelp */
|
|
208038
|
-
]: (
|
|
208038
|
+
]: (request2) => {
|
|
208039
208039
|
return this.requiredResponse(this.getSignatureHelpItems(
|
|
208040
|
-
|
|
208040
|
+
request2.arguments,
|
|
208041
208041
|
/*simplifiedResult*/
|
|
208042
208042
|
true
|
|
208043
208043
|
));
|
|
@@ -208045,9 +208045,9 @@ ${json}${newLine}`;
|
|
|
208045
208045
|
[
|
|
208046
208046
|
"signatureHelp-full"
|
|
208047
208047
|
/* SignatureHelpFull */
|
|
208048
|
-
]: (
|
|
208048
|
+
]: (request2) => {
|
|
208049
208049
|
return this.requiredResponse(this.getSignatureHelpItems(
|
|
208050
|
-
|
|
208050
|
+
request2.arguments,
|
|
208051
208051
|
/*simplifiedResult*/
|
|
208052
208052
|
false
|
|
208053
208053
|
));
|
|
@@ -208055,20 +208055,20 @@ ${json}${newLine}`;
|
|
|
208055
208055
|
[
|
|
208056
208056
|
"compilerOptionsDiagnostics-full"
|
|
208057
208057
|
/* CompilerOptionsDiagnosticsFull */
|
|
208058
|
-
]: (
|
|
208059
|
-
return this.requiredResponse(this.getCompilerOptionsDiagnostics(
|
|
208058
|
+
]: (request2) => {
|
|
208059
|
+
return this.requiredResponse(this.getCompilerOptionsDiagnostics(request2.arguments));
|
|
208060
208060
|
},
|
|
208061
208061
|
[
|
|
208062
208062
|
"encodedSyntacticClassifications-full"
|
|
208063
208063
|
/* EncodedSyntacticClassificationsFull */
|
|
208064
|
-
]: (
|
|
208065
|
-
return this.requiredResponse(this.getEncodedSyntacticClassifications(
|
|
208064
|
+
]: (request2) => {
|
|
208065
|
+
return this.requiredResponse(this.getEncodedSyntacticClassifications(request2.arguments));
|
|
208066
208066
|
},
|
|
208067
208067
|
[
|
|
208068
208068
|
"encodedSemanticClassifications-full"
|
|
208069
208069
|
/* EncodedSemanticClassificationsFull */
|
|
208070
|
-
]: (
|
|
208071
|
-
return this.requiredResponse(this.getEncodedSemanticClassifications(
|
|
208070
|
+
]: (request2) => {
|
|
208071
|
+
return this.requiredResponse(this.getEncodedSemanticClassifications(request2.arguments));
|
|
208072
208072
|
},
|
|
208073
208073
|
[
|
|
208074
208074
|
"cleanup"
|
|
@@ -208083,26 +208083,26 @@ ${json}${newLine}`;
|
|
|
208083
208083
|
[
|
|
208084
208084
|
"semanticDiagnosticsSync"
|
|
208085
208085
|
/* SemanticDiagnosticsSync */
|
|
208086
|
-
]: (
|
|
208087
|
-
return this.requiredResponse(this.getSemanticDiagnosticsSync(
|
|
208086
|
+
]: (request2) => {
|
|
208087
|
+
return this.requiredResponse(this.getSemanticDiagnosticsSync(request2.arguments));
|
|
208088
208088
|
},
|
|
208089
208089
|
[
|
|
208090
208090
|
"syntacticDiagnosticsSync"
|
|
208091
208091
|
/* SyntacticDiagnosticsSync */
|
|
208092
|
-
]: (
|
|
208093
|
-
return this.requiredResponse(this.getSyntacticDiagnosticsSync(
|
|
208092
|
+
]: (request2) => {
|
|
208093
|
+
return this.requiredResponse(this.getSyntacticDiagnosticsSync(request2.arguments));
|
|
208094
208094
|
},
|
|
208095
208095
|
[
|
|
208096
208096
|
"suggestionDiagnosticsSync"
|
|
208097
208097
|
/* SuggestionDiagnosticsSync */
|
|
208098
|
-
]: (
|
|
208099
|
-
return this.requiredResponse(this.getSuggestionDiagnosticsSync(
|
|
208098
|
+
]: (request2) => {
|
|
208099
|
+
return this.requiredResponse(this.getSuggestionDiagnosticsSync(request2.arguments));
|
|
208100
208100
|
},
|
|
208101
208101
|
[
|
|
208102
208102
|
"geterr"
|
|
208103
208103
|
/* Geterr */
|
|
208104
|
-
]: (
|
|
208105
|
-
this.errorCheck.startNew((next) => this.getDiagnostics(next,
|
|
208104
|
+
]: (request2) => {
|
|
208105
|
+
this.errorCheck.startNew((next) => this.getDiagnostics(next, request2.arguments.delay, request2.arguments.files));
|
|
208106
208106
|
return this.notRequired(
|
|
208107
208107
|
/*request*/
|
|
208108
208108
|
void 0
|
|
@@ -208111,8 +208111,8 @@ ${json}${newLine}`;
|
|
|
208111
208111
|
[
|
|
208112
208112
|
"geterrForProject"
|
|
208113
208113
|
/* GeterrForProject */
|
|
208114
|
-
]: (
|
|
208115
|
-
this.errorCheck.startNew((next) => this.getDiagnosticsForProject(next,
|
|
208114
|
+
]: (request2) => {
|
|
208115
|
+
this.errorCheck.startNew((next) => this.getDiagnosticsForProject(next, request2.arguments.delay, request2.arguments.file));
|
|
208116
208116
|
return this.notRequired(
|
|
208117
208117
|
/*request*/
|
|
208118
208118
|
void 0
|
|
@@ -208121,46 +208121,46 @@ ${json}${newLine}`;
|
|
|
208121
208121
|
[
|
|
208122
208122
|
"change"
|
|
208123
208123
|
/* Change */
|
|
208124
|
-
]: (
|
|
208125
|
-
this.change(
|
|
208126
|
-
return this.notRequired(
|
|
208124
|
+
]: (request2) => {
|
|
208125
|
+
this.change(request2.arguments);
|
|
208126
|
+
return this.notRequired(request2);
|
|
208127
208127
|
},
|
|
208128
208128
|
[
|
|
208129
208129
|
"configure"
|
|
208130
208130
|
/* Configure */
|
|
208131
|
-
]: (
|
|
208132
|
-
this.projectService.setHostConfiguration(
|
|
208133
|
-
return this.notRequired(
|
|
208131
|
+
]: (request2) => {
|
|
208132
|
+
this.projectService.setHostConfiguration(request2.arguments);
|
|
208133
|
+
return this.notRequired(request2);
|
|
208134
208134
|
},
|
|
208135
208135
|
[
|
|
208136
208136
|
"reload"
|
|
208137
208137
|
/* Reload */
|
|
208138
|
-
]: (
|
|
208139
|
-
this.reload(
|
|
208138
|
+
]: (request2) => {
|
|
208139
|
+
this.reload(request2.arguments);
|
|
208140
208140
|
return this.requiredResponse({ reloadFinished: true });
|
|
208141
208141
|
},
|
|
208142
208142
|
[
|
|
208143
208143
|
"saveto"
|
|
208144
208144
|
/* Saveto */
|
|
208145
|
-
]: (
|
|
208146
|
-
const savetoArgs =
|
|
208145
|
+
]: (request2) => {
|
|
208146
|
+
const savetoArgs = request2.arguments;
|
|
208147
208147
|
this.saveToTmp(savetoArgs.file, savetoArgs.tmpfile);
|
|
208148
|
-
return this.notRequired(
|
|
208148
|
+
return this.notRequired(request2);
|
|
208149
208149
|
},
|
|
208150
208150
|
[
|
|
208151
208151
|
"close"
|
|
208152
208152
|
/* Close */
|
|
208153
|
-
]: (
|
|
208154
|
-
const closeArgs =
|
|
208153
|
+
]: (request2) => {
|
|
208154
|
+
const closeArgs = request2.arguments;
|
|
208155
208155
|
this.closeClientFile(closeArgs.file);
|
|
208156
|
-
return this.notRequired(
|
|
208156
|
+
return this.notRequired(request2);
|
|
208157
208157
|
},
|
|
208158
208158
|
[
|
|
208159
208159
|
"navto"
|
|
208160
208160
|
/* Navto */
|
|
208161
|
-
]: (
|
|
208161
|
+
]: (request2) => {
|
|
208162
208162
|
return this.requiredResponse(this.getNavigateToItems(
|
|
208163
|
-
|
|
208163
|
+
request2.arguments,
|
|
208164
208164
|
/*simplifiedResult*/
|
|
208165
208165
|
true
|
|
208166
208166
|
));
|
|
@@ -208168,9 +208168,9 @@ ${json}${newLine}`;
|
|
|
208168
208168
|
[
|
|
208169
208169
|
"navto-full"
|
|
208170
208170
|
/* NavtoFull */
|
|
208171
|
-
]: (
|
|
208171
|
+
]: (request2) => {
|
|
208172
208172
|
return this.requiredResponse(this.getNavigateToItems(
|
|
208173
|
-
|
|
208173
|
+
request2.arguments,
|
|
208174
208174
|
/*simplifiedResult*/
|
|
208175
208175
|
false
|
|
208176
208176
|
));
|
|
@@ -208178,9 +208178,9 @@ ${json}${newLine}`;
|
|
|
208178
208178
|
[
|
|
208179
208179
|
"brace"
|
|
208180
208180
|
/* Brace */
|
|
208181
|
-
]: (
|
|
208181
|
+
]: (request2) => {
|
|
208182
208182
|
return this.requiredResponse(this.getBraceMatching(
|
|
208183
|
-
|
|
208183
|
+
request2.arguments,
|
|
208184
208184
|
/*simplifiedResult*/
|
|
208185
208185
|
true
|
|
208186
208186
|
));
|
|
@@ -208188,9 +208188,9 @@ ${json}${newLine}`;
|
|
|
208188
208188
|
[
|
|
208189
208189
|
"brace-full"
|
|
208190
208190
|
/* BraceFull */
|
|
208191
|
-
]: (
|
|
208191
|
+
]: (request2) => {
|
|
208192
208192
|
return this.requiredResponse(this.getBraceMatching(
|
|
208193
|
-
|
|
208193
|
+
request2.arguments,
|
|
208194
208194
|
/*simplifiedResult*/
|
|
208195
208195
|
false
|
|
208196
208196
|
));
|
|
@@ -208198,9 +208198,9 @@ ${json}${newLine}`;
|
|
|
208198
208198
|
[
|
|
208199
208199
|
"navbar"
|
|
208200
208200
|
/* NavBar */
|
|
208201
|
-
]: (
|
|
208201
|
+
]: (request2) => {
|
|
208202
208202
|
return this.requiredResponse(this.getNavigationBarItems(
|
|
208203
|
-
|
|
208203
|
+
request2.arguments,
|
|
208204
208204
|
/*simplifiedResult*/
|
|
208205
208205
|
true
|
|
208206
208206
|
));
|
|
@@ -208208,9 +208208,9 @@ ${json}${newLine}`;
|
|
|
208208
208208
|
[
|
|
208209
208209
|
"navbar-full"
|
|
208210
208210
|
/* NavBarFull */
|
|
208211
|
-
]: (
|
|
208211
|
+
]: (request2) => {
|
|
208212
208212
|
return this.requiredResponse(this.getNavigationBarItems(
|
|
208213
|
-
|
|
208213
|
+
request2.arguments,
|
|
208214
208214
|
/*simplifiedResult*/
|
|
208215
208215
|
false
|
|
208216
208216
|
));
|
|
@@ -208218,9 +208218,9 @@ ${json}${newLine}`;
|
|
|
208218
208218
|
[
|
|
208219
208219
|
"navtree"
|
|
208220
208220
|
/* NavTree */
|
|
208221
|
-
]: (
|
|
208221
|
+
]: (request2) => {
|
|
208222
208222
|
return this.requiredResponse(this.getNavigationTree(
|
|
208223
|
-
|
|
208223
|
+
request2.arguments,
|
|
208224
208224
|
/*simplifiedResult*/
|
|
208225
208225
|
true
|
|
208226
208226
|
));
|
|
@@ -208228,9 +208228,9 @@ ${json}${newLine}`;
|
|
|
208228
208228
|
[
|
|
208229
208229
|
"navtree-full"
|
|
208230
208230
|
/* NavTreeFull */
|
|
208231
|
-
]: (
|
|
208231
|
+
]: (request2) => {
|
|
208232
208232
|
return this.requiredResponse(this.getNavigationTree(
|
|
208233
|
-
|
|
208233
|
+
request2.arguments,
|
|
208234
208234
|
/*simplifiedResult*/
|
|
208235
208235
|
false
|
|
208236
208236
|
));
|
|
@@ -208238,9 +208238,9 @@ ${json}${newLine}`;
|
|
|
208238
208238
|
[
|
|
208239
208239
|
"documentHighlights"
|
|
208240
208240
|
/* DocumentHighlights */
|
|
208241
|
-
]: (
|
|
208241
|
+
]: (request2) => {
|
|
208242
208242
|
return this.requiredResponse(this.getDocumentHighlights(
|
|
208243
|
-
|
|
208243
|
+
request2.arguments,
|
|
208244
208244
|
/*simplifiedResult*/
|
|
208245
208245
|
true
|
|
208246
208246
|
));
|
|
@@ -208248,9 +208248,9 @@ ${json}${newLine}`;
|
|
|
208248
208248
|
[
|
|
208249
208249
|
"documentHighlights-full"
|
|
208250
208250
|
/* DocumentHighlightsFull */
|
|
208251
|
-
]: (
|
|
208251
|
+
]: (request2) => {
|
|
208252
208252
|
return this.requiredResponse(this.getDocumentHighlights(
|
|
208253
|
-
|
|
208253
|
+
request2.arguments,
|
|
208254
208254
|
/*simplifiedResult*/
|
|
208255
208255
|
false
|
|
208256
208256
|
));
|
|
@@ -208258,8 +208258,8 @@ ${json}${newLine}`;
|
|
|
208258
208258
|
[
|
|
208259
208259
|
"compilerOptionsForInferredProjects"
|
|
208260
208260
|
/* CompilerOptionsForInferredProjects */
|
|
208261
|
-
]: (
|
|
208262
|
-
this.setCompilerOptionsForInferredProjects(
|
|
208261
|
+
]: (request2) => {
|
|
208262
|
+
this.setCompilerOptionsForInferredProjects(request2.arguments);
|
|
208263
208263
|
return this.requiredResponse(
|
|
208264
208264
|
/*response*/
|
|
208265
208265
|
true
|
|
@@ -208268,34 +208268,34 @@ ${json}${newLine}`;
|
|
|
208268
208268
|
[
|
|
208269
208269
|
"projectInfo"
|
|
208270
208270
|
/* ProjectInfo */
|
|
208271
|
-
]: (
|
|
208272
|
-
return this.requiredResponse(this.getProjectInfo(
|
|
208271
|
+
]: (request2) => {
|
|
208272
|
+
return this.requiredResponse(this.getProjectInfo(request2.arguments));
|
|
208273
208273
|
},
|
|
208274
208274
|
[
|
|
208275
208275
|
"reloadProjects"
|
|
208276
208276
|
/* ReloadProjects */
|
|
208277
|
-
]: (
|
|
208277
|
+
]: (request2) => {
|
|
208278
208278
|
this.projectService.reloadProjects();
|
|
208279
|
-
return this.notRequired(
|
|
208279
|
+
return this.notRequired(request2);
|
|
208280
208280
|
},
|
|
208281
208281
|
[
|
|
208282
208282
|
"jsxClosingTag"
|
|
208283
208283
|
/* JsxClosingTag */
|
|
208284
|
-
]: (
|
|
208285
|
-
return this.requiredResponse(this.getJsxClosingTag(
|
|
208284
|
+
]: (request2) => {
|
|
208285
|
+
return this.requiredResponse(this.getJsxClosingTag(request2.arguments));
|
|
208286
208286
|
},
|
|
208287
208287
|
[
|
|
208288
208288
|
"linkedEditingRange"
|
|
208289
208289
|
/* LinkedEditingRange */
|
|
208290
|
-
]: (
|
|
208291
|
-
return this.requiredResponse(this.getLinkedEditingRange(
|
|
208290
|
+
]: (request2) => {
|
|
208291
|
+
return this.requiredResponse(this.getLinkedEditingRange(request2.arguments));
|
|
208292
208292
|
},
|
|
208293
208293
|
[
|
|
208294
208294
|
"getCodeFixes"
|
|
208295
208295
|
/* GetCodeFixes */
|
|
208296
|
-
]: (
|
|
208296
|
+
]: (request2) => {
|
|
208297
208297
|
return this.requiredResponse(this.getCodeFixes(
|
|
208298
|
-
|
|
208298
|
+
request2.arguments,
|
|
208299
208299
|
/*simplifiedResult*/
|
|
208300
208300
|
true
|
|
208301
208301
|
));
|
|
@@ -208303,9 +208303,9 @@ ${json}${newLine}`;
|
|
|
208303
208303
|
[
|
|
208304
208304
|
"getCodeFixes-full"
|
|
208305
208305
|
/* GetCodeFixesFull */
|
|
208306
|
-
]: (
|
|
208306
|
+
]: (request2) => {
|
|
208307
208307
|
return this.requiredResponse(this.getCodeFixes(
|
|
208308
|
-
|
|
208308
|
+
request2.arguments,
|
|
208309
208309
|
/*simplifiedResult*/
|
|
208310
208310
|
false
|
|
208311
208311
|
));
|
|
@@ -208313,9 +208313,9 @@ ${json}${newLine}`;
|
|
|
208313
208313
|
[
|
|
208314
208314
|
"getCombinedCodeFix"
|
|
208315
208315
|
/* GetCombinedCodeFix */
|
|
208316
|
-
]: (
|
|
208316
|
+
]: (request2) => {
|
|
208317
208317
|
return this.requiredResponse(this.getCombinedCodeFix(
|
|
208318
|
-
|
|
208318
|
+
request2.arguments,
|
|
208319
208319
|
/*simplifiedResult*/
|
|
208320
208320
|
true
|
|
208321
208321
|
));
|
|
@@ -208323,9 +208323,9 @@ ${json}${newLine}`;
|
|
|
208323
208323
|
[
|
|
208324
208324
|
"getCombinedCodeFix-full"
|
|
208325
208325
|
/* GetCombinedCodeFixFull */
|
|
208326
|
-
]: (
|
|
208326
|
+
]: (request2) => {
|
|
208327
208327
|
return this.requiredResponse(this.getCombinedCodeFix(
|
|
208328
|
-
|
|
208328
|
+
request2.arguments,
|
|
208329
208329
|
/*simplifiedResult*/
|
|
208330
208330
|
false
|
|
208331
208331
|
));
|
|
@@ -208333,27 +208333,27 @@ ${json}${newLine}`;
|
|
|
208333
208333
|
[
|
|
208334
208334
|
"applyCodeActionCommand"
|
|
208335
208335
|
/* ApplyCodeActionCommand */
|
|
208336
|
-
]: (
|
|
208337
|
-
return this.requiredResponse(this.applyCodeActionCommand(
|
|
208336
|
+
]: (request2) => {
|
|
208337
|
+
return this.requiredResponse(this.applyCodeActionCommand(request2.arguments));
|
|
208338
208338
|
},
|
|
208339
208339
|
[
|
|
208340
208340
|
"getSupportedCodeFixes"
|
|
208341
208341
|
/* GetSupportedCodeFixes */
|
|
208342
|
-
]: (
|
|
208343
|
-
return this.requiredResponse(this.getSupportedCodeFixes(
|
|
208342
|
+
]: (request2) => {
|
|
208343
|
+
return this.requiredResponse(this.getSupportedCodeFixes(request2.arguments));
|
|
208344
208344
|
},
|
|
208345
208345
|
[
|
|
208346
208346
|
"getApplicableRefactors"
|
|
208347
208347
|
/* GetApplicableRefactors */
|
|
208348
|
-
]: (
|
|
208349
|
-
return this.requiredResponse(this.getApplicableRefactors(
|
|
208348
|
+
]: (request2) => {
|
|
208349
|
+
return this.requiredResponse(this.getApplicableRefactors(request2.arguments));
|
|
208350
208350
|
},
|
|
208351
208351
|
[
|
|
208352
208352
|
"getEditsForRefactor"
|
|
208353
208353
|
/* GetEditsForRefactor */
|
|
208354
|
-
]: (
|
|
208354
|
+
]: (request2) => {
|
|
208355
208355
|
return this.requiredResponse(this.getEditsForRefactor(
|
|
208356
|
-
|
|
208356
|
+
request2.arguments,
|
|
208357
208357
|
/*simplifiedResult*/
|
|
208358
208358
|
true
|
|
208359
208359
|
));
|
|
@@ -208361,27 +208361,27 @@ ${json}${newLine}`;
|
|
|
208361
208361
|
[
|
|
208362
208362
|
"getMoveToRefactoringFileSuggestions"
|
|
208363
208363
|
/* GetMoveToRefactoringFileSuggestions */
|
|
208364
|
-
]: (
|
|
208365
|
-
return this.requiredResponse(this.getMoveToRefactoringFileSuggestions(
|
|
208364
|
+
]: (request2) => {
|
|
208365
|
+
return this.requiredResponse(this.getMoveToRefactoringFileSuggestions(request2.arguments));
|
|
208366
208366
|
},
|
|
208367
208367
|
[
|
|
208368
208368
|
"preparePasteEdits"
|
|
208369
208369
|
/* PreparePasteEdits */
|
|
208370
|
-
]: (
|
|
208371
|
-
return this.requiredResponse(this.preparePasteEdits(
|
|
208370
|
+
]: (request2) => {
|
|
208371
|
+
return this.requiredResponse(this.preparePasteEdits(request2.arguments));
|
|
208372
208372
|
},
|
|
208373
208373
|
[
|
|
208374
208374
|
"getPasteEdits"
|
|
208375
208375
|
/* GetPasteEdits */
|
|
208376
|
-
]: (
|
|
208377
|
-
return this.requiredResponse(this.getPasteEdits(
|
|
208376
|
+
]: (request2) => {
|
|
208377
|
+
return this.requiredResponse(this.getPasteEdits(request2.arguments));
|
|
208378
208378
|
},
|
|
208379
208379
|
[
|
|
208380
208380
|
"getEditsForRefactor-full"
|
|
208381
208381
|
/* GetEditsForRefactorFull */
|
|
208382
|
-
]: (
|
|
208382
|
+
]: (request2) => {
|
|
208383
208383
|
return this.requiredResponse(this.getEditsForRefactor(
|
|
208384
|
-
|
|
208384
|
+
request2.arguments,
|
|
208385
208385
|
/*simplifiedResult*/
|
|
208386
208386
|
false
|
|
208387
208387
|
));
|
|
@@ -208389,9 +208389,9 @@ ${json}${newLine}`;
|
|
|
208389
208389
|
[
|
|
208390
208390
|
"organizeImports"
|
|
208391
208391
|
/* OrganizeImports */
|
|
208392
|
-
]: (
|
|
208392
|
+
]: (request2) => {
|
|
208393
208393
|
return this.requiredResponse(this.organizeImports(
|
|
208394
|
-
|
|
208394
|
+
request2.arguments,
|
|
208395
208395
|
/*simplifiedResult*/
|
|
208396
208396
|
true
|
|
208397
208397
|
));
|
|
@@ -208399,9 +208399,9 @@ ${json}${newLine}`;
|
|
|
208399
208399
|
[
|
|
208400
208400
|
"organizeImports-full"
|
|
208401
208401
|
/* OrganizeImportsFull */
|
|
208402
|
-
]: (
|
|
208402
|
+
]: (request2) => {
|
|
208403
208403
|
return this.requiredResponse(this.organizeImports(
|
|
208404
|
-
|
|
208404
|
+
request2.arguments,
|
|
208405
208405
|
/*simplifiedResult*/
|
|
208406
208406
|
false
|
|
208407
208407
|
));
|
|
@@ -208409,9 +208409,9 @@ ${json}${newLine}`;
|
|
|
208409
208409
|
[
|
|
208410
208410
|
"getEditsForFileRename"
|
|
208411
208411
|
/* GetEditsForFileRename */
|
|
208412
|
-
]: (
|
|
208412
|
+
]: (request2) => {
|
|
208413
208413
|
return this.requiredResponse(this.getEditsForFileRename(
|
|
208414
|
-
|
|
208414
|
+
request2.arguments,
|
|
208415
208415
|
/*simplifiedResult*/
|
|
208416
208416
|
true
|
|
208417
208417
|
));
|
|
@@ -208419,9 +208419,9 @@ ${json}${newLine}`;
|
|
|
208419
208419
|
[
|
|
208420
208420
|
"getEditsForFileRename-full"
|
|
208421
208421
|
/* GetEditsForFileRenameFull */
|
|
208422
|
-
]: (
|
|
208422
|
+
]: (request2) => {
|
|
208423
208423
|
return this.requiredResponse(this.getEditsForFileRename(
|
|
208424
|
-
|
|
208424
|
+
request2.arguments,
|
|
208425
208425
|
/*simplifiedResult*/
|
|
208426
208426
|
false
|
|
208427
208427
|
));
|
|
@@ -208429,16 +208429,16 @@ ${json}${newLine}`;
|
|
|
208429
208429
|
[
|
|
208430
208430
|
"configurePlugin"
|
|
208431
208431
|
/* ConfigurePlugin */
|
|
208432
|
-
]: (
|
|
208433
|
-
this.configurePlugin(
|
|
208434
|
-
return this.notRequired(
|
|
208432
|
+
]: (request2) => {
|
|
208433
|
+
this.configurePlugin(request2.arguments);
|
|
208434
|
+
return this.notRequired(request2);
|
|
208435
208435
|
},
|
|
208436
208436
|
[
|
|
208437
208437
|
"selectionRange"
|
|
208438
208438
|
/* SelectionRange */
|
|
208439
|
-
]: (
|
|
208439
|
+
]: (request2) => {
|
|
208440
208440
|
return this.requiredResponse(this.getSmartSelectionRange(
|
|
208441
|
-
|
|
208441
|
+
request2.arguments,
|
|
208442
208442
|
/*simplifiedResult*/
|
|
208443
208443
|
true
|
|
208444
208444
|
));
|
|
@@ -208446,9 +208446,9 @@ ${json}${newLine}`;
|
|
|
208446
208446
|
[
|
|
208447
208447
|
"selectionRange-full"
|
|
208448
208448
|
/* SelectionRangeFull */
|
|
208449
|
-
]: (
|
|
208449
|
+
]: (request2) => {
|
|
208450
208450
|
return this.requiredResponse(this.getSmartSelectionRange(
|
|
208451
|
-
|
|
208451
|
+
request2.arguments,
|
|
208452
208452
|
/*simplifiedResult*/
|
|
208453
208453
|
false
|
|
208454
208454
|
));
|
|
@@ -208456,27 +208456,27 @@ ${json}${newLine}`;
|
|
|
208456
208456
|
[
|
|
208457
208457
|
"prepareCallHierarchy"
|
|
208458
208458
|
/* PrepareCallHierarchy */
|
|
208459
|
-
]: (
|
|
208460
|
-
return this.requiredResponse(this.prepareCallHierarchy(
|
|
208459
|
+
]: (request2) => {
|
|
208460
|
+
return this.requiredResponse(this.prepareCallHierarchy(request2.arguments));
|
|
208461
208461
|
},
|
|
208462
208462
|
[
|
|
208463
208463
|
"provideCallHierarchyIncomingCalls"
|
|
208464
208464
|
/* ProvideCallHierarchyIncomingCalls */
|
|
208465
|
-
]: (
|
|
208466
|
-
return this.requiredResponse(this.provideCallHierarchyIncomingCalls(
|
|
208465
|
+
]: (request2) => {
|
|
208466
|
+
return this.requiredResponse(this.provideCallHierarchyIncomingCalls(request2.arguments));
|
|
208467
208467
|
},
|
|
208468
208468
|
[
|
|
208469
208469
|
"provideCallHierarchyOutgoingCalls"
|
|
208470
208470
|
/* ProvideCallHierarchyOutgoingCalls */
|
|
208471
|
-
]: (
|
|
208472
|
-
return this.requiredResponse(this.provideCallHierarchyOutgoingCalls(
|
|
208471
|
+
]: (request2) => {
|
|
208472
|
+
return this.requiredResponse(this.provideCallHierarchyOutgoingCalls(request2.arguments));
|
|
208473
208473
|
},
|
|
208474
208474
|
[
|
|
208475
208475
|
"toggleLineComment"
|
|
208476
208476
|
/* ToggleLineComment */
|
|
208477
|
-
]: (
|
|
208477
|
+
]: (request2) => {
|
|
208478
208478
|
return this.requiredResponse(this.toggleLineComment(
|
|
208479
|
-
|
|
208479
|
+
request2.arguments,
|
|
208480
208480
|
/*simplifiedResult*/
|
|
208481
208481
|
true
|
|
208482
208482
|
));
|
|
@@ -208484,9 +208484,9 @@ ${json}${newLine}`;
|
|
|
208484
208484
|
[
|
|
208485
208485
|
"toggleLineComment-full"
|
|
208486
208486
|
/* ToggleLineCommentFull */
|
|
208487
|
-
]: (
|
|
208487
|
+
]: (request2) => {
|
|
208488
208488
|
return this.requiredResponse(this.toggleLineComment(
|
|
208489
|
-
|
|
208489
|
+
request2.arguments,
|
|
208490
208490
|
/*simplifiedResult*/
|
|
208491
208491
|
false
|
|
208492
208492
|
));
|
|
@@ -208494,9 +208494,9 @@ ${json}${newLine}`;
|
|
|
208494
208494
|
[
|
|
208495
208495
|
"toggleMultilineComment"
|
|
208496
208496
|
/* ToggleMultilineComment */
|
|
208497
|
-
]: (
|
|
208497
|
+
]: (request2) => {
|
|
208498
208498
|
return this.requiredResponse(this.toggleMultilineComment(
|
|
208499
|
-
|
|
208499
|
+
request2.arguments,
|
|
208500
208500
|
/*simplifiedResult*/
|
|
208501
208501
|
true
|
|
208502
208502
|
));
|
|
@@ -208504,9 +208504,9 @@ ${json}${newLine}`;
|
|
|
208504
208504
|
[
|
|
208505
208505
|
"toggleMultilineComment-full"
|
|
208506
208506
|
/* ToggleMultilineCommentFull */
|
|
208507
|
-
]: (
|
|
208507
|
+
]: (request2) => {
|
|
208508
208508
|
return this.requiredResponse(this.toggleMultilineComment(
|
|
208509
|
-
|
|
208509
|
+
request2.arguments,
|
|
208510
208510
|
/*simplifiedResult*/
|
|
208511
208511
|
false
|
|
208512
208512
|
));
|
|
@@ -208514,9 +208514,9 @@ ${json}${newLine}`;
|
|
|
208514
208514
|
[
|
|
208515
208515
|
"commentSelection"
|
|
208516
208516
|
/* CommentSelection */
|
|
208517
|
-
]: (
|
|
208517
|
+
]: (request2) => {
|
|
208518
208518
|
return this.requiredResponse(this.commentSelection(
|
|
208519
|
-
|
|
208519
|
+
request2.arguments,
|
|
208520
208520
|
/*simplifiedResult*/
|
|
208521
208521
|
true
|
|
208522
208522
|
));
|
|
@@ -208524,9 +208524,9 @@ ${json}${newLine}`;
|
|
|
208524
208524
|
[
|
|
208525
208525
|
"commentSelection-full"
|
|
208526
208526
|
/* CommentSelectionFull */
|
|
208527
|
-
]: (
|
|
208527
|
+
]: (request2) => {
|
|
208528
208528
|
return this.requiredResponse(this.commentSelection(
|
|
208529
|
-
|
|
208529
|
+
request2.arguments,
|
|
208530
208530
|
/*simplifiedResult*/
|
|
208531
208531
|
false
|
|
208532
208532
|
));
|
|
@@ -208534,9 +208534,9 @@ ${json}${newLine}`;
|
|
|
208534
208534
|
[
|
|
208535
208535
|
"uncommentSelection"
|
|
208536
208536
|
/* UncommentSelection */
|
|
208537
|
-
]: (
|
|
208537
|
+
]: (request2) => {
|
|
208538
208538
|
return this.requiredResponse(this.uncommentSelection(
|
|
208539
|
-
|
|
208539
|
+
request2.arguments,
|
|
208540
208540
|
/*simplifiedResult*/
|
|
208541
208541
|
true
|
|
208542
208542
|
));
|
|
@@ -208544,9 +208544,9 @@ ${json}${newLine}`;
|
|
|
208544
208544
|
[
|
|
208545
208545
|
"uncommentSelection-full"
|
|
208546
208546
|
/* UncommentSelectionFull */
|
|
208547
|
-
]: (
|
|
208547
|
+
]: (request2) => {
|
|
208548
208548
|
return this.requiredResponse(this.uncommentSelection(
|
|
208549
|
-
|
|
208549
|
+
request2.arguments,
|
|
208550
208550
|
/*simplifiedResult*/
|
|
208551
208551
|
false
|
|
208552
208552
|
));
|
|
@@ -208554,14 +208554,14 @@ ${json}${newLine}`;
|
|
|
208554
208554
|
[
|
|
208555
208555
|
"provideInlayHints"
|
|
208556
208556
|
/* ProvideInlayHints */
|
|
208557
|
-
]: (
|
|
208558
|
-
return this.requiredResponse(this.provideInlayHints(
|
|
208557
|
+
]: (request2) => {
|
|
208558
|
+
return this.requiredResponse(this.provideInlayHints(request2.arguments));
|
|
208559
208559
|
},
|
|
208560
208560
|
[
|
|
208561
208561
|
"mapCode"
|
|
208562
208562
|
/* MapCode */
|
|
208563
|
-
]: (
|
|
208564
|
-
return this.requiredResponse(this.mapCode(
|
|
208563
|
+
]: (request2) => {
|
|
208564
|
+
return this.requiredResponse(this.mapCode(request2.arguments));
|
|
208565
208565
|
},
|
|
208566
208566
|
[
|
|
208567
208567
|
"copilotRelated"
|
|
@@ -208623,15 +208623,15 @@ ${json}${newLine}`;
|
|
|
208623
208623
|
break;
|
|
208624
208624
|
case 1:
|
|
208625
208625
|
invalidPartialSemanticModeCommands.forEach(
|
|
208626
|
-
(commandName) => this.handlers.set(commandName, (
|
|
208627
|
-
throw new Error(`Request: ${
|
|
208626
|
+
(commandName) => this.handlers.set(commandName, (request2) => {
|
|
208627
|
+
throw new Error(`Request: ${request2.command} not allowed in LanguageServiceMode.PartialSemantic`);
|
|
208628
208628
|
})
|
|
208629
208629
|
);
|
|
208630
208630
|
break;
|
|
208631
208631
|
case 2:
|
|
208632
208632
|
invalidSyntacticModeCommands.forEach(
|
|
208633
|
-
(commandName) => this.handlers.set(commandName, (
|
|
208634
|
-
throw new Error(`Request: ${
|
|
208633
|
+
(commandName) => this.handlers.set(commandName, (request2) => {
|
|
208634
|
+
throw new Error(`Request: ${request2.command} not allowed in LanguageServiceMode.Syntactic`);
|
|
208635
208635
|
})
|
|
208636
208636
|
);
|
|
208637
208637
|
break;
|
|
@@ -208991,12 +208991,12 @@ Project '${project.projectName}' (${ProjectKind[project.projectKind]}) ${counter
|
|
|
208991
208991
|
next.delay("checkOne", ms, checkOne);
|
|
208992
208992
|
}
|
|
208993
208993
|
}
|
|
208994
|
-
cleanProjects(caption,
|
|
208995
|
-
if (!
|
|
208994
|
+
cleanProjects(caption, projects2) {
|
|
208995
|
+
if (!projects2) {
|
|
208996
208996
|
return;
|
|
208997
208997
|
}
|
|
208998
208998
|
this.logger.info(`cleaning ${caption}`);
|
|
208999
|
-
for (const p2 of
|
|
208999
|
+
for (const p2 of projects2) {
|
|
209000
209000
|
p2.getLanguageService(
|
|
209001
209001
|
/*ensureSynchronized*/
|
|
209002
209002
|
false
|
|
@@ -209600,12 +209600,12 @@ Project '${project.projectName}' (${ProjectKind[project.projectKind]}) ${counter
|
|
|
209600
209600
|
return project.getLanguageService().getRenameInfo(file, position, preferences);
|
|
209601
209601
|
}
|
|
209602
209602
|
getProjects(args, getScriptInfoEnsuringProjectsUptoDate, ignoreNoProjectError) {
|
|
209603
|
-
let
|
|
209603
|
+
let projects2;
|
|
209604
209604
|
let symLinkedProjects;
|
|
209605
209605
|
if (args.projectFileName) {
|
|
209606
209606
|
const project = this.getProject(args.projectFileName);
|
|
209607
209607
|
if (project) {
|
|
209608
|
-
|
|
209608
|
+
projects2 = [project];
|
|
209609
209609
|
}
|
|
209610
209610
|
} else {
|
|
209611
209611
|
const scriptInfo = getScriptInfoEnsuringProjectsUptoDate ? this.projectService.getScriptInfoEnsuringProjectsUptoDate(args.file) : this.projectService.getScriptInfo(args.file);
|
|
@@ -209616,15 +209616,15 @@ Project '${project.projectName}' (${ProjectKind[project.projectKind]}) ${counter
|
|
|
209616
209616
|
} else if (!getScriptInfoEnsuringProjectsUptoDate) {
|
|
209617
209617
|
this.projectService.ensureDefaultProjectForFile(scriptInfo);
|
|
209618
209618
|
}
|
|
209619
|
-
|
|
209619
|
+
projects2 = scriptInfo.containingProjects;
|
|
209620
209620
|
symLinkedProjects = this.projectService.getSymlinkedProjects(scriptInfo);
|
|
209621
209621
|
}
|
|
209622
|
-
|
|
209623
|
-
if (!ignoreNoProjectError && (!
|
|
209622
|
+
projects2 = filter(projects2, (p2) => p2.languageServiceEnabled && !p2.isOrphan());
|
|
209623
|
+
if (!ignoreNoProjectError && (!projects2 || !projects2.length) && !symLinkedProjects) {
|
|
209624
209624
|
this.projectService.logErrorForScriptInfoNotFound(args.file ?? args.projectFileName);
|
|
209625
209625
|
return Errors2.ThrowNoProject();
|
|
209626
209626
|
}
|
|
209627
|
-
return symLinkedProjects ? { projects, symLinkedProjects } :
|
|
209627
|
+
return symLinkedProjects ? { projects: projects2, symLinkedProjects } : projects2;
|
|
209628
209628
|
}
|
|
209629
209629
|
getDefaultProject(args) {
|
|
209630
209630
|
if (args.projectFileName) {
|
|
@@ -209642,7 +209642,7 @@ Project '${project.projectName}' (${ProjectKind[project.projectKind]}) ${counter
|
|
|
209642
209642
|
getRenameLocations(args, simplifiedResult) {
|
|
209643
209643
|
const file = toNormalizedPath(args.file);
|
|
209644
209644
|
const position = this.getPositionInFile(args, file);
|
|
209645
|
-
const
|
|
209645
|
+
const projects2 = this.getProjects(args);
|
|
209646
209646
|
const defaultProject = this.getDefaultProject(args);
|
|
209647
209647
|
const preferences = this.getPreferences(file);
|
|
209648
209648
|
const renameInfo = this.mapRenameInfo(
|
|
@@ -209651,7 +209651,7 @@ Project '${project.projectName}' (${ProjectKind[project.projectKind]}) ${counter
|
|
|
209651
209651
|
);
|
|
209652
209652
|
if (!renameInfo.canRename) return simplifiedResult ? { info: renameInfo, locs: [] } : [];
|
|
209653
209653
|
const locations = getRenameLocationsWorker(
|
|
209654
|
-
|
|
209654
|
+
projects2,
|
|
209655
209655
|
defaultProject,
|
|
209656
209656
|
{ fileName: args.file, pos: position },
|
|
209657
209657
|
!!args.findInStrings,
|
|
@@ -209684,10 +209684,10 @@ Project '${project.projectName}' (${ProjectKind[project.projectKind]}) ${counter
|
|
|
209684
209684
|
}
|
|
209685
209685
|
getReferences(args, simplifiedResult) {
|
|
209686
209686
|
const file = toNormalizedPath(args.file);
|
|
209687
|
-
const
|
|
209687
|
+
const projects2 = this.getProjects(args);
|
|
209688
209688
|
const position = this.getPositionInFile(args, file);
|
|
209689
209689
|
const references = getReferencesWorker(
|
|
209690
|
-
|
|
209690
|
+
projects2,
|
|
209691
209691
|
this.getDefaultProject(args),
|
|
209692
209692
|
{ fileName: args.file, pos: position },
|
|
209693
209693
|
this.host.useCaseSensitiveFileNames,
|
|
@@ -209708,12 +209708,12 @@ Project '${project.projectName}' (${ProjectKind[project.projectKind]}) ${counter
|
|
|
209708
209708
|
return { refs, symbolName: symbolName2, symbolStartOffset, symbolDisplayString };
|
|
209709
209709
|
}
|
|
209710
209710
|
getFileReferences(args, simplifiedResult) {
|
|
209711
|
-
const
|
|
209711
|
+
const projects2 = this.getProjects(args);
|
|
209712
209712
|
const fileName = toNormalizedPath(args.file);
|
|
209713
209713
|
const preferences = this.getPreferences(fileName);
|
|
209714
209714
|
const initialLocation = { fileName, pos: 0 };
|
|
209715
209715
|
const perProjectResults = getPerProjectReferences(
|
|
209716
|
-
|
|
209716
|
+
projects2,
|
|
209717
209717
|
this.getDefaultProject(args),
|
|
209718
209718
|
initialLocation,
|
|
209719
209719
|
initialLocation,
|
|
@@ -209999,7 +209999,7 @@ Project '${project.projectName}' (${ProjectKind[project.projectKind]}) ${counter
|
|
|
209999
209999
|
}));
|
|
210000
210000
|
}
|
|
210001
210001
|
getCompileOnSaveAffectedFileList(args) {
|
|
210002
|
-
const
|
|
210002
|
+
const projects2 = this.getProjects(
|
|
210003
210003
|
args,
|
|
210004
210004
|
/*getScriptInfoEnsuringProjectsUptoDate*/
|
|
210005
210005
|
true,
|
|
@@ -210013,7 +210013,7 @@ Project '${project.projectName}' (${ProjectKind[project.projectKind]}) ${counter
|
|
|
210013
210013
|
return combineProjectOutput(
|
|
210014
210014
|
info,
|
|
210015
210015
|
(path) => this.projectService.getScriptInfoForPath(path),
|
|
210016
|
-
|
|
210016
|
+
projects2,
|
|
210017
210017
|
(project, info2) => {
|
|
210018
210018
|
if (!project.compileOnSaveEnabled || !project.languageServiceEnabled || project.isOrphan()) {
|
|
210019
210019
|
return void 0;
|
|
@@ -210205,9 +210205,9 @@ Project '${project.projectName}' (${ProjectKind[project.projectKind]}) ${counter
|
|
|
210205
210205
|
this.projectService.loadAncestorProjectTree();
|
|
210206
210206
|
this.projectService.forEachEnabledProject((project) => addItemsForProject(project));
|
|
210207
210207
|
} else {
|
|
210208
|
-
const
|
|
210208
|
+
const projects2 = this.getProjects(args);
|
|
210209
210209
|
forEachProjectInProjects(
|
|
210210
|
-
|
|
210210
|
+
projects2,
|
|
210211
210211
|
/*path*/
|
|
210212
210212
|
void 0,
|
|
210213
210213
|
(project) => addItemsForProject(project)
|
|
@@ -210667,12 +210667,12 @@ Additional information: BADCLIENT: Bad error code, ${badCode} not found in range
|
|
|
210667
210667
|
}
|
|
210668
210668
|
exit() {
|
|
210669
210669
|
}
|
|
210670
|
-
notRequired(
|
|
210671
|
-
if (
|
|
210670
|
+
notRequired(request2) {
|
|
210671
|
+
if (request2) this.doOutput(
|
|
210672
210672
|
/*info*/
|
|
210673
210673
|
void 0,
|
|
210674
|
-
|
|
210675
|
-
|
|
210674
|
+
request2.command,
|
|
210675
|
+
request2.seq,
|
|
210676
210676
|
/*success*/
|
|
210677
210677
|
true,
|
|
210678
210678
|
this.performanceData
|
|
@@ -210710,12 +210710,12 @@ Additional information: BADCLIENT: Bad error code, ${badCode} not found in range
|
|
|
210710
210710
|
this.performanceData = currentPerformanceData;
|
|
210711
210711
|
}
|
|
210712
210712
|
}
|
|
210713
|
-
executeCommand(
|
|
210714
|
-
const handler = this.handlers.get(
|
|
210713
|
+
executeCommand(request2) {
|
|
210714
|
+
const handler = this.handlers.get(request2.command);
|
|
210715
210715
|
if (handler) {
|
|
210716
210716
|
const response = this.executeWithRequestId(
|
|
210717
|
-
|
|
210718
|
-
() => handler(
|
|
210717
|
+
request2.seq,
|
|
210718
|
+
() => handler(request2),
|
|
210719
210719
|
/*perfomanceData*/
|
|
210720
210720
|
void 0
|
|
210721
210721
|
);
|
|
@@ -210723,7 +210723,7 @@ Additional information: BADCLIENT: Bad error code, ${badCode} not found in range
|
|
|
210723
210723
|
return response;
|
|
210724
210724
|
} else {
|
|
210725
210725
|
this.logger.msg(
|
|
210726
|
-
`Unrecognized JSON command:${stringifyIndented(
|
|
210726
|
+
`Unrecognized JSON command:${stringifyIndented(request2)}`,
|
|
210727
210727
|
"Err"
|
|
210728
210728
|
/* Err */
|
|
210729
210729
|
);
|
|
@@ -210731,12 +210731,12 @@ Additional information: BADCLIENT: Bad error code, ${badCode} not found in range
|
|
|
210731
210731
|
/*info*/
|
|
210732
210732
|
void 0,
|
|
210733
210733
|
"unknown",
|
|
210734
|
-
|
|
210734
|
+
request2.seq,
|
|
210735
210735
|
/*success*/
|
|
210736
210736
|
false,
|
|
210737
210737
|
/*performanceData*/
|
|
210738
210738
|
void 0,
|
|
210739
|
-
`Unrecognized JSON command: ${
|
|
210739
|
+
`Unrecognized JSON command: ${request2.command}`
|
|
210740
210740
|
);
|
|
210741
210741
|
return { responseRequired: false };
|
|
210742
210742
|
}
|
|
@@ -210758,20 +210758,20 @@ Additional information: BADCLIENT: Bad error code, ${badCode} not found in range
|
|
|
210758
210758
|
this.logger.info(`request:${indent2(this.toStringMessage(message))}`);
|
|
210759
210759
|
}
|
|
210760
210760
|
}
|
|
210761
|
-
let
|
|
210761
|
+
let request2;
|
|
210762
210762
|
let relevantFile;
|
|
210763
210763
|
try {
|
|
210764
|
-
|
|
210765
|
-
relevantFile =
|
|
210766
|
-
(_a = tracing) == null ? void 0 : _a.instant(tracing.Phase.Session, "request", { seq:
|
|
210764
|
+
request2 = this.parseMessage(message);
|
|
210765
|
+
relevantFile = request2.arguments && request2.arguments.file ? request2.arguments : void 0;
|
|
210766
|
+
(_a = tracing) == null ? void 0 : _a.instant(tracing.Phase.Session, "request", { seq: request2.seq, command: request2.command });
|
|
210767
210767
|
(_b = tracing) == null ? void 0 : _b.push(
|
|
210768
210768
|
tracing.Phase.Session,
|
|
210769
210769
|
"executeCommand",
|
|
210770
|
-
{ seq:
|
|
210770
|
+
{ seq: request2.seq, command: request2.command },
|
|
210771
210771
|
/*separateBeginAndEnd*/
|
|
210772
210772
|
true
|
|
210773
210773
|
);
|
|
210774
|
-
const { response, responseRequired, performanceData } = this.executeCommand(
|
|
210774
|
+
const { response, responseRequired, performanceData } = this.executeCommand(request2);
|
|
210775
210775
|
(_c = tracing) == null ? void 0 : _c.pop();
|
|
210776
210776
|
if (this.logger.hasLevel(
|
|
210777
210777
|
2
|
|
@@ -210779,17 +210779,17 @@ Additional information: BADCLIENT: Bad error code, ${badCode} not found in range
|
|
|
210779
210779
|
)) {
|
|
210780
210780
|
const elapsedTime = hrTimeToMilliseconds(this.hrtime(start)).toFixed(4);
|
|
210781
210781
|
if (responseRequired) {
|
|
210782
|
-
this.logger.perftrc(`${
|
|
210782
|
+
this.logger.perftrc(`${request2.seq}::${request2.command}: elapsed time (in milliseconds) ${elapsedTime}`);
|
|
210783
210783
|
} else {
|
|
210784
|
-
this.logger.perftrc(`${
|
|
210784
|
+
this.logger.perftrc(`${request2.seq}::${request2.command}: async elapsed time (in milliseconds) ${elapsedTime}`);
|
|
210785
210785
|
}
|
|
210786
210786
|
}
|
|
210787
|
-
(_d = tracing) == null ? void 0 : _d.instant(tracing.Phase.Session, "response", { seq:
|
|
210787
|
+
(_d = tracing) == null ? void 0 : _d.instant(tracing.Phase.Session, "response", { seq: request2.seq, command: request2.command, success: !!response });
|
|
210788
210788
|
if (response) {
|
|
210789
210789
|
this.doOutput(
|
|
210790
210790
|
response,
|
|
210791
|
-
|
|
210792
|
-
|
|
210791
|
+
request2.command,
|
|
210792
|
+
request2.seq,
|
|
210793
210793
|
/*success*/
|
|
210794
210794
|
true,
|
|
210795
210795
|
performanceData
|
|
@@ -210798,8 +210798,8 @@ Additional information: BADCLIENT: Bad error code, ${badCode} not found in range
|
|
|
210798
210798
|
this.doOutput(
|
|
210799
210799
|
/*info*/
|
|
210800
210800
|
void 0,
|
|
210801
|
-
|
|
210802
|
-
|
|
210801
|
+
request2.command,
|
|
210802
|
+
request2.seq,
|
|
210803
210803
|
/*success*/
|
|
210804
210804
|
false,
|
|
210805
210805
|
performanceData,
|
|
@@ -210809,11 +210809,11 @@ Additional information: BADCLIENT: Bad error code, ${badCode} not found in range
|
|
|
210809
210809
|
} catch (err) {
|
|
210810
210810
|
(_e = tracing) == null ? void 0 : _e.popAll();
|
|
210811
210811
|
if (err instanceof OperationCanceledException) {
|
|
210812
|
-
(_f = tracing) == null ? void 0 : _f.instant(tracing.Phase.Session, "commandCanceled", { seq:
|
|
210812
|
+
(_f = tracing) == null ? void 0 : _f.instant(tracing.Phase.Session, "commandCanceled", { seq: request2 == null ? void 0 : request2.seq, command: request2 == null ? void 0 : request2.command });
|
|
210813
210813
|
this.doOutput(
|
|
210814
210814
|
{ canceled: true },
|
|
210815
|
-
|
|
210816
|
-
|
|
210815
|
+
request2.command,
|
|
210816
|
+
request2.seq,
|
|
210817
210817
|
/*success*/
|
|
210818
210818
|
true,
|
|
210819
210819
|
this.performanceData
|
|
@@ -210821,12 +210821,12 @@ Additional information: BADCLIENT: Bad error code, ${badCode} not found in range
|
|
|
210821
210821
|
return;
|
|
210822
210822
|
}
|
|
210823
210823
|
this.logErrorWorker(err, this.toStringMessage(message), relevantFile);
|
|
210824
|
-
(_g = tracing) == null ? void 0 : _g.instant(tracing.Phase.Session, "commandError", { seq:
|
|
210824
|
+
(_g = tracing) == null ? void 0 : _g.instant(tracing.Phase.Session, "commandError", { seq: request2 == null ? void 0 : request2.seq, command: request2 == null ? void 0 : request2.command, message: err.message });
|
|
210825
210825
|
this.doOutput(
|
|
210826
210826
|
/*info*/
|
|
210827
210827
|
void 0,
|
|
210828
|
-
|
|
210829
|
-
|
|
210828
|
+
request2 ? request2.command : "unknown",
|
|
210829
|
+
request2 ? request2.seq : 0,
|
|
210830
210830
|
/*success*/
|
|
210831
210831
|
false,
|
|
210832
210832
|
this.performanceData,
|
|
@@ -211694,11 +211694,11 @@ Additional information: BADCLIENT: Bad error code, ${badCode} not found in range
|
|
|
211694
211694
|
}
|
|
211695
211695
|
installPackage(options) {
|
|
211696
211696
|
this.packageInstallId++;
|
|
211697
|
-
const
|
|
211697
|
+
const request2 = { kind: "installPackage", ...options, id: this.packageInstallId };
|
|
211698
211698
|
const promise = new Promise((resolve6, reject) => {
|
|
211699
211699
|
(this.packageInstalledPromise ?? (this.packageInstalledPromise = /* @__PURE__ */ new Map())).set(this.packageInstallId, { resolve: resolve6, reject });
|
|
211700
211700
|
});
|
|
211701
|
-
this.installer.send(
|
|
211701
|
+
this.installer.send(request2);
|
|
211702
211702
|
return promise;
|
|
211703
211703
|
}
|
|
211704
211704
|
attach(projectService) {
|
|
@@ -211709,24 +211709,24 @@ Additional information: BADCLIENT: Bad error code, ${badCode} not found in range
|
|
|
211709
211709
|
this.installer.send({ projectName: p2.getProjectName(), kind: "closeProject" });
|
|
211710
211710
|
}
|
|
211711
211711
|
enqueueInstallTypingsRequest(project, typeAcquisition, unresolvedImports) {
|
|
211712
|
-
const
|
|
211712
|
+
const request2 = createInstallTypingsRequest(project, typeAcquisition, unresolvedImports);
|
|
211713
211713
|
if (this.logger.hasLevel(
|
|
211714
211714
|
3
|
|
211715
211715
|
/* verbose */
|
|
211716
211716
|
)) {
|
|
211717
|
-
this.logger.info(`TIAdapter:: Scheduling throttled operation:${stringifyIndented(
|
|
211717
|
+
this.logger.info(`TIAdapter:: Scheduling throttled operation:${stringifyIndented(request2)}`);
|
|
211718
211718
|
}
|
|
211719
211719
|
if (this.activeRequestCount < this.maxActiveRequestCount) {
|
|
211720
|
-
this.scheduleRequest(
|
|
211720
|
+
this.scheduleRequest(request2);
|
|
211721
211721
|
} else {
|
|
211722
211722
|
if (this.logger.hasLevel(
|
|
211723
211723
|
3
|
|
211724
211724
|
/* verbose */
|
|
211725
211725
|
)) {
|
|
211726
|
-
this.logger.info(`TIAdapter:: Deferring request for: ${
|
|
211726
|
+
this.logger.info(`TIAdapter:: Deferring request for: ${request2.projectName}`);
|
|
211727
211727
|
}
|
|
211728
|
-
this.requestQueue.enqueue(
|
|
211729
|
-
this.requestMap.set(
|
|
211728
|
+
this.requestQueue.enqueue(request2);
|
|
211729
|
+
this.requestMap.set(request2.projectName, request2);
|
|
211730
211730
|
}
|
|
211731
211731
|
}
|
|
211732
211732
|
handleMessage(response) {
|
|
@@ -211828,12 +211828,12 @@ Additional information: BADCLIENT: Bad error code, ${badCode} not found in range
|
|
|
211828
211828
|
assertType(response);
|
|
211829
211829
|
}
|
|
211830
211830
|
}
|
|
211831
|
-
scheduleRequest(
|
|
211831
|
+
scheduleRequest(request2) {
|
|
211832
211832
|
if (this.logger.hasLevel(
|
|
211833
211833
|
3
|
|
211834
211834
|
/* verbose */
|
|
211835
211835
|
)) {
|
|
211836
|
-
this.logger.info(`TIAdapter:: Scheduling request for: ${
|
|
211836
|
+
this.logger.info(`TIAdapter:: Scheduling request for: ${request2.projectName}`);
|
|
211837
211837
|
}
|
|
211838
211838
|
this.activeRequestCount++;
|
|
211839
211839
|
this.host.setTimeout(
|
|
@@ -211842,12 +211842,12 @@ Additional information: BADCLIENT: Bad error code, ${badCode} not found in range
|
|
|
211842
211842
|
3
|
|
211843
211843
|
/* verbose */
|
|
211844
211844
|
)) {
|
|
211845
|
-
this.logger.info(`TIAdapter:: Sending request:${stringifyIndented(
|
|
211845
|
+
this.logger.info(`TIAdapter:: Sending request:${stringifyIndented(request2)}`);
|
|
211846
211846
|
}
|
|
211847
|
-
this.installer.send(
|
|
211847
|
+
this.installer.send(request2);
|
|
211848
211848
|
},
|
|
211849
211849
|
_TypingsInstallerAdapter2.requestDelayMillis,
|
|
211850
|
-
`${
|
|
211850
|
+
`${request2.projectName}::${request2.kind}`
|
|
211851
211851
|
);
|
|
211852
211852
|
}
|
|
211853
211853
|
};
|
|
@@ -276700,7 +276700,7 @@ var Y2 = ({ indicator: t = "dots" } = {}) => {
|
|
|
276700
276700
|
};
|
|
276701
276701
|
|
|
276702
276702
|
// src/cli/index.ts
|
|
276703
|
-
var
|
|
276703
|
+
var import_picocolors18 = __toESM(require_picocolors(), 1);
|
|
276704
276704
|
var import_fs12 = require("fs");
|
|
276705
276705
|
var import_path7 = require("path");
|
|
276706
276706
|
var import_child_process2 = require("child_process");
|
|
@@ -276950,6 +276950,8 @@ var ERROR_CODES = {
|
|
|
276950
276950
|
invalid_json: wire("validation", 400, false, "The request body was not valid JSON."),
|
|
276951
276951
|
capability_id_required: wire("validation", 400, false, "A capability id is required for this request."),
|
|
276952
276952
|
organization_mismatch: wire("permission", 403, false, "The request targeted an organization the caller is not scoped to."),
|
|
276953
|
+
project_scope_denied: wire("permission", 403, false, "The request targeted a project the caller's key is not scoped to."),
|
|
276954
|
+
project_slug_taken: wire("validation", 409, false, "A project with this slug already exists in the organization."),
|
|
276953
276955
|
forbidden: wire("permission", 403, false, "The caller lacks permission for this operation."),
|
|
276954
276956
|
source_api_key_unresolved: wire("auth", 401, false, "The source API key could not be resolved."),
|
|
276955
276957
|
capability_auth_disabled: wire("server", 503, false, "Capability authentication is disabled on this server."),
|
|
@@ -279443,6 +279445,13 @@ function readJson(path) {
|
|
|
279443
279445
|
return null;
|
|
279444
279446
|
}
|
|
279445
279447
|
}
|
|
279448
|
+
function asActiveProject(value) {
|
|
279449
|
+
if (value && typeof value === "object" && typeof value.id === "string" && typeof value.slug === "string") {
|
|
279450
|
+
const v = value;
|
|
279451
|
+
return { id: v.id, slug: v.slug };
|
|
279452
|
+
}
|
|
279453
|
+
return void 0;
|
|
279454
|
+
}
|
|
279446
279455
|
function normalizeStoredMode(value) {
|
|
279447
279456
|
if (value === "sandbox" || value === "test") return "sandbox";
|
|
279448
279457
|
if (value === "production" || value === "live") return "production";
|
|
@@ -279461,6 +279470,7 @@ function readConfig() {
|
|
|
279461
279470
|
const cfgObj = readJson(configPath());
|
|
279462
279471
|
const credObj = readJson(credentialsPath());
|
|
279463
279472
|
const mode2 = normalizeStoredMode(cfgObj?.mode) ?? normalizeStoredMode(credObj?.mode);
|
|
279473
|
+
const activeProject = asActiveProject(cfgObj?.activeProject);
|
|
279464
279474
|
const cfgEntries = cfgObj ? extractEntries(cfgObj) : {};
|
|
279465
279475
|
const entries = {
|
|
279466
279476
|
...cfgEntries,
|
|
@@ -279468,15 +279478,27 @@ function readConfig() {
|
|
|
279468
279478
|
// credentials file wins
|
|
279469
279479
|
};
|
|
279470
279480
|
if (!mode2 && !entries.sandbox && !entries.production) return null;
|
|
279471
|
-
const config = {
|
|
279481
|
+
const config = {
|
|
279482
|
+
mode: mode2 ?? "sandbox",
|
|
279483
|
+
...activeProject ? { activeProject } : {},
|
|
279484
|
+
...entries
|
|
279485
|
+
};
|
|
279472
279486
|
if (cfgEntries.sandbox || cfgEntries.production) writeConfig(config);
|
|
279473
279487
|
return config;
|
|
279474
279488
|
}
|
|
279475
279489
|
function writeConfig(cfg) {
|
|
279476
279490
|
const dir = configDir();
|
|
279477
279491
|
(0, import_fs3.mkdirSync)(dir, { recursive: true, mode: 448 });
|
|
279478
|
-
(0, import_fs3.writeFileSync)(
|
|
279479
|
-
|
|
279492
|
+
(0, import_fs3.writeFileSync)(
|
|
279493
|
+
configPath(),
|
|
279494
|
+
`${JSON.stringify(
|
|
279495
|
+
{ mode: cfg.mode, ...cfg.activeProject ? { activeProject: cfg.activeProject } : {} },
|
|
279496
|
+
null,
|
|
279497
|
+
2
|
|
279498
|
+
)}
|
|
279499
|
+
`,
|
|
279500
|
+
{ mode: 384 }
|
|
279501
|
+
);
|
|
279480
279502
|
const credentials = {
|
|
279481
279503
|
...cfg.sandbox ? { sandbox: cfg.sandbox } : {},
|
|
279482
279504
|
...cfg.production ? { production: cfg.production } : {}
|
|
@@ -279493,9 +279515,23 @@ function setMode(mode2) {
|
|
|
279493
279515
|
function getMode() {
|
|
279494
279516
|
return readConfig()?.mode ?? "sandbox";
|
|
279495
279517
|
}
|
|
279518
|
+
function getActiveProject() {
|
|
279519
|
+
return readConfig()?.activeProject;
|
|
279520
|
+
}
|
|
279521
|
+
function setActiveProject(project) {
|
|
279522
|
+
const cfg = readConfig() ?? { mode: "sandbox" };
|
|
279523
|
+
if (project) cfg.activeProject = project;
|
|
279524
|
+
else delete cfg.activeProject;
|
|
279525
|
+
return writeConfig(cfg);
|
|
279526
|
+
}
|
|
279496
279527
|
function getKeyEntry(mode2) {
|
|
279497
279528
|
return readConfig()?.[mode2];
|
|
279498
279529
|
}
|
|
279530
|
+
function modeFromKey(key) {
|
|
279531
|
+
if (/^(sk|rk)_test_/.test(key)) return "sandbox";
|
|
279532
|
+
if (/^(sk|rk)_live_/.test(key)) return "production";
|
|
279533
|
+
return void 0;
|
|
279534
|
+
}
|
|
279499
279535
|
function normalizeMode(value) {
|
|
279500
279536
|
return normalizeStoredMode(value);
|
|
279501
279537
|
}
|
|
@@ -279518,6 +279554,13 @@ function resolveApiKey(modeOverride) {
|
|
|
279518
279554
|
if (entry.expiresAt && Date.parse(entry.expiresAt) <= Date.now()) return void 0;
|
|
279519
279555
|
return entry.apiKey;
|
|
279520
279556
|
}
|
|
279557
|
+
function resolvePushPlan() {
|
|
279558
|
+
const envKey = process.env.ABLO_API_KEY;
|
|
279559
|
+
if (envKey) return { flow: modeFromKey(envKey) ?? getMode(), apiKey: envKey, source: "env" };
|
|
279560
|
+
const mode2 = getMode();
|
|
279561
|
+
const apiKey = resolveApiKey(mode2);
|
|
279562
|
+
return { flow: mode2, apiKey, source: apiKey ? "stored" : null };
|
|
279563
|
+
}
|
|
279521
279564
|
|
|
279522
279565
|
// src/cli/push.ts
|
|
279523
279566
|
function coerceBackfill(raw) {
|
|
@@ -279641,7 +279684,9 @@ async function push(argv) {
|
|
|
279641
279684
|
if (!args.apiKey) args.apiKey = resolveApiKey();
|
|
279642
279685
|
if (!args.apiKey) {
|
|
279643
279686
|
console.error(
|
|
279644
|
-
import_picocolors3.default.red(` No API key.`) + import_picocolors3.default.dim(
|
|
279687
|
+
import_picocolors3.default.red(` No API key.`) + import_picocolors3.default.dim(
|
|
279688
|
+
` Run ${import_picocolors3.default.bold("npx ablo login")} for the sandbox dev loop \u2014 or set ${import_picocolors3.default.bold("ABLO_API_KEY")} (${import_picocolors3.default.bold("sk_test_")} = sandbox; ${import_picocolors3.default.bold("sk_live_")} = deliberate production deploy). Mode is currently '${getMode()}'.`
|
|
279689
|
+
)
|
|
279645
279690
|
);
|
|
279646
279691
|
process.exit(1);
|
|
279647
279692
|
}
|
|
@@ -279678,6 +279723,13 @@ async function push(argv) {
|
|
|
279678
279723
|
console.error(import_picocolors3.default.dim(` Re-push with ${import_picocolors3.default.bold("--force")} to override, or use ${import_picocolors3.default.bold("--rename old:new")} if you renamed a model.`));
|
|
279679
279724
|
} else if (status2 === 403) {
|
|
279680
279725
|
console.error(import_picocolors3.default.red(` Forbidden: ${body.message ?? body.reason ?? "key lacks schema:push scope"}`));
|
|
279726
|
+
if (args.apiKey?.startsWith("rk_")) {
|
|
279727
|
+
console.error(
|
|
279728
|
+
import_picocolors3.default.dim(
|
|
279729
|
+
` Schema pushes need a SECRET key: ${import_picocolors3.default.bold("sk_test_")} (sandbox dev loop) or a dashboard ${import_picocolors3.default.bold("sk_live_")} (production deploy: ${import_picocolors3.default.bold("ABLO_API_KEY=sk_live_\u2026 npx ablo push")}).`
|
|
279730
|
+
)
|
|
279731
|
+
);
|
|
279732
|
+
}
|
|
279681
279733
|
} else {
|
|
279682
279734
|
console.error(import_picocolors3.default.red(` Push failed (${status2}): ${body.message ?? body.reason ?? bodyText}`));
|
|
279683
279735
|
}
|
|
@@ -279944,27 +279996,30 @@ function parseDevArgs(argv) {
|
|
|
279944
279996
|
url = url.replace(/\/+$/, "");
|
|
279945
279997
|
return { schemaPath, exportName, url, apiKey: process.env.ABLO_API_KEY, watch: watchEnabled };
|
|
279946
279998
|
}
|
|
279947
|
-
function classifyKey(apiKey) {
|
|
279999
|
+
function classifyKey(apiKey, activeMode) {
|
|
279948
280000
|
if (!apiKey) {
|
|
279949
280001
|
return {
|
|
279950
280002
|
ok: false,
|
|
279951
|
-
reason: `No API key. Run ${import_picocolors6.default.bold("ablo login")}
|
|
280003
|
+
reason: `No API key. Run ${import_picocolors6.default.bold("npx ablo login")} for the sandbox dev loop \u2014 or set ${import_picocolors6.default.bold("ABLO_API_KEY")} (${import_picocolors6.default.bold("sk_test_")} = sandbox; ${import_picocolors6.default.bold("sk_live_")} = deliberate production deploy). ` + import_picocolors6.default.dim(`Mode is currently '${activeMode}'.`)
|
|
279952
280004
|
};
|
|
279953
280005
|
}
|
|
279954
280006
|
if (apiKey.startsWith("sk_test_")) return { ok: true };
|
|
279955
280007
|
if (apiKey.startsWith("sk_live_")) {
|
|
279956
280008
|
return {
|
|
279957
280009
|
ok: false,
|
|
279958
|
-
reason:
|
|
280010
|
+
reason: `Production schema deploys run one-shot: ${import_picocolors6.default.bold("ABLO_API_KEY=sk_live_\u2026 npx ablo push")} (or ${import_picocolors6.default.bold("ablo mode production")}). ${import_picocolors6.default.bold("--watch")} is sandbox-only.`
|
|
279959
280011
|
};
|
|
279960
280012
|
}
|
|
279961
280013
|
if (apiKey.startsWith("rk_")) {
|
|
279962
280014
|
return {
|
|
279963
280015
|
ok: false,
|
|
279964
|
-
reason: `Restricted (${import_picocolors6.default.bold("rk_")}) keys can't push schema. Use a secret ${import_picocolors6.default.bold("sk_test_")}
|
|
280016
|
+
reason: `Restricted (${import_picocolors6.default.bold("rk_")}) keys can't push schema. Use a secret key: ${import_picocolors6.default.bold("sk_test_")} for the sandbox dev loop, or ${import_picocolors6.default.bold("sk_live_")} with ${import_picocolors6.default.bold("npx ablo push")} for a production deploy.`
|
|
279965
280017
|
};
|
|
279966
280018
|
}
|
|
279967
|
-
return {
|
|
280019
|
+
return {
|
|
280020
|
+
ok: false,
|
|
280021
|
+
reason: `${import_picocolors6.default.bold("ABLO_API_KEY")} is not an Ablo key \u2014 expected ${import_picocolors6.default.bold("sk_test_\u2026")} (sandbox) or ${import_picocolors6.default.bold("sk_live_\u2026")} (production deploy via ${import_picocolors6.default.bold("npx ablo push")}).`
|
|
280022
|
+
};
|
|
279968
280023
|
}
|
|
279969
280024
|
function wireEnvLocal(apiKey, cwd = process.cwd()) {
|
|
279970
280025
|
const envPath = (0, import_path5.resolve)(cwd, ".env.local");
|
|
@@ -280048,7 +280103,7 @@ async function dev(argv) {
|
|
|
280048
280103
|
process.exit(1);
|
|
280049
280104
|
}
|
|
280050
280105
|
if (!args.apiKey) args.apiKey = resolveApiKey("sandbox");
|
|
280051
|
-
const key = classifyKey(args.apiKey);
|
|
280106
|
+
const key = classifyKey(args.apiKey, getMode());
|
|
280052
280107
|
if (!key.ok) {
|
|
280053
280108
|
console.error(import_picocolors6.default.red(` ${key.reason}`));
|
|
280054
280109
|
process.exit(1);
|
|
@@ -280315,21 +280370,184 @@ async function mode(argv) {
|
|
|
280315
280370
|
apply(selected);
|
|
280316
280371
|
}
|
|
280317
280372
|
|
|
280318
|
-
// src/cli/
|
|
280373
|
+
// src/cli/projects.ts
|
|
280319
280374
|
init_cjs_shims();
|
|
280320
280375
|
var import_picocolors9 = __toESM(require_picocolors(), 1);
|
|
280376
|
+
function apiUrl() {
|
|
280377
|
+
return (process.env.ABLO_API_URL ?? DEFAULT_URL).replace(/\/+$/, "");
|
|
280378
|
+
}
|
|
280379
|
+
function requireKey() {
|
|
280380
|
+
const apiKey = resolveApiKey();
|
|
280381
|
+
if (!apiKey) {
|
|
280382
|
+
console.error(
|
|
280383
|
+
import_picocolors9.default.red(" No API key.") + import_picocolors9.default.dim(
|
|
280384
|
+
` Run ${import_picocolors9.default.bold("npx ablo login")} \u2014 or set ${import_picocolors9.default.bold("ABLO_API_KEY")} (${import_picocolors9.default.bold("sk_test_")} = sandbox; ${import_picocolors9.default.bold("sk_live_")} = production).`
|
|
280385
|
+
)
|
|
280386
|
+
);
|
|
280387
|
+
process.exit(1);
|
|
280388
|
+
}
|
|
280389
|
+
return apiKey;
|
|
280390
|
+
}
|
|
280391
|
+
async function request(path, apiKey, init2 = {}) {
|
|
280392
|
+
const res = await fetch(`${apiUrl()}${path}`, {
|
|
280393
|
+
method: init2.method ?? "GET",
|
|
280394
|
+
headers: {
|
|
280395
|
+
"content-type": "application/json",
|
|
280396
|
+
authorization: `Bearer ${apiKey}`
|
|
280397
|
+
},
|
|
280398
|
+
...init2.body !== void 0 ? { body: JSON.stringify(init2.body) } : {}
|
|
280399
|
+
});
|
|
280400
|
+
let body = {};
|
|
280401
|
+
try {
|
|
280402
|
+
body = await res.json();
|
|
280403
|
+
} catch {
|
|
280404
|
+
}
|
|
280405
|
+
return { status: res.status, body };
|
|
280406
|
+
}
|
|
280407
|
+
async function listProjects(apiKey) {
|
|
280408
|
+
try {
|
|
280409
|
+
const { status: status2, body } = await request("/api/v1/projects", apiKey);
|
|
280410
|
+
if (status2 !== 200 || !Array.isArray(body.data)) return null;
|
|
280411
|
+
return body.data;
|
|
280412
|
+
} catch {
|
|
280413
|
+
return null;
|
|
280414
|
+
}
|
|
280415
|
+
}
|
|
280416
|
+
async function fetchProjects() {
|
|
280417
|
+
const all = await listProjects(requireKey());
|
|
280418
|
+
if (!all) {
|
|
280419
|
+
console.error(import_picocolors9.default.red(" Could not list projects \u2014 is the API reachable and the key valid?"));
|
|
280420
|
+
process.exit(1);
|
|
280421
|
+
}
|
|
280422
|
+
return all;
|
|
280423
|
+
}
|
|
280424
|
+
function projectSlugFromPackageName(name) {
|
|
280425
|
+
if (typeof name !== "string") return void 0;
|
|
280426
|
+
const slug = name.toLowerCase().replace(/[^a-z0-9-_]+/g, "-").replace(/^[-_]+|[-_]+$/g, "").slice(0, 64);
|
|
280427
|
+
if (!slug || slug === "default") return void 0;
|
|
280428
|
+
return slug;
|
|
280429
|
+
}
|
|
280430
|
+
async function ensureProject(slug, name) {
|
|
280431
|
+
const apiKey = resolveApiKey();
|
|
280432
|
+
if (!apiKey) return null;
|
|
280433
|
+
try {
|
|
280434
|
+
const { status: status2, body } = await request("/api/v1/projects", apiKey, {
|
|
280435
|
+
method: "POST",
|
|
280436
|
+
body: { slug, ...name ? { name } : {} }
|
|
280437
|
+
});
|
|
280438
|
+
if (status2 === 201) {
|
|
280439
|
+
const created = body;
|
|
280440
|
+
setActiveProject({ id: created.id, slug: created.slug });
|
|
280441
|
+
return { id: created.id, slug: created.slug, created: true };
|
|
280442
|
+
}
|
|
280443
|
+
if (body.code === "project_slug_taken") {
|
|
280444
|
+
const all = await listProjects(apiKey);
|
|
280445
|
+
const existing = all?.find((p2) => p2.slug === slug);
|
|
280446
|
+
if (!existing) return null;
|
|
280447
|
+
setActiveProject({ id: existing.id, slug: existing.slug });
|
|
280448
|
+
return { id: existing.id, slug: existing.slug, created: false };
|
|
280449
|
+
}
|
|
280450
|
+
return null;
|
|
280451
|
+
} catch {
|
|
280452
|
+
return null;
|
|
280453
|
+
}
|
|
280454
|
+
}
|
|
280455
|
+
function printList(projects2) {
|
|
280456
|
+
const active = getActiveProject();
|
|
280457
|
+
for (const p2 of projects2) {
|
|
280458
|
+
const isActive = active ? active.id === p2.id : p2.default;
|
|
280459
|
+
const marker = isActive ? import_picocolors9.default.green("\u25CF") : import_picocolors9.default.dim("\u25CB");
|
|
280460
|
+
const tags = [p2.default ? import_picocolors9.default.dim("default") : "", isActive ? import_picocolors9.default.green("active") : ""].filter(Boolean).join(import_picocolors9.default.dim(", "));
|
|
280461
|
+
console.log(
|
|
280462
|
+
` ${marker} ${p2.slug.padEnd(20)} ${import_picocolors9.default.dim(p2.id)}${tags ? ` ${tags}` : ""}`
|
|
280463
|
+
);
|
|
280464
|
+
}
|
|
280465
|
+
}
|
|
280466
|
+
async function projects(argv) {
|
|
280467
|
+
const sub = argv[0];
|
|
280468
|
+
if (sub === "list" || sub === void 0) {
|
|
280469
|
+
console.log(`
|
|
280470
|
+
${brand("ablo")} ${import_picocolors9.default.dim("projects")}
|
|
280471
|
+
`);
|
|
280472
|
+
printList(await fetchProjects());
|
|
280473
|
+
console.log();
|
|
280474
|
+
return;
|
|
280475
|
+
}
|
|
280476
|
+
if (sub === "create") {
|
|
280477
|
+
const slug = argv[1];
|
|
280478
|
+
if (!slug || slug.startsWith("-")) {
|
|
280479
|
+
console.error(import_picocolors9.default.red(' usage: ablo projects create <slug> [--name "Display Name"]'));
|
|
280480
|
+
process.exit(1);
|
|
280481
|
+
}
|
|
280482
|
+
const nameIdx = argv.indexOf("--name");
|
|
280483
|
+
const name = nameIdx >= 0 ? argv[nameIdx + 1] : void 0;
|
|
280484
|
+
const { status: status2, body } = await request("/api/v1/projects", requireKey(), {
|
|
280485
|
+
method: "POST",
|
|
280486
|
+
body: { slug, ...name ? { name } : {} }
|
|
280487
|
+
});
|
|
280488
|
+
if (status2 !== 201) {
|
|
280489
|
+
console.error(
|
|
280490
|
+
import_picocolors9.default.red(` Create failed (${status2}): ${String(body.message ?? body.code ?? "")}`)
|
|
280491
|
+
);
|
|
280492
|
+
if (body.code === "project_slug_taken") {
|
|
280493
|
+
console.error(import_picocolors9.default.dim(` Pick another slug, or switch to it: ${import_picocolors9.default.bold(`ablo projects use ${slug}`)}`));
|
|
280494
|
+
}
|
|
280495
|
+
process.exit(1);
|
|
280496
|
+
}
|
|
280497
|
+
const created = body;
|
|
280498
|
+
console.log(` ${import_picocolors9.default.green("\u2713")} Created project ${import_picocolors9.default.bold(created.slug)} ${import_picocolors9.default.dim(`(${created.id})`)}`);
|
|
280499
|
+
console.log(
|
|
280500
|
+
import_picocolors9.default.dim(` Make it active with ${import_picocolors9.default.bold(`ablo projects use ${created.slug}`)}; mint its keys in the dashboard.`)
|
|
280501
|
+
);
|
|
280502
|
+
return;
|
|
280503
|
+
}
|
|
280504
|
+
if (sub === "use") {
|
|
280505
|
+
const ref = argv[1];
|
|
280506
|
+
if (!ref) {
|
|
280507
|
+
console.error(import_picocolors9.default.red(" usage: ablo projects use <slug|id|default>"));
|
|
280508
|
+
process.exit(1);
|
|
280509
|
+
}
|
|
280510
|
+
const all = await fetchProjects();
|
|
280511
|
+
const target = all.find((p2) => p2.slug === ref || p2.id === ref);
|
|
280512
|
+
if (!target) {
|
|
280513
|
+
console.error(import_picocolors9.default.red(` No project "${ref}".`) + import_picocolors9.default.dim(" Run ablo projects list."));
|
|
280514
|
+
process.exit(1);
|
|
280515
|
+
}
|
|
280516
|
+
if (target.default) {
|
|
280517
|
+
setActiveProject(void 0);
|
|
280518
|
+
console.log(` ${import_picocolors9.default.green("\u2713")} now targeting the ${import_picocolors9.default.bold("default")} project`);
|
|
280519
|
+
} else {
|
|
280520
|
+
setActiveProject({ id: target.id, slug: target.slug });
|
|
280521
|
+
console.log(` ${import_picocolors9.default.green("\u2713")} now targeting project ${import_picocolors9.default.bold(target.slug)} ${import_picocolors9.default.dim(`(${target.id})`)}`);
|
|
280522
|
+
}
|
|
280523
|
+
console.log(
|
|
280524
|
+
import_picocolors9.default.dim(
|
|
280525
|
+
" Note: a key\u2019s project scope is fixed at mint \u2014 switch keys (or mint one for this project) to act in it."
|
|
280526
|
+
)
|
|
280527
|
+
);
|
|
280528
|
+
return;
|
|
280529
|
+
}
|
|
280530
|
+
console.error(
|
|
280531
|
+
import_picocolors9.default.red(` unknown subcommand: ${sub}`) + import_picocolors9.default.dim(` (expected ${import_picocolors9.default.bold("list")}, ${import_picocolors9.default.bold("create")}, or ${import_picocolors9.default.bold("use")})`)
|
|
280532
|
+
);
|
|
280533
|
+
process.exit(1);
|
|
280534
|
+
}
|
|
280535
|
+
|
|
280536
|
+
// src/cli/status.ts
|
|
280537
|
+
init_cjs_shims();
|
|
280538
|
+
var import_picocolors10 = __toESM(require_picocolors(), 1);
|
|
280321
280539
|
function expiryLabel(iso) {
|
|
280322
280540
|
const ms = Date.parse(iso) - Date.now();
|
|
280323
280541
|
if (Number.isNaN(ms)) return "";
|
|
280324
|
-
if (ms <= 0) return
|
|
280542
|
+
if (ms <= 0) return import_picocolors10.default.red("expired");
|
|
280325
280543
|
const days = Math.floor(ms / (24 * 60 * 60 * 1e3));
|
|
280326
|
-
return
|
|
280544
|
+
return import_picocolors10.default.dim(days > 0 ? `expires in ${days}d` : "expires <1d");
|
|
280327
280545
|
}
|
|
280328
|
-
async function ping(
|
|
280546
|
+
async function ping(apiUrl2) {
|
|
280329
280547
|
const ctrl = new AbortController();
|
|
280330
280548
|
const t = setTimeout(() => ctrl.abort(), 3e3);
|
|
280331
280549
|
try {
|
|
280332
|
-
const res = await fetch(`${
|
|
280550
|
+
const res = await fetch(`${apiUrl2}/api/health`, { signal: ctrl.signal });
|
|
280333
280551
|
return res.ok;
|
|
280334
280552
|
} catch {
|
|
280335
280553
|
return false;
|
|
@@ -280338,53 +280556,72 @@ async function ping(apiUrl) {
|
|
|
280338
280556
|
}
|
|
280339
280557
|
}
|
|
280340
280558
|
async function status(args = []) {
|
|
280341
|
-
const
|
|
280559
|
+
const apiUrl2 = (process.env.ABLO_API_URL ?? DEFAULT_URL).replace(/\/+$/, "");
|
|
280342
280560
|
const cfg = readConfig();
|
|
280343
280561
|
const mode2 = getMode();
|
|
280344
280562
|
if (args.includes("--json")) {
|
|
280345
280563
|
const entry = getKeyEntry(mode2);
|
|
280564
|
+
const plan2 = resolvePushPlan();
|
|
280565
|
+
const activeProject2 = getActiveProject();
|
|
280346
280566
|
const out = {
|
|
280347
280567
|
mode: mode2,
|
|
280568
|
+
// The locally-active project (`ablo projects use`); null = org-default.
|
|
280569
|
+
project: activeProject2 ?? null,
|
|
280348
280570
|
keyPrefix: process.env.ABLO_API_KEY ? process.env.ABLO_API_KEY.slice(0, 12) : entry?.apiKey.slice(0, 12) ?? null,
|
|
280349
280571
|
keySource: process.env.ABLO_API_KEY ? "env" : entry ? "stored" : null,
|
|
280350
280572
|
organizationId: entry?.organizationId ?? null,
|
|
280351
|
-
|
|
280352
|
-
|
|
280573
|
+
// What `ablo push` would do right now — the one-command answer to
|
|
280574
|
+
// "why did push demand a different key" (2026-06-11 live-key incident).
|
|
280575
|
+
push: {
|
|
280576
|
+
flow: plan2.flow,
|
|
280577
|
+
keyPrefix: plan2.apiKey?.slice(0, 12) ?? null,
|
|
280578
|
+
keySource: plan2.source
|
|
280579
|
+
},
|
|
280580
|
+
apiUrl: apiUrl2,
|
|
280581
|
+
reachable: await ping(apiUrl2)
|
|
280353
280582
|
};
|
|
280354
280583
|
console.log(JSON.stringify(out, null, 2));
|
|
280355
280584
|
return;
|
|
280356
280585
|
}
|
|
280357
280586
|
console.log(`
|
|
280358
|
-
${brand("ablo")} ${
|
|
280587
|
+
${brand("ablo")} ${import_picocolors10.default.dim("status")}
|
|
280359
280588
|
`);
|
|
280360
280589
|
if (process.env.ABLO_API_KEY) {
|
|
280361
280590
|
console.log(
|
|
280362
|
-
` ${
|
|
280591
|
+
` ${import_picocolors10.default.dim("key")} ${process.env.ABLO_API_KEY.slice(0, 12)}\u2026 ${import_picocolors10.default.dim("(ABLO_API_KEY env \u2014 overrides stored)")}`
|
|
280363
280592
|
);
|
|
280364
280593
|
} else if (!cfg) {
|
|
280365
|
-
console.log(` ${
|
|
280594
|
+
console.log(` ${import_picocolors10.default.yellow("!")} Not logged in \u2014 run ${import_picocolors10.default.bold("ablo login")}.`);
|
|
280366
280595
|
}
|
|
280367
|
-
console.log(` ${
|
|
280596
|
+
console.log(` ${import_picocolors10.default.dim("mode")} ${import_picocolors10.default.bold(mode2)}`);
|
|
280597
|
+
const activeProject = getActiveProject();
|
|
280598
|
+
console.log(
|
|
280599
|
+
` ${import_picocolors10.default.dim("project")} ${activeProject ? `${import_picocolors10.default.bold(activeProject.slug)} ${import_picocolors10.default.dim(`(${activeProject.id})`)}` : import_picocolors10.default.bold("default")}`
|
|
280600
|
+
);
|
|
280368
280601
|
for (const m2 of ["sandbox", "production"]) {
|
|
280369
280602
|
const entry = getKeyEntry(m2);
|
|
280370
|
-
const marker = m2 === mode2 ?
|
|
280603
|
+
const marker = m2 === mode2 ? import_picocolors10.default.green("\u25CF") : import_picocolors10.default.dim("\u25CB");
|
|
280371
280604
|
if (entry) {
|
|
280372
280605
|
const exp = entry.expiresAt ? ` ${expiryLabel(entry.expiresAt)}` : "";
|
|
280373
|
-
console.log(` ${marker} ${m2.padEnd(10)} ${
|
|
280606
|
+
console.log(` ${marker} ${m2.padEnd(10)} ${import_picocolors10.default.dim(`${entry.apiKey.slice(0, 12)}\u2026`)}${exp}`);
|
|
280374
280607
|
} else {
|
|
280375
|
-
console.log(` ${marker} ${m2.padEnd(10)} ${
|
|
280608
|
+
console.log(` ${marker} ${m2.padEnd(10)} ${import_picocolors10.default.dim("\u2014 no key")}`);
|
|
280376
280609
|
}
|
|
280377
280610
|
}
|
|
280378
280611
|
const org = getKeyEntry(mode2)?.organizationId;
|
|
280379
|
-
if (org) console.log(` ${
|
|
280380
|
-
|
|
280381
|
-
console.log(
|
|
280612
|
+
if (org) console.log(` ${import_picocolors10.default.dim("org")} ${org}`);
|
|
280613
|
+
const plan = resolvePushPlan();
|
|
280614
|
+
console.log(
|
|
280615
|
+
` ${import_picocolors10.default.dim("push")} ${plan.apiKey ? `${import_picocolors10.default.bold(plan.flow)} ${import_picocolors10.default.dim(`with ${plan.apiKey.slice(0, 12)}\u2026 (${plan.source})`)}` : `${import_picocolors10.default.bold(plan.flow)} ${import_picocolors10.default.yellow("\u2014 no credential")} ${import_picocolors10.default.dim(`(run ${import_picocolors10.default.bold("ablo login")} or set ${import_picocolors10.default.bold("ABLO_API_KEY")})`)}`}`
|
|
280616
|
+
);
|
|
280617
|
+
process.stdout.write(` ${import_picocolors10.default.dim("api")} ${apiUrl2} `);
|
|
280618
|
+
console.log(await ping(apiUrl2) ? import_picocolors10.default.green("reachable") : import_picocolors10.default.red("unreachable"));
|
|
280382
280619
|
console.log();
|
|
280383
280620
|
}
|
|
280384
280621
|
|
|
280385
280622
|
// src/cli/logs.ts
|
|
280386
280623
|
init_cjs_shims();
|
|
280387
|
-
var
|
|
280624
|
+
var import_picocolors11 = __toESM(require_picocolors(), 1);
|
|
280388
280625
|
function parseLogsArgs(argv) {
|
|
280389
280626
|
const args = {
|
|
280390
280627
|
follow: true,
|
|
@@ -280448,10 +280685,10 @@ function resolveSince(since) {
|
|
|
280448
280685
|
var sleep2 = (ms) => new Promise((r2) => setTimeout(r2, ms));
|
|
280449
280686
|
function colorOp(op) {
|
|
280450
280687
|
const label = op.padEnd(6);
|
|
280451
|
-
if (op === "create") return
|
|
280452
|
-
if (op === "update") return
|
|
280453
|
-
if (op === "delete") return
|
|
280454
|
-
return
|
|
280688
|
+
if (op === "create") return import_picocolors11.default.green(label);
|
|
280689
|
+
if (op === "update") return import_picocolors11.default.yellow(label);
|
|
280690
|
+
if (op === "delete") return import_picocolors11.default.red(label);
|
|
280691
|
+
return import_picocolors11.default.dim(label);
|
|
280455
280692
|
}
|
|
280456
280693
|
function render(e2, json) {
|
|
280457
280694
|
if (json) {
|
|
@@ -280460,21 +280697,21 @@ function render(e2, json) {
|
|
|
280460
280697
|
return;
|
|
280461
280698
|
}
|
|
280462
280699
|
const t = new Date(e2.at).toLocaleTimeString();
|
|
280463
|
-
const actor = e2.actor ?
|
|
280464
|
-
console.log(` ${
|
|
280700
|
+
const actor = e2.actor ? import_picocolors11.default.dim(` ${e2.actor}`) : "";
|
|
280701
|
+
console.log(` ${import_picocolors11.default.dim(t)} ${colorOp(e2.op)} ${import_picocolors11.default.bold(e2.model)} ${import_picocolors11.default.dim(e2.recordId)}${actor}`);
|
|
280465
280702
|
}
|
|
280466
280703
|
async function logs(argv) {
|
|
280467
280704
|
let args;
|
|
280468
280705
|
try {
|
|
280469
280706
|
args = parseLogsArgs(argv);
|
|
280470
280707
|
} catch (err) {
|
|
280471
|
-
console.error(
|
|
280708
|
+
console.error(import_picocolors11.default.red(` ${err instanceof Error ? err.message : String(err)}`));
|
|
280472
280709
|
process.exit(1);
|
|
280473
280710
|
}
|
|
280474
280711
|
const apiKey = resolveApiKey(args.mode);
|
|
280475
280712
|
if (!apiKey) {
|
|
280476
280713
|
console.error(
|
|
280477
|
-
|
|
280714
|
+
import_picocolors11.default.red(` No API key.`) + import_picocolors11.default.dim(` Run ${import_picocolors11.default.bold("ablo login")} or set ${import_picocolors11.default.bold("ABLO_API_KEY")}.`)
|
|
280478
280715
|
);
|
|
280479
280716
|
process.exit(1);
|
|
280480
280717
|
}
|
|
@@ -280488,7 +280725,7 @@ async function logs(argv) {
|
|
|
280488
280725
|
if (!res) return null;
|
|
280489
280726
|
if (!res.ok) {
|
|
280490
280727
|
const body = await res.json().catch(() => ({}));
|
|
280491
|
-
console.error(
|
|
280728
|
+
console.error(import_picocolors11.default.red(` logs failed (${res.status}): ${body.reason ?? body.message ?? ""}`));
|
|
280492
280729
|
process.exit(1);
|
|
280493
280730
|
}
|
|
280494
280731
|
const json = await res.json();
|
|
@@ -280499,7 +280736,7 @@ async function logs(argv) {
|
|
|
280499
280736
|
}
|
|
280500
280737
|
if (!args.json) {
|
|
280501
280738
|
console.log(`
|
|
280502
|
-
${brand("ablo")} ${
|
|
280739
|
+
${brand("ablo")} ${import_picocolors11.default.dim("logs")} ${import_picocolors11.default.dim(`(${args.mode ?? "active"} mode)`)}
|
|
280503
280740
|
`);
|
|
280504
280741
|
}
|
|
280505
280742
|
const initial = await fetchPage({
|
|
@@ -280509,13 +280746,13 @@ async function logs(argv) {
|
|
|
280509
280746
|
...args.op ? { op: args.op } : {}
|
|
280510
280747
|
});
|
|
280511
280748
|
if (!initial) {
|
|
280512
|
-
console.error(
|
|
280749
|
+
console.error(import_picocolors11.default.red(` Couldn't reach ${baseUrl2}.`));
|
|
280513
280750
|
process.exit(1);
|
|
280514
280751
|
}
|
|
280515
280752
|
for (const e2 of initial.events) render(e2, args.json);
|
|
280516
280753
|
let cursor = initial.cursor;
|
|
280517
280754
|
if (!args.follow) return;
|
|
280518
|
-
if (!args.json) console.log(` ${
|
|
280755
|
+
if (!args.json) console.log(` ${import_picocolors11.default.dim("watching for new activity \u2026 (Ctrl-C to stop)")}
|
|
280519
280756
|
`);
|
|
280520
280757
|
for (; ; ) {
|
|
280521
280758
|
await sleep2(1500);
|
|
@@ -280533,7 +280770,7 @@ async function logs(argv) {
|
|
|
280533
280770
|
// src/cli/webhooks.ts
|
|
280534
280771
|
init_cjs_shims();
|
|
280535
280772
|
var import_fs8 = require("fs");
|
|
280536
|
-
var
|
|
280773
|
+
var import_picocolors12 = __toESM(require_picocolors(), 1);
|
|
280537
280774
|
var ENV_KEY = "ABLO_WEBHOOK_SECRET";
|
|
280538
280775
|
function flag(args, name) {
|
|
280539
280776
|
const inline = args.find((a) => a.startsWith(`${name}=`));
|
|
@@ -280556,16 +280793,16 @@ function positional(args) {
|
|
|
280556
280793
|
}
|
|
280557
280794
|
return void 0;
|
|
280558
280795
|
}
|
|
280559
|
-
function
|
|
280796
|
+
function requireKey2(mode2) {
|
|
280560
280797
|
const apiKey = resolveApiKey(mode2);
|
|
280561
280798
|
if (!apiKey) {
|
|
280562
280799
|
console.error(
|
|
280563
|
-
|
|
280800
|
+
import_picocolors12.default.red(" No API key.") + import_picocolors12.default.dim(` Run ${import_picocolors12.default.bold("ablo login")} or set ${import_picocolors12.default.bold("ABLO_API_KEY")}.`)
|
|
280564
280801
|
);
|
|
280565
280802
|
process.exit(1);
|
|
280566
280803
|
}
|
|
280567
280804
|
if (!apiKey.startsWith("sk_")) {
|
|
280568
|
-
console.error(
|
|
280805
|
+
console.error(import_picocolors12.default.red(" Managing webhooks requires a secret key ") + import_picocolors12.default.dim("(sk_test_ / sk_live_)."));
|
|
280569
280806
|
process.exit(1);
|
|
280570
280807
|
}
|
|
280571
280808
|
return apiKey;
|
|
@@ -280581,12 +280818,12 @@ async function api(apiKey, method, path, body) {
|
|
|
280581
280818
|
...body ? { body: JSON.stringify(body) } : {}
|
|
280582
280819
|
}).catch(() => null);
|
|
280583
280820
|
if (!res) {
|
|
280584
|
-
console.error(
|
|
280821
|
+
console.error(import_picocolors12.default.red(` Couldn't reach ${baseUrl()}.`));
|
|
280585
280822
|
process.exit(1);
|
|
280586
280823
|
}
|
|
280587
280824
|
if (!res.ok) {
|
|
280588
280825
|
const err = await res.json().catch(() => ({}));
|
|
280589
|
-
console.error(
|
|
280826
|
+
console.error(import_picocolors12.default.red(` Request failed (${res.status}): ${err.message ?? err.reason ?? ""}`));
|
|
280590
280827
|
process.exit(1);
|
|
280591
280828
|
}
|
|
280592
280829
|
return await res.json();
|
|
@@ -280608,11 +280845,11 @@ ${line}
|
|
|
280608
280845
|
return file;
|
|
280609
280846
|
}
|
|
280610
280847
|
function printEndpoint(e2) {
|
|
280611
|
-
const dot = e2.status === "enabled" ?
|
|
280612
|
-
const health = e2.last_error ?
|
|
280613
|
-
console.log(` ${dot} ${
|
|
280848
|
+
const dot = e2.status === "enabled" ? import_picocolors12.default.green("\u25CF") : import_picocolors12.default.red("\u25CF");
|
|
280849
|
+
const health = e2.last_error ? import_picocolors12.default.red(` last error: ${e2.last_error}`) : "";
|
|
280850
|
+
console.log(` ${dot} ${import_picocolors12.default.bold(e2.id)} ${e2.url}`);
|
|
280614
280851
|
console.log(
|
|
280615
|
-
|
|
280852
|
+
import_picocolors12.default.dim(
|
|
280616
280853
|
` ${e2.status} \xB7 ${e2.environment} \xB7 events ${e2.enabled_events.join(",")} \xB7 cursor ${e2.cursor ?? "\u2014"}${health}`
|
|
280617
280854
|
)
|
|
280618
280855
|
);
|
|
@@ -280624,10 +280861,10 @@ async function webhooks(argv) {
|
|
|
280624
280861
|
if (sub === "create") {
|
|
280625
280862
|
const url = positional(rest);
|
|
280626
280863
|
if (!url) {
|
|
280627
|
-
console.error(
|
|
280864
|
+
console.error(import_picocolors12.default.red(" Usage: ") + brand("ablo webhooks create <url>"));
|
|
280628
280865
|
process.exit(1);
|
|
280629
280866
|
}
|
|
280630
|
-
const apiKey =
|
|
280867
|
+
const apiKey = requireKey2(mode2);
|
|
280631
280868
|
const events = flag(rest, "--events");
|
|
280632
280869
|
const created = await api(apiKey, "POST", "", {
|
|
280633
280870
|
url,
|
|
@@ -280636,16 +280873,16 @@ async function webhooks(argv) {
|
|
|
280636
280873
|
});
|
|
280637
280874
|
const file = writeSecretToEnv(created.secret);
|
|
280638
280875
|
console.log(`
|
|
280639
|
-
${
|
|
280640
|
-
console.log(` ${
|
|
280876
|
+
${import_picocolors12.default.green("\u2713")} Registered ${import_picocolors12.default.bold(created.id)} \u2192 ${created.url}`);
|
|
280877
|
+
console.log(` ${import_picocolors12.default.green("\u2713")} Wrote ${import_picocolors12.default.bold(ENV_KEY)} to ${import_picocolors12.default.bold(file)} ${import_picocolors12.default.dim("(shown once)")}
|
|
280641
280878
|
`);
|
|
280642
280879
|
return;
|
|
280643
280880
|
}
|
|
280644
280881
|
if (sub === "list") {
|
|
280645
|
-
const apiKey =
|
|
280882
|
+
const apiKey = requireKey2(mode2);
|
|
280646
280883
|
const { data } = await api(apiKey, "GET", "");
|
|
280647
280884
|
if (data.length === 0) {
|
|
280648
|
-
console.log(
|
|
280885
|
+
console.log(import_picocolors12.default.dim(" No webhook endpoints. ") + brand("ablo webhooks create <url>"));
|
|
280649
280886
|
return;
|
|
280650
280887
|
}
|
|
280651
280888
|
console.log();
|
|
@@ -280656,40 +280893,40 @@ async function webhooks(argv) {
|
|
|
280656
280893
|
if (sub === "roll") {
|
|
280657
280894
|
const id = positional(rest);
|
|
280658
280895
|
if (!id) {
|
|
280659
|
-
console.error(
|
|
280896
|
+
console.error(import_picocolors12.default.red(" Usage: ") + brand("ablo webhooks roll <id>"));
|
|
280660
280897
|
process.exit(1);
|
|
280661
280898
|
}
|
|
280662
|
-
const apiKey =
|
|
280899
|
+
const apiKey = requireKey2(mode2);
|
|
280663
280900
|
const rolled = await api(apiKey, "POST", `/${id}/roll_secret`);
|
|
280664
280901
|
const file = writeSecretToEnv(rolled.secret);
|
|
280665
280902
|
console.log(`
|
|
280666
|
-
${
|
|
280903
|
+
${import_picocolors12.default.green("\u2713")} Rolled secret for ${import_picocolors12.default.bold(id)} \u2192 ${import_picocolors12.default.bold(file)} ${import_picocolors12.default.dim("(old secret now invalid)")}
|
|
280667
280904
|
`);
|
|
280668
280905
|
return;
|
|
280669
280906
|
}
|
|
280670
280907
|
if (sub === "enable") {
|
|
280671
280908
|
const id = positional(rest);
|
|
280672
280909
|
if (!id) {
|
|
280673
|
-
console.error(
|
|
280910
|
+
console.error(import_picocolors12.default.red(" Usage: ") + brand("ablo webhooks enable <id>"));
|
|
280674
280911
|
process.exit(1);
|
|
280675
280912
|
}
|
|
280676
|
-
const apiKey =
|
|
280913
|
+
const apiKey = requireKey2(mode2);
|
|
280677
280914
|
const e2 = await api(apiKey, "POST", `/${id}/enable`);
|
|
280678
|
-
console.log(` ${
|
|
280915
|
+
console.log(` ${import_picocolors12.default.green("\u2713")} Re-enabled ${import_picocolors12.default.bold(e2.id)}`);
|
|
280679
280916
|
return;
|
|
280680
280917
|
}
|
|
280681
280918
|
if (sub === "rm" || sub === "delete") {
|
|
280682
280919
|
const id = positional(rest);
|
|
280683
280920
|
if (!id) {
|
|
280684
|
-
console.error(
|
|
280921
|
+
console.error(import_picocolors12.default.red(" Usage: ") + brand("ablo webhooks rm <id>"));
|
|
280685
280922
|
process.exit(1);
|
|
280686
280923
|
}
|
|
280687
|
-
const apiKey =
|
|
280924
|
+
const apiKey = requireKey2(mode2);
|
|
280688
280925
|
await api(apiKey, "DELETE", `/${id}`);
|
|
280689
|
-
console.log(` ${
|
|
280926
|
+
console.log(` ${import_picocolors12.default.green("\u2713")} Removed ${import_picocolors12.default.bold(id)}`);
|
|
280690
280927
|
return;
|
|
280691
280928
|
}
|
|
280692
|
-
console.log(` ${
|
|
280929
|
+
console.log(` ${import_picocolors12.default.bold("Usage:")}`);
|
|
280693
280930
|
console.log(` ${brand("ablo webhooks create <url>")} Register an endpoint; writes ${ENV_KEY}`);
|
|
280694
280931
|
console.log(` ${brand("ablo webhooks list")} List endpoints + delivery health`);
|
|
280695
280932
|
console.log(` ${brand("ablo webhooks roll <id>")} Mint a fresh signing secret`);
|
|
@@ -280700,7 +280937,7 @@ async function webhooks(argv) {
|
|
|
280700
280937
|
|
|
280701
280938
|
// src/cli/check.ts
|
|
280702
280939
|
init_cjs_shims();
|
|
280703
|
-
var
|
|
280940
|
+
var import_picocolors13 = __toESM(require_picocolors(), 1);
|
|
280704
280941
|
var import_schema5 = require("@abloatai/ablo/schema");
|
|
280705
280942
|
var DEFAULT_SCHEMA_PATH4 = "ablo/schema.ts";
|
|
280706
280943
|
var DEFAULT_EXPORT4 = "schema";
|
|
@@ -280735,13 +280972,13 @@ async function check(argv) {
|
|
|
280735
280972
|
try {
|
|
280736
280973
|
args = parseCheckArgs(argv);
|
|
280737
280974
|
} catch (err) {
|
|
280738
|
-
console.error(
|
|
280975
|
+
console.error(import_picocolors13.default.red(` ${err instanceof Error ? err.message : String(err)}`));
|
|
280739
280976
|
process.exit(1);
|
|
280740
280977
|
}
|
|
280741
280978
|
const dbUrl = process.env.DATABASE_URL ?? process.env.ABLO_DATABASE_URL;
|
|
280742
280979
|
if (!dbUrl) {
|
|
280743
280980
|
console.error(
|
|
280744
|
-
|
|
280981
|
+
import_picocolors13.default.red(` No database.`) + import_picocolors13.default.dim(` Set ${import_picocolors13.default.bold("DATABASE_URL")} to the Postgres you want Ablo to adopt.`)
|
|
280745
280982
|
);
|
|
280746
280983
|
process.exit(1);
|
|
280747
280984
|
}
|
|
@@ -280756,7 +280993,7 @@ async function check(argv) {
|
|
|
280756
280993
|
[args.appSchema]
|
|
280757
280994
|
);
|
|
280758
280995
|
} catch (err) {
|
|
280759
|
-
console.error(
|
|
280996
|
+
console.error(import_picocolors13.default.red(` Couldn't read the database: ${err instanceof Error ? err.message : String(err)}`));
|
|
280760
280997
|
await sql.end({ timeout: 2 });
|
|
280761
280998
|
process.exit(1);
|
|
280762
280999
|
}
|
|
@@ -280771,7 +281008,7 @@ async function check(argv) {
|
|
|
280771
281008
|
set.add(r2.column_name);
|
|
280772
281009
|
}
|
|
280773
281010
|
console.log(`
|
|
280774
|
-
${brand("ablo")} ${
|
|
281011
|
+
${brand("ablo")} ${import_picocolors13.default.dim("check")} ${import_picocolors13.default.dim(`schema "${args.appSchema}"`)}
|
|
280775
281012
|
`);
|
|
280776
281013
|
const declaredTables = /* @__PURE__ */ new Set();
|
|
280777
281014
|
let errors = 0;
|
|
@@ -280781,7 +281018,7 @@ async function check(argv) {
|
|
|
280781
281018
|
declaredTables.add(table);
|
|
280782
281019
|
const present = colsByTable.get(table);
|
|
280783
281020
|
if (!present) {
|
|
280784
|
-
console.log(` ${
|
|
281021
|
+
console.log(` ${import_picocolors13.default.red("\u2717")} ${import_picocolors13.default.bold(key)} ${import_picocolors13.default.dim("\u2192")} table ${import_picocolors13.default.bold(table)} ${import_picocolors13.default.red("not found")}`);
|
|
280785
281022
|
errors++;
|
|
280786
281023
|
continue;
|
|
280787
281024
|
}
|
|
@@ -280803,26 +281040,26 @@ async function check(argv) {
|
|
|
280803
281040
|
if (!present.has(col)) problems.push(`missing column "${col}" (field ${fieldName})`);
|
|
280804
281041
|
}
|
|
280805
281042
|
if (problems.length > 0) {
|
|
280806
|
-
console.log(` ${
|
|
280807
|
-
for (const p2 of problems) console.log(` ${
|
|
280808
|
-
for (const w2 of warns) console.log(` ${
|
|
281043
|
+
console.log(` ${import_picocolors13.default.red("\u2717")} ${import_picocolors13.default.bold(key)} ${import_picocolors13.default.dim("\u2192")} ${table}`);
|
|
281044
|
+
for (const p2 of problems) console.log(` ${import_picocolors13.default.red("\u2022")} ${p2}`);
|
|
281045
|
+
for (const w2 of warns) console.log(` ${import_picocolors13.default.yellow("\u2022")} ${w2}`);
|
|
280809
281046
|
errors++;
|
|
280810
281047
|
} else if (warns.length > 0) {
|
|
280811
|
-
console.log(` ${
|
|
280812
|
-
for (const w2 of warns) console.log(` ${
|
|
281048
|
+
console.log(` ${import_picocolors13.default.yellow("!")} ${import_picocolors13.default.bold(key)} ${import_picocolors13.default.dim("\u2192")} ${table}`);
|
|
281049
|
+
for (const w2 of warns) console.log(` ${import_picocolors13.default.yellow("\u2022")} ${w2}`);
|
|
280813
281050
|
warnings++;
|
|
280814
281051
|
} else {
|
|
280815
|
-
console.log(` ${
|
|
281052
|
+
console.log(` ${import_picocolors13.default.green("\u2713")} ${import_picocolors13.default.bold(key)} ${import_picocolors13.default.dim(`\u2192 ${table} (id, ${orgCol ?? "no org"} ok)`)}`);
|
|
280816
281053
|
}
|
|
280817
281054
|
}
|
|
280818
281055
|
const modelCount = Object.keys(schemaJson.models).length;
|
|
280819
281056
|
const ignored = [...colsByTable.keys()].filter((t) => !declaredTables.has(t)).length;
|
|
280820
281057
|
console.log(
|
|
280821
281058
|
`
|
|
280822
|
-
${modelCount} model${modelCount === 1 ? "" : "s"} \xB7 ${
|
|
281059
|
+
${modelCount} model${modelCount === 1 ? "" : "s"} \xB7 ${import_picocolors13.default.green(`${modelCount - errors - warnings} ok`)}` + (warnings ? ` \xB7 ${import_picocolors13.default.yellow(`${warnings} warning${warnings === 1 ? "" : "s"}`)}` : "") + (errors ? ` \xB7 ${import_picocolors13.default.red(`${errors} error${errors === 1 ? "" : "s"}`)}` : "")
|
|
280823
281060
|
);
|
|
280824
281061
|
if (ignored > 0) {
|
|
280825
|
-
console.log(` ${
|
|
281062
|
+
console.log(` ${import_picocolors13.default.dim(`${ignored} other table${ignored === 1 ? "" : "s"} in your database \u2014 ignored by Ablo`)}`);
|
|
280826
281063
|
}
|
|
280827
281064
|
console.log();
|
|
280828
281065
|
process.exit(errors > 0 ? 1 : 0);
|
|
@@ -280830,7 +281067,7 @@ async function check(argv) {
|
|
|
280830
281067
|
|
|
280831
281068
|
// src/cli/upgrade.ts
|
|
280832
281069
|
init_cjs_shims();
|
|
280833
|
-
var
|
|
281070
|
+
var import_picocolors14 = __toESM(require_picocolors(), 1);
|
|
280834
281071
|
var import_ts_morph = __toESM(require_ts_morph(), 1);
|
|
280835
281072
|
var DEFAULT_GLOBS = ["app/**/*.{ts,tsx}", "src/**/*.{ts,tsx}", "ablo/**/*.{ts,tsx}", "lib/**/*.{ts,tsx}"];
|
|
280836
281073
|
var VERB_ARGS = {
|
|
@@ -280908,7 +281145,7 @@ async function upgrade(argv) {
|
|
|
280908
281145
|
project.addSourceFilesAtPaths(globs.length > 0 ? globs : DEFAULT_GLOBS);
|
|
280909
281146
|
const files = project.getSourceFiles();
|
|
280910
281147
|
if (files.length === 0) {
|
|
280911
|
-
console.log(
|
|
281148
|
+
console.log(import_picocolors14.default.yellow(' No .ts/.tsx files found. Pass a glob, e.g. `ablo upgrade "src/**/*.tsx"`.'));
|
|
280912
281149
|
return;
|
|
280913
281150
|
}
|
|
280914
281151
|
const edits = [];
|
|
@@ -280982,38 +281219,38 @@ async function upgrade(argv) {
|
|
|
280982
281219
|
const rel = (f) => f.replace(cwd + "/", "");
|
|
280983
281220
|
console.log();
|
|
280984
281221
|
if (edits.length === 0 && manual.length === 0) {
|
|
280985
|
-
console.log(
|
|
281222
|
+
console.log(import_picocolors14.default.green(" \u2713 Nothing to migrate \u2014 your code is already on the current API."));
|
|
280986
281223
|
return;
|
|
280987
281224
|
}
|
|
280988
281225
|
if (edits.length > 0) {
|
|
280989
|
-
console.log(
|
|
281226
|
+
console.log(import_picocolors14.default.bold(` ${write ? "Applied" : "Would apply"} ${edits.length} change${edits.length === 1 ? "" : "s"}:`));
|
|
280990
281227
|
for (const e2 of edits) {
|
|
280991
|
-
console.log(` ${
|
|
280992
|
-
console.log(` ${
|
|
280993
|
-
console.log(` ${
|
|
281228
|
+
console.log(` ${import_picocolors14.default.dim(`${rel(e2.file)}:${e2.line}`)} ${import_picocolors14.default.cyan(e2.rule)}`);
|
|
281229
|
+
console.log(` ${import_picocolors14.default.red("-")} ${e2.before}`);
|
|
281230
|
+
console.log(` ${import_picocolors14.default.green("+")} ${e2.after}`);
|
|
280994
281231
|
}
|
|
280995
281232
|
}
|
|
280996
281233
|
if (manual.length > 0) {
|
|
280997
281234
|
console.log();
|
|
280998
|
-
console.log(
|
|
281235
|
+
console.log(import_picocolors14.default.bold(import_picocolors14.default.yellow(` ${manual.length} spot${manual.length === 1 ? "" : "s"} need manual review (structural):`)));
|
|
280999
281236
|
for (const m2 of manual) {
|
|
281000
|
-
console.log(` ${
|
|
281001
|
-
console.log(` ${
|
|
281237
|
+
console.log(` ${import_picocolors14.default.dim(`${rel(m2.file)}:${m2.line}`)} ${import_picocolors14.default.yellow(m2.rule)}`);
|
|
281238
|
+
console.log(` ${import_picocolors14.default.dim(m2.snippet)}`);
|
|
281002
281239
|
console.log(` \u2192 ${m2.hint}`);
|
|
281003
281240
|
}
|
|
281004
281241
|
}
|
|
281005
281242
|
console.log();
|
|
281006
281243
|
if (write) {
|
|
281007
281244
|
await project.save();
|
|
281008
|
-
console.log(
|
|
281245
|
+
console.log(import_picocolors14.default.green(` \u2713 Wrote ${edits.length} change${edits.length === 1 ? "" : "s"}. Review the diff, run your typecheck.`));
|
|
281009
281246
|
} else {
|
|
281010
|
-
console.log(
|
|
281247
|
+
console.log(import_picocolors14.default.dim(" Dry run. Re-run with `--write` to apply the auto-fixes above (manual items are never auto-written)."));
|
|
281011
281248
|
}
|
|
281012
281249
|
}
|
|
281013
281250
|
|
|
281014
281251
|
// src/cli/pull.ts
|
|
281015
281252
|
init_cjs_shims();
|
|
281016
|
-
var
|
|
281253
|
+
var import_picocolors15 = __toESM(require_picocolors(), 1);
|
|
281017
281254
|
var import_fs9 = require("fs");
|
|
281018
281255
|
var DEFAULT_OUT2 = "ablo/schema.ts";
|
|
281019
281256
|
var DEFAULT_IMPORT = "@abloatai/ablo/schema";
|
|
@@ -281125,52 +281362,52 @@ async function pull(argv) {
|
|
|
281125
281362
|
try {
|
|
281126
281363
|
args = parsePullArgs(argv);
|
|
281127
281364
|
} catch (err) {
|
|
281128
|
-
console.error(
|
|
281365
|
+
console.error(import_picocolors15.default.red(` ${err instanceof Error ? err.message : String(err)}`));
|
|
281129
281366
|
process.exit(1);
|
|
281130
281367
|
}
|
|
281131
281368
|
const dbUrl = process.env.DATABASE_URL ?? process.env.ABLO_DATABASE_URL;
|
|
281132
281369
|
if (!dbUrl) {
|
|
281133
|
-
console.error(
|
|
281370
|
+
console.error(import_picocolors15.default.red(` No database.`) + import_picocolors15.default.dim(` Set ${import_picocolors15.default.bold("DATABASE_URL")} to the Postgres to pull from.`));
|
|
281134
281371
|
process.exit(1);
|
|
281135
281372
|
}
|
|
281136
281373
|
if ((0, import_fs9.existsSync)(args.out) && !args.force) {
|
|
281137
281374
|
console.error(
|
|
281138
|
-
|
|
281375
|
+
import_picocolors15.default.red(` ${args.out} already exists.`) + import_picocolors15.default.dim(` Re-run with ${import_picocolors15.default.bold("--force")} to overwrite.`)
|
|
281139
281376
|
);
|
|
281140
281377
|
process.exit(1);
|
|
281141
281378
|
}
|
|
281142
281379
|
console.log(`
|
|
281143
|
-
${brand("ablo")} ${
|
|
281380
|
+
${brand("ablo")} ${import_picocolors15.default.dim("pull")} ${import_picocolors15.default.dim(`schema "${args.appSchema}"`)}
|
|
281144
281381
|
`);
|
|
281145
281382
|
let result;
|
|
281146
281383
|
try {
|
|
281147
281384
|
result = await buildSchemaSourceFromDb({ dbUrl, appSchema: args.appSchema, importPath: args.importPath });
|
|
281148
281385
|
} catch (err) {
|
|
281149
|
-
console.error(
|
|
281386
|
+
console.error(import_picocolors15.default.red(` Couldn't read the database: ${err instanceof Error ? err.message : String(err)}`));
|
|
281150
281387
|
process.exit(1);
|
|
281151
281388
|
}
|
|
281152
281389
|
if (result.models.length === 0) {
|
|
281153
281390
|
console.error(
|
|
281154
|
-
|
|
281391
|
+
import_picocolors15.default.yellow(` No adoptable tables found`) + import_picocolors15.default.dim(` (a model needs an ${import_picocolors15.default.bold("id")} + ${import_picocolors15.default.bold("organization_id")} column).`)
|
|
281155
281392
|
);
|
|
281156
281393
|
process.exit(1);
|
|
281157
281394
|
}
|
|
281158
281395
|
(0, import_fs9.writeFileSync)(args.out, result.source);
|
|
281159
|
-
console.log(` ${
|
|
281160
|
-
console.log(` ${
|
|
281396
|
+
console.log(` ${import_picocolors15.default.green("\u2713")} wrote ${import_picocolors15.default.bold(args.out)} ${import_picocolors15.default.dim(`(${result.models.length} models)`)}`);
|
|
281397
|
+
console.log(` ${import_picocolors15.default.dim(`models: ${result.models.join(", ")}`)}`);
|
|
281161
281398
|
if (result.skipped > 0) {
|
|
281162
|
-
console.log(` ${
|
|
281399
|
+
console.log(` ${import_picocolors15.default.dim(`${result.skipped} table(s) skipped \u2014 no id/organization_id`)}`);
|
|
281163
281400
|
}
|
|
281164
281401
|
console.log(
|
|
281165
281402
|
`
|
|
281166
|
-
${
|
|
281403
|
+
${import_picocolors15.default.dim("Introspection is lossy (enums, JSON shape, relations). Review the file, then")} ${import_picocolors15.default.bold("ablo check")}.
|
|
281167
281404
|
`
|
|
281168
281405
|
);
|
|
281169
281406
|
}
|
|
281170
281407
|
|
|
281171
281408
|
// src/cli/prisma-pull.ts
|
|
281172
281409
|
init_cjs_shims();
|
|
281173
|
-
var
|
|
281410
|
+
var import_picocolors16 = __toESM(require_picocolors(), 1);
|
|
281174
281411
|
var import_fs10 = require("fs");
|
|
281175
281412
|
|
|
281176
281413
|
// src/cli/schema-ir.ts
|
|
@@ -281448,55 +281685,55 @@ async function prismaPull(argv) {
|
|
|
281448
281685
|
try {
|
|
281449
281686
|
args = parsePrismaPullArgs(argv);
|
|
281450
281687
|
} catch (err) {
|
|
281451
|
-
console.error(
|
|
281688
|
+
console.error(import_picocolors16.default.red(` ${err instanceof Error ? err.message : String(err)}`));
|
|
281452
281689
|
process.exit(1);
|
|
281453
281690
|
}
|
|
281454
281691
|
if (!(0, import_fs10.existsSync)(args.schema)) {
|
|
281455
281692
|
console.error(
|
|
281456
|
-
|
|
281693
|
+
import_picocolors16.default.red(` No Prisma schema at ${import_picocolors16.default.bold(args.schema)}.`) + import_picocolors16.default.dim(` Pass a path: ${import_picocolors16.default.bold("ablo pull prisma <path>")}.`)
|
|
281457
281694
|
);
|
|
281458
281695
|
process.exit(1);
|
|
281459
281696
|
}
|
|
281460
281697
|
if ((0, import_fs10.existsSync)(args.out) && !args.force) {
|
|
281461
281698
|
console.error(
|
|
281462
|
-
|
|
281699
|
+
import_picocolors16.default.red(` ${args.out} already exists.`) + import_picocolors16.default.dim(` Re-run with ${import_picocolors16.default.bold("--force")} to overwrite.`)
|
|
281463
281700
|
);
|
|
281464
281701
|
process.exit(1);
|
|
281465
281702
|
}
|
|
281466
281703
|
console.log(`
|
|
281467
|
-
${brand("ablo")} ${
|
|
281704
|
+
${brand("ablo")} ${import_picocolors16.default.dim("pull prisma")} ${import_picocolors16.default.dim(args.schema)}
|
|
281468
281705
|
`);
|
|
281469
281706
|
let result;
|
|
281470
281707
|
try {
|
|
281471
281708
|
const src = (0, import_fs10.readFileSync)(args.schema, "utf8");
|
|
281472
281709
|
result = buildSchemaSourceFromPrisma({ src, importPath: args.importPath });
|
|
281473
281710
|
} catch (err) {
|
|
281474
|
-
console.error(
|
|
281711
|
+
console.error(import_picocolors16.default.red(` Couldn't parse the schema: ${err instanceof Error ? err.message : String(err)}`));
|
|
281475
281712
|
process.exit(1);
|
|
281476
281713
|
}
|
|
281477
281714
|
if (result.models.length === 0) {
|
|
281478
281715
|
console.error(
|
|
281479
|
-
|
|
281716
|
+
import_picocolors16.default.yellow(` No adoptable models found`) + import_picocolors16.default.dim(` (a model needs an ${import_picocolors16.default.bold("id")} + ${import_picocolors16.default.bold("organizationId")} / ${import_picocolors16.default.bold("organization_id")}).`)
|
|
281480
281717
|
);
|
|
281481
281718
|
process.exit(1);
|
|
281482
281719
|
}
|
|
281483
281720
|
(0, import_fs10.writeFileSync)(args.out, result.source);
|
|
281484
|
-
console.log(` ${
|
|
281485
|
-
console.log(` ${
|
|
281721
|
+
console.log(` ${import_picocolors16.default.green("\u2713")} wrote ${import_picocolors16.default.bold(args.out)} ${import_picocolors16.default.dim(`(${result.models.length} models)`)}`);
|
|
281722
|
+
console.log(` ${import_picocolors16.default.dim(`models: ${result.models.join(", ")}`)}`);
|
|
281486
281723
|
if (result.skipped.length > 0) {
|
|
281487
|
-
console.log(` ${
|
|
281488
|
-
for (const s of result.skipped) console.log(` ${
|
|
281724
|
+
console.log(` ${import_picocolors16.default.dim(`${result.skipped.length} model(s) skipped:`)}`);
|
|
281725
|
+
for (const s of result.skipped) console.log(` ${import_picocolors16.default.dim(`- ${s.name}: ${s.reason}`)}`);
|
|
281489
281726
|
}
|
|
281490
281727
|
console.log(
|
|
281491
281728
|
`
|
|
281492
|
-
${
|
|
281729
|
+
${import_picocolors16.default.dim("Enums and relations were preserved. Review the file, then")} ${import_picocolors16.default.bold("ablo check")}.
|
|
281493
281730
|
`
|
|
281494
281731
|
);
|
|
281495
281732
|
}
|
|
281496
281733
|
|
|
281497
281734
|
// src/cli/drizzle-pull.ts
|
|
281498
281735
|
init_cjs_shims();
|
|
281499
|
-
var
|
|
281736
|
+
var import_picocolors17 = __toESM(require_picocolors(), 1);
|
|
281500
281737
|
var import_fs11 = require("fs");
|
|
281501
281738
|
var import_path6 = require("path");
|
|
281502
281739
|
var DEFAULT_OUT4 = "ablo/schema.ts";
|
|
@@ -281632,27 +281869,27 @@ async function drizzlePull(argv) {
|
|
|
281632
281869
|
try {
|
|
281633
281870
|
args = parseDrizzlePullArgs(argv);
|
|
281634
281871
|
} catch (err) {
|
|
281635
|
-
console.error(
|
|
281872
|
+
console.error(import_picocolors17.default.red(` ${err instanceof Error ? err.message : String(err)}`));
|
|
281636
281873
|
process.exit(1);
|
|
281637
281874
|
}
|
|
281638
281875
|
if (!args.schema) {
|
|
281639
281876
|
console.error(
|
|
281640
|
-
|
|
281877
|
+
import_picocolors17.default.red(` No Drizzle schema given.`) + import_picocolors17.default.dim(` Pass the module: ${import_picocolors17.default.bold("ablo pull drizzle src/db/schema.ts")}.`)
|
|
281641
281878
|
);
|
|
281642
281879
|
process.exit(1);
|
|
281643
281880
|
}
|
|
281644
281881
|
if (!(0, import_fs11.existsSync)(args.schema)) {
|
|
281645
|
-
console.error(
|
|
281882
|
+
console.error(import_picocolors17.default.red(` No file at ${import_picocolors17.default.bold(args.schema)}.`));
|
|
281646
281883
|
process.exit(1);
|
|
281647
281884
|
}
|
|
281648
281885
|
if ((0, import_fs11.existsSync)(args.out) && !args.force) {
|
|
281649
281886
|
console.error(
|
|
281650
|
-
|
|
281887
|
+
import_picocolors17.default.red(` ${args.out} already exists.`) + import_picocolors17.default.dim(` Re-run with ${import_picocolors17.default.bold("--force")} to overwrite.`)
|
|
281651
281888
|
);
|
|
281652
281889
|
process.exit(1);
|
|
281653
281890
|
}
|
|
281654
281891
|
console.log(`
|
|
281655
|
-
${brand("ablo")} ${
|
|
281892
|
+
${brand("ablo")} ${import_picocolors17.default.dim("pull drizzle")} ${import_picocolors17.default.dim(args.schema)}
|
|
281656
281893
|
`);
|
|
281657
281894
|
let result;
|
|
281658
281895
|
try {
|
|
@@ -281660,33 +281897,33 @@ async function drizzlePull(argv) {
|
|
|
281660
281897
|
result = await buildSchemaSourceFromDrizzle({ mod, importPath: args.importPath });
|
|
281661
281898
|
} catch (err) {
|
|
281662
281899
|
const msg = err instanceof Error ? err.message : String(err);
|
|
281663
|
-
const hint = /Cannot find package 'drizzle-orm'/.test(msg) ?
|
|
281664
|
-
console.error(
|
|
281900
|
+
const hint = /Cannot find package 'drizzle-orm'/.test(msg) ? import_picocolors17.default.dim(` (install ${import_picocolors17.default.bold("drizzle-orm")} in this project)`) : "";
|
|
281901
|
+
console.error(import_picocolors17.default.red(` Couldn't load the schema: ${msg}`) + hint);
|
|
281665
281902
|
process.exit(1);
|
|
281666
281903
|
}
|
|
281667
281904
|
if (result.models.length === 0) {
|
|
281668
281905
|
console.error(
|
|
281669
|
-
|
|
281906
|
+
import_picocolors17.default.yellow(` No adoptable tables found`) + import_picocolors17.default.dim(` (a table needs an ${import_picocolors17.default.bold("id")} + ${import_picocolors17.default.bold("organization_id")} column).`)
|
|
281670
281907
|
);
|
|
281671
281908
|
process.exit(1);
|
|
281672
281909
|
}
|
|
281673
281910
|
(0, import_fs11.writeFileSync)(args.out, result.source);
|
|
281674
|
-
console.log(` ${
|
|
281675
|
-
console.log(` ${
|
|
281911
|
+
console.log(` ${import_picocolors17.default.green("\u2713")} wrote ${import_picocolors17.default.bold(args.out)} ${import_picocolors17.default.dim(`(${result.models.length} models)`)}`);
|
|
281912
|
+
console.log(` ${import_picocolors17.default.dim(`models: ${result.models.join(", ")}`)}`);
|
|
281676
281913
|
if (result.skipped.length > 0) {
|
|
281677
|
-
console.log(` ${
|
|
281678
|
-
for (const s of result.skipped) console.log(` ${
|
|
281914
|
+
console.log(` ${import_picocolors17.default.dim(`${result.skipped.length} table(s) skipped:`)}`);
|
|
281915
|
+
for (const s of result.skipped) console.log(` ${import_picocolors17.default.dim(`- ${s.name}: ${s.reason}`)}`);
|
|
281679
281916
|
}
|
|
281680
281917
|
console.log(
|
|
281681
281918
|
`
|
|
281682
|
-
${
|
|
281919
|
+
${import_picocolors17.default.dim("Enums and relations were preserved. Review the file, then")} ${import_picocolors17.default.bold("ablo check")}.
|
|
281683
281920
|
`
|
|
281684
281921
|
);
|
|
281685
281922
|
}
|
|
281686
281923
|
|
|
281687
281924
|
// src/cli/index.ts
|
|
281688
281925
|
var LOGO = `
|
|
281689
|
-
${brand("ablo")} ${
|
|
281926
|
+
${brand("ablo")} ${import_picocolors18.default.dim("sync engine")}
|
|
281690
281927
|
`;
|
|
281691
281928
|
async function main() {
|
|
281692
281929
|
const command = process.argv[2];
|
|
@@ -281698,6 +281935,8 @@ async function main() {
|
|
|
281698
281935
|
logout();
|
|
281699
281936
|
} else if (command === "mode") {
|
|
281700
281937
|
await mode(process.argv.slice(3));
|
|
281938
|
+
} else if (command === "projects") {
|
|
281939
|
+
await projects(process.argv.slice(3));
|
|
281701
281940
|
} else if (command === "status") {
|
|
281702
281941
|
await status(process.argv.slice(3));
|
|
281703
281942
|
} else if (command === "logs") {
|
|
@@ -281705,7 +281944,7 @@ async function main() {
|
|
|
281705
281944
|
} else if (command === "webhooks") {
|
|
281706
281945
|
await webhooks(process.argv.slice(3));
|
|
281707
281946
|
} else if (command === "dev") {
|
|
281708
|
-
console.log(
|
|
281947
|
+
console.log(import_picocolors18.default.dim(" `ablo dev` is now `ablo push --watch` \u2014 running that."));
|
|
281709
281948
|
await dev([...process.argv.slice(3), "--watch"]);
|
|
281710
281949
|
} else if (command === "check") {
|
|
281711
281950
|
await check(process.argv.slice(3));
|
|
@@ -281723,8 +281962,9 @@ async function main() {
|
|
|
281723
281962
|
} else if (command === "push") {
|
|
281724
281963
|
const rest = process.argv.slice(3);
|
|
281725
281964
|
const advanced = rest.some((a) => ["--force", "--rename", "--backfill", "--url"].includes(a));
|
|
281726
|
-
const
|
|
281727
|
-
|
|
281965
|
+
const watching = rest.includes("--watch");
|
|
281966
|
+
const plan = resolvePushPlan();
|
|
281967
|
+
if (advanced || plan.flow === "production" && !watching) {
|
|
281728
281968
|
await push(rest);
|
|
281729
281969
|
} else {
|
|
281730
281970
|
await dev(rest);
|
|
@@ -281735,19 +281975,23 @@ async function main() {
|
|
|
281735
281975
|
await generate(process.argv.slice(3));
|
|
281736
281976
|
} else if (command === "schema") {
|
|
281737
281977
|
console.error(
|
|
281738
|
-
` ${
|
|
281978
|
+
` ${import_picocolors18.default.red("\u2717")} \`ablo schema push\` was renamed to \`${brand("ablo push")}\`.`
|
|
281739
281979
|
);
|
|
281740
281980
|
console.error(` Run \`ablo push${process.argv.slice(4).join(" ") ? " " + process.argv.slice(4).join(" ") : ""}\` instead.`);
|
|
281741
281981
|
process.exitCode = 1;
|
|
281742
281982
|
} else {
|
|
281743
281983
|
console.log(LOGO);
|
|
281744
|
-
console.log(` ${
|
|
281984
|
+
console.log(` ${import_picocolors18.default.bold("Usage:")}`);
|
|
281745
281985
|
console.log(` npx ablo init Scaffold ablo/ directory + starter schema`);
|
|
281746
281986
|
console.log(` npx ablo init --yes [--framework nextjs] Non-interactive (agents/CI): no prompts, flag-driven`);
|
|
281747
|
-
console.log(` [--auth apikey] [--storage direct|endpoint] [--
|
|
281987
|
+
console.log(` [--auth apikey] [--storage direct|endpoint] [--project <slug>] [--no-project]`);
|
|
281988
|
+
console.log(` [--no-agent] [--no-pull] [--no-install] [--no-login]`);
|
|
281748
281989
|
console.log(` npx ablo login Authorize in your browser (provisions sandbox + production keys)`);
|
|
281749
281990
|
console.log(` npx ablo logout Remove the stored API key`);
|
|
281750
281991
|
console.log(` npx ablo mode [sandbox|production] Switch active environment, like Stripe`);
|
|
281992
|
+
console.log(` npx ablo projects list List the org's projects (default + your own)`);
|
|
281993
|
+
console.log(` npx ablo projects create <slug> Create a project (its keys/schema/data are isolated)`);
|
|
281994
|
+
console.log(` npx ablo projects use <slug|default> Set the active project for new key mints`);
|
|
281751
281995
|
console.log(` npx ablo status Show org, mode, keys, and server health`);
|
|
281752
281996
|
console.log(` npx ablo status --json Same, machine-readable (mode, key prefix, org id, api host)`);
|
|
281753
281997
|
console.log(` npx ablo logs [-n N] [--since 15m] Tail commit activity (follows; --no-follow to exit)`);
|
|
@@ -281767,10 +282011,10 @@ async function main() {
|
|
|
281767
282011
|
console.log(` npx ablo generate Emit TypeScript types from your schema`);
|
|
281768
282012
|
console.log(` npx ablo generate --out path.ts Write generated types to a path`);
|
|
281769
282013
|
console.log();
|
|
281770
|
-
console.log(` ${
|
|
282014
|
+
console.log(` ${import_picocolors18.default.bold("Schema workflow:")}`);
|
|
281771
282015
|
console.log(` The server holds its own copy of your schema \u2014 edit ${brand("ablo/schema.ts")}, then`);
|
|
281772
282016
|
console.log(` run ${brand("ablo push")} (or keep ${brand("ablo dev")} running) before the server will accept`);
|
|
281773
|
-
console.log(` writes to new or changed models. Skip it and writes fail with ${
|
|
282017
|
+
console.log(` writes to new or changed models. Skip it and writes fail with ${import_picocolors18.default.yellow("server_execute_unknown_model")}.`);
|
|
281774
282018
|
console.log();
|
|
281775
282019
|
}
|
|
281776
282020
|
}
|
|
@@ -281801,9 +282045,30 @@ function parseInitArgs(args) {
|
|
|
281801
282045
|
pull: has("--no-pull") ? false : has("--pull") ? true : void 0,
|
|
281802
282046
|
install: !has("--no-install"),
|
|
281803
282047
|
login: !has("--no-login"),
|
|
281804
|
-
orm: val("--orm")
|
|
282048
|
+
orm: val("--orm"),
|
|
282049
|
+
project: val("--project"),
|
|
282050
|
+
useProject: !has("--no-project")
|
|
281805
282051
|
};
|
|
281806
282052
|
}
|
|
282053
|
+
async function ensureInitProject(opts) {
|
|
282054
|
+
if (!opts.useProject) return;
|
|
282055
|
+
const slug = opts.project ?? projectSlugFromPackageName(
|
|
282056
|
+
(() => {
|
|
282057
|
+
try {
|
|
282058
|
+
return JSON.parse((0, import_fs12.readFileSync)("package.json", "utf-8")).name;
|
|
282059
|
+
} catch {
|
|
282060
|
+
return void 0;
|
|
282061
|
+
}
|
|
282062
|
+
})()
|
|
282063
|
+
);
|
|
282064
|
+
if (!slug) return;
|
|
282065
|
+
const ensured = await ensureProject(slug);
|
|
282066
|
+
if (ensured) {
|
|
282067
|
+
console.log(
|
|
282068
|
+
` ${import_picocolors18.default.green("\u2713")} ${ensured.created ? "Created" : "Using"} project ${import_picocolors18.default.bold(ensured.slug)} ${import_picocolors18.default.dim(`(${ensured.id})`)} \u2014 keys you mint for it are isolated from the org's other apps.`
|
|
282069
|
+
);
|
|
282070
|
+
}
|
|
282071
|
+
}
|
|
281807
282072
|
function detectOrm(override) {
|
|
281808
282073
|
if (override === "prisma" || override === "drizzle" || override === "none") return override;
|
|
281809
282074
|
try {
|
|
@@ -281838,7 +282103,7 @@ async function chooseBool(flagValue, fallback, interactive, prompt) {
|
|
|
281838
282103
|
async function init(args = []) {
|
|
281839
282104
|
const opts = parseInitArgs(args);
|
|
281840
282105
|
const interactive = Boolean(process.stdin.isTTY) && !opts.yes && !process.env.CI;
|
|
281841
|
-
Ie(`${brand("ablo")} ${
|
|
282106
|
+
Ie(`${brand("ablo")} ${import_picocolors18.default.dim("sync engine")}`);
|
|
281842
282107
|
if (!(0, import_fs12.existsSync)("package.json")) {
|
|
281843
282108
|
xe("No package.json found. Run this from your project root.");
|
|
281844
282109
|
process.exit(1);
|
|
@@ -281922,7 +282187,7 @@ async function init(args = []) {
|
|
|
281922
282187
|
if (pullExisting) {
|
|
281923
282188
|
const dbUrl = process.env.DATABASE_URL ?? process.env.ABLO_DATABASE_URL;
|
|
281924
282189
|
if (!dbUrl) {
|
|
281925
|
-
schemaNote =
|
|
282190
|
+
schemaNote = import_picocolors18.default.dim(" (no DATABASE_URL \u2014 wrote starter; run `ablo pull` later)");
|
|
281926
282191
|
} else {
|
|
281927
282192
|
try {
|
|
281928
282193
|
const pulled = await buildSchemaSourceFromDb({
|
|
@@ -281932,12 +282197,12 @@ async function init(args = []) {
|
|
|
281932
282197
|
});
|
|
281933
282198
|
if (pulled.models.length > 0) {
|
|
281934
282199
|
schemaSource = pulled.source;
|
|
281935
|
-
schemaNote =
|
|
282200
|
+
schemaNote = import_picocolors18.default.dim(` (pulled ${pulled.models.length} models)`);
|
|
281936
282201
|
} else {
|
|
281937
|
-
schemaNote =
|
|
282202
|
+
schemaNote = import_picocolors18.default.dim(" (no adoptable tables \u2014 wrote starter)");
|
|
281938
282203
|
}
|
|
281939
282204
|
} catch {
|
|
281940
|
-
schemaNote =
|
|
282205
|
+
schemaNote = import_picocolors18.default.dim(" (pull failed \u2014 wrote starter)");
|
|
281941
282206
|
}
|
|
281942
282207
|
}
|
|
281943
282208
|
}
|
|
@@ -281958,9 +282223,9 @@ async function init(args = []) {
|
|
|
281958
282223
|
const existing = (0, import_fs12.readFileSync)(envFile, "utf-8");
|
|
281959
282224
|
if (!existing.includes("ABLO_")) {
|
|
281960
282225
|
(0, import_fs12.writeFileSync)(envFile, existing + "\n" + generateEnv(storage));
|
|
281961
|
-
created.push(`${envFile} ${
|
|
282226
|
+
created.push(`${envFile} ${import_picocolors18.default.dim("(appended)")}`);
|
|
281962
282227
|
} else {
|
|
281963
|
-
created.push(`${envFile} ${
|
|
282228
|
+
created.push(`${envFile} ${import_picocolors18.default.dim("(already configured)")}`);
|
|
281964
282229
|
}
|
|
281965
282230
|
}
|
|
281966
282231
|
if (agent) {
|
|
@@ -281975,17 +282240,17 @@ async function init(args = []) {
|
|
|
281975
282240
|
created.push(`${webhookDir}/route.ts${orm === "prisma" ? " (Prisma mirror)" : " (add your database write)"}`);
|
|
281976
282241
|
}
|
|
281977
282242
|
(0, import_fs12.writeFileSync)((0, import_path7.join)("app", "providers.tsx"), generateProviders());
|
|
281978
|
-
created.push(`app/providers.tsx ${
|
|
282243
|
+
created.push(`app/providers.tsx ${import_picocolors18.default.dim("(wrap app/layout.tsx in <Providers>)")}`);
|
|
281979
282244
|
const sessionDir = (0, import_path7.join)("app", "api", "ablo-session");
|
|
281980
282245
|
(0, import_fs12.mkdirSync)(sessionDir, { recursive: true });
|
|
281981
282246
|
(0, import_fs12.writeFileSync)((0, import_path7.join)(sessionDir, "route.ts"), generateSessionRoute());
|
|
281982
|
-
created.push(`app/api/ablo-session/route.ts ${
|
|
282247
|
+
created.push(`app/api/ablo-session/route.ts ${import_picocolors18.default.dim("(wire your auth)")}`);
|
|
281983
282248
|
}
|
|
281984
282249
|
if (framework !== "vanilla") {
|
|
281985
282250
|
(0, import_fs12.writeFileSync)((0, import_path7.join)(abloDir, "TaskList.tsx"), generateComponent());
|
|
281986
282251
|
created.push(`${abloDir}/TaskList.tsx`);
|
|
281987
282252
|
}
|
|
281988
|
-
Me(created.map((f) => `${
|
|
282253
|
+
Me(created.map((f) => `${import_picocolors18.default.green("\u2713")} ${f}`).join("\n"), "Created");
|
|
281989
282254
|
const pm = detectPackageManager();
|
|
281990
282255
|
if (opts.install) {
|
|
281991
282256
|
const s = Y2();
|
|
@@ -281994,43 +282259,45 @@ async function init(args = []) {
|
|
|
281994
282259
|
(0, import_child_process2.execSync)(`${pm} add @abloatai/ablo`, { stdio: "ignore" });
|
|
281995
282260
|
s.stop("Installed @abloatai/ablo");
|
|
281996
282261
|
} catch {
|
|
281997
|
-
s.stop(`${
|
|
282262
|
+
s.stop(`${import_picocolors18.default.yellow("!")} Couldn't auto-install \u2014 run ${import_picocolors18.default.bold(`${pm} install @abloatai/ablo`)}`);
|
|
281998
282263
|
}
|
|
281999
282264
|
}
|
|
282000
282265
|
const steps = [
|
|
282001
|
-
`Get a ${
|
|
282002
|
-
`Run ${
|
|
282003
|
-
`Set ${
|
|
282004
|
-
`Run ${
|
|
282266
|
+
`Get a ${import_picocolors18.default.bold("sk_test_")} key at ${import_picocolors18.default.cyan("https://abloatai.com")}`,
|
|
282267
|
+
`Run ${import_picocolors18.default.bold("npx ablo login")} (or add ${import_picocolors18.default.bold("ABLO_API_KEY")} to ${import_picocolors18.default.bold(envFile)})`,
|
|
282268
|
+
`Set ${import_picocolors18.default.bold("DATABASE_URL")} in ${import_picocolors18.default.bold(envFile)} \u2014 your Postgres is the system of record; rows live there, never with Ablo`,
|
|
282269
|
+
`Run ${import_picocolors18.default.bold("npx ablo dev")} \u2014 pushes your schema definition and watches for changes`,
|
|
282005
282270
|
...storage === "direct" ? [
|
|
282006
|
-
`Provision your DB: ${
|
|
282271
|
+
`Provision your DB: ${import_picocolors18.default.bold("npx ablo migrate")} (creates your synced-model tables with row-level security; keep your own migrations for everything else)`
|
|
282007
282272
|
] : [
|
|
282008
|
-
`Provision your DB: ${
|
|
282273
|
+
`Provision your DB: ${import_picocolors18.default.bold("npx ablo migrate")} (creates your Ablo-model tables + the adapter tables; keep your own migrations for everything else), then mount ${import_picocolors18.default.bold(`${abloDir}/data-source.ts`)} at ${import_picocolors18.default.bold("/api/ablo/source")}`
|
|
282009
282274
|
],
|
|
282010
282275
|
...framework === "nextjs" ? [
|
|
282011
|
-
`Wrap ${
|
|
282276
|
+
`Wrap ${import_picocolors18.default.bold("app/layout.tsx")} in ${import_picocolors18.default.bold("<Providers>")} (app/providers.tsx) and add your auth to ${import_picocolors18.default.bold("app/api/ablo-session/route.ts")}`
|
|
282012
282277
|
] : [],
|
|
282013
|
-
`Run ${
|
|
282278
|
+
`Run ${import_picocolors18.default.bold(`${pm} run dev`)} and open two browser tabs \u2014 changes sync in real-time`,
|
|
282014
282279
|
...agent ? [
|
|
282015
|
-
`Run ${
|
|
282016
|
-
`Run ${
|
|
282280
|
+
`Run ${import_picocolors18.default.bold(`npx tsx ${abloDir}/agent.ts`)} \u2014 an AI teammate edits the same tasks`,
|
|
282281
|
+
`Run ${import_picocolors18.default.bold("npx ablo logs")} to watch human + agent commits stream by`
|
|
282017
282282
|
] : []
|
|
282018
282283
|
];
|
|
282019
282284
|
Me(steps.map((s, i) => `${i + 1}. ${s}`).join("\n"), "Next steps");
|
|
282020
282285
|
const existingKey = resolveApiKey("sandbox");
|
|
282021
282286
|
if (existingKey) {
|
|
282022
|
-
|
|
282287
|
+
await ensureInitProject(opts);
|
|
282288
|
+
Se(`Already authorized ${import_picocolors18.default.dim(`(${existingKey.slice(0, 11)}\u2026)`)} \u2014 run ${import_picocolors18.default.bold("npx ablo push")} next. ${import_picocolors18.default.dim("Docs:")} https://abloatai.com/docs`);
|
|
282023
282289
|
return;
|
|
282024
282290
|
}
|
|
282025
282291
|
if (interactive && opts.login) {
|
|
282026
282292
|
const loginNow = await ye({ message: "Log in now? (opens your browser)", initialValue: true });
|
|
282027
282293
|
if (!pD(loginNow) && loginNow) {
|
|
282028
|
-
Se(`${
|
|
282294
|
+
Se(`${import_picocolors18.default.dim("Docs:")} https://abloatai.com/docs`);
|
|
282029
282295
|
await login();
|
|
282296
|
+
await ensureInitProject(opts);
|
|
282030
282297
|
return;
|
|
282031
282298
|
}
|
|
282032
282299
|
}
|
|
282033
|
-
Se(`Run ${
|
|
282300
|
+
Se(`Run ${import_picocolors18.default.bold("npx ablo login")} when ready. ${import_picocolors18.default.dim("Docs:")} https://abloatai.com/docs`);
|
|
282034
282301
|
}
|
|
282035
282302
|
function generateSchema() {
|
|
282036
282303
|
return `import { defineSchema, model, relation, z } from '@abloatai/ablo/schema';
|