@semiont/cli 0.2.38 → 0.2.40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/cli.mjs +376 -310
- package/package.json +4 -4
package/dist/cli.mjs
CHANGED
|
@@ -341,10 +341,10 @@ function mergeDefs(...defs) {
|
|
|
341
341
|
function cloneDef(schema2) {
|
|
342
342
|
return mergeDefs(schema2._zod.def);
|
|
343
343
|
}
|
|
344
|
-
function getElementAtPath(obj,
|
|
345
|
-
if (!
|
|
344
|
+
function getElementAtPath(obj, path39) {
|
|
345
|
+
if (!path39)
|
|
346
346
|
return obj;
|
|
347
|
-
return
|
|
347
|
+
return path39.reduce((acc, key) => acc?.[key], obj);
|
|
348
348
|
}
|
|
349
349
|
function promiseAllObject(promisesObj) {
|
|
350
350
|
const keys = Object.keys(promisesObj);
|
|
@@ -634,11 +634,11 @@ function aborted(x, startIndex = 0) {
|
|
|
634
634
|
}
|
|
635
635
|
return false;
|
|
636
636
|
}
|
|
637
|
-
function prefixIssues(
|
|
637
|
+
function prefixIssues(path39, issues) {
|
|
638
638
|
return issues.map((iss) => {
|
|
639
639
|
var _a4;
|
|
640
640
|
(_a4 = iss).path ?? (_a4.path = []);
|
|
641
|
-
iss.path.unshift(
|
|
641
|
+
iss.path.unshift(path39);
|
|
642
642
|
return iss;
|
|
643
643
|
});
|
|
644
644
|
}
|
|
@@ -859,7 +859,7 @@ function formatError(error46, mapper = (issue2) => issue2.message) {
|
|
|
859
859
|
}
|
|
860
860
|
function treeifyError(error46, mapper = (issue2) => issue2.message) {
|
|
861
861
|
const result = { errors: [] };
|
|
862
|
-
const processError = (error47,
|
|
862
|
+
const processError = (error47, path39 = []) => {
|
|
863
863
|
var _a4, _b;
|
|
864
864
|
for (const issue2 of error47.issues) {
|
|
865
865
|
if (issue2.code === "invalid_union" && issue2.errors.length) {
|
|
@@ -869,7 +869,7 @@ function treeifyError(error46, mapper = (issue2) => issue2.message) {
|
|
|
869
869
|
} else if (issue2.code === "invalid_element") {
|
|
870
870
|
processError({ issues: issue2.issues }, issue2.path);
|
|
871
871
|
} else {
|
|
872
|
-
const fullpath = [...
|
|
872
|
+
const fullpath = [...path39, ...issue2.path];
|
|
873
873
|
if (fullpath.length === 0) {
|
|
874
874
|
result.errors.push(mapper(issue2));
|
|
875
875
|
continue;
|
|
@@ -901,8 +901,8 @@ function treeifyError(error46, mapper = (issue2) => issue2.message) {
|
|
|
901
901
|
}
|
|
902
902
|
function toDotPath(_path) {
|
|
903
903
|
const segs = [];
|
|
904
|
-
const
|
|
905
|
-
for (const seg of
|
|
904
|
+
const path39 = _path.map((seg) => typeof seg === "object" ? seg.key : seg);
|
|
905
|
+
for (const seg of path39) {
|
|
906
906
|
if (typeof seg === "number")
|
|
907
907
|
segs.push(`[${seg}]`);
|
|
908
908
|
else if (typeof seg === "symbol")
|
|
@@ -15816,7 +15816,7 @@ var init_graph_check = __esm({
|
|
|
15816
15816
|
// src/platforms/posix/handlers/backend-paths.ts
|
|
15817
15817
|
import * as path10 from "path";
|
|
15818
15818
|
import { createRequire } from "module";
|
|
15819
|
-
function
|
|
15819
|
+
function resolveBackendNpmPackage() {
|
|
15820
15820
|
try {
|
|
15821
15821
|
const require2 = createRequire(import.meta.url);
|
|
15822
15822
|
const pkgPath = require2.resolve("@semiont/backend/package.json");
|
|
@@ -15826,28 +15826,31 @@ function resolveNpmPackage() {
|
|
|
15826
15826
|
}
|
|
15827
15827
|
}
|
|
15828
15828
|
function getBackendPaths(context) {
|
|
15829
|
+
const projectRoot = context.service.projectRoot;
|
|
15830
|
+
const runtimeDir = path10.join(projectRoot, "backend");
|
|
15829
15831
|
const semiontRepo = context.options?.semiontRepo;
|
|
15830
15832
|
if (semiontRepo) {
|
|
15831
15833
|
const sourceDir = path10.join(semiontRepo, "apps", "backend");
|
|
15832
|
-
return buildPaths(sourceDir, false);
|
|
15834
|
+
return buildPaths(sourceDir, runtimeDir, false);
|
|
15833
15835
|
}
|
|
15834
|
-
const npmDir =
|
|
15836
|
+
const npmDir = resolveBackendNpmPackage();
|
|
15835
15837
|
if (npmDir) {
|
|
15836
|
-
return buildPaths(npmDir, true);
|
|
15838
|
+
return buildPaths(npmDir, runtimeDir, true);
|
|
15837
15839
|
}
|
|
15838
15840
|
throw new Error(
|
|
15839
15841
|
"Cannot find backend source. Either:\n - Set SEMIONT_REPO to your semiont clone, or\n - Run: npm install @semiont/backend"
|
|
15840
15842
|
);
|
|
15841
15843
|
}
|
|
15842
|
-
function buildPaths(sourceDir, fromNpmPackage) {
|
|
15844
|
+
function buildPaths(sourceDir, runtimeDir, fromNpmPackage) {
|
|
15843
15845
|
return {
|
|
15844
15846
|
sourceDir,
|
|
15845
|
-
|
|
15846
|
-
|
|
15847
|
-
|
|
15848
|
-
|
|
15849
|
-
|
|
15850
|
-
|
|
15847
|
+
runtimeDir,
|
|
15848
|
+
pidFile: path10.join(runtimeDir, ".pid"),
|
|
15849
|
+
envFile: path10.join(runtimeDir, ".env"),
|
|
15850
|
+
logsDir: path10.join(runtimeDir, "logs"),
|
|
15851
|
+
appLogFile: path10.join(runtimeDir, "logs", "app.log"),
|
|
15852
|
+
errorLogFile: path10.join(runtimeDir, "logs", "error.log"),
|
|
15853
|
+
tmpDir: path10.join(runtimeDir, "tmp"),
|
|
15851
15854
|
distDir: path10.join(sourceDir, "dist"),
|
|
15852
15855
|
fromNpmPackage
|
|
15853
15856
|
};
|
|
@@ -15880,7 +15883,8 @@ var init_backend_check = __esm({
|
|
|
15880
15883
|
let healthy = false;
|
|
15881
15884
|
let details = {
|
|
15882
15885
|
backendDir,
|
|
15883
|
-
port: config2.port
|
|
15886
|
+
port: config2.port,
|
|
15887
|
+
source: paths.fromNpmPackage ? "npm package" : "SEMIONT_REPO"
|
|
15884
15888
|
};
|
|
15885
15889
|
if (!fs10.existsSync(backendDir)) {
|
|
15886
15890
|
details.message = "Backend not provisioned";
|
|
@@ -16016,7 +16020,7 @@ var init_backend_check = __esm({
|
|
|
16016
16020
|
// src/platforms/posix/handlers/frontend-paths.ts
|
|
16017
16021
|
import * as path11 from "path";
|
|
16018
16022
|
import { createRequire as createRequire2 } from "module";
|
|
16019
|
-
function
|
|
16023
|
+
function resolveFrontendNpmPackage() {
|
|
16020
16024
|
try {
|
|
16021
16025
|
const require2 = createRequire2(import.meta.url);
|
|
16022
16026
|
const pkgPath = require2.resolve("@semiont/frontend/package.json");
|
|
@@ -16026,28 +16030,31 @@ function resolveNpmPackage2() {
|
|
|
16026
16030
|
}
|
|
16027
16031
|
}
|
|
16028
16032
|
function getFrontendPaths(context) {
|
|
16033
|
+
const projectRoot = context.service.projectRoot;
|
|
16034
|
+
const runtimeDir = path11.join(projectRoot, "frontend");
|
|
16029
16035
|
const semiontRepo = context.options?.semiontRepo;
|
|
16030
16036
|
if (semiontRepo) {
|
|
16031
16037
|
const sourceDir = path11.join(semiontRepo, "apps", "frontend");
|
|
16032
|
-
return buildPaths2(sourceDir, false);
|
|
16038
|
+
return buildPaths2(sourceDir, runtimeDir, false);
|
|
16033
16039
|
}
|
|
16034
|
-
const npmDir =
|
|
16040
|
+
const npmDir = resolveFrontendNpmPackage();
|
|
16035
16041
|
if (npmDir) {
|
|
16036
|
-
return buildPaths2(npmDir, true);
|
|
16042
|
+
return buildPaths2(npmDir, runtimeDir, true);
|
|
16037
16043
|
}
|
|
16038
16044
|
throw new Error(
|
|
16039
16045
|
"Cannot find frontend source. Either:\n - Set SEMIONT_REPO to your semiont clone, or\n - Run: npm install @semiont/frontend"
|
|
16040
16046
|
);
|
|
16041
16047
|
}
|
|
16042
|
-
function buildPaths2(sourceDir, fromNpmPackage) {
|
|
16048
|
+
function buildPaths2(sourceDir, runtimeDir, fromNpmPackage) {
|
|
16043
16049
|
return {
|
|
16044
16050
|
sourceDir,
|
|
16045
|
-
|
|
16046
|
-
|
|
16047
|
-
|
|
16048
|
-
|
|
16049
|
-
|
|
16050
|
-
|
|
16051
|
+
runtimeDir,
|
|
16052
|
+
pidFile: path11.join(runtimeDir, ".pid"),
|
|
16053
|
+
envLocalFile: path11.join(runtimeDir, ".env.local"),
|
|
16054
|
+
logsDir: path11.join(runtimeDir, "logs"),
|
|
16055
|
+
appLogFile: path11.join(runtimeDir, "logs", "app.log"),
|
|
16056
|
+
errorLogFile: path11.join(runtimeDir, "logs", "error.log"),
|
|
16057
|
+
tmpDir: path11.join(runtimeDir, "tmp"),
|
|
16051
16058
|
nextDir: path11.join(sourceDir, ".next"),
|
|
16052
16059
|
fromNpmPackage
|
|
16053
16060
|
};
|
|
@@ -16078,7 +16085,8 @@ var init_frontend_check = __esm({
|
|
|
16078
16085
|
let healthy = false;
|
|
16079
16086
|
let details = {
|
|
16080
16087
|
frontendDir,
|
|
16081
|
-
port: config2.port
|
|
16088
|
+
port: config2.port,
|
|
16089
|
+
source: paths.fromNpmPackage ? "npm package" : "SEMIONT_REPO"
|
|
16082
16090
|
};
|
|
16083
16091
|
if (!fs11.existsSync(frontendDir)) {
|
|
16084
16092
|
details.message = "Frontend not provisioned";
|
|
@@ -16854,9 +16862,9 @@ async function startJanusGraph(context) {
|
|
|
16854
16862
|
}
|
|
16855
16863
|
};
|
|
16856
16864
|
}
|
|
16857
|
-
async function fileExists(
|
|
16865
|
+
async function fileExists(path39) {
|
|
16858
16866
|
try {
|
|
16859
|
-
await fs15.access(
|
|
16867
|
+
await fs15.access(path39);
|
|
16860
16868
|
return true;
|
|
16861
16869
|
} catch {
|
|
16862
16870
|
return false;
|
|
@@ -16917,6 +16925,10 @@ var init_backend_start = __esm({
|
|
|
16917
16925
|
const config2 = service.config;
|
|
16918
16926
|
const paths = getBackendPaths(context);
|
|
16919
16927
|
const { sourceDir: backendSourceDir, envFile, pidFile, logsDir, tmpDir } = paths;
|
|
16928
|
+
if (service.verbose) {
|
|
16929
|
+
printInfo(`Source: ${backendSourceDir}`);
|
|
16930
|
+
printInfo(`Mode: ${paths.fromNpmPackage ? "npm package" : "SEMIONT_REPO"}`);
|
|
16931
|
+
}
|
|
16920
16932
|
if (!fs16.existsSync(backendSourceDir)) {
|
|
16921
16933
|
return {
|
|
16922
16934
|
success: false,
|
|
@@ -17135,6 +17147,10 @@ var init_frontend_start = __esm({
|
|
|
17135
17147
|
const config2 = service.config;
|
|
17136
17148
|
const paths = getFrontendPaths(context);
|
|
17137
17149
|
const { sourceDir: frontendSourceDir, envLocalFile: envFile, pidFile, logsDir, tmpDir } = paths;
|
|
17150
|
+
if (service.verbose) {
|
|
17151
|
+
printInfo(`Source: ${frontendSourceDir}`);
|
|
17152
|
+
printInfo(`Mode: ${paths.fromNpmPackage ? "npm package" : "SEMIONT_REPO"}`);
|
|
17153
|
+
}
|
|
17138
17154
|
if (!fs17.existsSync(frontendSourceDir)) {
|
|
17139
17155
|
return {
|
|
17140
17156
|
success: false,
|
|
@@ -17788,9 +17804,9 @@ Files placed here will persist across service restarts.
|
|
|
17788
17804
|
// src/platforms/posix/handlers/graph-provision.ts
|
|
17789
17805
|
import * as fs21 from "fs/promises";
|
|
17790
17806
|
import { execSync as execSync10 } from "child_process";
|
|
17791
|
-
async function fileExists2(
|
|
17807
|
+
async function fileExists2(path39) {
|
|
17792
17808
|
try {
|
|
17793
|
-
await fs21.access(
|
|
17809
|
+
await fs21.access(path39);
|
|
17794
17810
|
return true;
|
|
17795
17811
|
} catch {
|
|
17796
17812
|
return false;
|
|
@@ -17984,15 +18000,27 @@ var init_backend_provision = __esm({
|
|
|
17984
18000
|
provisionBackendService = async (context) => {
|
|
17985
18001
|
const { service, options } = context;
|
|
17986
18002
|
const config2 = service.config;
|
|
17987
|
-
|
|
17988
|
-
|
|
17989
|
-
|
|
17990
|
-
|
|
17991
|
-
|
|
17992
|
-
|
|
17993
|
-
|
|
17994
|
-
|
|
18003
|
+
if (!context.options?.semiontRepo && !resolveBackendNpmPackage()) {
|
|
18004
|
+
if (!service.quiet) {
|
|
18005
|
+
printInfo("Installing @semiont/backend...");
|
|
18006
|
+
}
|
|
18007
|
+
try {
|
|
18008
|
+
execSync11("npm install -g @semiont/backend", {
|
|
18009
|
+
stdio: service.verbose ? "inherit" : "pipe"
|
|
18010
|
+
});
|
|
18011
|
+
if (!service.quiet) {
|
|
18012
|
+
printSuccess("Installed @semiont/backend");
|
|
18013
|
+
}
|
|
18014
|
+
} catch (error46) {
|
|
18015
|
+
return {
|
|
18016
|
+
success: false,
|
|
18017
|
+
error: `Failed to install @semiont/backend: ${error46}`,
|
|
18018
|
+
metadata: { serviceType: "backend" }
|
|
18019
|
+
};
|
|
18020
|
+
}
|
|
17995
18021
|
}
|
|
18022
|
+
const paths = getBackendPaths(context);
|
|
18023
|
+
const { sourceDir: backendSourceDir, runtimeDir, envFile, logsDir, tmpDir } = paths;
|
|
17996
18024
|
if (!service.quiet) {
|
|
17997
18025
|
printInfo(`Provisioning backend service ${service.name}...`);
|
|
17998
18026
|
if (paths.fromNpmPackage) {
|
|
@@ -18000,11 +18028,13 @@ var init_backend_provision = __esm({
|
|
|
18000
18028
|
} else {
|
|
18001
18029
|
printInfo(`Using semiont repo: ${options.semiontRepo}`);
|
|
18002
18030
|
}
|
|
18031
|
+
printInfo(`Runtime directory: ${runtimeDir}`);
|
|
18003
18032
|
}
|
|
18033
|
+
fs22.mkdirSync(runtimeDir, { recursive: true });
|
|
18004
18034
|
fs22.mkdirSync(logsDir, { recursive: true });
|
|
18005
18035
|
fs22.mkdirSync(tmpDir, { recursive: true });
|
|
18006
18036
|
if (!service.quiet) {
|
|
18007
|
-
printInfo(`Created runtime directories in: ${
|
|
18037
|
+
printInfo(`Created runtime directories in: ${runtimeDir}`);
|
|
18008
18038
|
}
|
|
18009
18039
|
const envConfig = service.environmentConfig;
|
|
18010
18040
|
const dbConfig = envConfig.services?.database;
|
|
@@ -18234,7 +18264,7 @@ var init_backend_provision = __esm({
|
|
|
18234
18264
|
printInfo("You may need to run migrations manually: npx prisma migrate deploy");
|
|
18235
18265
|
}
|
|
18236
18266
|
}
|
|
18237
|
-
const readmePath = path18.join(
|
|
18267
|
+
const readmePath = path18.join(runtimeDir, "RUNTIME.md");
|
|
18238
18268
|
if (!fs22.existsSync(readmePath)) {
|
|
18239
18269
|
const readmeContent = `# Backend Runtime Directory
|
|
18240
18270
|
|
|
@@ -18242,37 +18272,28 @@ This directory contains runtime files for the backend service.
|
|
|
18242
18272
|
|
|
18243
18273
|
## Structure
|
|
18244
18274
|
|
|
18245
|
-
- \`.env\` - Environment configuration
|
|
18275
|
+
- \`.env\` - Environment configuration
|
|
18246
18276
|
- \`logs/\` - Application logs
|
|
18247
18277
|
- \`tmp/\` - Temporary files
|
|
18248
18278
|
- \`.pid\` - Process ID when running
|
|
18249
18279
|
|
|
18250
|
-
## Configuration
|
|
18251
|
-
|
|
18252
|
-
Edit \`.env\` to configure:
|
|
18253
|
-
- Database connection (DATABASE_URL)
|
|
18254
|
-
- Backend URL (BACKEND_URL)
|
|
18255
|
-
- JWT secret (JWT_SECRET)
|
|
18256
|
-
- Port (PORT)
|
|
18257
|
-
- Other environment-specific settings
|
|
18258
|
-
|
|
18259
18280
|
## Source Code
|
|
18260
18281
|
|
|
18261
|
-
|
|
18262
|
-
${backendSourceDir}
|
|
18282
|
+
${paths.fromNpmPackage ? `Installed npm package: ${backendSourceDir}` : `Semiont repo: ${backendSourceDir}`}
|
|
18263
18283
|
|
|
18264
18284
|
## Commands
|
|
18265
18285
|
|
|
18266
18286
|
- Start: \`semiont start --service backend --environment ${service.environment}\`
|
|
18267
18287
|
- Check: \`semiont check --service backend --environment ${service.environment}\`
|
|
18268
18288
|
- Stop: \`semiont stop --service backend --environment ${service.environment}\`
|
|
18269
|
-
- Logs: \`tail -f
|
|
18289
|
+
- Logs: \`tail -f ${logsDir}/app.log\`
|
|
18270
18290
|
`;
|
|
18271
18291
|
fs22.writeFileSync(readmePath, readmeContent);
|
|
18272
18292
|
}
|
|
18273
18293
|
const metadata = {
|
|
18274
18294
|
serviceType: "backend",
|
|
18275
18295
|
backendSourceDir,
|
|
18296
|
+
runtimeDir,
|
|
18276
18297
|
envFile,
|
|
18277
18298
|
logsDir,
|
|
18278
18299
|
tmpDir,
|
|
@@ -18283,6 +18304,7 @@ ${backendSourceDir}
|
|
|
18283
18304
|
printInfo("");
|
|
18284
18305
|
printInfo("Backend details:");
|
|
18285
18306
|
printInfo(` Source directory: ${backendSourceDir}`);
|
|
18307
|
+
printInfo(` Runtime directory: ${runtimeDir}`);
|
|
18286
18308
|
printInfo(` Environment file: ${envFile}`);
|
|
18287
18309
|
printInfo(` Logs directory: ${logsDir}`);
|
|
18288
18310
|
printInfo("");
|
|
@@ -18338,15 +18360,27 @@ var init_frontend_provision = __esm({
|
|
|
18338
18360
|
init_preflight_utils();
|
|
18339
18361
|
provisionFrontendService = async (context) => {
|
|
18340
18362
|
const { service } = context;
|
|
18341
|
-
|
|
18342
|
-
|
|
18343
|
-
|
|
18344
|
-
|
|
18345
|
-
|
|
18346
|
-
|
|
18347
|
-
|
|
18348
|
-
|
|
18363
|
+
if (!context.options?.semiontRepo && !resolveFrontendNpmPackage()) {
|
|
18364
|
+
if (!service.quiet) {
|
|
18365
|
+
printInfo("Installing @semiont/frontend...");
|
|
18366
|
+
}
|
|
18367
|
+
try {
|
|
18368
|
+
execSync12("npm install -g @semiont/frontend", {
|
|
18369
|
+
stdio: service.verbose ? "inherit" : "pipe"
|
|
18370
|
+
});
|
|
18371
|
+
if (!service.quiet) {
|
|
18372
|
+
printSuccess("Installed @semiont/frontend");
|
|
18373
|
+
}
|
|
18374
|
+
} catch (error46) {
|
|
18375
|
+
return {
|
|
18376
|
+
success: false,
|
|
18377
|
+
error: `Failed to install @semiont/frontend: ${error46}`,
|
|
18378
|
+
metadata: { serviceType: "frontend" }
|
|
18379
|
+
};
|
|
18380
|
+
}
|
|
18349
18381
|
}
|
|
18382
|
+
const paths = getFrontendPaths(context);
|
|
18383
|
+
const { sourceDir: frontendSourceDir, runtimeDir, logsDir, tmpDir, envLocalFile: envFile } = paths;
|
|
18350
18384
|
if (!service.quiet) {
|
|
18351
18385
|
printInfo(`Provisioning frontend service ${service.name}...`);
|
|
18352
18386
|
if (paths.fromNpmPackage) {
|
|
@@ -18354,11 +18388,13 @@ var init_frontend_provision = __esm({
|
|
|
18354
18388
|
} else {
|
|
18355
18389
|
printInfo(`Using source directory: ${frontendSourceDir}`);
|
|
18356
18390
|
}
|
|
18391
|
+
printInfo(`Runtime directory: ${runtimeDir}`);
|
|
18357
18392
|
}
|
|
18393
|
+
fs23.mkdirSync(runtimeDir, { recursive: true });
|
|
18358
18394
|
fs23.mkdirSync(logsDir, { recursive: true });
|
|
18359
18395
|
fs23.mkdirSync(tmpDir, { recursive: true });
|
|
18360
18396
|
if (!service.quiet) {
|
|
18361
|
-
printInfo(`Created runtime directories in: ${
|
|
18397
|
+
printInfo(`Created runtime directories in: ${runtimeDir}`);
|
|
18362
18398
|
}
|
|
18363
18399
|
const envExamplePath = path19.join(frontendSourceDir, ".env.example");
|
|
18364
18400
|
if (fs23.existsSync(envFile)) {
|
|
@@ -18570,7 +18606,7 @@ NEXT_PUBLIC_OAUTH_ALLOWED_DOMAINS=${oauthAllowedDomains.join(",")}
|
|
|
18570
18606
|
}
|
|
18571
18607
|
}
|
|
18572
18608
|
}
|
|
18573
|
-
const readmePath = path19.join(
|
|
18609
|
+
const readmePath = path19.join(runtimeDir, "RUNTIME.md");
|
|
18574
18610
|
if (!fs23.existsSync(readmePath)) {
|
|
18575
18611
|
const readmeContent = `# Frontend Runtime Directory
|
|
18576
18612
|
|
|
@@ -18578,35 +18614,28 @@ This directory contains runtime files for the frontend service.
|
|
|
18578
18614
|
|
|
18579
18615
|
## Structure
|
|
18580
18616
|
|
|
18581
|
-
- \`.env.local\` - Environment configuration
|
|
18617
|
+
- \`.env.local\` - Environment configuration
|
|
18582
18618
|
- \`logs/\` - Application logs
|
|
18583
18619
|
- \`tmp/\` - Temporary files
|
|
18584
18620
|
- \`.pid\` - Process ID when running
|
|
18585
18621
|
|
|
18586
|
-
## Configuration
|
|
18587
|
-
|
|
18588
|
-
Edit \`.env.local\` to configure:
|
|
18589
|
-
- Server API URL (SERVER_API_URL) - set to localhost for POSIX platform
|
|
18590
|
-
- Port (PORT)
|
|
18591
|
-
- Other environment-specific settings
|
|
18592
|
-
|
|
18593
18622
|
## Source Code
|
|
18594
18623
|
|
|
18595
|
-
|
|
18596
|
-
${frontendSourceDir}
|
|
18624
|
+
${paths.fromNpmPackage ? `Installed npm package: ${frontendSourceDir}` : `Semiont repo: ${frontendSourceDir}`}
|
|
18597
18625
|
|
|
18598
18626
|
## Commands
|
|
18599
18627
|
|
|
18600
18628
|
- Start: \`semiont start --service frontend --environment ${service.environment}\`
|
|
18601
18629
|
- Check: \`semiont check --service frontend --environment ${service.environment}\`
|
|
18602
18630
|
- Stop: \`semiont stop --service frontend --environment ${service.environment}\`
|
|
18603
|
-
- Logs: \`tail -f
|
|
18631
|
+
- Logs: \`tail -f ${logsDir}/app.log\`
|
|
18604
18632
|
`;
|
|
18605
18633
|
fs23.writeFileSync(readmePath, readmeContent);
|
|
18606
18634
|
}
|
|
18607
18635
|
const metadata = {
|
|
18608
18636
|
serviceType: "frontend",
|
|
18609
18637
|
frontendSourceDir,
|
|
18638
|
+
runtimeDir,
|
|
18610
18639
|
envFile,
|
|
18611
18640
|
logsDir,
|
|
18612
18641
|
tmpDir,
|
|
@@ -18617,6 +18646,7 @@ ${frontendSourceDir}
|
|
|
18617
18646
|
printInfo("");
|
|
18618
18647
|
printInfo("Frontend details:");
|
|
18619
18648
|
printInfo(` Source directory: ${frontendSourceDir}`);
|
|
18649
|
+
printInfo(` Runtime directory: ${runtimeDir}`);
|
|
18620
18650
|
printInfo(` Environment file: ${envFile}`);
|
|
18621
18651
|
printInfo(` Logs directory: ${logsDir}`);
|
|
18622
18652
|
printInfo("");
|
|
@@ -19027,9 +19057,9 @@ async function stopJanusGraph(context) {
|
|
|
19027
19057
|
};
|
|
19028
19058
|
}
|
|
19029
19059
|
}
|
|
19030
|
-
async function fileExists3(
|
|
19060
|
+
async function fileExists3(path39) {
|
|
19031
19061
|
try {
|
|
19032
|
-
await fs25.access(
|
|
19062
|
+
await fs25.access(path39);
|
|
19033
19063
|
return true;
|
|
19034
19064
|
} catch {
|
|
19035
19065
|
return false;
|
|
@@ -19326,7 +19356,6 @@ var init_process_manager = __esm({
|
|
|
19326
19356
|
|
|
19327
19357
|
// src/platforms/posix/handlers/backend-stop.ts
|
|
19328
19358
|
import * as fs27 from "fs";
|
|
19329
|
-
import * as path24 from "path";
|
|
19330
19359
|
var stopBackendService, backendStopDescriptor;
|
|
19331
19360
|
var init_backend_stop = __esm({
|
|
19332
19361
|
"src/platforms/posix/handlers/backend-stop.ts"() {
|
|
@@ -19334,21 +19363,15 @@ var init_backend_stop = __esm({
|
|
|
19334
19363
|
init_cli_logger();
|
|
19335
19364
|
init_process_manager();
|
|
19336
19365
|
init_preflight_utils();
|
|
19366
|
+
init_backend_paths();
|
|
19337
19367
|
stopBackendService = async (context) => {
|
|
19338
19368
|
const { service } = context;
|
|
19339
|
-
const
|
|
19340
|
-
|
|
19341
|
-
|
|
19342
|
-
|
|
19343
|
-
|
|
19344
|
-
metadata: { serviceType: "backend" }
|
|
19345
|
-
};
|
|
19369
|
+
const paths = getBackendPaths(context);
|
|
19370
|
+
const { sourceDir: backendSourceDir, pidFile, appLogFile: appLogPath, errorLogFile: errorLogPath } = paths;
|
|
19371
|
+
if (service.verbose) {
|
|
19372
|
+
printInfo(`Source: ${backendSourceDir}`);
|
|
19373
|
+
printInfo(`Mode: ${paths.fromNpmPackage ? "npm package" : "SEMIONT_REPO"}`);
|
|
19346
19374
|
}
|
|
19347
|
-
const backendSourceDir = path24.join(semiontRepo, "apps", "backend");
|
|
19348
|
-
const pidFile = path24.join(backendSourceDir, ".pid");
|
|
19349
|
-
const logsDir = path24.join(backendSourceDir, "logs");
|
|
19350
|
-
const appLogPath = path24.join(logsDir, "app.log");
|
|
19351
|
-
const errorLogPath = path24.join(logsDir, "error.log");
|
|
19352
19375
|
if (!fs27.existsSync(backendSourceDir)) {
|
|
19353
19376
|
return {
|
|
19354
19377
|
success: false,
|
|
@@ -19502,6 +19525,10 @@ var init_frontend_stop = __esm({
|
|
|
19502
19525
|
const { service } = context;
|
|
19503
19526
|
const paths = getFrontendPaths(context);
|
|
19504
19527
|
const { sourceDir: frontendSourceDir, pidFile, appLogFile: appLogPath, errorLogFile: errorLogPath } = paths;
|
|
19528
|
+
if (service.verbose) {
|
|
19529
|
+
printInfo(`Source: ${frontendSourceDir}`);
|
|
19530
|
+
printInfo(`Mode: ${paths.fromNpmPackage ? "npm package" : "SEMIONT_REPO"}`);
|
|
19531
|
+
}
|
|
19505
19532
|
if (!fs28.existsSync(frontendSourceDir)) {
|
|
19506
19533
|
return {
|
|
19507
19534
|
success: false,
|
|
@@ -19818,7 +19845,7 @@ var init_handlers = __esm({
|
|
|
19818
19845
|
// src/platforms/posix/platform.ts
|
|
19819
19846
|
import { execSync as execSync17 } from "child_process";
|
|
19820
19847
|
import * as fs30 from "fs";
|
|
19821
|
-
import * as
|
|
19848
|
+
import * as path24 from "path";
|
|
19822
19849
|
var PosixPlatform;
|
|
19823
19850
|
var init_platform2 = __esm({
|
|
19824
19851
|
"src/platforms/posix/platform.ts"() {
|
|
@@ -19951,19 +19978,19 @@ var init_platform2 = __esm({
|
|
|
19951
19978
|
}
|
|
19952
19979
|
if (logs.length === 0) {
|
|
19953
19980
|
const logPaths = [
|
|
19954
|
-
|
|
19955
|
-
|
|
19956
|
-
|
|
19981
|
+
path24.join("/var/log", service.name, "*.log"),
|
|
19982
|
+
path24.join(service.projectRoot, "logs", "*.log"),
|
|
19983
|
+
path24.join(service.projectRoot, ".logs", "*.log")
|
|
19957
19984
|
];
|
|
19958
19985
|
for (const pattern of logPaths) {
|
|
19959
|
-
const dir =
|
|
19960
|
-
const filePattern =
|
|
19986
|
+
const dir = path24.dirname(pattern);
|
|
19987
|
+
const filePattern = path24.basename(pattern);
|
|
19961
19988
|
if (fs30.existsSync(dir)) {
|
|
19962
19989
|
const files = fs30.readdirSync(dir).filter(
|
|
19963
19990
|
(f) => f.match(filePattern.replace("*", ".*"))
|
|
19964
19991
|
);
|
|
19965
19992
|
for (const file2 of files) {
|
|
19966
|
-
const fullPath =
|
|
19993
|
+
const fullPath = path24.join(dir, file2);
|
|
19967
19994
|
const content = this.tailFile(fullPath, tail);
|
|
19968
19995
|
if (content) {
|
|
19969
19996
|
const lines = content.split("\n");
|
|
@@ -19997,17 +20024,17 @@ var init_platform2 = __esm({
|
|
|
19997
20024
|
"/var/log/postgresql/*.log",
|
|
19998
20025
|
"/var/log/mysql/*.log",
|
|
19999
20026
|
"/var/log/mongodb/*.log",
|
|
20000
|
-
|
|
20027
|
+
path24.join(service.projectRoot, "data", "logs", "*.log")
|
|
20001
20028
|
];
|
|
20002
20029
|
for (const pattern of logPaths) {
|
|
20003
|
-
const dir =
|
|
20004
|
-
const filePattern =
|
|
20030
|
+
const dir = path24.dirname(pattern);
|
|
20031
|
+
const filePattern = path24.basename(pattern);
|
|
20005
20032
|
if (fs30.existsSync(dir)) {
|
|
20006
20033
|
const files = fs30.readdirSync(dir).filter(
|
|
20007
20034
|
(f) => f.match(filePattern.replace("*", ".*"))
|
|
20008
20035
|
);
|
|
20009
20036
|
for (const file2 of files.slice(-1)) {
|
|
20010
|
-
const fullPath =
|
|
20037
|
+
const fullPath = path24.join(dir, file2);
|
|
20011
20038
|
const content = this.tailFile(fullPath, tail);
|
|
20012
20039
|
if (content) {
|
|
20013
20040
|
const lines = content.split("\n");
|
|
@@ -20961,11 +20988,11 @@ var init_database_start2 = __esm({
|
|
|
20961
20988
|
|
|
20962
20989
|
// src/platforms/container/handlers/graph-start.ts
|
|
20963
20990
|
import * as fs31 from "fs/promises";
|
|
20964
|
-
import * as
|
|
20991
|
+
import * as path25 from "path";
|
|
20965
20992
|
import { execSync as execSync23 } from "child_process";
|
|
20966
20993
|
async function startJanusGraph2(context) {
|
|
20967
20994
|
const { service, containerName } = context;
|
|
20968
|
-
const composePath =
|
|
20995
|
+
const composePath = path25.join(service.projectRoot, "docker-compose.janusgraph.yml");
|
|
20969
20996
|
if (!await fileExists4(composePath)) {
|
|
20970
20997
|
return {
|
|
20971
20998
|
success: false,
|
|
@@ -21091,9 +21118,9 @@ async function startJanusGraph2(context) {
|
|
|
21091
21118
|
};
|
|
21092
21119
|
}
|
|
21093
21120
|
}
|
|
21094
|
-
async function fileExists4(
|
|
21121
|
+
async function fileExists4(path39) {
|
|
21095
21122
|
try {
|
|
21096
|
-
await fs31.access(
|
|
21123
|
+
await fs31.access(path39);
|
|
21097
21124
|
return true;
|
|
21098
21125
|
} catch {
|
|
21099
21126
|
return false;
|
|
@@ -21143,7 +21170,7 @@ var init_graph_start2 = __esm({
|
|
|
21143
21170
|
// src/platforms/container/handlers/database-provision.ts
|
|
21144
21171
|
import { execSync as execSync24 } from "child_process";
|
|
21145
21172
|
import * as fs32 from "fs";
|
|
21146
|
-
import * as
|
|
21173
|
+
import * as path26 from "path";
|
|
21147
21174
|
var provisionDatabaseContainer, preflightDatabaseProvision, databaseProvisionDescriptor;
|
|
21148
21175
|
var init_database_provision = __esm({
|
|
21149
21176
|
"src/platforms/container/handlers/database-provision.ts"() {
|
|
@@ -21180,9 +21207,9 @@ var init_database_provision = __esm({
|
|
|
21180
21207
|
} catch (error46) {
|
|
21181
21208
|
printWarning(`Failed to pull image ${image}, will try to use local`);
|
|
21182
21209
|
}
|
|
21183
|
-
const initScriptsPath =
|
|
21184
|
-
const migrationsPath =
|
|
21185
|
-
const seedDataPath =
|
|
21210
|
+
const initScriptsPath = path26.join(service.projectRoot, "db", "init");
|
|
21211
|
+
const migrationsPath = path26.join(service.projectRoot, "db", "migrations");
|
|
21212
|
+
const seedDataPath = path26.join(service.projectRoot, "db", "seed");
|
|
21186
21213
|
const hasInitScripts = fs32.existsSync(initScriptsPath);
|
|
21187
21214
|
const hasMigrations = fs32.existsSync(migrationsPath);
|
|
21188
21215
|
const hasSeedData = fs32.existsSync(seedDataPath);
|
|
@@ -23933,7 +23960,7 @@ var init_js_yaml = __esm({
|
|
|
23933
23960
|
|
|
23934
23961
|
// src/platforms/container/handlers/graph-provision.ts
|
|
23935
23962
|
import * as fs33 from "fs/promises";
|
|
23936
|
-
import * as
|
|
23963
|
+
import * as path27 from "path";
|
|
23937
23964
|
import { execSync as execSync25 } from "child_process";
|
|
23938
23965
|
var provisionGraphService2, preflightGraphProvision2, graphProvisionDescriptor2;
|
|
23939
23966
|
var init_graph_provision2 = __esm({
|
|
@@ -24078,7 +24105,7 @@ var init_graph_provision2 = __esm({
|
|
|
24078
24105
|
...withElasticsearch && { "elasticsearch-data": {} }
|
|
24079
24106
|
}
|
|
24080
24107
|
};
|
|
24081
|
-
const composePath =
|
|
24108
|
+
const composePath = path27.join(service.projectRoot, "docker-compose.janusgraph.yml");
|
|
24082
24109
|
await fs33.writeFile(
|
|
24083
24110
|
composePath,
|
|
24084
24111
|
`# Generated by semiont provision --service janusgraph
|
|
@@ -24147,12 +24174,12 @@ var init_graph_provision2 = __esm({
|
|
|
24147
24174
|
});
|
|
24148
24175
|
|
|
24149
24176
|
// src/platforms/container/handlers/graph-stop.ts
|
|
24150
|
-
import * as
|
|
24177
|
+
import * as path28 from "path";
|
|
24151
24178
|
import { execSync as execSync26 } from "child_process";
|
|
24152
24179
|
import * as fs34 from "fs/promises";
|
|
24153
24180
|
async function stopJanusGraph2(context) {
|
|
24154
24181
|
const { service, options, containerName } = context;
|
|
24155
|
-
const composePath =
|
|
24182
|
+
const composePath = path28.join(service.projectRoot, "docker-compose.janusgraph.yml");
|
|
24156
24183
|
if (!await fileExists5(composePath)) {
|
|
24157
24184
|
if (!service.quiet) {
|
|
24158
24185
|
printWarning("JanusGraph is not provisioned.");
|
|
@@ -24248,9 +24275,9 @@ async function stopJanusGraph2(context) {
|
|
|
24248
24275
|
};
|
|
24249
24276
|
}
|
|
24250
24277
|
}
|
|
24251
|
-
async function fileExists5(
|
|
24278
|
+
async function fileExists5(path39) {
|
|
24252
24279
|
try {
|
|
24253
|
-
await fs34.access(
|
|
24280
|
+
await fs34.access(path39);
|
|
24254
24281
|
return true;
|
|
24255
24282
|
} catch {
|
|
24256
24283
|
return false;
|
|
@@ -24439,18 +24466,18 @@ var init_database_stop = __esm({
|
|
|
24439
24466
|
});
|
|
24440
24467
|
|
|
24441
24468
|
// src/platforms/container/handlers/proxy-paths.ts
|
|
24442
|
-
import * as
|
|
24469
|
+
import * as path29 from "path";
|
|
24443
24470
|
function getProxyPaths2(context) {
|
|
24444
24471
|
const projectRoot = context.service.projectRoot;
|
|
24445
|
-
const runtimeDir =
|
|
24472
|
+
const runtimeDir = path29.join(projectRoot, "proxy");
|
|
24446
24473
|
return {
|
|
24447
24474
|
runtimeDir,
|
|
24448
|
-
logsDir:
|
|
24449
|
-
pidFile:
|
|
24450
|
-
configFile:
|
|
24451
|
-
containerLogFile:
|
|
24452
|
-
accessLogFile:
|
|
24453
|
-
adminLogFile:
|
|
24475
|
+
logsDir: path29.join(runtimeDir, "logs"),
|
|
24476
|
+
pidFile: path29.join(runtimeDir, "proxy.pid"),
|
|
24477
|
+
configFile: path29.join(runtimeDir, "envoy.yaml"),
|
|
24478
|
+
containerLogFile: path29.join(runtimeDir, "logs", "container.log"),
|
|
24479
|
+
accessLogFile: path29.join(runtimeDir, "logs", "access.log"),
|
|
24480
|
+
adminLogFile: path29.join(runtimeDir, "logs", "admin.log")
|
|
24454
24481
|
};
|
|
24455
24482
|
}
|
|
24456
24483
|
var init_proxy_paths2 = __esm({
|
|
@@ -24461,7 +24488,7 @@ var init_proxy_paths2 = __esm({
|
|
|
24461
24488
|
|
|
24462
24489
|
// src/platforms/container/handlers/proxy-provision.ts
|
|
24463
24490
|
import * as fs35 from "fs";
|
|
24464
|
-
import * as
|
|
24491
|
+
import * as path30 from "path";
|
|
24465
24492
|
import { execSync as execSync28 } from "child_process";
|
|
24466
24493
|
function getHostAddress() {
|
|
24467
24494
|
const platform = process.platform;
|
|
@@ -24528,7 +24555,7 @@ var init_proxy_provision2 = __esm({
|
|
|
24528
24555
|
const backendPort = config2.backendPort || 4e3;
|
|
24529
24556
|
const frontendPort = config2.frontendPort || 3e3;
|
|
24530
24557
|
if (config2.type === "envoy") {
|
|
24531
|
-
const templatePath =
|
|
24558
|
+
const templatePath = path30.join(getTemplatesDir(import.meta.url), "envoy.yaml");
|
|
24532
24559
|
if (!fs35.existsSync(templatePath)) {
|
|
24533
24560
|
return {
|
|
24534
24561
|
success: false,
|
|
@@ -26363,7 +26390,7 @@ var init_rds_start = __esm({
|
|
|
26363
26390
|
|
|
26364
26391
|
// src/platforms/aws/handlers/stack-provision.ts
|
|
26365
26392
|
import { spawnSync } from "child_process";
|
|
26366
|
-
import * as
|
|
26393
|
+
import * as path31 from "path";
|
|
26367
26394
|
import * as fs38 from "fs";
|
|
26368
26395
|
var provisionStackService, preflightStackProvision, stackProvisionDescriptor;
|
|
26369
26396
|
var init_stack_provision = __esm({
|
|
@@ -26434,7 +26461,7 @@ var init_stack_provision = __esm({
|
|
|
26434
26461
|
continue;
|
|
26435
26462
|
}
|
|
26436
26463
|
try {
|
|
26437
|
-
const cdkContextPath =
|
|
26464
|
+
const cdkContextPath = path31.join(projectRoot, "cdk.context.json");
|
|
26438
26465
|
const cdkContext = fs38.existsSync(cdkContextPath) ? JSON.parse(fs38.readFileSync(cdkContextPath, "utf-8")) : {};
|
|
26439
26466
|
cdkContext[`availability-zones:account=${awsConfig.accountId}:region=${awsConfig.region}`] = cdkContext[`availability-zones:account=${awsConfig.accountId}:region=${awsConfig.region}`] || [`${awsConfig.region}a`, `${awsConfig.region}b`];
|
|
26440
26467
|
fs38.writeFileSync(cdkContextPath, JSON.stringify(cdkContext, null, 2));
|
|
@@ -26538,7 +26565,7 @@ var init_stack_provision = __esm({
|
|
|
26538
26565
|
|
|
26539
26566
|
// src/platforms/aws/handlers/ecs-publish.ts
|
|
26540
26567
|
import { execSync as execSync37 } from "child_process";
|
|
26541
|
-
import * as
|
|
26568
|
+
import * as path32 from "path";
|
|
26542
26569
|
import * as fs39 from "fs";
|
|
26543
26570
|
async function createNewTaskDefinition(service, imageUri, region, _accountId, cfnDiscoveredResources, resourceName) {
|
|
26544
26571
|
if (!service || !imageUri) return "";
|
|
@@ -26675,7 +26702,7 @@ var init_ecs_publish = __esm({
|
|
|
26675
26702
|
}
|
|
26676
26703
|
}
|
|
26677
26704
|
try {
|
|
26678
|
-
const apiTypesPath =
|
|
26705
|
+
const apiTypesPath = path32.join(buildContext, "packages", "api-types");
|
|
26679
26706
|
if (fs39.existsSync(apiTypesPath)) {
|
|
26680
26707
|
execSync37("npm run build", {
|
|
26681
26708
|
cwd: apiTypesPath,
|
|
@@ -26683,7 +26710,7 @@ var init_ecs_publish = __esm({
|
|
|
26683
26710
|
stdio: service.verbose ? "inherit" : "pipe"
|
|
26684
26711
|
});
|
|
26685
26712
|
}
|
|
26686
|
-
const appPath =
|
|
26713
|
+
const appPath = path32.join(buildContext, "apps", service.name);
|
|
26687
26714
|
if (fs39.existsSync(appPath)) {
|
|
26688
26715
|
execSync37("npm run build", {
|
|
26689
26716
|
cwd: appPath,
|
|
@@ -29647,17 +29674,17 @@ var init_headers = __esm({
|
|
|
29647
29674
|
function encodeURIPath(str3) {
|
|
29648
29675
|
return str3.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g, encodeURIComponent);
|
|
29649
29676
|
}
|
|
29650
|
-
var EMPTY, createPathTagFunction,
|
|
29677
|
+
var EMPTY, createPathTagFunction, path33;
|
|
29651
29678
|
var init_path = __esm({
|
|
29652
29679
|
"../../node_modules/@anthropic-ai/sdk/internal/utils/path.mjs"() {
|
|
29653
29680
|
init_error();
|
|
29654
29681
|
EMPTY = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.create(null));
|
|
29655
|
-
createPathTagFunction = (pathEncoder = encodeURIPath) => function
|
|
29682
|
+
createPathTagFunction = (pathEncoder = encodeURIPath) => function path39(statics, ...params) {
|
|
29656
29683
|
if (statics.length === 1)
|
|
29657
29684
|
return statics[0];
|
|
29658
29685
|
let postPath = false;
|
|
29659
29686
|
const invalidSegments = [];
|
|
29660
|
-
const
|
|
29687
|
+
const path40 = statics.reduce((previousValue, currentValue, index) => {
|
|
29661
29688
|
if (/[?#]/.test(currentValue)) {
|
|
29662
29689
|
postPath = true;
|
|
29663
29690
|
}
|
|
@@ -29674,7 +29701,7 @@ var init_path = __esm({
|
|
|
29674
29701
|
}
|
|
29675
29702
|
return previousValue + currentValue + (index === params.length ? "" : encoded);
|
|
29676
29703
|
}, "");
|
|
29677
|
-
const pathOnly =
|
|
29704
|
+
const pathOnly = path40.split(/[?#]/, 1)[0];
|
|
29678
29705
|
const invalidSegmentPattern = /(?<=^|\/)(?:\.|%2e){1,2}(?=\/|$)/gi;
|
|
29679
29706
|
let match;
|
|
29680
29707
|
while ((match = invalidSegmentPattern.exec(pathOnly)) !== null) {
|
|
@@ -29695,12 +29722,12 @@ var init_path = __esm({
|
|
|
29695
29722
|
}, "");
|
|
29696
29723
|
throw new AnthropicError(`Path parameters result in path with invalid segments:
|
|
29697
29724
|
${invalidSegments.map((e) => e.error).join("\n")}
|
|
29698
|
-
${
|
|
29725
|
+
${path40}
|
|
29699
29726
|
${underline}`);
|
|
29700
29727
|
}
|
|
29701
|
-
return
|
|
29728
|
+
return path40;
|
|
29702
29729
|
};
|
|
29703
|
-
|
|
29730
|
+
path33 = /* @__PURE__ */ createPathTagFunction(encodeURIPath);
|
|
29704
29731
|
}
|
|
29705
29732
|
});
|
|
29706
29733
|
|
|
@@ -29748,7 +29775,7 @@ var init_files = __esm({
|
|
|
29748
29775
|
*/
|
|
29749
29776
|
delete(fileID, params = {}, options) {
|
|
29750
29777
|
const { betas } = params ?? {};
|
|
29751
|
-
return this._client.delete(
|
|
29778
|
+
return this._client.delete(path33`/v1/files/${fileID}`, {
|
|
29752
29779
|
...options,
|
|
29753
29780
|
headers: buildHeaders([
|
|
29754
29781
|
{ "anthropic-beta": [...betas ?? [], "files-api-2025-04-14"].toString() },
|
|
@@ -29771,7 +29798,7 @@ var init_files = __esm({
|
|
|
29771
29798
|
*/
|
|
29772
29799
|
download(fileID, params = {}, options) {
|
|
29773
29800
|
const { betas } = params ?? {};
|
|
29774
|
-
return this._client.get(
|
|
29801
|
+
return this._client.get(path33`/v1/files/${fileID}/content`, {
|
|
29775
29802
|
...options,
|
|
29776
29803
|
headers: buildHeaders([
|
|
29777
29804
|
{
|
|
@@ -29794,7 +29821,7 @@ var init_files = __esm({
|
|
|
29794
29821
|
*/
|
|
29795
29822
|
retrieveMetadata(fileID, params = {}, options) {
|
|
29796
29823
|
const { betas } = params ?? {};
|
|
29797
|
-
return this._client.get(
|
|
29824
|
+
return this._client.get(path33`/v1/files/${fileID}`, {
|
|
29798
29825
|
...options,
|
|
29799
29826
|
headers: buildHeaders([
|
|
29800
29827
|
{ "anthropic-beta": [...betas ?? [], "files-api-2025-04-14"].toString() },
|
|
@@ -29851,7 +29878,7 @@ var init_models = __esm({
|
|
|
29851
29878
|
*/
|
|
29852
29879
|
retrieve(modelID, params = {}, options) {
|
|
29853
29880
|
const { betas } = params ?? {};
|
|
29854
|
-
return this._client.get(
|
|
29881
|
+
return this._client.get(path33`/v1/models/${modelID}?beta=true`, {
|
|
29855
29882
|
...options,
|
|
29856
29883
|
headers: buildHeaders([
|
|
29857
29884
|
{ ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0 },
|
|
@@ -30004,7 +30031,7 @@ var init_batches = __esm({
|
|
|
30004
30031
|
*/
|
|
30005
30032
|
retrieve(messageBatchID, params = {}, options) {
|
|
30006
30033
|
const { betas } = params ?? {};
|
|
30007
|
-
return this._client.get(
|
|
30034
|
+
return this._client.get(path33`/v1/messages/batches/${messageBatchID}?beta=true`, {
|
|
30008
30035
|
...options,
|
|
30009
30036
|
headers: buildHeaders([
|
|
30010
30037
|
{ "anthropic-beta": [...betas ?? [], "message-batches-2024-09-24"].toString() },
|
|
@@ -30057,7 +30084,7 @@ var init_batches = __esm({
|
|
|
30057
30084
|
*/
|
|
30058
30085
|
delete(messageBatchID, params = {}, options) {
|
|
30059
30086
|
const { betas } = params ?? {};
|
|
30060
|
-
return this._client.delete(
|
|
30087
|
+
return this._client.delete(path33`/v1/messages/batches/${messageBatchID}?beta=true`, {
|
|
30061
30088
|
...options,
|
|
30062
30089
|
headers: buildHeaders([
|
|
30063
30090
|
{ "anthropic-beta": [...betas ?? [], "message-batches-2024-09-24"].toString() },
|
|
@@ -30089,7 +30116,7 @@ var init_batches = __esm({
|
|
|
30089
30116
|
*/
|
|
30090
30117
|
cancel(messageBatchID, params = {}, options) {
|
|
30091
30118
|
const { betas } = params ?? {};
|
|
30092
|
-
return this._client.post(
|
|
30119
|
+
return this._client.post(path33`/v1/messages/batches/${messageBatchID}/cancel?beta=true`, {
|
|
30093
30120
|
...options,
|
|
30094
30121
|
headers: buildHeaders([
|
|
30095
30122
|
{ "anthropic-beta": [...betas ?? [], "message-batches-2024-09-24"].toString() },
|
|
@@ -31993,7 +32020,7 @@ var init_batches2 = __esm({
|
|
|
31993
32020
|
* ```
|
|
31994
32021
|
*/
|
|
31995
32022
|
retrieve(messageBatchID, options) {
|
|
31996
|
-
return this._client.get(
|
|
32023
|
+
return this._client.get(path33`/v1/messages/batches/${messageBatchID}`, options);
|
|
31997
32024
|
}
|
|
31998
32025
|
/**
|
|
31999
32026
|
* List all Message Batches within a Workspace. Most recently created batches are
|
|
@@ -32029,7 +32056,7 @@ var init_batches2 = __esm({
|
|
|
32029
32056
|
* ```
|
|
32030
32057
|
*/
|
|
32031
32058
|
delete(messageBatchID, options) {
|
|
32032
|
-
return this._client.delete(
|
|
32059
|
+
return this._client.delete(path33`/v1/messages/batches/${messageBatchID}`, options);
|
|
32033
32060
|
}
|
|
32034
32061
|
/**
|
|
32035
32062
|
* Batches may be canceled any time before processing ends. Once cancellation is
|
|
@@ -32053,7 +32080,7 @@ var init_batches2 = __esm({
|
|
|
32053
32080
|
* ```
|
|
32054
32081
|
*/
|
|
32055
32082
|
cancel(messageBatchID, options) {
|
|
32056
|
-
return this._client.post(
|
|
32083
|
+
return this._client.post(path33`/v1/messages/batches/${messageBatchID}/cancel`, options);
|
|
32057
32084
|
}
|
|
32058
32085
|
/**
|
|
32059
32086
|
* Streams the results of a Message Batch as a `.jsonl` file.
|
|
@@ -32180,7 +32207,7 @@ var init_models2 = __esm({
|
|
|
32180
32207
|
*/
|
|
32181
32208
|
retrieve(modelID, params = {}, options) {
|
|
32182
32209
|
const { betas } = params ?? {};
|
|
32183
|
-
return this._client.get(
|
|
32210
|
+
return this._client.get(path33`/v1/models/${modelID}`, {
|
|
32184
32211
|
...options,
|
|
32185
32212
|
headers: buildHeaders([
|
|
32186
32213
|
{ ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0 },
|
|
@@ -32381,9 +32408,9 @@ var init_client = __esm({
|
|
|
32381
32408
|
makeStatusError(status, error46, message, headers) {
|
|
32382
32409
|
return APIError.generate(status, error46, message, headers);
|
|
32383
32410
|
}
|
|
32384
|
-
buildURL(
|
|
32411
|
+
buildURL(path39, query, defaultBaseURL) {
|
|
32385
32412
|
const baseURL = !__classPrivateFieldGet(this, _BaseAnthropic_instances, "m", _BaseAnthropic_baseURLOverridden).call(this) && defaultBaseURL || this.baseURL;
|
|
32386
|
-
const url2 = isAbsoluteURL(
|
|
32413
|
+
const url2 = isAbsoluteURL(path39) ? new URL(path39) : new URL(baseURL + (baseURL.endsWith("/") && path39.startsWith("/") ? path39.slice(1) : path39));
|
|
32387
32414
|
const defaultQuery = this.defaultQuery();
|
|
32388
32415
|
if (!isEmptyObj(defaultQuery)) {
|
|
32389
32416
|
query = { ...defaultQuery, ...query };
|
|
@@ -32414,24 +32441,24 @@ var init_client = __esm({
|
|
|
32414
32441
|
*/
|
|
32415
32442
|
async prepareRequest(request, { url: url2, options }) {
|
|
32416
32443
|
}
|
|
32417
|
-
get(
|
|
32418
|
-
return this.methodRequest("get",
|
|
32444
|
+
get(path39, opts) {
|
|
32445
|
+
return this.methodRequest("get", path39, opts);
|
|
32419
32446
|
}
|
|
32420
|
-
post(
|
|
32421
|
-
return this.methodRequest("post",
|
|
32447
|
+
post(path39, opts) {
|
|
32448
|
+
return this.methodRequest("post", path39, opts);
|
|
32422
32449
|
}
|
|
32423
|
-
patch(
|
|
32424
|
-
return this.methodRequest("patch",
|
|
32450
|
+
patch(path39, opts) {
|
|
32451
|
+
return this.methodRequest("patch", path39, opts);
|
|
32425
32452
|
}
|
|
32426
|
-
put(
|
|
32427
|
-
return this.methodRequest("put",
|
|
32453
|
+
put(path39, opts) {
|
|
32454
|
+
return this.methodRequest("put", path39, opts);
|
|
32428
32455
|
}
|
|
32429
|
-
delete(
|
|
32430
|
-
return this.methodRequest("delete",
|
|
32456
|
+
delete(path39, opts) {
|
|
32457
|
+
return this.methodRequest("delete", path39, opts);
|
|
32431
32458
|
}
|
|
32432
|
-
methodRequest(method,
|
|
32459
|
+
methodRequest(method, path39, opts) {
|
|
32433
32460
|
return this.request(Promise.resolve(opts).then((opts2) => {
|
|
32434
|
-
return { method, path:
|
|
32461
|
+
return { method, path: path39, ...opts2 };
|
|
32435
32462
|
}));
|
|
32436
32463
|
}
|
|
32437
32464
|
request(options, remainingRetries = null) {
|
|
@@ -32535,8 +32562,8 @@ var init_client = __esm({
|
|
|
32535
32562
|
}));
|
|
32536
32563
|
return { response, options, controller, requestLogID, retryOfRequestLogID, startTime };
|
|
32537
32564
|
}
|
|
32538
|
-
getAPIList(
|
|
32539
|
-
return this.requestAPIList(Page3, { method: "get", path:
|
|
32565
|
+
getAPIList(path39, Page3, opts) {
|
|
32566
|
+
return this.requestAPIList(Page3, { method: "get", path: path39, ...opts });
|
|
32540
32567
|
}
|
|
32541
32568
|
requestAPIList(Page3, options) {
|
|
32542
32569
|
const request = this.makeRequest(options, null, void 0);
|
|
@@ -32623,8 +32650,8 @@ var init_client = __esm({
|
|
|
32623
32650
|
}
|
|
32624
32651
|
async buildRequest(inputOptions, { retryCount = 0 } = {}) {
|
|
32625
32652
|
const options = { ...inputOptions };
|
|
32626
|
-
const { method, path:
|
|
32627
|
-
const url2 = this.buildURL(
|
|
32653
|
+
const { method, path: path39, query, defaultBaseURL } = options;
|
|
32654
|
+
const url2 = this.buildURL(path39, query, defaultBaseURL);
|
|
32628
32655
|
if ("timeout" in options)
|
|
32629
32656
|
validatePositiveInteger("timeout", options.timeout);
|
|
32630
32657
|
options.timeout = options.timeout ?? this.timeout;
|
|
@@ -34497,17 +34524,17 @@ var init_resource2 = __esm({
|
|
|
34497
34524
|
function encodeURIPath2(str3) {
|
|
34498
34525
|
return str3.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g, encodeURIComponent);
|
|
34499
34526
|
}
|
|
34500
|
-
var EMPTY2, createPathTagFunction2,
|
|
34527
|
+
var EMPTY2, createPathTagFunction2, path34;
|
|
34501
34528
|
var init_path2 = __esm({
|
|
34502
34529
|
"../../node_modules/openai/internal/utils/path.mjs"() {
|
|
34503
34530
|
init_error3();
|
|
34504
34531
|
EMPTY2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.create(null));
|
|
34505
|
-
createPathTagFunction2 = (pathEncoder = encodeURIPath2) => function
|
|
34532
|
+
createPathTagFunction2 = (pathEncoder = encodeURIPath2) => function path39(statics, ...params) {
|
|
34506
34533
|
if (statics.length === 1)
|
|
34507
34534
|
return statics[0];
|
|
34508
34535
|
let postPath = false;
|
|
34509
34536
|
const invalidSegments = [];
|
|
34510
|
-
const
|
|
34537
|
+
const path40 = statics.reduce((previousValue, currentValue, index) => {
|
|
34511
34538
|
if (/[?#]/.test(currentValue)) {
|
|
34512
34539
|
postPath = true;
|
|
34513
34540
|
}
|
|
@@ -34524,7 +34551,7 @@ var init_path2 = __esm({
|
|
|
34524
34551
|
}
|
|
34525
34552
|
return previousValue + currentValue + (index === params.length ? "" : encoded);
|
|
34526
34553
|
}, "");
|
|
34527
|
-
const pathOnly =
|
|
34554
|
+
const pathOnly = path40.split(/[?#]/, 1)[0];
|
|
34528
34555
|
const invalidSegmentPattern = /(?<=^|\/)(?:\.|%2e){1,2}(?=\/|$)/gi;
|
|
34529
34556
|
let match;
|
|
34530
34557
|
while ((match = invalidSegmentPattern.exec(pathOnly)) !== null) {
|
|
@@ -34545,12 +34572,12 @@ var init_path2 = __esm({
|
|
|
34545
34572
|
}, "");
|
|
34546
34573
|
throw new OpenAIError(`Path parameters result in path with invalid segments:
|
|
34547
34574
|
${invalidSegments.map((e) => e.error).join("\n")}
|
|
34548
|
-
${
|
|
34575
|
+
${path40}
|
|
34549
34576
|
${underline}`);
|
|
34550
34577
|
}
|
|
34551
|
-
return
|
|
34578
|
+
return path40;
|
|
34552
34579
|
};
|
|
34553
|
-
|
|
34580
|
+
path34 = /* @__PURE__ */ createPathTagFunction2(encodeURIPath2);
|
|
34554
34581
|
}
|
|
34555
34582
|
});
|
|
34556
34583
|
|
|
@@ -34577,7 +34604,7 @@ var init_messages3 = __esm({
|
|
|
34577
34604
|
* ```
|
|
34578
34605
|
*/
|
|
34579
34606
|
list(completionID, query = {}, options) {
|
|
34580
|
-
return this._client.getAPIList(
|
|
34607
|
+
return this._client.getAPIList(path34`/chat/completions/${completionID}/messages`, CursorPage, { query, ...options });
|
|
34581
34608
|
}
|
|
34582
34609
|
};
|
|
34583
34610
|
}
|
|
@@ -35972,7 +35999,7 @@ var init_completions2 = __esm({
|
|
|
35972
35999
|
* ```
|
|
35973
36000
|
*/
|
|
35974
36001
|
retrieve(completionID, options) {
|
|
35975
|
-
return this._client.get(
|
|
36002
|
+
return this._client.get(path34`/chat/completions/${completionID}`, options);
|
|
35976
36003
|
}
|
|
35977
36004
|
/**
|
|
35978
36005
|
* Modify a stored chat completion. Only Chat Completions that have been created
|
|
@@ -35988,7 +36015,7 @@ var init_completions2 = __esm({
|
|
|
35988
36015
|
* ```
|
|
35989
36016
|
*/
|
|
35990
36017
|
update(completionID, body, options) {
|
|
35991
|
-
return this._client.post(
|
|
36018
|
+
return this._client.post(path34`/chat/completions/${completionID}`, { body, ...options });
|
|
35992
36019
|
}
|
|
35993
36020
|
/**
|
|
35994
36021
|
* List stored Chat Completions. Only Chat Completions that have been stored with
|
|
@@ -36016,7 +36043,7 @@ var init_completions2 = __esm({
|
|
|
36016
36043
|
* ```
|
|
36017
36044
|
*/
|
|
36018
36045
|
delete(completionID, options) {
|
|
36019
|
-
return this._client.delete(
|
|
36046
|
+
return this._client.delete(path34`/chat/completions/${completionID}`, options);
|
|
36020
36047
|
}
|
|
36021
36048
|
parse(body, options) {
|
|
36022
36049
|
validateInputTools(body.tools);
|
|
@@ -36264,7 +36291,7 @@ var init_batches3 = __esm({
|
|
|
36264
36291
|
* Retrieves a batch.
|
|
36265
36292
|
*/
|
|
36266
36293
|
retrieve(batchID, options) {
|
|
36267
|
-
return this._client.get(
|
|
36294
|
+
return this._client.get(path34`/batches/${batchID}`, options);
|
|
36268
36295
|
}
|
|
36269
36296
|
/**
|
|
36270
36297
|
* List your organization's batches.
|
|
@@ -36278,7 +36305,7 @@ var init_batches3 = __esm({
|
|
|
36278
36305
|
* (if any) available in the output file.
|
|
36279
36306
|
*/
|
|
36280
36307
|
cancel(batchID, options) {
|
|
36281
|
-
return this._client.post(
|
|
36308
|
+
return this._client.post(path34`/batches/${batchID}/cancel`, options);
|
|
36282
36309
|
}
|
|
36283
36310
|
};
|
|
36284
36311
|
}
|
|
@@ -36321,7 +36348,7 @@ var init_assistants = __esm({
|
|
|
36321
36348
|
* ```
|
|
36322
36349
|
*/
|
|
36323
36350
|
retrieve(assistantID, options) {
|
|
36324
|
-
return this._client.get(
|
|
36351
|
+
return this._client.get(path34`/assistants/${assistantID}`, {
|
|
36325
36352
|
...options,
|
|
36326
36353
|
headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
|
|
36327
36354
|
});
|
|
@@ -36337,7 +36364,7 @@ var init_assistants = __esm({
|
|
|
36337
36364
|
* ```
|
|
36338
36365
|
*/
|
|
36339
36366
|
update(assistantID, body, options) {
|
|
36340
|
-
return this._client.post(
|
|
36367
|
+
return this._client.post(path34`/assistants/${assistantID}`, {
|
|
36341
36368
|
body,
|
|
36342
36369
|
...options,
|
|
36343
36370
|
headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
|
|
@@ -36371,7 +36398,7 @@ var init_assistants = __esm({
|
|
|
36371
36398
|
* ```
|
|
36372
36399
|
*/
|
|
36373
36400
|
delete(assistantID, options) {
|
|
36374
|
-
return this._client.delete(
|
|
36401
|
+
return this._client.delete(path34`/assistants/${assistantID}`, {
|
|
36375
36402
|
...options,
|
|
36376
36403
|
headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
|
|
36377
36404
|
});
|
|
@@ -36482,7 +36509,7 @@ var init_messages4 = __esm({
|
|
|
36482
36509
|
* @deprecated The Assistants API is deprecated in favor of the Responses API
|
|
36483
36510
|
*/
|
|
36484
36511
|
create(threadID, body, options) {
|
|
36485
|
-
return this._client.post(
|
|
36512
|
+
return this._client.post(path34`/threads/${threadID}/messages`, {
|
|
36486
36513
|
body,
|
|
36487
36514
|
...options,
|
|
36488
36515
|
headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
|
|
@@ -36495,7 +36522,7 @@ var init_messages4 = __esm({
|
|
|
36495
36522
|
*/
|
|
36496
36523
|
retrieve(messageID, params, options) {
|
|
36497
36524
|
const { thread_id } = params;
|
|
36498
|
-
return this._client.get(
|
|
36525
|
+
return this._client.get(path34`/threads/${thread_id}/messages/${messageID}`, {
|
|
36499
36526
|
...options,
|
|
36500
36527
|
headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
|
|
36501
36528
|
});
|
|
@@ -36507,7 +36534,7 @@ var init_messages4 = __esm({
|
|
|
36507
36534
|
*/
|
|
36508
36535
|
update(messageID, params, options) {
|
|
36509
36536
|
const { thread_id, ...body } = params;
|
|
36510
|
-
return this._client.post(
|
|
36537
|
+
return this._client.post(path34`/threads/${thread_id}/messages/${messageID}`, {
|
|
36511
36538
|
body,
|
|
36512
36539
|
...options,
|
|
36513
36540
|
headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
|
|
@@ -36519,7 +36546,7 @@ var init_messages4 = __esm({
|
|
|
36519
36546
|
* @deprecated The Assistants API is deprecated in favor of the Responses API
|
|
36520
36547
|
*/
|
|
36521
36548
|
list(threadID, query = {}, options) {
|
|
36522
|
-
return this._client.getAPIList(
|
|
36549
|
+
return this._client.getAPIList(path34`/threads/${threadID}/messages`, CursorPage, {
|
|
36523
36550
|
query,
|
|
36524
36551
|
...options,
|
|
36525
36552
|
headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
|
|
@@ -36532,7 +36559,7 @@ var init_messages4 = __esm({
|
|
|
36532
36559
|
*/
|
|
36533
36560
|
delete(messageID, params, options) {
|
|
36534
36561
|
const { thread_id } = params;
|
|
36535
|
-
return this._client.delete(
|
|
36562
|
+
return this._client.delete(path34`/threads/${thread_id}/messages/${messageID}`, {
|
|
36536
36563
|
...options,
|
|
36537
36564
|
headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
|
|
36538
36565
|
});
|
|
@@ -36557,7 +36584,7 @@ var init_steps = __esm({
|
|
|
36557
36584
|
*/
|
|
36558
36585
|
retrieve(stepID, params, options) {
|
|
36559
36586
|
const { thread_id, run_id, ...query } = params;
|
|
36560
|
-
return this._client.get(
|
|
36587
|
+
return this._client.get(path34`/threads/${thread_id}/runs/${run_id}/steps/${stepID}`, {
|
|
36561
36588
|
query,
|
|
36562
36589
|
...options,
|
|
36563
36590
|
headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
|
|
@@ -36570,7 +36597,7 @@ var init_steps = __esm({
|
|
|
36570
36597
|
*/
|
|
36571
36598
|
list(runID, params, options) {
|
|
36572
36599
|
const { thread_id, ...query } = params;
|
|
36573
|
-
return this._client.getAPIList(
|
|
36600
|
+
return this._client.getAPIList(path34`/threads/${thread_id}/runs/${runID}/steps`, CursorPage, {
|
|
36574
36601
|
query,
|
|
36575
36602
|
...options,
|
|
36576
36603
|
headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
|
|
@@ -37176,7 +37203,7 @@ var init_runs = __esm({
|
|
|
37176
37203
|
}
|
|
37177
37204
|
create(threadID, params, options) {
|
|
37178
37205
|
const { include, ...body } = params;
|
|
37179
|
-
return this._client.post(
|
|
37206
|
+
return this._client.post(path34`/threads/${threadID}/runs`, {
|
|
37180
37207
|
query: { include },
|
|
37181
37208
|
body,
|
|
37182
37209
|
...options,
|
|
@@ -37191,7 +37218,7 @@ var init_runs = __esm({
|
|
|
37191
37218
|
*/
|
|
37192
37219
|
retrieve(runID, params, options) {
|
|
37193
37220
|
const { thread_id } = params;
|
|
37194
|
-
return this._client.get(
|
|
37221
|
+
return this._client.get(path34`/threads/${thread_id}/runs/${runID}`, {
|
|
37195
37222
|
...options,
|
|
37196
37223
|
headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
|
|
37197
37224
|
});
|
|
@@ -37203,7 +37230,7 @@ var init_runs = __esm({
|
|
|
37203
37230
|
*/
|
|
37204
37231
|
update(runID, params, options) {
|
|
37205
37232
|
const { thread_id, ...body } = params;
|
|
37206
|
-
return this._client.post(
|
|
37233
|
+
return this._client.post(path34`/threads/${thread_id}/runs/${runID}`, {
|
|
37207
37234
|
body,
|
|
37208
37235
|
...options,
|
|
37209
37236
|
headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
|
|
@@ -37215,7 +37242,7 @@ var init_runs = __esm({
|
|
|
37215
37242
|
* @deprecated The Assistants API is deprecated in favor of the Responses API
|
|
37216
37243
|
*/
|
|
37217
37244
|
list(threadID, query = {}, options) {
|
|
37218
|
-
return this._client.getAPIList(
|
|
37245
|
+
return this._client.getAPIList(path34`/threads/${threadID}/runs`, CursorPage, {
|
|
37219
37246
|
query,
|
|
37220
37247
|
...options,
|
|
37221
37248
|
headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
|
|
@@ -37228,7 +37255,7 @@ var init_runs = __esm({
|
|
|
37228
37255
|
*/
|
|
37229
37256
|
cancel(runID, params, options) {
|
|
37230
37257
|
const { thread_id } = params;
|
|
37231
|
-
return this._client.post(
|
|
37258
|
+
return this._client.post(path34`/threads/${thread_id}/runs/${runID}/cancel`, {
|
|
37232
37259
|
...options,
|
|
37233
37260
|
headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
|
|
37234
37261
|
});
|
|
@@ -37306,7 +37333,7 @@ var init_runs = __esm({
|
|
|
37306
37333
|
}
|
|
37307
37334
|
submitToolOutputs(runID, params, options) {
|
|
37308
37335
|
const { thread_id, ...body } = params;
|
|
37309
|
-
return this._client.post(
|
|
37336
|
+
return this._client.post(path34`/threads/${thread_id}/runs/${runID}/submit_tool_outputs`, {
|
|
37310
37337
|
body,
|
|
37311
37338
|
...options,
|
|
37312
37339
|
headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]),
|
|
@@ -37371,7 +37398,7 @@ var init_threads = __esm({
|
|
|
37371
37398
|
* @deprecated The Assistants API is deprecated in favor of the Responses API
|
|
37372
37399
|
*/
|
|
37373
37400
|
retrieve(threadID, options) {
|
|
37374
|
-
return this._client.get(
|
|
37401
|
+
return this._client.get(path34`/threads/${threadID}`, {
|
|
37375
37402
|
...options,
|
|
37376
37403
|
headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
|
|
37377
37404
|
});
|
|
@@ -37382,7 +37409,7 @@ var init_threads = __esm({
|
|
|
37382
37409
|
* @deprecated The Assistants API is deprecated in favor of the Responses API
|
|
37383
37410
|
*/
|
|
37384
37411
|
update(threadID, body, options) {
|
|
37385
|
-
return this._client.post(
|
|
37412
|
+
return this._client.post(path34`/threads/${threadID}`, {
|
|
37386
37413
|
body,
|
|
37387
37414
|
...options,
|
|
37388
37415
|
headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
|
|
@@ -37394,7 +37421,7 @@ var init_threads = __esm({
|
|
|
37394
37421
|
* @deprecated The Assistants API is deprecated in favor of the Responses API
|
|
37395
37422
|
*/
|
|
37396
37423
|
delete(threadID, options) {
|
|
37397
|
-
return this._client.delete(
|
|
37424
|
+
return this._client.delete(path34`/threads/${threadID}`, {
|
|
37398
37425
|
...options,
|
|
37399
37426
|
headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
|
|
37400
37427
|
});
|
|
@@ -37479,7 +37506,7 @@ var init_content = __esm({
|
|
|
37479
37506
|
*/
|
|
37480
37507
|
retrieve(fileID, params, options) {
|
|
37481
37508
|
const { container_id } = params;
|
|
37482
|
-
return this._client.get(
|
|
37509
|
+
return this._client.get(path34`/containers/${container_id}/files/${fileID}/content`, {
|
|
37483
37510
|
...options,
|
|
37484
37511
|
headers: buildHeaders2([{ Accept: "application/binary" }, options?.headers]),
|
|
37485
37512
|
__binaryResponse: true
|
|
@@ -37512,20 +37539,20 @@ var init_files2 = __esm({
|
|
|
37512
37539
|
* a JSON request with a file ID.
|
|
37513
37540
|
*/
|
|
37514
37541
|
create(containerID, body, options) {
|
|
37515
|
-
return this._client.post(
|
|
37542
|
+
return this._client.post(path34`/containers/${containerID}/files`, multipartFormRequestOptions2({ body, ...options }, this._client));
|
|
37516
37543
|
}
|
|
37517
37544
|
/**
|
|
37518
37545
|
* Retrieve Container File
|
|
37519
37546
|
*/
|
|
37520
37547
|
retrieve(fileID, params, options) {
|
|
37521
37548
|
const { container_id } = params;
|
|
37522
|
-
return this._client.get(
|
|
37549
|
+
return this._client.get(path34`/containers/${container_id}/files/${fileID}`, options);
|
|
37523
37550
|
}
|
|
37524
37551
|
/**
|
|
37525
37552
|
* List Container files
|
|
37526
37553
|
*/
|
|
37527
37554
|
list(containerID, query = {}, options) {
|
|
37528
|
-
return this._client.getAPIList(
|
|
37555
|
+
return this._client.getAPIList(path34`/containers/${containerID}/files`, CursorPage, {
|
|
37529
37556
|
query,
|
|
37530
37557
|
...options
|
|
37531
37558
|
});
|
|
@@ -37535,7 +37562,7 @@ var init_files2 = __esm({
|
|
|
37535
37562
|
*/
|
|
37536
37563
|
delete(fileID, params, options) {
|
|
37537
37564
|
const { container_id } = params;
|
|
37538
|
-
return this._client.delete(
|
|
37565
|
+
return this._client.delete(path34`/containers/${container_id}/files/${fileID}`, {
|
|
37539
37566
|
...options,
|
|
37540
37567
|
headers: buildHeaders2([{ Accept: "*/*" }, options?.headers])
|
|
37541
37568
|
});
|
|
@@ -37570,7 +37597,7 @@ var init_containers = __esm({
|
|
|
37570
37597
|
* Retrieve Container
|
|
37571
37598
|
*/
|
|
37572
37599
|
retrieve(containerID, options) {
|
|
37573
|
-
return this._client.get(
|
|
37600
|
+
return this._client.get(path34`/containers/${containerID}`, options);
|
|
37574
37601
|
}
|
|
37575
37602
|
/**
|
|
37576
37603
|
* List Containers
|
|
@@ -37582,7 +37609,7 @@ var init_containers = __esm({
|
|
|
37582
37609
|
* Delete Container
|
|
37583
37610
|
*/
|
|
37584
37611
|
delete(containerID, options) {
|
|
37585
|
-
return this._client.delete(
|
|
37612
|
+
return this._client.delete(path34`/containers/${containerID}`, {
|
|
37586
37613
|
...options,
|
|
37587
37614
|
headers: buildHeaders2([{ Accept: "*/*" }, options?.headers])
|
|
37588
37615
|
});
|
|
@@ -37605,7 +37632,7 @@ var init_items = __esm({
|
|
|
37605
37632
|
*/
|
|
37606
37633
|
create(conversationID, params, options) {
|
|
37607
37634
|
const { include, ...body } = params;
|
|
37608
|
-
return this._client.post(
|
|
37635
|
+
return this._client.post(path34`/conversations/${conversationID}/items`, {
|
|
37609
37636
|
query: { include },
|
|
37610
37637
|
body,
|
|
37611
37638
|
...options
|
|
@@ -37616,20 +37643,20 @@ var init_items = __esm({
|
|
|
37616
37643
|
*/
|
|
37617
37644
|
retrieve(itemID, params, options) {
|
|
37618
37645
|
const { conversation_id, ...query } = params;
|
|
37619
|
-
return this._client.get(
|
|
37646
|
+
return this._client.get(path34`/conversations/${conversation_id}/items/${itemID}`, { query, ...options });
|
|
37620
37647
|
}
|
|
37621
37648
|
/**
|
|
37622
37649
|
* List all items for a conversation with the given ID.
|
|
37623
37650
|
*/
|
|
37624
37651
|
list(conversationID, query = {}, options) {
|
|
37625
|
-
return this._client.getAPIList(
|
|
37652
|
+
return this._client.getAPIList(path34`/conversations/${conversationID}/items`, ConversationCursorPage, { query, ...options });
|
|
37626
37653
|
}
|
|
37627
37654
|
/**
|
|
37628
37655
|
* Delete an item from a conversation with the given IDs.
|
|
37629
37656
|
*/
|
|
37630
37657
|
delete(itemID, params, options) {
|
|
37631
37658
|
const { conversation_id } = params;
|
|
37632
|
-
return this._client.delete(
|
|
37659
|
+
return this._client.delete(path34`/conversations/${conversation_id}/items/${itemID}`, options);
|
|
37633
37660
|
}
|
|
37634
37661
|
};
|
|
37635
37662
|
}
|
|
@@ -37658,19 +37685,19 @@ var init_conversations = __esm({
|
|
|
37658
37685
|
* Get a conversation
|
|
37659
37686
|
*/
|
|
37660
37687
|
retrieve(conversationID, options) {
|
|
37661
|
-
return this._client.get(
|
|
37688
|
+
return this._client.get(path34`/conversations/${conversationID}`, options);
|
|
37662
37689
|
}
|
|
37663
37690
|
/**
|
|
37664
37691
|
* Update a conversation
|
|
37665
37692
|
*/
|
|
37666
37693
|
update(conversationID, body, options) {
|
|
37667
|
-
return this._client.post(
|
|
37694
|
+
return this._client.post(path34`/conversations/${conversationID}`, { body, ...options });
|
|
37668
37695
|
}
|
|
37669
37696
|
/**
|
|
37670
37697
|
* Delete a conversation. Items in the conversation will not be deleted.
|
|
37671
37698
|
*/
|
|
37672
37699
|
delete(conversationID, options) {
|
|
37673
|
-
return this._client.delete(
|
|
37700
|
+
return this._client.delete(path34`/conversations/${conversationID}`, options);
|
|
37674
37701
|
}
|
|
37675
37702
|
};
|
|
37676
37703
|
Conversations.Items = Items;
|
|
@@ -37740,14 +37767,14 @@ var init_output_items = __esm({
|
|
|
37740
37767
|
*/
|
|
37741
37768
|
retrieve(outputItemID, params, options) {
|
|
37742
37769
|
const { eval_id, run_id } = params;
|
|
37743
|
-
return this._client.get(
|
|
37770
|
+
return this._client.get(path34`/evals/${eval_id}/runs/${run_id}/output_items/${outputItemID}`, options);
|
|
37744
37771
|
}
|
|
37745
37772
|
/**
|
|
37746
37773
|
* Get a list of output items for an evaluation run.
|
|
37747
37774
|
*/
|
|
37748
37775
|
list(runID, params, options) {
|
|
37749
37776
|
const { eval_id, ...query } = params;
|
|
37750
|
-
return this._client.getAPIList(
|
|
37777
|
+
return this._client.getAPIList(path34`/evals/${eval_id}/runs/${runID}/output_items`, CursorPage, { query, ...options });
|
|
37751
37778
|
}
|
|
37752
37779
|
};
|
|
37753
37780
|
}
|
|
@@ -37773,20 +37800,20 @@ var init_runs2 = __esm({
|
|
|
37773
37800
|
* schema specified in the config of the evaluation.
|
|
37774
37801
|
*/
|
|
37775
37802
|
create(evalID, body, options) {
|
|
37776
|
-
return this._client.post(
|
|
37803
|
+
return this._client.post(path34`/evals/${evalID}/runs`, { body, ...options });
|
|
37777
37804
|
}
|
|
37778
37805
|
/**
|
|
37779
37806
|
* Get an evaluation run by ID.
|
|
37780
37807
|
*/
|
|
37781
37808
|
retrieve(runID, params, options) {
|
|
37782
37809
|
const { eval_id } = params;
|
|
37783
|
-
return this._client.get(
|
|
37810
|
+
return this._client.get(path34`/evals/${eval_id}/runs/${runID}`, options);
|
|
37784
37811
|
}
|
|
37785
37812
|
/**
|
|
37786
37813
|
* Get a list of runs for an evaluation.
|
|
37787
37814
|
*/
|
|
37788
37815
|
list(evalID, query = {}, options) {
|
|
37789
|
-
return this._client.getAPIList(
|
|
37816
|
+
return this._client.getAPIList(path34`/evals/${evalID}/runs`, CursorPage, {
|
|
37790
37817
|
query,
|
|
37791
37818
|
...options
|
|
37792
37819
|
});
|
|
@@ -37796,14 +37823,14 @@ var init_runs2 = __esm({
|
|
|
37796
37823
|
*/
|
|
37797
37824
|
delete(runID, params, options) {
|
|
37798
37825
|
const { eval_id } = params;
|
|
37799
|
-
return this._client.delete(
|
|
37826
|
+
return this._client.delete(path34`/evals/${eval_id}/runs/${runID}`, options);
|
|
37800
37827
|
}
|
|
37801
37828
|
/**
|
|
37802
37829
|
* Cancel an ongoing evaluation run.
|
|
37803
37830
|
*/
|
|
37804
37831
|
cancel(runID, params, options) {
|
|
37805
37832
|
const { eval_id } = params;
|
|
37806
|
-
return this._client.post(
|
|
37833
|
+
return this._client.post(path34`/evals/${eval_id}/runs/${runID}`, options);
|
|
37807
37834
|
}
|
|
37808
37835
|
};
|
|
37809
37836
|
Runs2.OutputItems = OutputItems;
|
|
@@ -37839,13 +37866,13 @@ var init_evals = __esm({
|
|
|
37839
37866
|
* Get an evaluation by ID.
|
|
37840
37867
|
*/
|
|
37841
37868
|
retrieve(evalID, options) {
|
|
37842
|
-
return this._client.get(
|
|
37869
|
+
return this._client.get(path34`/evals/${evalID}`, options);
|
|
37843
37870
|
}
|
|
37844
37871
|
/**
|
|
37845
37872
|
* Update certain properties of an evaluation.
|
|
37846
37873
|
*/
|
|
37847
37874
|
update(evalID, body, options) {
|
|
37848
|
-
return this._client.post(
|
|
37875
|
+
return this._client.post(path34`/evals/${evalID}`, { body, ...options });
|
|
37849
37876
|
}
|
|
37850
37877
|
/**
|
|
37851
37878
|
* List evaluations for a project.
|
|
@@ -37857,7 +37884,7 @@ var init_evals = __esm({
|
|
|
37857
37884
|
* Delete an evaluation.
|
|
37858
37885
|
*/
|
|
37859
37886
|
delete(evalID, options) {
|
|
37860
|
-
return this._client.delete(
|
|
37887
|
+
return this._client.delete(path34`/evals/${evalID}`, options);
|
|
37861
37888
|
}
|
|
37862
37889
|
};
|
|
37863
37890
|
Evals.Runs = Runs2;
|
|
@@ -37906,7 +37933,7 @@ var init_files3 = __esm({
|
|
|
37906
37933
|
* Returns information about a specific file.
|
|
37907
37934
|
*/
|
|
37908
37935
|
retrieve(fileID, options) {
|
|
37909
|
-
return this._client.get(
|
|
37936
|
+
return this._client.get(path34`/files/${fileID}`, options);
|
|
37910
37937
|
}
|
|
37911
37938
|
/**
|
|
37912
37939
|
* Returns a list of files.
|
|
@@ -37918,13 +37945,13 @@ var init_files3 = __esm({
|
|
|
37918
37945
|
* Delete a file.
|
|
37919
37946
|
*/
|
|
37920
37947
|
delete(fileID, options) {
|
|
37921
|
-
return this._client.delete(
|
|
37948
|
+
return this._client.delete(path34`/files/${fileID}`, options);
|
|
37922
37949
|
}
|
|
37923
37950
|
/**
|
|
37924
37951
|
* Returns the contents of the specified file.
|
|
37925
37952
|
*/
|
|
37926
37953
|
content(fileID, options) {
|
|
37927
|
-
return this._client.get(
|
|
37954
|
+
return this._client.get(path34`/files/${fileID}/content`, {
|
|
37928
37955
|
...options,
|
|
37929
37956
|
headers: buildHeaders2([{ Accept: "application/binary" }, options?.headers]),
|
|
37930
37957
|
__binaryResponse: true
|
|
@@ -38055,7 +38082,7 @@ var init_permissions = __esm({
|
|
|
38055
38082
|
* ```
|
|
38056
38083
|
*/
|
|
38057
38084
|
create(fineTunedModelCheckpoint, body, options) {
|
|
38058
|
-
return this._client.getAPIList(
|
|
38085
|
+
return this._client.getAPIList(path34`/fine_tuning/checkpoints/${fineTunedModelCheckpoint}/permissions`, Page2, { body, method: "post", ...options });
|
|
38059
38086
|
}
|
|
38060
38087
|
/**
|
|
38061
38088
|
* **NOTE:** This endpoint requires an [admin API key](../admin-api-keys).
|
|
@@ -38072,7 +38099,7 @@ var init_permissions = __esm({
|
|
|
38072
38099
|
* ```
|
|
38073
38100
|
*/
|
|
38074
38101
|
retrieve(fineTunedModelCheckpoint, query = {}, options) {
|
|
38075
|
-
return this._client.get(
|
|
38102
|
+
return this._client.get(path34`/fine_tuning/checkpoints/${fineTunedModelCheckpoint}/permissions`, {
|
|
38076
38103
|
query,
|
|
38077
38104
|
...options
|
|
38078
38105
|
});
|
|
@@ -38097,7 +38124,7 @@ var init_permissions = __esm({
|
|
|
38097
38124
|
*/
|
|
38098
38125
|
delete(permissionID, params, options) {
|
|
38099
38126
|
const { fine_tuned_model_checkpoint } = params;
|
|
38100
|
-
return this._client.delete(
|
|
38127
|
+
return this._client.delete(path34`/fine_tuning/checkpoints/${fine_tuned_model_checkpoint}/permissions/${permissionID}`, options);
|
|
38101
38128
|
}
|
|
38102
38129
|
};
|
|
38103
38130
|
}
|
|
@@ -38142,7 +38169,7 @@ var init_checkpoints2 = __esm({
|
|
|
38142
38169
|
* ```
|
|
38143
38170
|
*/
|
|
38144
38171
|
list(fineTuningJobID, query = {}, options) {
|
|
38145
|
-
return this._client.getAPIList(
|
|
38172
|
+
return this._client.getAPIList(path34`/fine_tuning/jobs/${fineTuningJobID}/checkpoints`, CursorPage, { query, ...options });
|
|
38146
38173
|
}
|
|
38147
38174
|
};
|
|
38148
38175
|
}
|
|
@@ -38195,7 +38222,7 @@ var init_jobs = __esm({
|
|
|
38195
38222
|
* ```
|
|
38196
38223
|
*/
|
|
38197
38224
|
retrieve(fineTuningJobID, options) {
|
|
38198
|
-
return this._client.get(
|
|
38225
|
+
return this._client.get(path34`/fine_tuning/jobs/${fineTuningJobID}`, options);
|
|
38199
38226
|
}
|
|
38200
38227
|
/**
|
|
38201
38228
|
* List your organization's fine-tuning jobs
|
|
@@ -38222,7 +38249,7 @@ var init_jobs = __esm({
|
|
|
38222
38249
|
* ```
|
|
38223
38250
|
*/
|
|
38224
38251
|
cancel(fineTuningJobID, options) {
|
|
38225
|
-
return this._client.post(
|
|
38252
|
+
return this._client.post(path34`/fine_tuning/jobs/${fineTuningJobID}/cancel`, options);
|
|
38226
38253
|
}
|
|
38227
38254
|
/**
|
|
38228
38255
|
* Get status updates for a fine-tuning job.
|
|
@@ -38238,7 +38265,7 @@ var init_jobs = __esm({
|
|
|
38238
38265
|
* ```
|
|
38239
38266
|
*/
|
|
38240
38267
|
listEvents(fineTuningJobID, query = {}, options) {
|
|
38241
|
-
return this._client.getAPIList(
|
|
38268
|
+
return this._client.getAPIList(path34`/fine_tuning/jobs/${fineTuningJobID}/events`, CursorPage, { query, ...options });
|
|
38242
38269
|
}
|
|
38243
38270
|
/**
|
|
38244
38271
|
* Pause a fine-tune job.
|
|
@@ -38251,7 +38278,7 @@ var init_jobs = __esm({
|
|
|
38251
38278
|
* ```
|
|
38252
38279
|
*/
|
|
38253
38280
|
pause(fineTuningJobID, options) {
|
|
38254
|
-
return this._client.post(
|
|
38281
|
+
return this._client.post(path34`/fine_tuning/jobs/${fineTuningJobID}/pause`, options);
|
|
38255
38282
|
}
|
|
38256
38283
|
/**
|
|
38257
38284
|
* Resume a fine-tune job.
|
|
@@ -38264,7 +38291,7 @@ var init_jobs = __esm({
|
|
|
38264
38291
|
* ```
|
|
38265
38292
|
*/
|
|
38266
38293
|
resume(fineTuningJobID, options) {
|
|
38267
|
-
return this._client.post(
|
|
38294
|
+
return this._client.post(path34`/fine_tuning/jobs/${fineTuningJobID}/resume`, options);
|
|
38268
38295
|
}
|
|
38269
38296
|
};
|
|
38270
38297
|
Jobs.Checkpoints = Checkpoints2;
|
|
@@ -38370,7 +38397,7 @@ var init_models3 = __esm({
|
|
|
38370
38397
|
* the owner and permissioning.
|
|
38371
38398
|
*/
|
|
38372
38399
|
retrieve(model, options) {
|
|
38373
|
-
return this._client.get(
|
|
38400
|
+
return this._client.get(path34`/models/${model}`, options);
|
|
38374
38401
|
}
|
|
38375
38402
|
/**
|
|
38376
38403
|
* Lists the currently available models, and provides basic information about each
|
|
@@ -38384,7 +38411,7 @@ var init_models3 = __esm({
|
|
|
38384
38411
|
* delete a model.
|
|
38385
38412
|
*/
|
|
38386
38413
|
delete(model, options) {
|
|
38387
|
-
return this._client.delete(
|
|
38414
|
+
return this._client.delete(path34`/models/${model}`, options);
|
|
38388
38415
|
}
|
|
38389
38416
|
};
|
|
38390
38417
|
}
|
|
@@ -38852,7 +38879,7 @@ var init_input_items = __esm({
|
|
|
38852
38879
|
* ```
|
|
38853
38880
|
*/
|
|
38854
38881
|
list(responseID, query = {}, options) {
|
|
38855
|
-
return this._client.getAPIList(
|
|
38882
|
+
return this._client.getAPIList(path34`/responses/${responseID}/input_items`, CursorPage, { query, ...options });
|
|
38856
38883
|
}
|
|
38857
38884
|
};
|
|
38858
38885
|
}
|
|
@@ -38883,7 +38910,7 @@ var init_responses = __esm({
|
|
|
38883
38910
|
});
|
|
38884
38911
|
}
|
|
38885
38912
|
retrieve(responseID, query = {}, options) {
|
|
38886
|
-
return this._client.get(
|
|
38913
|
+
return this._client.get(path34`/responses/${responseID}`, {
|
|
38887
38914
|
query,
|
|
38888
38915
|
...options,
|
|
38889
38916
|
stream: query?.stream ?? false
|
|
@@ -38905,7 +38932,7 @@ var init_responses = __esm({
|
|
|
38905
38932
|
* ```
|
|
38906
38933
|
*/
|
|
38907
38934
|
delete(responseID, options) {
|
|
38908
|
-
return this._client.delete(
|
|
38935
|
+
return this._client.delete(path34`/responses/${responseID}`, {
|
|
38909
38936
|
...options,
|
|
38910
38937
|
headers: buildHeaders2([{ Accept: "*/*" }, options?.headers])
|
|
38911
38938
|
});
|
|
@@ -38932,7 +38959,7 @@ var init_responses = __esm({
|
|
|
38932
38959
|
* ```
|
|
38933
38960
|
*/
|
|
38934
38961
|
cancel(responseID, options) {
|
|
38935
|
-
return this._client.post(
|
|
38962
|
+
return this._client.post(path34`/responses/${responseID}/cancel`, options);
|
|
38936
38963
|
}
|
|
38937
38964
|
};
|
|
38938
38965
|
Responses.InputItems = InputItems;
|
|
@@ -38961,7 +38988,7 @@ var init_parts = __esm({
|
|
|
38961
38988
|
* [complete the Upload](https://platform.openai.com/docs/api-reference/uploads/complete).
|
|
38962
38989
|
*/
|
|
38963
38990
|
create(uploadID, body, options) {
|
|
38964
|
-
return this._client.post(
|
|
38991
|
+
return this._client.post(path34`/uploads/${uploadID}/parts`, multipartFormRequestOptions2({ body, ...options }, this._client));
|
|
38965
38992
|
}
|
|
38966
38993
|
};
|
|
38967
38994
|
}
|
|
@@ -39008,7 +39035,7 @@ var init_uploads5 = __esm({
|
|
|
39008
39035
|
* Cancels the Upload. No Parts may be added after an Upload is cancelled.
|
|
39009
39036
|
*/
|
|
39010
39037
|
cancel(uploadID, options) {
|
|
39011
|
-
return this._client.post(
|
|
39038
|
+
return this._client.post(path34`/uploads/${uploadID}/cancel`, options);
|
|
39012
39039
|
}
|
|
39013
39040
|
/**
|
|
39014
39041
|
* Completes the
|
|
@@ -39026,7 +39053,7 @@ var init_uploads5 = __esm({
|
|
|
39026
39053
|
* an Upload is completed.
|
|
39027
39054
|
*/
|
|
39028
39055
|
complete(uploadID, body, options) {
|
|
39029
|
-
return this._client.post(
|
|
39056
|
+
return this._client.post(path34`/uploads/${uploadID}/complete`, { body, ...options });
|
|
39030
39057
|
}
|
|
39031
39058
|
};
|
|
39032
39059
|
Uploads.Parts = Parts;
|
|
@@ -39072,7 +39099,7 @@ var init_file_batches = __esm({
|
|
|
39072
39099
|
* Create a vector store file batch.
|
|
39073
39100
|
*/
|
|
39074
39101
|
create(vectorStoreID, body, options) {
|
|
39075
|
-
return this._client.post(
|
|
39102
|
+
return this._client.post(path34`/vector_stores/${vectorStoreID}/file_batches`, {
|
|
39076
39103
|
body,
|
|
39077
39104
|
...options,
|
|
39078
39105
|
headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
|
|
@@ -39083,7 +39110,7 @@ var init_file_batches = __esm({
|
|
|
39083
39110
|
*/
|
|
39084
39111
|
retrieve(batchID, params, options) {
|
|
39085
39112
|
const { vector_store_id } = params;
|
|
39086
|
-
return this._client.get(
|
|
39113
|
+
return this._client.get(path34`/vector_stores/${vector_store_id}/file_batches/${batchID}`, {
|
|
39087
39114
|
...options,
|
|
39088
39115
|
headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
|
|
39089
39116
|
});
|
|
@@ -39094,7 +39121,7 @@ var init_file_batches = __esm({
|
|
|
39094
39121
|
*/
|
|
39095
39122
|
cancel(batchID, params, options) {
|
|
39096
39123
|
const { vector_store_id } = params;
|
|
39097
|
-
return this._client.post(
|
|
39124
|
+
return this._client.post(path34`/vector_stores/${vector_store_id}/file_batches/${batchID}/cancel`, {
|
|
39098
39125
|
...options,
|
|
39099
39126
|
headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
|
|
39100
39127
|
});
|
|
@@ -39111,7 +39138,7 @@ var init_file_batches = __esm({
|
|
|
39111
39138
|
*/
|
|
39112
39139
|
listFiles(batchID, params, options) {
|
|
39113
39140
|
const { vector_store_id, ...query } = params;
|
|
39114
|
-
return this._client.getAPIList(
|
|
39141
|
+
return this._client.getAPIList(path34`/vector_stores/${vector_store_id}/file_batches/${batchID}/files`, CursorPage, { query, ...options, headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]) });
|
|
39115
39142
|
}
|
|
39116
39143
|
/**
|
|
39117
39144
|
* Wait for the given file batch to be processed.
|
|
@@ -39201,7 +39228,7 @@ var init_files4 = __esm({
|
|
|
39201
39228
|
* [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object).
|
|
39202
39229
|
*/
|
|
39203
39230
|
create(vectorStoreID, body, options) {
|
|
39204
|
-
return this._client.post(
|
|
39231
|
+
return this._client.post(path34`/vector_stores/${vectorStoreID}/files`, {
|
|
39205
39232
|
body,
|
|
39206
39233
|
...options,
|
|
39207
39234
|
headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
|
|
@@ -39212,7 +39239,7 @@ var init_files4 = __esm({
|
|
|
39212
39239
|
*/
|
|
39213
39240
|
retrieve(fileID, params, options) {
|
|
39214
39241
|
const { vector_store_id } = params;
|
|
39215
|
-
return this._client.get(
|
|
39242
|
+
return this._client.get(path34`/vector_stores/${vector_store_id}/files/${fileID}`, {
|
|
39216
39243
|
...options,
|
|
39217
39244
|
headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
|
|
39218
39245
|
});
|
|
@@ -39222,7 +39249,7 @@ var init_files4 = __esm({
|
|
|
39222
39249
|
*/
|
|
39223
39250
|
update(fileID, params, options) {
|
|
39224
39251
|
const { vector_store_id, ...body } = params;
|
|
39225
|
-
return this._client.post(
|
|
39252
|
+
return this._client.post(path34`/vector_stores/${vector_store_id}/files/${fileID}`, {
|
|
39226
39253
|
body,
|
|
39227
39254
|
...options,
|
|
39228
39255
|
headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
|
|
@@ -39232,7 +39259,7 @@ var init_files4 = __esm({
|
|
|
39232
39259
|
* Returns a list of vector store files.
|
|
39233
39260
|
*/
|
|
39234
39261
|
list(vectorStoreID, query = {}, options) {
|
|
39235
|
-
return this._client.getAPIList(
|
|
39262
|
+
return this._client.getAPIList(path34`/vector_stores/${vectorStoreID}/files`, CursorPage, {
|
|
39236
39263
|
query,
|
|
39237
39264
|
...options,
|
|
39238
39265
|
headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
|
|
@@ -39246,7 +39273,7 @@ var init_files4 = __esm({
|
|
|
39246
39273
|
*/
|
|
39247
39274
|
delete(fileID, params, options) {
|
|
39248
39275
|
const { vector_store_id } = params;
|
|
39249
|
-
return this._client.delete(
|
|
39276
|
+
return this._client.delete(path34`/vector_stores/${vector_store_id}/files/${fileID}`, {
|
|
39250
39277
|
...options,
|
|
39251
39278
|
headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
|
|
39252
39279
|
});
|
|
@@ -39321,7 +39348,7 @@ var init_files4 = __esm({
|
|
|
39321
39348
|
*/
|
|
39322
39349
|
content(fileID, params, options) {
|
|
39323
39350
|
const { vector_store_id } = params;
|
|
39324
|
-
return this._client.getAPIList(
|
|
39351
|
+
return this._client.getAPIList(path34`/vector_stores/${vector_store_id}/files/${fileID}/content`, Page2, { ...options, headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]) });
|
|
39325
39352
|
}
|
|
39326
39353
|
};
|
|
39327
39354
|
}
|
|
@@ -39359,7 +39386,7 @@ var init_vector_stores = __esm({
|
|
|
39359
39386
|
* Retrieves a vector store.
|
|
39360
39387
|
*/
|
|
39361
39388
|
retrieve(vectorStoreID, options) {
|
|
39362
|
-
return this._client.get(
|
|
39389
|
+
return this._client.get(path34`/vector_stores/${vectorStoreID}`, {
|
|
39363
39390
|
...options,
|
|
39364
39391
|
headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
|
|
39365
39392
|
});
|
|
@@ -39368,7 +39395,7 @@ var init_vector_stores = __esm({
|
|
|
39368
39395
|
* Modifies a vector store.
|
|
39369
39396
|
*/
|
|
39370
39397
|
update(vectorStoreID, body, options) {
|
|
39371
|
-
return this._client.post(
|
|
39398
|
+
return this._client.post(path34`/vector_stores/${vectorStoreID}`, {
|
|
39372
39399
|
body,
|
|
39373
39400
|
...options,
|
|
39374
39401
|
headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
|
|
@@ -39388,7 +39415,7 @@ var init_vector_stores = __esm({
|
|
|
39388
39415
|
* Delete a vector store.
|
|
39389
39416
|
*/
|
|
39390
39417
|
delete(vectorStoreID, options) {
|
|
39391
|
-
return this._client.delete(
|
|
39418
|
+
return this._client.delete(path34`/vector_stores/${vectorStoreID}`, {
|
|
39392
39419
|
...options,
|
|
39393
39420
|
headers: buildHeaders2([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
|
|
39394
39421
|
});
|
|
@@ -39398,7 +39425,7 @@ var init_vector_stores = __esm({
|
|
|
39398
39425
|
* filter.
|
|
39399
39426
|
*/
|
|
39400
39427
|
search(vectorStoreID, body, options) {
|
|
39401
|
-
return this._client.getAPIList(
|
|
39428
|
+
return this._client.getAPIList(path34`/vector_stores/${vectorStoreID}/search`, Page2, {
|
|
39402
39429
|
body,
|
|
39403
39430
|
method: "post",
|
|
39404
39431
|
...options,
|
|
@@ -39701,9 +39728,9 @@ var init_client2 = __esm({
|
|
|
39701
39728
|
this.apiKey = token;
|
|
39702
39729
|
return true;
|
|
39703
39730
|
}
|
|
39704
|
-
buildURL(
|
|
39731
|
+
buildURL(path39, query, defaultBaseURL) {
|
|
39705
39732
|
const baseURL = !__classPrivateFieldGet2(this, _OpenAI_instances, "m", _OpenAI_baseURLOverridden).call(this) && defaultBaseURL || this.baseURL;
|
|
39706
|
-
const url2 = isAbsoluteURL2(
|
|
39733
|
+
const url2 = isAbsoluteURL2(path39) ? new URL(path39) : new URL(baseURL + (baseURL.endsWith("/") && path39.startsWith("/") ? path39.slice(1) : path39));
|
|
39707
39734
|
const defaultQuery = this.defaultQuery();
|
|
39708
39735
|
if (!isEmptyObj2(defaultQuery)) {
|
|
39709
39736
|
query = { ...defaultQuery, ...query };
|
|
@@ -39727,24 +39754,24 @@ var init_client2 = __esm({
|
|
|
39727
39754
|
*/
|
|
39728
39755
|
async prepareRequest(request, { url: url2, options }) {
|
|
39729
39756
|
}
|
|
39730
|
-
get(
|
|
39731
|
-
return this.methodRequest("get",
|
|
39757
|
+
get(path39, opts) {
|
|
39758
|
+
return this.methodRequest("get", path39, opts);
|
|
39732
39759
|
}
|
|
39733
|
-
post(
|
|
39734
|
-
return this.methodRequest("post",
|
|
39760
|
+
post(path39, opts) {
|
|
39761
|
+
return this.methodRequest("post", path39, opts);
|
|
39735
39762
|
}
|
|
39736
|
-
patch(
|
|
39737
|
-
return this.methodRequest("patch",
|
|
39763
|
+
patch(path39, opts) {
|
|
39764
|
+
return this.methodRequest("patch", path39, opts);
|
|
39738
39765
|
}
|
|
39739
|
-
put(
|
|
39740
|
-
return this.methodRequest("put",
|
|
39766
|
+
put(path39, opts) {
|
|
39767
|
+
return this.methodRequest("put", path39, opts);
|
|
39741
39768
|
}
|
|
39742
|
-
delete(
|
|
39743
|
-
return this.methodRequest("delete",
|
|
39769
|
+
delete(path39, opts) {
|
|
39770
|
+
return this.methodRequest("delete", path39, opts);
|
|
39744
39771
|
}
|
|
39745
|
-
methodRequest(method,
|
|
39772
|
+
methodRequest(method, path39, opts) {
|
|
39746
39773
|
return this.request(Promise.resolve(opts).then((opts2) => {
|
|
39747
|
-
return { method, path:
|
|
39774
|
+
return { method, path: path39, ...opts2 };
|
|
39748
39775
|
}));
|
|
39749
39776
|
}
|
|
39750
39777
|
request(options, remainingRetries = null) {
|
|
@@ -39848,8 +39875,8 @@ var init_client2 = __esm({
|
|
|
39848
39875
|
}));
|
|
39849
39876
|
return { response, options, controller, requestLogID, retryOfRequestLogID, startTime };
|
|
39850
39877
|
}
|
|
39851
|
-
getAPIList(
|
|
39852
|
-
return this.requestAPIList(Page3, { method: "get", path:
|
|
39878
|
+
getAPIList(path39, Page3, opts) {
|
|
39879
|
+
return this.requestAPIList(Page3, { method: "get", path: path39, ...opts });
|
|
39853
39880
|
}
|
|
39854
39881
|
requestAPIList(Page3, options) {
|
|
39855
39882
|
const request = this.makeRequest(options, null, void 0);
|
|
@@ -39927,8 +39954,8 @@ var init_client2 = __esm({
|
|
|
39927
39954
|
}
|
|
39928
39955
|
async buildRequest(inputOptions, { retryCount = 0 } = {}) {
|
|
39929
39956
|
const options = { ...inputOptions };
|
|
39930
|
-
const { method, path:
|
|
39931
|
-
const url2 = this.buildURL(
|
|
39957
|
+
const { method, path: path39, query, defaultBaseURL } = options;
|
|
39958
|
+
const url2 = this.buildURL(path39, query, defaultBaseURL);
|
|
39932
39959
|
if ("timeout" in options)
|
|
39933
39960
|
validatePositiveInteger2("timeout", options.timeout);
|
|
39934
39961
|
options.timeout = options.timeout ?? this.timeout;
|
|
@@ -40729,7 +40756,7 @@ __export(config_loader_exports, {
|
|
|
40729
40756
|
loadEnvironmentConfig: () => loadEnvironmentConfig
|
|
40730
40757
|
});
|
|
40731
40758
|
import * as fs40 from "fs";
|
|
40732
|
-
import * as
|
|
40759
|
+
import * as path35 from "path";
|
|
40733
40760
|
import { createConfigLoader, listEnvironmentNames, ConfigurationError } from "@semiont/core";
|
|
40734
40761
|
function findProjectRoot() {
|
|
40735
40762
|
const root = process.env.SEMIONT_ROOT;
|
|
@@ -40747,8 +40774,8 @@ function findProjectRoot() {
|
|
|
40747
40774
|
"Check that SEMIONT_ROOT environment variable is set correctly"
|
|
40748
40775
|
);
|
|
40749
40776
|
}
|
|
40750
|
-
const hasSemiontJson = fs40.existsSync(
|
|
40751
|
-
const hasEnvironments = fs40.existsSync(
|
|
40777
|
+
const hasSemiontJson = fs40.existsSync(path35.join(root, "semiont.json"));
|
|
40778
|
+
const hasEnvironments = fs40.existsSync(path35.join(root, "environments"));
|
|
40752
40779
|
if (!hasSemiontJson && !hasEnvironments) {
|
|
40753
40780
|
throw new ConfigurationError(
|
|
40754
40781
|
`SEMIONT_ROOT does not point to a valid Semiont project: ${root}`,
|
|
@@ -40761,7 +40788,7 @@ function findProjectRoot() {
|
|
|
40761
40788
|
function getAvailableEnvironments() {
|
|
40762
40789
|
try {
|
|
40763
40790
|
const projectRoot = findProjectRoot();
|
|
40764
|
-
const configDir =
|
|
40791
|
+
const configDir = path35.join(projectRoot, "environments");
|
|
40765
40792
|
if (!fs40.existsSync(configDir)) {
|
|
40766
40793
|
return [];
|
|
40767
40794
|
}
|
|
@@ -40780,11 +40807,11 @@ var init_config_loader = __esm({
|
|
|
40780
40807
|
"use strict";
|
|
40781
40808
|
nodeFileReader = {
|
|
40782
40809
|
readIfExists: (filePath) => {
|
|
40783
|
-
const absolutePath =
|
|
40810
|
+
const absolutePath = path35.resolve(filePath);
|
|
40784
40811
|
return fs40.existsSync(absolutePath) ? fs40.readFileSync(absolutePath, "utf-8") : null;
|
|
40785
40812
|
},
|
|
40786
40813
|
readRequired: (filePath) => {
|
|
40787
|
-
const absolutePath =
|
|
40814
|
+
const absolutePath = path35.resolve(filePath);
|
|
40788
40815
|
if (!fs40.existsSync(absolutePath)) {
|
|
40789
40816
|
throw new ConfigurationError(
|
|
40790
40817
|
`Configuration file not found: ${absolutePath}`,
|
|
@@ -41923,7 +41950,7 @@ import express from "express";
|
|
|
41923
41950
|
import { createServer as createServer4 } from "http";
|
|
41924
41951
|
import { Server as SocketIOServer } from "socket.io";
|
|
41925
41952
|
import { fileURLToPath as fileURLToPath2 } from "url";
|
|
41926
|
-
import { dirname as dirname11, join as
|
|
41953
|
+
import { dirname as dirname11, join as join34 } from "path";
|
|
41927
41954
|
import fs41 from "fs";
|
|
41928
41955
|
var __filename, __dirname, embeddedJS, embeddedCSS, WebDashboardServer;
|
|
41929
41956
|
var init_web_dashboard_server = __esm({
|
|
@@ -41974,15 +42001,15 @@ var init_web_dashboard_server = __esm({
|
|
|
41974
42001
|
});
|
|
41975
42002
|
} else {
|
|
41976
42003
|
const possibleDirs = [
|
|
41977
|
-
|
|
41978
|
-
|
|
41979
|
-
|
|
41980
|
-
|
|
41981
|
-
|
|
42004
|
+
join34(__dirname, "..", "..", "..", "dist", "dashboard"),
|
|
42005
|
+
join34(__dirname, "dashboard"),
|
|
42006
|
+
join34(__dirname, "..", "dashboard"),
|
|
42007
|
+
join34(process.cwd(), "dist", "dashboard"),
|
|
42008
|
+
join34(process.cwd(), "apps", "cli", "dist", "dashboard")
|
|
41982
42009
|
];
|
|
41983
42010
|
let distDir = null;
|
|
41984
42011
|
for (const dir of possibleDirs) {
|
|
41985
|
-
if (fs41.existsSync(
|
|
42012
|
+
if (fs41.existsSync(join34(dir, "dashboard.js"))) {
|
|
41986
42013
|
distDir = dir;
|
|
41987
42014
|
bundleExists = true;
|
|
41988
42015
|
console.log(`Found dashboard bundle at: ${dir}`);
|
|
@@ -42383,7 +42410,7 @@ var require_package = __commonJS({
|
|
|
42383
42410
|
"package.json"(exports, module) {
|
|
42384
42411
|
module.exports = {
|
|
42385
42412
|
name: "@semiont/cli",
|
|
42386
|
-
version: "0.2.
|
|
42413
|
+
version: "0.2.40",
|
|
42387
42414
|
description: "Semiont CLI - Unified environment management tool",
|
|
42388
42415
|
_comment: "AWS SDK dependencies (@aws-sdk/*) are only used by platforms/aws",
|
|
42389
42416
|
type: "module",
|
|
@@ -42447,9 +42474,8 @@ var require_package = __commonJS({
|
|
|
42447
42474
|
"@aws-sdk/client-secrets-manager": "^3.600.0",
|
|
42448
42475
|
"@aws-sdk/client-sts": "^3.859.0",
|
|
42449
42476
|
"@aws-sdk/client-wafv2": "^3.859.0",
|
|
42450
|
-
"@
|
|
42451
|
-
"@semiont/
|
|
42452
|
-
"@semiont/core": "^0.2.38",
|
|
42477
|
+
"@semiont/api-client": "^0.2.40",
|
|
42478
|
+
"@semiont/core": "^0.2.40",
|
|
42453
42479
|
"@testcontainers/postgresql": "^11.5.1",
|
|
42454
42480
|
arg: "^5.0.2",
|
|
42455
42481
|
argon2: "^0.43.0",
|
|
@@ -42467,6 +42493,7 @@ var require_package = __commonJS({
|
|
|
42467
42493
|
zod: "^3.23.8"
|
|
42468
42494
|
},
|
|
42469
42495
|
devDependencies: {
|
|
42496
|
+
"@prisma/client": "^6.13.0",
|
|
42470
42497
|
"@types/express": "^4.17.17",
|
|
42471
42498
|
"@types/ink": "^0.5.2",
|
|
42472
42499
|
"@types/js-yaml": "^4.0.9",
|
|
@@ -43520,9 +43547,29 @@ init_zod();
|
|
|
43520
43547
|
init_command_definition();
|
|
43521
43548
|
init_base_options_schema();
|
|
43522
43549
|
init_cli_logger();
|
|
43550
|
+
init_config_loader();
|
|
43523
43551
|
import * as crypto4 from "crypto";
|
|
43524
43552
|
import * as argon2 from "argon2";
|
|
43525
|
-
import {
|
|
43553
|
+
import { createRequire as createRequire3 } from "module";
|
|
43554
|
+
function loadPrismaClient() {
|
|
43555
|
+
try {
|
|
43556
|
+
const req = createRequire3(import.meta.url);
|
|
43557
|
+
const backendPkgPath = req.resolve("@semiont/backend/package.json");
|
|
43558
|
+
const backendReq = createRequire3(backendPkgPath);
|
|
43559
|
+
const mod = backendReq("@prisma/client");
|
|
43560
|
+
return mod.PrismaClient;
|
|
43561
|
+
} catch {
|
|
43562
|
+
}
|
|
43563
|
+
try {
|
|
43564
|
+
const req = createRequire3(import.meta.url);
|
|
43565
|
+
const mod = req("@prisma/client");
|
|
43566
|
+
return mod.PrismaClient;
|
|
43567
|
+
} catch {
|
|
43568
|
+
throw new Error(
|
|
43569
|
+
'@prisma/client not initialized. Run "semiont provision" first, or run "prisma generate" in the backend directory.'
|
|
43570
|
+
);
|
|
43571
|
+
}
|
|
43572
|
+
}
|
|
43526
43573
|
var UseraddOptionsSchema = BaseOptionsSchema.extend({
|
|
43527
43574
|
email: external_exports.string().email().min(1, "Email is required"),
|
|
43528
43575
|
name: external_exports.string().optional(),
|
|
@@ -43559,7 +43606,26 @@ function generatePassword() {
|
|
|
43559
43606
|
}
|
|
43560
43607
|
async function useradd(options) {
|
|
43561
43608
|
const startTime = Date.now();
|
|
43562
|
-
const
|
|
43609
|
+
const projectRoot = process.env.SEMIONT_ROOT || findProjectRoot();
|
|
43610
|
+
const environment = options.environment;
|
|
43611
|
+
const envConfig = loadEnvironmentConfig(projectRoot, environment);
|
|
43612
|
+
const dbConfig = envConfig.services?.database;
|
|
43613
|
+
if (!dbConfig?.environment) {
|
|
43614
|
+
throw new Error("Database configuration not found in environment file");
|
|
43615
|
+
}
|
|
43616
|
+
const dbUser = dbConfig.environment.POSTGRES_USER;
|
|
43617
|
+
const dbPassword = dbConfig.environment.POSTGRES_PASSWORD;
|
|
43618
|
+
const dbName = dbConfig.environment.POSTGRES_DB;
|
|
43619
|
+
const dbPort = dbConfig.port;
|
|
43620
|
+
const dbHost = dbConfig.host || "localhost";
|
|
43621
|
+
if (!dbUser || !dbPassword || !dbName || !dbPort) {
|
|
43622
|
+
throw new Error("Incomplete database configuration: need POSTGRES_USER, POSTGRES_PASSWORD, POSTGRES_DB, and port");
|
|
43623
|
+
}
|
|
43624
|
+
const databaseUrl = `postgresql://${dbUser}:${dbPassword}@${dbHost}:${dbPort}/${dbName}`;
|
|
43625
|
+
const PrismaClient = loadPrismaClient();
|
|
43626
|
+
const prisma = new PrismaClient({
|
|
43627
|
+
datasources: { db: { url: databaseUrl } }
|
|
43628
|
+
});
|
|
43563
43629
|
try {
|
|
43564
43630
|
validateEmail(options.email);
|
|
43565
43631
|
const domain2 = extractDomain(options.email);
|
|
@@ -43780,7 +43846,7 @@ function isCommandDefinition(obj) {
|
|
|
43780
43846
|
|
|
43781
43847
|
// src/core/service-discovery.ts
|
|
43782
43848
|
init_config_loader();
|
|
43783
|
-
import * as
|
|
43849
|
+
import * as path36 from "path";
|
|
43784
43850
|
import * as fs42 from "fs";
|
|
43785
43851
|
var BUILT_IN_SERVICES = ["frontend", "backend", "database", "filesystem"];
|
|
43786
43852
|
var environmentServicesCache = /* @__PURE__ */ new Map();
|
|
@@ -43790,7 +43856,7 @@ async function loadEnvironmentServices(environment) {
|
|
|
43790
43856
|
}
|
|
43791
43857
|
try {
|
|
43792
43858
|
const PROJECT_ROOT = findProjectRoot();
|
|
43793
|
-
const configPath =
|
|
43859
|
+
const configPath = path36.join(PROJECT_ROOT, "environments", `${environment}.json`);
|
|
43794
43860
|
if (!fs42.existsSync(configPath)) {
|
|
43795
43861
|
return [...BUILT_IN_SERVICES];
|
|
43796
43862
|
}
|
|
@@ -43825,7 +43891,7 @@ async function isValidService(service, environment) {
|
|
|
43825
43891
|
import { parseEnvironment as parseEnvironment2 } from "@semiont/core";
|
|
43826
43892
|
|
|
43827
43893
|
// src/core/service-resolver.ts
|
|
43828
|
-
import * as
|
|
43894
|
+
import * as path37 from "path";
|
|
43829
43895
|
import { ConfigurationError as ConfigurationError2 } from "@semiont/core";
|
|
43830
43896
|
function getServicePlatform(serviceName, config2) {
|
|
43831
43897
|
const environment = config2._metadata?.environment;
|
|
@@ -43873,7 +43939,7 @@ function resolveServiceDeployments(serviceNames, config2) {
|
|
|
43873
43939
|
const serviceConfig = config2.services?.[serviceName];
|
|
43874
43940
|
if (!serviceConfig) {
|
|
43875
43941
|
const availableServices = Object.keys(config2.services || {});
|
|
43876
|
-
const configPath =
|
|
43942
|
+
const configPath = path37.join(projectRoot, "environments", `${environment}.json`);
|
|
43877
43943
|
console.warn(`\u274C Service '${serviceName}' not found in environment '${environment}'`);
|
|
43878
43944
|
if (availableServices.length > 0) {
|
|
43879
43945
|
console.warn(` Available services: ${availableServices.join(", ")}`);
|
|
@@ -43912,7 +43978,7 @@ function resolveServiceDeployments(serviceNames, config2) {
|
|
|
43912
43978
|
// src/core/command-service-matcher.ts
|
|
43913
43979
|
init_service_factory();
|
|
43914
43980
|
init_service_command_capabilities();
|
|
43915
|
-
import * as
|
|
43981
|
+
import * as path38 from "path";
|
|
43916
43982
|
async function checkServiceSupportsCommand(serviceName, command, envConfig) {
|
|
43917
43983
|
try {
|
|
43918
43984
|
const projectRoot = envConfig._metadata?.projectRoot;
|
|
@@ -43996,7 +44062,7 @@ async function resolveServiceSelector(selector, capability, envConfig) {
|
|
|
43996
44062
|
if (!projectRoot) {
|
|
43997
44063
|
throw new Error("Project root is required in envConfig._metadata");
|
|
43998
44064
|
}
|
|
43999
|
-
const configPath =
|
|
44065
|
+
const configPath = path38.join(projectRoot, "environments", `${environment}.json`);
|
|
44000
44066
|
const errorMessage = [
|
|
44001
44067
|
`Unknown service '${selector}' in environment '${environment}'`,
|
|
44002
44068
|
`Available services: ${availableServices.join(", ")}`,
|
|
@@ -44492,14 +44558,14 @@ var OutputFormatter = class {
|
|
|
44492
44558
|
/**
|
|
44493
44559
|
* Get nested value from object using dot notation
|
|
44494
44560
|
*/
|
|
44495
|
-
static getNestedValue(obj,
|
|
44496
|
-
return
|
|
44561
|
+
static getNestedValue(obj, path39) {
|
|
44562
|
+
return path39.split(".").reduce((current, key) => current?.[key], obj);
|
|
44497
44563
|
}
|
|
44498
44564
|
/**
|
|
44499
44565
|
* Set nested value in object using dot notation
|
|
44500
44566
|
*/
|
|
44501
|
-
static setNestedValue(obj,
|
|
44502
|
-
const keys =
|
|
44567
|
+
static setNestedValue(obj, path39, value) {
|
|
44568
|
+
const keys = path39.split(".");
|
|
44503
44569
|
const lastKey = keys.pop();
|
|
44504
44570
|
const target = keys.reduce((current, key) => {
|
|
44505
44571
|
if (!(key in current)) {
|