@base44-preview/cli 0.1.14-pr.626.28bcbc7 → 0.1.14-pr.626.6952180
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/index.js +506 -170
- package/dist/cli/index.js.map +23 -15
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -31177,7 +31177,7 @@ function cleanDoc(doc) {
|
|
|
31177
31177
|
return mapDoc(doc, (currentDoc) => cleanDocFn(currentDoc));
|
|
31178
31178
|
}
|
|
31179
31179
|
function replaceEndOfLine(doc, replacement = literalline) {
|
|
31180
|
-
return mapDoc(doc, (currentDoc) => typeof currentDoc === "string" ?
|
|
31180
|
+
return mapDoc(doc, (currentDoc) => typeof currentDoc === "string" ? join30(replacement, currentDoc.split(`
|
|
31181
31181
|
`)) : currentDoc);
|
|
31182
31182
|
}
|
|
31183
31183
|
function canBreakFn(doc) {
|
|
@@ -31257,7 +31257,7 @@ function indentIfBreak(contents, options) {
|
|
|
31257
31257
|
negate: options.negate
|
|
31258
31258
|
};
|
|
31259
31259
|
}
|
|
31260
|
-
function
|
|
31260
|
+
function join30(separator, docs) {
|
|
31261
31261
|
assertDoc(separator);
|
|
31262
31262
|
assertDocArray(docs);
|
|
31263
31263
|
const parts = [];
|
|
@@ -31968,7 +31968,7 @@ var init_doc = __esm(() => {
|
|
|
31968
31968
|
MODE_FLAT = Symbol("MODE_FLAT");
|
|
31969
31969
|
DOC_FILL_PRINTED_LENGTH = Symbol("DOC_FILL_PRINTED_LENGTH");
|
|
31970
31970
|
builders = {
|
|
31971
|
-
join:
|
|
31971
|
+
join: join30,
|
|
31972
31972
|
line,
|
|
31973
31973
|
softline,
|
|
31974
31974
|
hardline,
|
|
@@ -228634,6 +228634,10 @@ class InternalError extends SystemError {
|
|
|
228634
228634
|
}
|
|
228635
228635
|
}
|
|
228636
228636
|
|
|
228637
|
+
class ResourceDeploymentError extends SystemError {
|
|
228638
|
+
code = "RESOURCE_DEPLOYMENT_FAILED";
|
|
228639
|
+
}
|
|
228640
|
+
|
|
228637
228641
|
class TypeGenerationError extends SystemError {
|
|
228638
228642
|
code = "TYPE_GENERATION_ERROR";
|
|
228639
228643
|
constructor(message, entityName, cause) {
|
|
@@ -228779,7 +228783,7 @@ function normalizeBase44Env() {
|
|
|
228779
228783
|
loadProjectEnvFiles();
|
|
228780
228784
|
|
|
228781
228785
|
// src/cli/index.ts
|
|
228782
|
-
import { dirname as
|
|
228786
|
+
import { dirname as dirname29, join as join39 } from "node:path";
|
|
228783
228787
|
import { fileURLToPath as fileURLToPath6 } from "node:url";
|
|
228784
228788
|
|
|
228785
228789
|
// ../../node_modules/@clack/core/dist/index.mjs
|
|
@@ -229905,8 +229909,10 @@ var {
|
|
|
229905
229909
|
Help: Help2
|
|
229906
229910
|
} = exports_commander;
|
|
229907
229911
|
|
|
229908
|
-
// src/cli/commands/
|
|
229909
|
-
|
|
229912
|
+
// src/cli/commands/functions/parseNames.ts
|
|
229913
|
+
function parseNames(args) {
|
|
229914
|
+
return args.flatMap((arg) => arg.split(",")).map((n) => n.trim()).filter(Boolean);
|
|
229915
|
+
}
|
|
229910
229916
|
// ../../node_modules/chalk/source/vendor/ansi-styles/index.js
|
|
229911
229917
|
var ANSI_BACKGROUND_OFFSET = 10;
|
|
229912
229918
|
var wrapAnsi16 = (offset = 0) => (code) => `\x1B[${code + offset}m`;
|
|
@@ -230720,6 +230726,7 @@ var ProjectConfigSchema = object({
|
|
|
230720
230726
|
site: SiteConfigSchema.optional(),
|
|
230721
230727
|
entitiesDir: string2().optional().default("entities"),
|
|
230722
230728
|
functionsDir: string2().optional().default("functions"),
|
|
230729
|
+
actorsDir: string2().optional().default("actors"),
|
|
230723
230730
|
agentsDir: string2().optional().default("agents"),
|
|
230724
230731
|
agentSkillsDir: string2().optional().default("agent-skills"),
|
|
230725
230732
|
connectorsDir: string2().optional().default("connectors"),
|
|
@@ -236672,7 +236679,7 @@ async function getSiteUrl() {
|
|
|
236672
236679
|
return result.data.url;
|
|
236673
236680
|
}
|
|
236674
236681
|
// src/core/project/config.ts
|
|
236675
|
-
import { dirname as
|
|
236682
|
+
import { dirname as dirname10, join as join12 } from "node:path";
|
|
236676
236683
|
|
|
236677
236684
|
// src/core/project/plugins.ts
|
|
236678
236685
|
import { createRequire as createRequire2 } from "node:module";
|
|
@@ -236710,6 +236717,159 @@ function markPluginEntities(entities, pluginNamespace) {
|
|
|
236710
236717
|
}));
|
|
236711
236718
|
}
|
|
236712
236719
|
|
|
236720
|
+
// src/core/resources/actor/schema.ts
|
|
236721
|
+
var RESERVED_NAMES = new Set(("await break case catch class const continue debugger default delete do else " + "enum export extends false finally for function if import in instanceof let " + "new null return static super switch this throw true try typeof var void " + "while with yield implements interface package private protected public " + "eval arguments").split(" "));
|
|
236722
|
+
var ActorNameSchema = string2().regex(/^[A-Za-z_][A-Za-z0-9_]{0,127}$(?![\s\S])/, "Actor names must be JavaScript identifiers of at most 128 characters (letters, digits, and underscores)").refine((name) => !RESERVED_NAMES.has(name), {
|
|
236723
|
+
message: "Actor names cannot be JavaScript reserved words"
|
|
236724
|
+
});
|
|
236725
|
+
function validateActorName(name) {
|
|
236726
|
+
const result = ActorNameSchema.safeParse(name);
|
|
236727
|
+
if (!result.success) {
|
|
236728
|
+
throw new SchemaValidationError(`Invalid actor name '${name}'`, result.error);
|
|
236729
|
+
}
|
|
236730
|
+
}
|
|
236731
|
+
var ActorDefinitionSchema = object({
|
|
236732
|
+
name: ActorNameSchema,
|
|
236733
|
+
entry: _enum(["entry.ts", "entry.js"]),
|
|
236734
|
+
entryPath: string2().min(1),
|
|
236735
|
+
filePaths: array(string2()).min(1),
|
|
236736
|
+
source: object({ type: literal("project") })
|
|
236737
|
+
});
|
|
236738
|
+
var ActorDeployPayloadSchema = object({
|
|
236739
|
+
entry: _enum(["entry.ts", "entry.js"]),
|
|
236740
|
+
files: array(object({ path: string2().min(1), content: string2() })).min(1)
|
|
236741
|
+
});
|
|
236742
|
+
var DeployActorResponseSchema = object({
|
|
236743
|
+
status: _enum(["deployed", "unchanged"]),
|
|
236744
|
+
warnings: array(string2()).optional().default([])
|
|
236745
|
+
});
|
|
236746
|
+
var DeleteActorResponseSchema = object({ status: literal("deleted"), handler_name: ActorNameSchema }).transform((data) => ({
|
|
236747
|
+
status: data.status,
|
|
236748
|
+
handlerName: data.handler_name
|
|
236749
|
+
}));
|
|
236750
|
+
|
|
236751
|
+
// src/core/resources/actor/api.ts
|
|
236752
|
+
async function deploySingleActor(name, payload) {
|
|
236753
|
+
validateActorName(name);
|
|
236754
|
+
const input = ActorDeployPayloadSchema.safeParse(payload);
|
|
236755
|
+
if (!input.success)
|
|
236756
|
+
throw new SchemaValidationError("Invalid actor deployment", input.error);
|
|
236757
|
+
let response;
|
|
236758
|
+
try {
|
|
236759
|
+
response = await getAppClient().put(`actors/${encodeURIComponent(name)}`, {
|
|
236760
|
+
json: input.data,
|
|
236761
|
+
timeout: false
|
|
236762
|
+
});
|
|
236763
|
+
} catch (error) {
|
|
236764
|
+
throw await ApiError.fromHttpError(error, `deploying actor "${name}"`);
|
|
236765
|
+
}
|
|
236766
|
+
const result = DeployActorResponseSchema.safeParse(await response.json());
|
|
236767
|
+
if (!result.success)
|
|
236768
|
+
throw new SchemaValidationError("Invalid actor deployment response", result.error);
|
|
236769
|
+
return result.data;
|
|
236770
|
+
}
|
|
236771
|
+
async function deleteSingleActor(name) {
|
|
236772
|
+
validateActorName(name);
|
|
236773
|
+
let response;
|
|
236774
|
+
try {
|
|
236775
|
+
response = await getAppClient().delete(`actors/${encodeURIComponent(name)}`, { timeout: 60000 });
|
|
236776
|
+
} catch (error) {
|
|
236777
|
+
throw await ApiError.fromHttpError(error, `deleting actor "${name}"`);
|
|
236778
|
+
}
|
|
236779
|
+
const result = DeleteActorResponseSchema.safeParse(await response.json());
|
|
236780
|
+
if (!result.success)
|
|
236781
|
+
throw new SchemaValidationError("Invalid actor deletion response", result.error);
|
|
236782
|
+
return result.data;
|
|
236783
|
+
}
|
|
236784
|
+
// src/core/resources/actor/config.ts
|
|
236785
|
+
import { basename as basename3, dirname as dirname6, join as join5, relative } from "node:path";
|
|
236786
|
+
async function readAllActors(actorsDir) {
|
|
236787
|
+
if (!await pathExists(actorsDir))
|
|
236788
|
+
return [];
|
|
236789
|
+
const entries = await globby(ENTRY_FILE_GLOB, {
|
|
236790
|
+
cwd: actorsDir,
|
|
236791
|
+
absolute: true,
|
|
236792
|
+
ignore: ENTRY_IGNORE_DOT_PATHS
|
|
236793
|
+
});
|
|
236794
|
+
const actors = [];
|
|
236795
|
+
const names = new Set;
|
|
236796
|
+
for (const entryPath of entries.sort()) {
|
|
236797
|
+
const actorDir = dirname6(entryPath);
|
|
236798
|
+
const name = relative(actorsDir, actorDir).split(/[/\\]/).join("/");
|
|
236799
|
+
if (!name) {
|
|
236800
|
+
throw new InvalidInputError("entry.ts or entry.js found directly in the actors directory — it must be inside a named subfolder");
|
|
236801
|
+
}
|
|
236802
|
+
if (name.includes("/")) {
|
|
236803
|
+
throw new InvalidInputError(`Invalid actor name '${name}' — actors cannot be nested`);
|
|
236804
|
+
}
|
|
236805
|
+
validateActorName(name);
|
|
236806
|
+
if (names.has(name)) {
|
|
236807
|
+
throw new ConfigInvalidError(`Duplicate actor name "${name}" in ${actorsDir}`, actorsDir);
|
|
236808
|
+
}
|
|
236809
|
+
names.add(name);
|
|
236810
|
+
const filePaths = (await globby(BACKEND_FILE_GLOB, { cwd: actorDir, absolute: true })).sort();
|
|
236811
|
+
const entry = basename3(entryPath) === "entry.js" ? "entry.js" : "entry.ts";
|
|
236812
|
+
actors.push({
|
|
236813
|
+
name,
|
|
236814
|
+
entry,
|
|
236815
|
+
entryPath: join5(actorDir, entry),
|
|
236816
|
+
filePaths,
|
|
236817
|
+
source: { type: "project" }
|
|
236818
|
+
});
|
|
236819
|
+
}
|
|
236820
|
+
return actors;
|
|
236821
|
+
}
|
|
236822
|
+
// src/core/resources/actor/deploy.ts
|
|
236823
|
+
import { dirname as dirname7, relative as relative2 } from "node:path";
|
|
236824
|
+
function actorOperationError(name, error) {
|
|
236825
|
+
return {
|
|
236826
|
+
name,
|
|
236827
|
+
status: "error",
|
|
236828
|
+
error: error instanceof Error ? error.message : String(error),
|
|
236829
|
+
...error instanceof ApiError ? { statusCode: error.statusCode, requestId: error.requestId } : {}
|
|
236830
|
+
};
|
|
236831
|
+
}
|
|
236832
|
+
function describeActorResult(result) {
|
|
236833
|
+
if (result.status !== "error")
|
|
236834
|
+
return `${result.name}: ${result.status}`;
|
|
236835
|
+
const context = [
|
|
236836
|
+
result.statusCode === undefined ? undefined : `HTTP ${result.statusCode}`,
|
|
236837
|
+
result.requestId ? `request ${result.requestId}` : undefined
|
|
236838
|
+
].filter(Boolean).join(", ");
|
|
236839
|
+
return `${result.name}: error — ${result.error}${context ? ` (${context})` : ""}`;
|
|
236840
|
+
}
|
|
236841
|
+
async function deployOne(actor) {
|
|
236842
|
+
const start = Date.now();
|
|
236843
|
+
try {
|
|
236844
|
+
const actorDir = dirname7(actor.entryPath);
|
|
236845
|
+
const files = await Promise.all(actor.filePaths.map(async (filePath) => ({
|
|
236846
|
+
path: relative2(actorDir, filePath).split(/[/\\]/).join("/"),
|
|
236847
|
+
content: await readTextFile(filePath)
|
|
236848
|
+
})));
|
|
236849
|
+
const response = await deploySingleActor(actor.name, {
|
|
236850
|
+
entry: actor.entry,
|
|
236851
|
+
files
|
|
236852
|
+
});
|
|
236853
|
+
return { name: actor.name, ...response, durationMs: Date.now() - start };
|
|
236854
|
+
} catch (error) {
|
|
236855
|
+
return actorOperationError(actor.name, error);
|
|
236856
|
+
}
|
|
236857
|
+
}
|
|
236858
|
+
async function deployActorsSequentially(actors, options) {
|
|
236859
|
+
const results = [];
|
|
236860
|
+
for (const actor of actors) {
|
|
236861
|
+
options?.onStart?.(actor.name);
|
|
236862
|
+
const result = await deployOne(actor);
|
|
236863
|
+
results.push(result);
|
|
236864
|
+
options?.onResult?.(result);
|
|
236865
|
+
}
|
|
236866
|
+
return results;
|
|
236867
|
+
}
|
|
236868
|
+
// src/core/resources/actor/resource.ts
|
|
236869
|
+
var actorResource = {
|
|
236870
|
+
readAll: readAllActors,
|
|
236871
|
+
push: deployActorsSequentially
|
|
236872
|
+
};
|
|
236713
236873
|
// src/core/resources/agent/schema.ts
|
|
236714
236874
|
var EntityOperationSchema = _enum(["create", "update", "delete", "read"]);
|
|
236715
236875
|
var EntityToolConfigSchema = object({
|
|
@@ -236788,7 +236948,7 @@ async function fetchAgents() {
|
|
|
236788
236948
|
return result.data;
|
|
236789
236949
|
}
|
|
236790
236950
|
// src/core/resources/agent/config.ts
|
|
236791
|
-
import { join as
|
|
236951
|
+
import { join as join6, normalize } from "node:path";
|
|
236792
236952
|
import { isDeepStrictEqual } from "node:util";
|
|
236793
236953
|
async function readAgentFile(agentPath) {
|
|
236794
236954
|
const raw = await readJsonFile(agentPath);
|
|
@@ -236833,12 +236993,12 @@ async function readAllAgents(agentsDir) {
|
|
|
236833
236993
|
return [...nameToEntry.values()].map((e) => e.data);
|
|
236834
236994
|
}
|
|
236835
236995
|
function findAvailablePath(agentsDir, name, claimedPaths) {
|
|
236836
|
-
const base =
|
|
236996
|
+
const base = join6(agentsDir, `${name}.${CONFIG_FILE_EXTENSION}`);
|
|
236837
236997
|
if (!claimedPaths.has(base)) {
|
|
236838
236998
|
return base;
|
|
236839
236999
|
}
|
|
236840
237000
|
for (let i = 1;; i++) {
|
|
236841
|
-
const candidate =
|
|
237001
|
+
const candidate = join6(agentsDir, `${name}_${i}.${CONFIG_FILE_EXTENSION}`);
|
|
236842
237002
|
if (!claimedPaths.has(candidate)) {
|
|
236843
237003
|
return candidate;
|
|
236844
237004
|
}
|
|
@@ -236953,7 +237113,7 @@ async function pushAgentSkills(skills) {
|
|
|
236953
237113
|
}
|
|
236954
237114
|
// src/core/resources/agent-skill/config.ts
|
|
236955
237115
|
var import_front_matter = __toESM(require_front_matter(), 1);
|
|
236956
|
-
import { join as
|
|
237116
|
+
import { join as join7 } from "node:path";
|
|
236957
237117
|
|
|
236958
237118
|
// ../../node_modules/yaml/dist/index.js
|
|
236959
237119
|
var composer = require_composer();
|
|
@@ -237039,7 +237199,7 @@ async function writeAgentSkills(dir, remote) {
|
|
|
237039
237199
|
const deleted = [];
|
|
237040
237200
|
for (const skill of existing) {
|
|
237041
237201
|
if (!remoteNames.has(skill.name)) {
|
|
237042
|
-
await deleteFile(
|
|
237202
|
+
await deleteFile(join7(dir, `${skill.name}.md`));
|
|
237043
237203
|
deleted.push(skill.name);
|
|
237044
237204
|
}
|
|
237045
237205
|
}
|
|
@@ -237050,7 +237210,7 @@ async function writeAgentSkills(dir, remote) {
|
|
|
237050
237210
|
if (prev && prev.description === skill.description && prev.body === skill.body) {
|
|
237051
237211
|
continue;
|
|
237052
237212
|
}
|
|
237053
|
-
await writeFile(
|
|
237213
|
+
await writeFile(join7(dir, `${skill.name}.md`), serializeSkillFile(skill));
|
|
237054
237214
|
written.push(skill.name);
|
|
237055
237215
|
}
|
|
237056
237216
|
return { written, deleted };
|
|
@@ -237176,7 +237336,7 @@ async function pushAuthConfigToApi(config) {
|
|
|
237176
237336
|
return result.data.authConfig;
|
|
237177
237337
|
}
|
|
237178
237338
|
// src/core/resources/auth-config/config.ts
|
|
237179
|
-
import { join as
|
|
237339
|
+
import { join as join8 } from "node:path";
|
|
237180
237340
|
import { isDeepStrictEqual as isDeepStrictEqual2 } from "node:util";
|
|
237181
237341
|
var AUTH_CONFIG_FILENAME = `config.${CONFIG_FILE_EXTENSION}`;
|
|
237182
237342
|
var DEFAULT_AUTH_CONFIG = {
|
|
@@ -237192,7 +237352,7 @@ var DEFAULT_AUTH_CONFIG = {
|
|
|
237192
237352
|
useWorkspaceSSO: false
|
|
237193
237353
|
};
|
|
237194
237354
|
function getAuthConfigPath(authDir) {
|
|
237195
|
-
return
|
|
237355
|
+
return join8(authDir, AUTH_CONFIG_FILENAME);
|
|
237196
237356
|
}
|
|
237197
237357
|
async function readAuthConfig(authDir) {
|
|
237198
237358
|
const filePath = getAuthConfigPath(authDir);
|
|
@@ -237844,7 +238004,7 @@ async function removeStripe() {
|
|
|
237844
238004
|
return result.data;
|
|
237845
238005
|
}
|
|
237846
238006
|
// src/core/resources/connector/config.ts
|
|
237847
|
-
import { join as
|
|
238007
|
+
import { join as join9 } from "node:path";
|
|
237848
238008
|
import { isDeepStrictEqual as isDeepStrictEqual3 } from "node:util";
|
|
237849
238009
|
async function readConnectorFile(connectorPath) {
|
|
237850
238010
|
const parsed = await readJsonFile(connectorPath);
|
|
@@ -237905,7 +238065,7 @@ async function writeConnectors(connectorsDir, remoteConnectors) {
|
|
|
237905
238065
|
if (existing && isDeepStrictEqual3(existing.data, connector)) {
|
|
237906
238066
|
continue;
|
|
237907
238067
|
}
|
|
237908
|
-
const filePath = existing?.filePath ??
|
|
238068
|
+
const filePath = existing?.filePath ?? join9(connectorsDir, `${connector.type}.${CONFIG_FILE_EXTENSION}`);
|
|
237909
238069
|
await writeJsonFile(filePath, connector);
|
|
237910
238070
|
written.push(connector.type);
|
|
237911
238071
|
}
|
|
@@ -238511,7 +238671,7 @@ async function fetchFunctionLogs(functionName, filters = {}) {
|
|
|
238511
238671
|
return result.data;
|
|
238512
238672
|
}
|
|
238513
238673
|
// src/core/resources/function/config.ts
|
|
238514
|
-
import { basename as
|
|
238674
|
+
import { basename as basename4, dirname as dirname8, join as join10, relative as relative3, resolve as resolve2 } from "node:path";
|
|
238515
238675
|
async function readSharedFiles(functionsDir) {
|
|
238516
238676
|
const sharedDir = resolve2(functionsDir, "..", "shared");
|
|
238517
238677
|
if (!await pathExists(sharedDir)) {
|
|
@@ -238529,8 +238689,8 @@ async function readFunctionConfig(configPath) {
|
|
|
238529
238689
|
}
|
|
238530
238690
|
async function readFunction(configPath, sharedFiles) {
|
|
238531
238691
|
const config = await readFunctionConfig(configPath);
|
|
238532
|
-
const functionDir =
|
|
238533
|
-
const entryPath =
|
|
238692
|
+
const functionDir = dirname8(configPath);
|
|
238693
|
+
const entryPath = join10(functionDir, config.entry);
|
|
238534
238694
|
if (!await pathExists(entryPath)) {
|
|
238535
238695
|
throw new InvalidInputError(`Function entry file not found: ${entryPath} (referenced in ${configPath})`, {
|
|
238536
238696
|
hints: [{ message: "Check the 'entry' field in your function config" }]
|
|
@@ -238562,18 +238722,18 @@ async function readAllFunctions(functionsDir) {
|
|
|
238562
238722
|
absolute: true,
|
|
238563
238723
|
ignore: ENTRY_IGNORE_DOT_PATHS
|
|
238564
238724
|
});
|
|
238565
|
-
const configFilesDirs = new Set(configFiles.map((f) =>
|
|
238566
|
-
const entryFilesWithoutConfig = entryFiles.filter((entryFile) => !configFilesDirs.has(
|
|
238725
|
+
const configFilesDirs = new Set(configFiles.map((f) => dirname8(f)));
|
|
238726
|
+
const entryFilesWithoutConfig = entryFiles.filter((entryFile) => !configFilesDirs.has(dirname8(entryFile)));
|
|
238567
238727
|
const sharedFiles = await readSharedFiles(functionsDir);
|
|
238568
238728
|
const functionsFromConfig = await Promise.all(configFiles.map((configPath) => readFunction(configPath, sharedFiles)));
|
|
238569
238729
|
const functionsWithoutConfig = await Promise.all(entryFilesWithoutConfig.map(async (entryFile) => {
|
|
238570
|
-
const functionDir =
|
|
238730
|
+
const functionDir = dirname8(entryFile);
|
|
238571
238731
|
const filePaths = await globby(BACKEND_FILE_GLOB, {
|
|
238572
238732
|
cwd: functionDir,
|
|
238573
238733
|
absolute: true
|
|
238574
238734
|
});
|
|
238575
238735
|
const allFilePaths = [...new Set([...filePaths, ...sharedFiles])];
|
|
238576
|
-
const name =
|
|
238736
|
+
const name = relative3(functionsDir, functionDir).split(/[/\\]/).join("/");
|
|
238577
238737
|
if (!name) {
|
|
238578
238738
|
throw new InvalidInputError("entry.ts found directly in the functions directory — it must be inside a named subfolder", {
|
|
238579
238739
|
hints: [
|
|
@@ -238583,7 +238743,7 @@ async function readAllFunctions(functionsDir) {
|
|
|
238583
238743
|
]
|
|
238584
238744
|
});
|
|
238585
238745
|
}
|
|
238586
|
-
const entry =
|
|
238746
|
+
const entry = basename4(entryFile);
|
|
238587
238747
|
const functionData = {
|
|
238588
238748
|
name,
|
|
238589
238749
|
entry,
|
|
@@ -238610,17 +238770,17 @@ async function readAllFunctions(functionsDir) {
|
|
|
238610
238770
|
return functions;
|
|
238611
238771
|
}
|
|
238612
238772
|
// src/core/resources/function/deploy.ts
|
|
238613
|
-
import { dirname as
|
|
238773
|
+
import { dirname as dirname9, relative as relative4 } from "node:path";
|
|
238614
238774
|
async function loadFunctionCode(fn) {
|
|
238615
|
-
const functionDir =
|
|
238775
|
+
const functionDir = dirname9(fn.entryPath);
|
|
238616
238776
|
const resolvedFiles = await Promise.all(fn.filePaths.map(async (filePath) => {
|
|
238617
238777
|
const content = await readTextFile(filePath);
|
|
238618
|
-
const path =
|
|
238778
|
+
const path = relative4(functionDir, filePath).split(/[/\\]/).join("/");
|
|
238619
238779
|
return { path, content };
|
|
238620
238780
|
}));
|
|
238621
238781
|
return { ...fn, files: resolvedFiles };
|
|
238622
238782
|
}
|
|
238623
|
-
async function
|
|
238783
|
+
async function deployOne2(fn) {
|
|
238624
238784
|
const start = Date.now();
|
|
238625
238785
|
try {
|
|
238626
238786
|
const functionWithCode = await loadFunctionCode(fn);
|
|
@@ -238648,7 +238808,7 @@ async function deployFunctionsSequentially(functions, options) {
|
|
|
238648
238808
|
const results = [];
|
|
238649
238809
|
for (const fn of functions) {
|
|
238650
238810
|
options?.onStart?.([fn.name]);
|
|
238651
|
-
const result = await
|
|
238811
|
+
const result = await deployOne2(fn);
|
|
238652
238812
|
results.push(result);
|
|
238653
238813
|
options?.onResult?.(result);
|
|
238654
238814
|
}
|
|
@@ -238679,14 +238839,14 @@ async function pruneRemovedFunctions(localFunctionNames, options) {
|
|
|
238679
238839
|
return results;
|
|
238680
238840
|
}
|
|
238681
238841
|
// src/core/resources/function/pull.ts
|
|
238682
|
-
import { join as
|
|
238842
|
+
import { join as join11 } from "node:path";
|
|
238683
238843
|
import { isDeepStrictEqual as isDeepStrictEqual4 } from "node:util";
|
|
238684
238844
|
async function writeFunctions(functionsDir, functions) {
|
|
238685
238845
|
const written = [];
|
|
238686
238846
|
const skipped = [];
|
|
238687
238847
|
for (const fn of functions) {
|
|
238688
|
-
const functionDir =
|
|
238689
|
-
const configPath =
|
|
238848
|
+
const functionDir = join11(functionsDir, fn.name);
|
|
238849
|
+
const configPath = join11(functionDir, "function.jsonc");
|
|
238690
238850
|
if (await isFunctionUnchanged(functionDir, fn)) {
|
|
238691
238851
|
skipped.push(fn.name);
|
|
238692
238852
|
continue;
|
|
@@ -238700,7 +238860,7 @@ async function writeFunctions(functionsDir, functions) {
|
|
|
238700
238860
|
}
|
|
238701
238861
|
await writeJsonFile(configPath, config);
|
|
238702
238862
|
for (const file of fn.files) {
|
|
238703
|
-
await writeFile(
|
|
238863
|
+
await writeFile(join11(functionDir, file.path), file.content);
|
|
238704
238864
|
}
|
|
238705
238865
|
written.push(fn.name);
|
|
238706
238866
|
}
|
|
@@ -238710,7 +238870,7 @@ async function isFunctionUnchanged(functionDir, fn) {
|
|
|
238710
238870
|
if (!await pathExists(functionDir)) {
|
|
238711
238871
|
return false;
|
|
238712
238872
|
}
|
|
238713
|
-
const configPath =
|
|
238873
|
+
const configPath = join11(functionDir, "function.jsonc");
|
|
238714
238874
|
try {
|
|
238715
238875
|
const localConfig = await readJsonFile(configPath);
|
|
238716
238876
|
if (localConfig.entry !== fn.entry) {
|
|
@@ -238723,7 +238883,7 @@ async function isFunctionUnchanged(functionDir, fn) {
|
|
|
238723
238883
|
return false;
|
|
238724
238884
|
}
|
|
238725
238885
|
for (const file of fn.files) {
|
|
238726
|
-
const filePath =
|
|
238886
|
+
const filePath = join11(functionDir, file.path);
|
|
238727
238887
|
if (!await pathExists(filePath)) {
|
|
238728
238888
|
return false;
|
|
238729
238889
|
}
|
|
@@ -238895,10 +239055,17 @@ class ProjectConfigReader {
|
|
|
238895
239055
|
...pluginResources.functions
|
|
238896
239056
|
];
|
|
238897
239057
|
this.validateFunctionNames(functions, configPath);
|
|
239058
|
+
const functionNames = new Set(functions.map((fn) => fn.name));
|
|
239059
|
+
for (const actor of localResources.actors) {
|
|
239060
|
+
if (functionNames.has(actor.name)) {
|
|
239061
|
+
throw new ConfigInvalidError(`'${actor.name}' exists as both a backend function and an actor`, configPath);
|
|
239062
|
+
}
|
|
239063
|
+
}
|
|
238898
239064
|
return {
|
|
238899
239065
|
project,
|
|
238900
239066
|
entities,
|
|
238901
239067
|
functions,
|
|
239068
|
+
actors: localResources.actors,
|
|
238902
239069
|
agents: localResources.agents,
|
|
238903
239070
|
agentSkills: localResources.agentSkills,
|
|
238904
239071
|
connectors: localResources.connectors,
|
|
@@ -238926,17 +239093,34 @@ class ProjectConfigReader {
|
|
|
238926
239093
|
}
|
|
238927
239094
|
return result.data;
|
|
238928
239095
|
}
|
|
238929
|
-
async readProjectResources(configPath, project) {
|
|
238930
|
-
const configDir =
|
|
238931
|
-
const [
|
|
238932
|
-
|
|
238933
|
-
|
|
238934
|
-
|
|
238935
|
-
|
|
238936
|
-
|
|
238937
|
-
|
|
239096
|
+
async readProjectResources(configPath, project, includeActors = true) {
|
|
239097
|
+
const configDir = dirname10(configPath);
|
|
239098
|
+
const [
|
|
239099
|
+
entities,
|
|
239100
|
+
functions,
|
|
239101
|
+
actors,
|
|
239102
|
+
agents,
|
|
239103
|
+
agentSkills,
|
|
239104
|
+
connectors,
|
|
239105
|
+
authConfig
|
|
239106
|
+
] = await Promise.all([
|
|
239107
|
+
entityResource.readAll(join12(configDir, project.entitiesDir)),
|
|
239108
|
+
functionResource.readAll(join12(configDir, project.functionsDir)),
|
|
239109
|
+
includeActors ? actorResource.readAll(join12(configDir, project.actorsDir)) : Promise.resolve([]),
|
|
239110
|
+
agentResource.readAll(join12(configDir, project.agentsDir)),
|
|
239111
|
+
agentSkillResource.readAll(join12(configDir, project.agentSkillsDir)),
|
|
239112
|
+
connectorResource.readAll(join12(configDir, project.connectorsDir)),
|
|
239113
|
+
authConfigResource.readAll(join12(configDir, project.authDir))
|
|
238938
239114
|
]);
|
|
238939
|
-
return {
|
|
239115
|
+
return {
|
|
239116
|
+
entities,
|
|
239117
|
+
functions,
|
|
239118
|
+
actors,
|
|
239119
|
+
agents,
|
|
239120
|
+
agentSkills,
|
|
239121
|
+
connectors,
|
|
239122
|
+
authConfig
|
|
239123
|
+
};
|
|
238940
239124
|
}
|
|
238941
239125
|
assertPluginProjectDoesNotLoadPlugins(project, configPath) {
|
|
238942
239126
|
if (project.plugin && project.plugins.length > 0) {
|
|
@@ -238957,7 +239141,7 @@ class ProjectConfigReader {
|
|
|
238957
239141
|
this.pluginSourceByNamespace.set(namespace, source);
|
|
238958
239142
|
}
|
|
238959
239143
|
async readPluginConfig(plugin, hostConfigPath) {
|
|
238960
|
-
const pluginRoot = resolvePluginRoot(plugin.source,
|
|
239144
|
+
const pluginRoot = resolvePluginRoot(plugin.source, dirname10(hostConfigPath));
|
|
238961
239145
|
const { configPath } = await this.findConfigOrThrow(pluginRoot);
|
|
238962
239146
|
const project = await this.readConfigFile(configPath);
|
|
238963
239147
|
const namespace = requirePluginNamespace(project, plugin.source, configPath);
|
|
@@ -238965,10 +239149,11 @@ class ProjectConfigReader {
|
|
|
238965
239149
|
return { configPath, namespace, project, source: plugin.source };
|
|
238966
239150
|
}
|
|
238967
239151
|
async readPluginResources(project, configPath, namespace) {
|
|
238968
|
-
const resources = await this.readProjectResources(configPath, project);
|
|
239152
|
+
const resources = await this.readProjectResources(configPath, project, false);
|
|
238969
239153
|
return {
|
|
238970
239154
|
entities: markPluginEntities(resources.entities, namespace),
|
|
238971
239155
|
functions: namespacePluginFunctions(resources.functions, namespace),
|
|
239156
|
+
actors: [],
|
|
238972
239157
|
agents: [],
|
|
238973
239158
|
agentSkills: [],
|
|
238974
239159
|
connectors: [],
|
|
@@ -239007,6 +239192,7 @@ class ProjectConfigReader {
|
|
|
239007
239192
|
return {
|
|
239008
239193
|
entities,
|
|
239009
239194
|
functions,
|
|
239195
|
+
actors: [],
|
|
239010
239196
|
agents: [],
|
|
239011
239197
|
agentSkills: [],
|
|
239012
239198
|
connectors: [],
|
|
@@ -239041,12 +239227,12 @@ async function readProjectSettings(projectRoot) {
|
|
|
239041
239227
|
// src/core/project/template.ts
|
|
239042
239228
|
var import_ejs = __toESM(require_ejs(), 1);
|
|
239043
239229
|
var import_front_matter2 = __toESM(require_front_matter(), 1);
|
|
239044
|
-
import { dirname as
|
|
239230
|
+
import { dirname as dirname11, join as join14 } from "node:path";
|
|
239045
239231
|
|
|
239046
239232
|
// src/core/assets.ts
|
|
239047
239233
|
import { cpSync, existsSync } from "node:fs";
|
|
239048
239234
|
import { homedir as homedir2 } from "node:os";
|
|
239049
|
-
import { join as
|
|
239235
|
+
import { join as join13 } from "node:path";
|
|
239050
239236
|
// package.json
|
|
239051
239237
|
var package_default = {
|
|
239052
239238
|
name: "base44",
|
|
@@ -239153,21 +239339,21 @@ var package_default = {
|
|
|
239153
239339
|
};
|
|
239154
239340
|
|
|
239155
239341
|
// src/core/assets.ts
|
|
239156
|
-
var ASSETS_DIR =
|
|
239342
|
+
var ASSETS_DIR = join13(homedir2(), ".base44", "assets", package_default.version);
|
|
239157
239343
|
function getTemplatesDir() {
|
|
239158
|
-
return
|
|
239344
|
+
return join13(ASSETS_DIR, "templates");
|
|
239159
239345
|
}
|
|
239160
239346
|
function getTemplatesIndexPath() {
|
|
239161
|
-
return
|
|
239347
|
+
return join13(ASSETS_DIR, "templates", "templates.json");
|
|
239162
239348
|
}
|
|
239163
239349
|
function getBackendRuntimeDir() {
|
|
239164
|
-
return
|
|
239350
|
+
return join13(ASSETS_DIR, "backend-runtime");
|
|
239165
239351
|
}
|
|
239166
239352
|
function getDenoWrapperPath() {
|
|
239167
|
-
return
|
|
239353
|
+
return join13(getBackendRuntimeDir(), "main.ts");
|
|
239168
239354
|
}
|
|
239169
239355
|
function getExecWrapperPath() {
|
|
239170
|
-
return
|
|
239356
|
+
return join13(getBackendRuntimeDir(), "exec.ts");
|
|
239171
239357
|
}
|
|
239172
239358
|
function ensureNpmAssets(sourceDir) {
|
|
239173
239359
|
if (existsSync(ASSETS_DIR) && existsSync(getBackendRuntimeDir()))
|
|
@@ -239189,7 +239375,7 @@ async function listTemplates() {
|
|
|
239189
239375
|
}
|
|
239190
239376
|
async function renderTemplate(template, destPath, data, options = {}) {
|
|
239191
239377
|
const { skipExisting = false } = options;
|
|
239192
|
-
const templateDir =
|
|
239378
|
+
const templateDir = join14(getTemplatesDir(), template.path);
|
|
239193
239379
|
const files = await globby("**/*", {
|
|
239194
239380
|
cwd: templateDir,
|
|
239195
239381
|
dot: true,
|
|
@@ -239197,20 +239383,20 @@ async function renderTemplate(template, destPath, data, options = {}) {
|
|
|
239197
239383
|
});
|
|
239198
239384
|
const skipped = [];
|
|
239199
239385
|
for (const file of files) {
|
|
239200
|
-
const srcPath =
|
|
239386
|
+
const srcPath = join14(templateDir, file);
|
|
239201
239387
|
try {
|
|
239202
239388
|
if (file.endsWith(".ejs")) {
|
|
239203
239389
|
const rendered = await import_ejs.default.renderFile(srcPath, data);
|
|
239204
239390
|
const { attributes, body } = import_front_matter2.default(rendered);
|
|
239205
|
-
const destFile = attributes.outputFileName ?
|
|
239206
|
-
const destFilePath =
|
|
239391
|
+
const destFile = attributes.outputFileName ? join14(dirname11(file), attributes.outputFileName) : file.replace(/\.ejs$/, "");
|
|
239392
|
+
const destFilePath = join14(destPath, destFile);
|
|
239207
239393
|
if (skipExisting && await pathExists(destFilePath)) {
|
|
239208
239394
|
skipped.push(destFile);
|
|
239209
239395
|
continue;
|
|
239210
239396
|
}
|
|
239211
239397
|
await writeFile(destFilePath, body);
|
|
239212
239398
|
} else {
|
|
239213
|
-
const destFilePath =
|
|
239399
|
+
const destFilePath = join14(destPath, file);
|
|
239214
239400
|
if (skipExisting && await pathExists(destFilePath)) {
|
|
239215
239401
|
skipped.push(file);
|
|
239216
239402
|
continue;
|
|
@@ -239364,7 +239550,7 @@ async function getSiteFilePaths(outputDir) {
|
|
|
239364
239550
|
// src/core/site/deploy.ts
|
|
239365
239551
|
import { randomUUID } from "node:crypto";
|
|
239366
239552
|
import { tmpdir } from "node:os";
|
|
239367
|
-
import { join as
|
|
239553
|
+
import { join as join15 } from "node:path";
|
|
239368
239554
|
async function deploySite(siteOutputDir) {
|
|
239369
239555
|
if (!await pathExists(siteOutputDir)) {
|
|
239370
239556
|
throw new InvalidInputError(`Output directory does not exist: ${siteOutputDir}. Make sure to build your project first.`, {
|
|
@@ -239385,7 +239571,7 @@ async function deploySite(siteOutputDir) {
|
|
|
239385
239571
|
]
|
|
239386
239572
|
});
|
|
239387
239573
|
}
|
|
239388
|
-
const archivePath =
|
|
239574
|
+
const archivePath = join15(tmpdir(), `base44-site-${randomUUID()}.tar.gz`);
|
|
239389
239575
|
try {
|
|
239390
239576
|
await createArchive(siteOutputDir, archivePath);
|
|
239391
239577
|
return await uploadSite(archivePath);
|
|
@@ -239402,13 +239588,13 @@ async function createArchive(pathToArchive, targetArchivePath) {
|
|
|
239402
239588
|
}
|
|
239403
239589
|
// src/core/site/deployment.ts
|
|
239404
239590
|
import { readFile as readFile3 } from "node:fs/promises";
|
|
239405
|
-
import { join as
|
|
239591
|
+
import { join as join18 } from "node:path";
|
|
239406
239592
|
|
|
239407
239593
|
// src/core/site/manifest.ts
|
|
239408
239594
|
import { createHash } from "node:crypto";
|
|
239409
239595
|
import { createReadStream } from "node:fs";
|
|
239410
239596
|
import { stat } from "node:fs/promises";
|
|
239411
|
-
import { basename as
|
|
239597
|
+
import { basename as basename5, extname, join as join16 } from "node:path";
|
|
239412
239598
|
var MAX_ASSET_COUNT = 1e5;
|
|
239413
239599
|
var ASSETS_IGNORE_FILE = ".assetsignore";
|
|
239414
239600
|
var ALWAYS_IGNORED = new Set([
|
|
@@ -239466,12 +239652,12 @@ async function buildAssetManifest(assetsDir, appId) {
|
|
|
239466
239652
|
followSymbolicLinks: false,
|
|
239467
239653
|
ignoreFiles: [ASSETS_IGNORE_FILE]
|
|
239468
239654
|
});
|
|
239469
|
-
const relativeFilePaths = found.filter((path) => !ALWAYS_IGNORED.has(
|
|
239655
|
+
const relativeFilePaths = found.filter((path) => !ALWAYS_IGNORED.has(basename5(path)));
|
|
239470
239656
|
if (relativeFilePaths.length > MAX_ASSET_COUNT) {
|
|
239471
239657
|
throw new InvalidInputError(`Too many static assets: found ${relativeFilePaths.length}, the limit is ${MAX_ASSET_COUNT} files.`);
|
|
239472
239658
|
}
|
|
239473
239659
|
for (const relativePath of relativeFilePaths.sort()) {
|
|
239474
|
-
const absolutePath =
|
|
239660
|
+
const absolutePath = join16(assetsDir, ...relativePath.split("/"));
|
|
239475
239661
|
const { size } = await stat(absolutePath);
|
|
239476
239662
|
const hash = await hashAssetFile(appId, absolutePath);
|
|
239477
239663
|
manifest[`/${relativePath}`] = { hash, size };
|
|
@@ -239489,7 +239675,7 @@ async function buildAssetManifest(assetsDir, appId) {
|
|
|
239489
239675
|
|
|
239490
239676
|
// src/core/site/modules.ts
|
|
239491
239677
|
import { stat as stat2 } from "node:fs/promises";
|
|
239492
|
-
import { relative as
|
|
239678
|
+
import { relative as relative5, resolve as resolve3, sep } from "node:path";
|
|
239493
239679
|
var MAX_TOTAL_MODULE_BYTES = 40 * 1024 * 1024;
|
|
239494
239680
|
var MODULE_IGNORE = ["wrangler.json", ".dev.vars"];
|
|
239495
239681
|
var RULE_TYPE_TO_MODULE_TYPE = {
|
|
@@ -239509,7 +239695,7 @@ async function collectModules(config) {
|
|
|
239509
239695
|
});
|
|
239510
239696
|
}
|
|
239511
239697
|
const modulesByName = new Map;
|
|
239512
|
-
const entryName = toPosix(
|
|
239698
|
+
const entryName = toPosix(relative5(config.configDir, entryPath));
|
|
239513
239699
|
modulesByName.set(entryName, {
|
|
239514
239700
|
name: entryName,
|
|
239515
239701
|
absolutePath: entryPath,
|
|
@@ -239518,7 +239704,7 @@ async function collectModules(config) {
|
|
|
239518
239704
|
});
|
|
239519
239705
|
const ignore = [...MODULE_IGNORE];
|
|
239520
239706
|
if (config.assetsDirectory?.startsWith(config.configDir + sep)) {
|
|
239521
|
-
ignore.push(`${toPosix(
|
|
239707
|
+
ignore.push(`${toPosix(relative5(config.configDir, config.assetsDirectory))}/**`);
|
|
239522
239708
|
}
|
|
239523
239709
|
for (const rule of config.rules) {
|
|
239524
239710
|
const type = RULE_TYPE_TO_MODULE_TYPE[rule.type];
|
|
@@ -239825,8 +240011,8 @@ async function uploadPresignedAsset(upload, assets) {
|
|
|
239825
240011
|
}
|
|
239826
240012
|
|
|
239827
240013
|
// src/core/site/wrangler-config.ts
|
|
239828
|
-
import { dirname as
|
|
239829
|
-
var WRANGLER_REDIRECT_PATH =
|
|
240014
|
+
import { dirname as dirname12, join as join17, resolve as resolve4 } from "node:path";
|
|
240015
|
+
var WRANGLER_REDIRECT_PATH = join17(".wrangler", "deploy", "config.json");
|
|
239830
240016
|
var RedirectConfigSchema = looseObject({
|
|
239831
240017
|
configPath: string2().min(1)
|
|
239832
240018
|
});
|
|
@@ -239848,7 +240034,7 @@ var WranglerConfigSchema = looseObject({
|
|
|
239848
240034
|
upload_source_maps: boolean2().optional()
|
|
239849
240035
|
});
|
|
239850
240036
|
async function detectFullStackArtifact(projectRoot) {
|
|
239851
|
-
const redirectPath =
|
|
240037
|
+
const redirectPath = join17(projectRoot, WRANGLER_REDIRECT_PATH);
|
|
239852
240038
|
return await pathExists(redirectPath) ? redirectPath : null;
|
|
239853
240039
|
}
|
|
239854
240040
|
async function resolveWranglerConfig(redirectPath) {
|
|
@@ -239862,7 +240048,7 @@ async function resolveWranglerConfig(redirectPath) {
|
|
|
239862
240048
|
if (config.no_bundle !== true) {
|
|
239863
240049
|
throw new InvalidInputError("This framework's output requires bundling; not yet supported. Base44 only deploys pre-bundled Workers output (no_bundle: true).");
|
|
239864
240050
|
}
|
|
239865
|
-
const configDir =
|
|
240051
|
+
const configDir = dirname12(configPath);
|
|
239866
240052
|
const assetsDirectory = config.assets?.directory ? resolve4(configDir, config.assets.directory) : null;
|
|
239867
240053
|
return {
|
|
239868
240054
|
configPath,
|
|
@@ -239885,7 +240071,7 @@ async function resolveRedirectedConfigPath(redirectPath) {
|
|
|
239885
240071
|
if (!result.success) {
|
|
239886
240072
|
throw new ConfigInvalidError(`Invalid deploy redirect file: ${prettifyError(result.error)}`, redirectPath);
|
|
239887
240073
|
}
|
|
239888
|
-
const configPath = resolve4(
|
|
240074
|
+
const configPath = resolve4(dirname12(redirectPath), result.data.configPath);
|
|
239889
240075
|
if (!await pathExists(configPath)) {
|
|
239890
240076
|
throw new ConfigInvalidError(`Wrangler config referenced by ${redirectPath} does not exist: ${configPath}`, redirectPath, {
|
|
239891
240077
|
hints: [{ message: "Rebuild the project to regenerate the artifact" }]
|
|
@@ -239950,7 +240136,7 @@ async function readIndexHtml(assetsDir, assets) {
|
|
|
239950
240136
|
if (!assetsDir || !assets.manifest["/index.html"]) {
|
|
239951
240137
|
throw new InvalidInputError(`No index.html found in "${assetsDir ?? "the site output directory"}" — a static site needs one at the output directory root.`);
|
|
239952
240138
|
}
|
|
239953
|
-
return new Uint8Array(await readFile3(
|
|
240139
|
+
return new Uint8Array(await readFile3(join18(assetsDir, "index.html")));
|
|
239954
240140
|
}
|
|
239955
240141
|
function buildAssetsConfig(assetsConfig, progress) {
|
|
239956
240142
|
if (!assetsConfig)
|
|
@@ -246509,6 +246695,7 @@ function hasResourcesToDeploy(projectData) {
|
|
|
246509
246695
|
project,
|
|
246510
246696
|
entities,
|
|
246511
246697
|
functions,
|
|
246698
|
+
actors,
|
|
246512
246699
|
agents,
|
|
246513
246700
|
agentSkills,
|
|
246514
246701
|
connectors,
|
|
@@ -246517,18 +246704,20 @@ function hasResourcesToDeploy(projectData) {
|
|
|
246517
246704
|
const hasSite = Boolean(project.site?.outputDirectory);
|
|
246518
246705
|
const hasEntities = entities.length > 0;
|
|
246519
246706
|
const hasFunctions = functions.length > 0;
|
|
246707
|
+
const hasActors = actors.length > 0;
|
|
246520
246708
|
const hasAgents = agents.length > 0;
|
|
246521
246709
|
const hasAgentSkills = agentSkills.length > 0;
|
|
246522
246710
|
const hasConnectors = connectors.length > 0;
|
|
246523
246711
|
const hasAuthConfig = authConfig.length > 0;
|
|
246524
246712
|
const hasVisibility = Boolean(project.visibility);
|
|
246525
|
-
return hasEntities || hasFunctions || hasAgents || hasAgentSkills || hasConnectors || hasAuthConfig || hasVisibility || hasSite;
|
|
246713
|
+
return hasEntities || hasFunctions || hasActors || hasAgents || hasAgentSkills || hasConnectors || hasAuthConfig || hasVisibility || hasSite;
|
|
246526
246714
|
}
|
|
246527
246715
|
async function deployAll(projectData, options) {
|
|
246528
246716
|
const {
|
|
246529
246717
|
project,
|
|
246530
246718
|
entities,
|
|
246531
246719
|
functions,
|
|
246720
|
+
actors,
|
|
246532
246721
|
agents,
|
|
246533
246722
|
agentSkills,
|
|
246534
246723
|
connectors,
|
|
@@ -246539,10 +246728,33 @@ async function deployAll(projectData, options) {
|
|
|
246539
246728
|
options?.onVisibilitySet?.(project.visibility);
|
|
246540
246729
|
}
|
|
246541
246730
|
await entityResource.push(entities);
|
|
246542
|
-
await deployFunctionsSequentially(functions, {
|
|
246731
|
+
const functionResults = await deployFunctionsSequentially(functions, {
|
|
246543
246732
|
onStart: options?.onFunctionStart,
|
|
246544
246733
|
onResult: options?.onFunctionResult
|
|
246545
246734
|
});
|
|
246735
|
+
const completedStages = [
|
|
246736
|
+
...project.visibility ? [`Visibility set to ${project.visibility}`] : [],
|
|
246737
|
+
...entities.length ? [`Entities synced: ${entities.length}`] : []
|
|
246738
|
+
];
|
|
246739
|
+
const functionDetails = functionResults.map((result) => `Function ${result.name}: ${result.status}${result.error ? ` — ${result.error}` : ""}`);
|
|
246740
|
+
if (functionResults.some((result) => result.status === "error")) {
|
|
246741
|
+
throw new ResourceDeploymentError("Function deployment failed; remaining deploy stages were not run", {
|
|
246742
|
+
details: [...completedStages, ...functionDetails]
|
|
246743
|
+
});
|
|
246744
|
+
}
|
|
246745
|
+
const actorResults = await deployActorsSequentially(actors, {
|
|
246746
|
+
onStart: options?.onActorStart,
|
|
246747
|
+
onResult: options?.onActorResult
|
|
246748
|
+
});
|
|
246749
|
+
if (actorResults.some((result) => result.status === "error")) {
|
|
246750
|
+
throw new ResourceDeploymentError("Actor deployment failed; remaining deploy stages were not run", {
|
|
246751
|
+
details: [
|
|
246752
|
+
...completedStages,
|
|
246753
|
+
...functionDetails,
|
|
246754
|
+
...actorResults.map(describeActorResult)
|
|
246755
|
+
]
|
|
246756
|
+
});
|
|
246757
|
+
}
|
|
246546
246758
|
await agentSkillResource.push(agentSkills);
|
|
246547
246759
|
await agentResource.push(agents);
|
|
246548
246760
|
await authConfigResource.push(authConfig);
|
|
@@ -247411,6 +247623,118 @@ function formatYaml(data, options = {}) {
|
|
|
247411
247623
|
const replacer = stripEmpty ? stripEmptyReplacer : undefined;
|
|
247412
247624
|
return $stringify(data, replacer, { indent: YAML_INDENT }).trimEnd();
|
|
247413
247625
|
}
|
|
247626
|
+
// src/cli/commands/actors/delete.ts
|
|
247627
|
+
async function deleteActorsAction({ log, jsonMode, runTask }, rawNames) {
|
|
247628
|
+
const names = [...new Set(parseNames(rawNames))];
|
|
247629
|
+
if (!names.length)
|
|
247630
|
+
throw new InvalidInputError("At least one actor name is required");
|
|
247631
|
+
names.forEach(validateActorName);
|
|
247632
|
+
const results = [];
|
|
247633
|
+
for (const name of names) {
|
|
247634
|
+
try {
|
|
247635
|
+
await runTask(`Deleting ${name}...`, () => deleteSingleActor(name), {
|
|
247636
|
+
successMessage: `${name} deleted`,
|
|
247637
|
+
errorMessage: `Failed to delete ${name}`
|
|
247638
|
+
});
|
|
247639
|
+
results.push({ name, status: "deleted" });
|
|
247640
|
+
} catch (error) {
|
|
247641
|
+
if (error instanceof ApiError && error.statusCode === 404) {
|
|
247642
|
+
results.push({ name, status: "not_found" });
|
|
247643
|
+
log.info(`${name} not found`);
|
|
247644
|
+
} else {
|
|
247645
|
+
const result = actorOperationError(name, error);
|
|
247646
|
+
results.push(result);
|
|
247647
|
+
log.error(describeActorResult(result));
|
|
247648
|
+
}
|
|
247649
|
+
}
|
|
247650
|
+
}
|
|
247651
|
+
const summary = {
|
|
247652
|
+
deleted: results.filter((result) => result.status === "deleted").length,
|
|
247653
|
+
notFound: results.filter((result) => result.status === "not_found").length,
|
|
247654
|
+
failed: results.filter((result) => result.status === "error").length
|
|
247655
|
+
};
|
|
247656
|
+
if (summary.failed)
|
|
247657
|
+
throw new ResourceDeploymentError("Actor deletion failed", {
|
|
247658
|
+
details: results.map(describeActorResult)
|
|
247659
|
+
});
|
|
247660
|
+
return {
|
|
247661
|
+
outroMessage: names.length === 1 ? `Actor "${names[0]}" ${summary.deleted ? "deleted" : "not found"}` : `${summary.deleted} deleted, ${summary.notFound} not found`,
|
|
247662
|
+
stdout: jsonMode ? `${JSON.stringify({ actors: results, summary })}
|
|
247663
|
+
` : undefined
|
|
247664
|
+
};
|
|
247665
|
+
}
|
|
247666
|
+
function getDeleteCommand() {
|
|
247667
|
+
return new Base44Command("delete").description("Delete deployed actors").argument("[names...]", "Actor names to delete (required)").action(deleteActorsAction);
|
|
247668
|
+
}
|
|
247669
|
+
|
|
247670
|
+
// src/cli/commands/functions/formatDeployResult.ts
|
|
247671
|
+
function formatDuration(ms) {
|
|
247672
|
+
return `${(ms / 1000).toFixed(1)}s`;
|
|
247673
|
+
}
|
|
247674
|
+
function formatDeployResult(result, log) {
|
|
247675
|
+
const label = result.name.padEnd(25);
|
|
247676
|
+
if (result.status === "deployed") {
|
|
247677
|
+
const timing = result.durationMs ? theme.styles.dim(` (${formatDuration(result.durationMs)})`) : "";
|
|
247678
|
+
log.success(`${label} deployed${timing}`);
|
|
247679
|
+
} else if (result.status === "unchanged") {
|
|
247680
|
+
log.success(`${label} unchanged`);
|
|
247681
|
+
} else {
|
|
247682
|
+
log.error(`${label} error: ${result.error}`);
|
|
247683
|
+
}
|
|
247684
|
+
}
|
|
247685
|
+
|
|
247686
|
+
// src/cli/commands/actors/deploy.ts
|
|
247687
|
+
async function deployActorsAction({ log, jsonMode }, rawNames) {
|
|
247688
|
+
const names = [...new Set(parseNames(rawNames))];
|
|
247689
|
+
if (rawNames.length && !names.length)
|
|
247690
|
+
throw new InvalidInputError("At least one actor name is required");
|
|
247691
|
+
names.forEach(validateActorName);
|
|
247692
|
+
const { actors, project } = await readProjectConfig();
|
|
247693
|
+
const notFound = names.filter((name) => !actors.some((actor) => actor.name === name));
|
|
247694
|
+
if (notFound.length)
|
|
247695
|
+
throw new InvalidInputError(`Actor not found in project: ${notFound.join(", ")}`);
|
|
247696
|
+
const selected = names.length ? actors.filter((actor) => names.includes(actor.name)) : actors;
|
|
247697
|
+
let completed = 0;
|
|
247698
|
+
if (selected.length)
|
|
247699
|
+
log.info(`Found ${selected.length} ${selected.length === 1 ? "actor" : "actors"} to deploy`);
|
|
247700
|
+
const results = await deployActorsSequentially(selected, {
|
|
247701
|
+
onStart: (name) => log.step(theme.styles.dim(`[${completed + 1}/${selected.length}] Deploying ${name}...`)),
|
|
247702
|
+
onResult: (result) => {
|
|
247703
|
+
completed++;
|
|
247704
|
+
formatDeployResult(result, log);
|
|
247705
|
+
if (result.status !== "error")
|
|
247706
|
+
for (const warning of result.warnings)
|
|
247707
|
+
log.warn(`${result.name}: ${warning}`);
|
|
247708
|
+
}
|
|
247709
|
+
});
|
|
247710
|
+
const summary = {
|
|
247711
|
+
deployed: results.filter((result) => result.status === "deployed").length,
|
|
247712
|
+
unchanged: results.filter((result) => result.status === "unchanged").length,
|
|
247713
|
+
failed: results.filter((result) => result.status === "error").length
|
|
247714
|
+
};
|
|
247715
|
+
const message = Object.entries(summary).filter(([, count]) => count > 0).map(([status, count]) => `${count} ${status}`).join(", ");
|
|
247716
|
+
if (summary.failed) {
|
|
247717
|
+
throw new ResourceDeploymentError(message, {
|
|
247718
|
+
details: results.map(describeActorResult)
|
|
247719
|
+
});
|
|
247720
|
+
}
|
|
247721
|
+
return {
|
|
247722
|
+
outroMessage: message || `No actors found. Create actors in the '${project.actorsDir}' directory.`,
|
|
247723
|
+
stdout: jsonMode ? `${JSON.stringify({ actors: results, summary })}
|
|
247724
|
+
` : undefined
|
|
247725
|
+
};
|
|
247726
|
+
}
|
|
247727
|
+
function getDeployCommand() {
|
|
247728
|
+
return new Base44Command("deploy").description("Deploy actors to Base44").argument("[names...]", "Actor names to deploy (deploys all if omitted)").action(deployActorsAction);
|
|
247729
|
+
}
|
|
247730
|
+
|
|
247731
|
+
// src/cli/commands/actors/index.ts
|
|
247732
|
+
function getActorsCommand() {
|
|
247733
|
+
return new Command2("actors").description("Manage realtime actors").addCommand(getDeployCommand()).addCommand(getDeleteCommand());
|
|
247734
|
+
}
|
|
247735
|
+
|
|
247736
|
+
// src/cli/commands/agent-skills/pull.ts
|
|
247737
|
+
import { dirname as dirname13, join as join19 } from "node:path";
|
|
247414
247738
|
// src/core/utils/dependencies.ts
|
|
247415
247739
|
import { spawnSync as spawnSync2 } from "node:child_process";
|
|
247416
247740
|
function verifyDenoInstalled(context) {
|
|
@@ -247499,7 +247823,7 @@ async function pullAction({
|
|
|
247499
247823
|
runTask
|
|
247500
247824
|
}) {
|
|
247501
247825
|
const { project } = await readProjectConfig();
|
|
247502
|
-
const dir =
|
|
247826
|
+
const dir = join19(dirname13(project.configPath), project.agentSkillsDir);
|
|
247503
247827
|
const remote = await runTask("Fetching agent skills from Base44", () => fetchAgentSkills(), {
|
|
247504
247828
|
successMessage: "Agent skills fetched successfully",
|
|
247505
247829
|
errorMessage: "Failed to fetch agent skills"
|
|
@@ -247555,14 +247879,14 @@ function getAgentSkillsCommand() {
|
|
|
247555
247879
|
}
|
|
247556
247880
|
|
|
247557
247881
|
// src/cli/commands/agents/pull.ts
|
|
247558
|
-
import { dirname as
|
|
247882
|
+
import { dirname as dirname14, join as join20 } from "node:path";
|
|
247559
247883
|
async function pullAgentsAction({
|
|
247560
247884
|
log,
|
|
247561
247885
|
runTask
|
|
247562
247886
|
}) {
|
|
247563
247887
|
const { project } = await readProjectConfig();
|
|
247564
|
-
const configDir =
|
|
247565
|
-
const agentsDir =
|
|
247888
|
+
const configDir = dirname14(project.configPath);
|
|
247889
|
+
const agentsDir = join20(configDir, project.agentsDir);
|
|
247566
247890
|
const remoteAgents = await runTask("Fetching agents from Base44", async () => {
|
|
247567
247891
|
return await fetchAgents();
|
|
247568
247892
|
}, {
|
|
@@ -247632,12 +247956,12 @@ function getAgentsCommand() {
|
|
|
247632
247956
|
}
|
|
247633
247957
|
|
|
247634
247958
|
// src/cli/commands/auth/password-login.ts
|
|
247635
|
-
import { dirname as
|
|
247959
|
+
import { dirname as dirname15, join as join21 } from "node:path";
|
|
247636
247960
|
async function passwordLoginAction({ log, runTask }, action) {
|
|
247637
247961
|
const shouldEnable = action === "enable";
|
|
247638
247962
|
const { project } = await readProjectConfig();
|
|
247639
|
-
const configDir =
|
|
247640
|
-
const authDir =
|
|
247963
|
+
const configDir = dirname15(project.configPath);
|
|
247964
|
+
const authDir = join21(configDir, project.authDir);
|
|
247641
247965
|
const updated = await runTask("Updating local auth config", async () => {
|
|
247642
247966
|
const current = await readAuthConfig(authDir) ?? DEFAULT_AUTH_CONFIG;
|
|
247643
247967
|
const merged = { ...current, enableUsernamePassword: shouldEnable };
|
|
@@ -247657,14 +247981,14 @@ function getPasswordLoginCommand() {
|
|
|
247657
247981
|
}
|
|
247658
247982
|
|
|
247659
247983
|
// src/cli/commands/auth/pull.ts
|
|
247660
|
-
import { dirname as
|
|
247984
|
+
import { dirname as dirname16, join as join22 } from "node:path";
|
|
247661
247985
|
async function pullAuthAction({
|
|
247662
247986
|
log,
|
|
247663
247987
|
runTask
|
|
247664
247988
|
}) {
|
|
247665
247989
|
const { project } = await readProjectConfig();
|
|
247666
|
-
const configDir =
|
|
247667
|
-
const authDir =
|
|
247990
|
+
const configDir = dirname16(project.configPath);
|
|
247991
|
+
const authDir = join22(configDir, project.authDir);
|
|
247668
247992
|
const remoteConfig = await runTask("Fetching auth config from Base44", async () => {
|
|
247669
247993
|
return await pullAuthConfig();
|
|
247670
247994
|
}, {
|
|
@@ -247728,7 +248052,7 @@ function getAuthPushCommand() {
|
|
|
247728
248052
|
}
|
|
247729
248053
|
|
|
247730
248054
|
// src/cli/commands/auth/social-login.ts
|
|
247731
|
-
import { dirname as
|
|
248055
|
+
import { dirname as dirname17, join as join23, resolve as resolve6 } from "node:path";
|
|
247732
248056
|
var PROVIDER_LABELS = {
|
|
247733
248057
|
google: "Google",
|
|
247734
248058
|
microsoft: "Microsoft",
|
|
@@ -247798,8 +248122,8 @@ async function socialLoginAction({ log, isNonInteractive, runTask }, provider, a
|
|
|
247798
248122
|
}
|
|
247799
248123
|
}
|
|
247800
248124
|
const { project } = await readProjectConfig();
|
|
247801
|
-
const configDir =
|
|
247802
|
-
const authDir =
|
|
248125
|
+
const configDir = dirname17(project.configPath);
|
|
248126
|
+
const authDir = join23(configDir, project.authDir);
|
|
247803
248127
|
const { config: updated } = await runTask("Updating local auth config", async () => updateSocialLoginConfig(authDir, provider, shouldEnable, useCustomOAuth && options.clientId ? { clientId: options.clientId } : undefined));
|
|
247804
248128
|
if (clientSecret) {
|
|
247805
248129
|
await runTask("Saving client secret", async () => pushCustomOAuthSecret(provider, clientSecret));
|
|
@@ -247824,7 +248148,7 @@ function getSocialLoginCommand() {
|
|
|
247824
248148
|
}
|
|
247825
248149
|
|
|
247826
248150
|
// src/cli/commands/auth/sso.ts
|
|
247827
|
-
import { dirname as
|
|
248151
|
+
import { dirname as dirname18, join as join24, resolve as resolve7 } from "node:path";
|
|
247828
248152
|
var SSOConfigFileSchema = object({
|
|
247829
248153
|
provider: _enum(Object.values(KNOWN_SSO_PROVIDERS)),
|
|
247830
248154
|
clientId: string2(),
|
|
@@ -247987,8 +248311,8 @@ async function ssoEnableAction({ isNonInteractive, runTask }, options) {
|
|
|
247987
248311
|
throw error;
|
|
247988
248312
|
}
|
|
247989
248313
|
const { project } = await readProjectConfig();
|
|
247990
|
-
const configDir =
|
|
247991
|
-
const authDir =
|
|
248314
|
+
const configDir = dirname18(project.configPath);
|
|
248315
|
+
const authDir = join24(configDir, project.authDir);
|
|
247992
248316
|
await runTask("Updating local auth config", async () => updateSSOConfig(authDir, provider, true));
|
|
247993
248317
|
await runTask("Saving SSO credentials", async () => pushSSOSecrets(secrets));
|
|
247994
248318
|
return {
|
|
@@ -248003,8 +248327,8 @@ async function ssoDisableAction({ log, runTask }, options) {
|
|
|
248003
248327
|
throw new InvalidInputError("Configuration options cannot be used with disable. To disable SSO: base44 auth sso disable");
|
|
248004
248328
|
}
|
|
248005
248329
|
const { project } = await readProjectConfig();
|
|
248006
|
-
const configDir =
|
|
248007
|
-
const authDir =
|
|
248330
|
+
const configDir = dirname18(project.configPath);
|
|
248331
|
+
const authDir = join24(configDir, project.authDir);
|
|
248008
248332
|
const updated = await runTask("Updating local auth config", async () => updateSSOConfig(authDir, null, false));
|
|
248009
248333
|
await runTask("Removing SSO credentials", async () => deleteSSOSecrets());
|
|
248010
248334
|
if (!hasAnyLoginMethod(updated)) {
|
|
@@ -248886,13 +249210,13 @@ function getConnectorsListAvailableCommand() {
|
|
|
248886
249210
|
}
|
|
248887
249211
|
|
|
248888
249212
|
// src/cli/commands/connectors/pull.ts
|
|
248889
|
-
import { dirname as
|
|
249213
|
+
import { dirname as dirname19, join as join25, resolve as resolve8 } from "node:path";
|
|
248890
249214
|
async function resolveConnectorsDir(options) {
|
|
248891
249215
|
if (!getAppContext().projectRoot) {
|
|
248892
249216
|
return resolve8(options.dir ?? "connectors");
|
|
248893
249217
|
}
|
|
248894
249218
|
const { project } = await readProjectConfig();
|
|
248895
|
-
return
|
|
249219
|
+
return join25(dirname19(project.configPath), project.connectorsDir);
|
|
248896
249220
|
}
|
|
248897
249221
|
async function pullConnectorsAction({ log, runTask, jsonMode }, options) {
|
|
248898
249222
|
const connectorsDir = await resolveConnectorsDir(options);
|
|
@@ -249147,43 +249471,22 @@ async function deleteFunctionsAction({ runTask }, names) {
|
|
|
249147
249471
|
parts.push(`${errors} error${errors !== 1 ? "s" : ""}`);
|
|
249148
249472
|
return { outroMessage: parts.join(", ") };
|
|
249149
249473
|
}
|
|
249150
|
-
function
|
|
249474
|
+
function parseNames2(args) {
|
|
249151
249475
|
return args.flatMap((arg) => arg.split(",")).map((n) => n.trim()).filter(Boolean);
|
|
249152
249476
|
}
|
|
249153
249477
|
function validateNames(command) {
|
|
249154
|
-
const names =
|
|
249478
|
+
const names = parseNames2(command.args);
|
|
249155
249479
|
if (names.length === 0) {
|
|
249156
249480
|
command.error("At least one function name is required");
|
|
249157
249481
|
}
|
|
249158
249482
|
}
|
|
249159
|
-
function
|
|
249483
|
+
function getDeleteCommand2() {
|
|
249160
249484
|
return new Base44Command("delete").description("Delete deployed functions").argument("<names...>", "Function names to delete").hook("preAction", validateNames).action(async (ctx, rawNames) => {
|
|
249161
|
-
const names =
|
|
249485
|
+
const names = parseNames2(rawNames);
|
|
249162
249486
|
return deleteFunctionsAction(ctx, names);
|
|
249163
249487
|
});
|
|
249164
249488
|
}
|
|
249165
249489
|
|
|
249166
|
-
// src/cli/commands/functions/formatDeployResult.ts
|
|
249167
|
-
function formatDuration(ms) {
|
|
249168
|
-
return `${(ms / 1000).toFixed(1)}s`;
|
|
249169
|
-
}
|
|
249170
|
-
function formatDeployResult(result, log) {
|
|
249171
|
-
const label = result.name.padEnd(25);
|
|
249172
|
-
if (result.status === "deployed") {
|
|
249173
|
-
const timing = result.durationMs ? theme.styles.dim(` (${formatDuration(result.durationMs)})`) : "";
|
|
249174
|
-
log.success(`${label} deployed${timing}`);
|
|
249175
|
-
} else if (result.status === "unchanged") {
|
|
249176
|
-
log.success(`${label} unchanged`);
|
|
249177
|
-
} else {
|
|
249178
|
-
log.error(`${label} error: ${result.error}`);
|
|
249179
|
-
}
|
|
249180
|
-
}
|
|
249181
|
-
|
|
249182
|
-
// src/cli/commands/functions/parseNames.ts
|
|
249183
|
-
function parseNames2(args) {
|
|
249184
|
-
return args.flatMap((arg) => arg.split(",")).map((n) => n.trim()).filter(Boolean);
|
|
249185
|
-
}
|
|
249186
|
-
|
|
249187
249490
|
// src/cli/commands/functions/deploy.ts
|
|
249188
249491
|
function resolveFunctionsToDeploy(names, allFunctions) {
|
|
249189
249492
|
if (names.length === 0)
|
|
@@ -249270,9 +249573,9 @@ async function deployFunctionsAction({ log }, names, options) {
|
|
|
249270
249573
|
}
|
|
249271
249574
|
return { outroMessage: buildDeploySummary(results) };
|
|
249272
249575
|
}
|
|
249273
|
-
function
|
|
249576
|
+
function getDeployCommand2() {
|
|
249274
249577
|
return new Base44Command("deploy").description("Deploy functions to Base44").argument("[names...]", "Function names to deploy (deploys all if omitted)").option("--force", "Delete remote functions not found locally").action(async (ctx, rawNames, options) => {
|
|
249275
|
-
const names =
|
|
249578
|
+
const names = parseNames(rawNames);
|
|
249276
249579
|
return deployFunctionsAction(ctx, names, options);
|
|
249277
249580
|
});
|
|
249278
249581
|
}
|
|
@@ -249300,11 +249603,11 @@ function getListCommand() {
|
|
|
249300
249603
|
}
|
|
249301
249604
|
|
|
249302
249605
|
// src/cli/commands/functions/pull.ts
|
|
249303
|
-
import { dirname as
|
|
249606
|
+
import { dirname as dirname20, join as join26 } from "node:path";
|
|
249304
249607
|
async function pullFunctionsAction({ log, runTask }, name) {
|
|
249305
249608
|
const { project, functions } = await readProjectConfig();
|
|
249306
|
-
const configDir =
|
|
249307
|
-
const functionsDir =
|
|
249609
|
+
const configDir = dirname20(project.configPath);
|
|
249610
|
+
const functionsDir = join26(configDir, project.functionsDir);
|
|
249308
249611
|
const pluginFunctionNames = new Set(functions.filter((fn) => fn.source.type === "plugin").map((fn) => fn.name));
|
|
249309
249612
|
const remoteFunctions = await runTask("Fetching functions from Base44", async () => {
|
|
249310
249613
|
const { functions } = await listDeployedFunctions();
|
|
@@ -249359,7 +249662,7 @@ function getPullCommand() {
|
|
|
249359
249662
|
|
|
249360
249663
|
// src/cli/commands/functions/index.ts
|
|
249361
249664
|
function getFunctionsCommand() {
|
|
249362
|
-
return new Command2("functions").description("Manage backend functions").addCommand(
|
|
249665
|
+
return new Command2("functions").description("Manage backend functions").addCommand(getDeployCommand2()).addCommand(getDeleteCommand2()).addCommand(getListCommand()).addCommand(getPullCommand());
|
|
249363
249666
|
}
|
|
249364
249667
|
|
|
249365
249668
|
// src/cli/commands/project/site-build.ts
|
|
@@ -249408,7 +249711,7 @@ async function maybeAskToBuild(isNonInteractive, buildCommand) {
|
|
|
249408
249711
|
import { createHash as createHash2 } from "node:crypto";
|
|
249409
249712
|
import { createReadStream as createReadStream3 } from "node:fs";
|
|
249410
249713
|
import { stat as stat3 } from "node:fs/promises";
|
|
249411
|
-
import { basename as
|
|
249714
|
+
import { basename as basename6, join as join27 } from "node:path";
|
|
249412
249715
|
var MAX_FILE_COUNT = 1e5;
|
|
249413
249716
|
var ASSETS_IGNORE_FILE2 = ".assetsignore";
|
|
249414
249717
|
var ALWAYS_IGNORED2 = new Set([
|
|
@@ -249432,7 +249735,7 @@ async function collectBuildOutput(outputDir) {
|
|
|
249432
249735
|
followSymbolicLinks: false,
|
|
249433
249736
|
ignoreFiles: [ASSETS_IGNORE_FILE2]
|
|
249434
249737
|
});
|
|
249435
|
-
const relativePaths = found.filter((path) => !ALWAYS_IGNORED2.has(
|
|
249738
|
+
const relativePaths = found.filter((path) => !ALWAYS_IGNORED2.has(basename6(path))).sort();
|
|
249436
249739
|
if (relativePaths.length === 0) {
|
|
249437
249740
|
throw new InvalidInputError(`No files found in ${outputDir}. Build the site before creating a version.`, {
|
|
249438
249741
|
hints: [
|
|
@@ -249447,7 +249750,7 @@ async function collectBuildOutput(outputDir) {
|
|
|
249447
249750
|
throw new InvalidInputError(`${outputDir} has no ${ENTRY2}, so nothing could enter the site.`);
|
|
249448
249751
|
}
|
|
249449
249752
|
return await Promise.all(relativePaths.map(async (path) => {
|
|
249450
|
-
const absolutePath =
|
|
249753
|
+
const absolutePath = join27(outputDir, ...path.split("/"));
|
|
249451
249754
|
const { size } = await stat3(absolutePath);
|
|
249452
249755
|
return {
|
|
249453
249756
|
path,
|
|
@@ -249469,14 +249772,14 @@ async function readRawResources(dir) {
|
|
|
249469
249772
|
const payloads = {};
|
|
249470
249773
|
for (const relativePath of files.sort()) {
|
|
249471
249774
|
const name = relativePath.replace(/\.jsonc?$/, "");
|
|
249472
|
-
payloads[name] = await readJsonFile(
|
|
249775
|
+
payloads[name] = await readJsonFile(join27(dir, ...relativePath.split("/")));
|
|
249473
249776
|
}
|
|
249474
249777
|
return payloads;
|
|
249475
249778
|
}
|
|
249476
249779
|
async function collectResources(configDir, dirs) {
|
|
249477
249780
|
const [entities, agents] = await Promise.all([
|
|
249478
|
-
readRawResources(
|
|
249479
|
-
readRawResources(
|
|
249781
|
+
readRawResources(join27(configDir, dirs.entitiesDir)),
|
|
249782
|
+
readRawResources(join27(configDir, dirs.agentsDir))
|
|
249480
249783
|
]);
|
|
249481
249784
|
return { entities, agents };
|
|
249482
249785
|
}
|
|
@@ -249487,7 +249790,7 @@ function versionsApiEnabled(env = process.env) {
|
|
|
249487
249790
|
return value === "1" || value === "true";
|
|
249488
249791
|
}
|
|
249489
249792
|
// src/core/version/project.ts
|
|
249490
|
-
import { dirname as
|
|
249793
|
+
import { dirname as dirname21, join as join28, resolve as resolve10 } from "node:path";
|
|
249491
249794
|
var DEFAULT_BUILD_COMMAND = "npm run build";
|
|
249492
249795
|
var DEFAULT_OUTPUT_DIRECTORY = "dist";
|
|
249493
249796
|
async function resolvePublishTarget(projectRoot, overrides = {}) {
|
|
@@ -249495,7 +249798,7 @@ async function resolvePublishTarget(projectRoot, overrides = {}) {
|
|
|
249495
249798
|
const root = project?.root ?? projectRoot ?? process.cwd();
|
|
249496
249799
|
return {
|
|
249497
249800
|
root,
|
|
249498
|
-
configDir: project ?
|
|
249801
|
+
configDir: project ? dirname21(project.configPath) : join28(root, PROJECT_SUBDIR),
|
|
249499
249802
|
buildCommand: project ? project.site?.buildCommand : DEFAULT_BUILD_COMMAND,
|
|
249500
249803
|
outputDir: outputDirectory(project, root, overrides.outputDir),
|
|
249501
249804
|
entitiesDir: project?.entitiesDir ?? "entities",
|
|
@@ -249547,11 +249850,11 @@ function getBuildCommand() {
|
|
|
249547
249850
|
}
|
|
249548
249851
|
|
|
249549
249852
|
// src/cli/commands/project/create.ts
|
|
249550
|
-
import { basename as
|
|
249853
|
+
import { basename as basename7, resolve as resolve11 } from "node:path";
|
|
249551
249854
|
var import_kebabCase = __toESM(require_kebabCase(), 1);
|
|
249552
249855
|
|
|
249553
249856
|
// src/cli/commands/project/scaffold-shared.ts
|
|
249554
|
-
import { join as
|
|
249857
|
+
import { join as join29 } from "node:path";
|
|
249555
249858
|
var DEFAULT_TEMPLATE_ID = "backend-only";
|
|
249556
249859
|
async function getTemplateById(templateId) {
|
|
249557
249860
|
const templates = await listTemplates();
|
|
@@ -249614,7 +249917,7 @@ async function completeProjectSetup({
|
|
|
249614
249917
|
env: { VITE_BASE44_APP_ID: projectId }
|
|
249615
249918
|
})`${buildCommand}`;
|
|
249616
249919
|
updateMessage("Deploying site...");
|
|
249617
|
-
return await deploySite(
|
|
249920
|
+
return await deploySite(join29(resolvedPath, outputDirectory));
|
|
249618
249921
|
}, {
|
|
249619
249922
|
successMessage: theme.colors.base44Orange("Site deployed successfully"),
|
|
249620
249923
|
errorMessage: "Failed to deploy site"
|
|
@@ -249712,8 +250015,8 @@ async function createInteractive(options, ctx) {
|
|
|
249712
250015
|
name: () => {
|
|
249713
250016
|
return options.name ? Promise.resolve(options.name) : Ze({
|
|
249714
250017
|
message: "What is the name of your project?",
|
|
249715
|
-
placeholder:
|
|
249716
|
-
initialValue:
|
|
250018
|
+
placeholder: basename7(process.cwd()),
|
|
250019
|
+
initialValue: basename7(process.cwd()),
|
|
249717
250020
|
validate: (value) => {
|
|
249718
250021
|
if (!value || value.trim().length === 0) {
|
|
249719
250022
|
return "Every project deserves a name";
|
|
@@ -249829,7 +250132,15 @@ async function deployAction(ctx, options = {}) {
|
|
|
249829
250132
|
outroMessage: "No resources found to deploy"
|
|
249830
250133
|
};
|
|
249831
250134
|
}
|
|
249832
|
-
const {
|
|
250135
|
+
const {
|
|
250136
|
+
project,
|
|
250137
|
+
entities,
|
|
250138
|
+
functions,
|
|
250139
|
+
actors,
|
|
250140
|
+
agents,
|
|
250141
|
+
connectors,
|
|
250142
|
+
authConfig
|
|
250143
|
+
} = projectData;
|
|
249833
250144
|
const summaryLines = [];
|
|
249834
250145
|
if (entities.length > 0) {
|
|
249835
250146
|
summaryLines.push(` - ${entities.length} ${entities.length === 1 ? "entity" : "entities"}`);
|
|
@@ -249837,6 +250148,9 @@ async function deployAction(ctx, options = {}) {
|
|
|
249837
250148
|
if (functions.length > 0) {
|
|
249838
250149
|
summaryLines.push(` - ${functions.length} ${functions.length === 1 ? "function" : "functions"}`);
|
|
249839
250150
|
}
|
|
250151
|
+
if (actors.length > 0) {
|
|
250152
|
+
summaryLines.push(` - ${actors.length} ${actors.length === 1 ? "actor" : "actors"}`);
|
|
250153
|
+
}
|
|
249840
250154
|
if (agents.length > 0) {
|
|
249841
250155
|
summaryLines.push(` - ${agents.length} ${agents.length === 1 ? "agent" : "agents"}`);
|
|
249842
250156
|
}
|
|
@@ -249870,6 +250184,7 @@ ${summaryLines.join(`
|
|
|
249870
250184
|
await maybeBuildBeforeDeploy(ctx, project, options.build);
|
|
249871
250185
|
let functionCompleted = 0;
|
|
249872
250186
|
const functionTotal = functions.length;
|
|
250187
|
+
let actorCompleted = 0;
|
|
249873
250188
|
const result = await deployAll(projectData, {
|
|
249874
250189
|
onVisibilitySet: (level) => {
|
|
249875
250190
|
log.success(`App visibility set to ${level}`);
|
|
@@ -249881,6 +250196,16 @@ ${summaryLines.join(`
|
|
|
249881
250196
|
onFunctionResult: (r) => {
|
|
249882
250197
|
functionCompleted++;
|
|
249883
250198
|
formatDeployResult(r, log);
|
|
250199
|
+
},
|
|
250200
|
+
onActorStart: (name) => {
|
|
250201
|
+
log.step(theme.styles.dim(`[${actorCompleted + 1}/${actors.length}] Deploying ${name}...`));
|
|
250202
|
+
},
|
|
250203
|
+
onActorResult: (result) => {
|
|
250204
|
+
actorCompleted++;
|
|
250205
|
+
formatDeployResult(result, log);
|
|
250206
|
+
if (result.status !== "error")
|
|
250207
|
+
for (const warning of result.warnings)
|
|
250208
|
+
log.warn(`${result.name}: ${warning}`);
|
|
249884
250209
|
}
|
|
249885
250210
|
});
|
|
249886
250211
|
const connectorResults = result.connectorResults ?? [];
|
|
@@ -249895,8 +250220,8 @@ ${summaryLines.join(`
|
|
|
249895
250220
|
}
|
|
249896
250221
|
return { outroMessage: "App deployed successfully" };
|
|
249897
250222
|
}
|
|
249898
|
-
function
|
|
249899
|
-
return new Base44Command("deploy").description("Deploy all project resources (entities, functions, agents, connectors, and site)").option("-y, --yes", "Skip confirmation prompt").option("--build", "Build the site before deploying (skips the prompt)").option("--no-build", "Deploy without building (skips the prompt)").action(deployAction);
|
|
250223
|
+
function getDeployCommand3() {
|
|
250224
|
+
return new Base44Command("deploy").description("Deploy all project resources (entities, functions, actors, agents, connectors, and site)").option("-y, --yes", "Skip confirmation prompt").option("--build", "Build the site before deploying (skips the prompt)").option("--no-build", "Deploy without building (skips the prompt)").action(deployAction);
|
|
249900
250225
|
}
|
|
249901
250226
|
async function handleOAuthConnectors(connectorResults, isNonInteractive, options, log) {
|
|
249902
250227
|
const needsOAuth = filterPendingOAuth(connectorResults);
|
|
@@ -250386,7 +250711,7 @@ function getLogsCommand() {
|
|
|
250386
250711
|
}
|
|
250387
250712
|
|
|
250388
250713
|
// src/cli/commands/project/scaffold.ts
|
|
250389
|
-
import { basename as
|
|
250714
|
+
import { basename as basename8, resolve as resolve12 } from "node:path";
|
|
250390
250715
|
function resolveAppId(options) {
|
|
250391
250716
|
const appId = options.appId;
|
|
250392
250717
|
if (!appId) {
|
|
@@ -250403,7 +250728,7 @@ async function scaffoldAction(ctx, name, options, command) {
|
|
|
250403
250728
|
const { log, runTask } = ctx;
|
|
250404
250729
|
const appId = resolveAppId(command.optsWithGlobals());
|
|
250405
250730
|
const resolvedPath = resolve12("./");
|
|
250406
|
-
const projectName = (name ??
|
|
250731
|
+
const projectName = (name ?? basename8(resolvedPath)).trim();
|
|
250407
250732
|
const template = await getTemplateById("backend-only");
|
|
250408
250733
|
log.info(`Scaffolding project at ${resolvedPath}`);
|
|
250409
250734
|
const { projectId } = await runTask("Setting up your project...", async () => {
|
|
@@ -251079,10 +251404,12 @@ var EMPTY_TEMPLATE = import_common_tags.stripIndent`
|
|
|
251079
251404
|
// Auto-generated by Base44 CLI - DO NOT EDIT
|
|
251080
251405
|
// Regenerate with: base44 types
|
|
251081
251406
|
//
|
|
251082
|
-
// No entities, functions, agents, or connectors found in project.
|
|
251083
|
-
// Add resources to base44/entities/, base44/functions/, base44/agents/, or base44/connectors/
|
|
251407
|
+
// No entities, functions, actors, agents, or connectors found in project.
|
|
251408
|
+
// Add resources to base44/entities/, base44/functions/, base44/actors/, base44/agents/, or base44/connectors/
|
|
251084
251409
|
// and run \`base44 types generate\` again.
|
|
251085
251410
|
|
|
251411
|
+
import '@base44/sdk';
|
|
251412
|
+
|
|
251086
251413
|
declare module '@base44/sdk' {
|
|
251087
251414
|
// No types to augment - add resources and regenerate
|
|
251088
251415
|
}
|
|
@@ -251092,8 +251419,8 @@ async function generateTypesFile(input) {
|
|
|
251092
251419
|
await writeFile(getTypesOutputPath(input.projectRoot), content);
|
|
251093
251420
|
}
|
|
251094
251421
|
async function generateContent(input) {
|
|
251095
|
-
const { entities, functions, agents, connectors } = input;
|
|
251096
|
-
if (!entities.length && !functions.length && !agents.length && !connectors.length) {
|
|
251422
|
+
const { entities, functions, actors, agents, connectors } = input;
|
|
251423
|
+
if (!entities.length && !functions.length && !actors.length && !agents.length && !connectors.length) {
|
|
251097
251424
|
return EMPTY_TEMPLATE;
|
|
251098
251425
|
}
|
|
251099
251426
|
const entityInterfaces = await Promise.all(entities.map((e) => compileEntity(e)));
|
|
@@ -251103,12 +251430,14 @@ async function generateContent(input) {
|
|
|
251103
251430
|
entities.map((e) => `"${e.name}": ${toPascalCase(e.name)};`)
|
|
251104
251431
|
],
|
|
251105
251432
|
["FunctionNameRegistry", functions.map((f) => `"${f.name}": true;`)],
|
|
251433
|
+
["ActorNameRegistry", actors.map((actor) => `"${actor.name}": true;`)],
|
|
251106
251434
|
["AgentNameRegistry", agents.map((a) => `"${a.name}": true;`)],
|
|
251107
251435
|
["ConnectorTypeRegistry", connectors.map((c) => `"${c.type}": true;`)]
|
|
251108
251436
|
];
|
|
251109
251437
|
const registries = registryEntries.filter(([, entries]) => entries.length > 0).map(([name, entries]) => registry2(name, entries));
|
|
251110
251438
|
return [
|
|
251111
251439
|
HEADER2,
|
|
251440
|
+
"import '@base44/sdk';",
|
|
251112
251441
|
entityInterfaces.join(`
|
|
251113
251442
|
|
|
251114
251443
|
`),
|
|
@@ -251153,10 +251482,10 @@ function toPascalCase(name) {
|
|
|
251153
251482
|
return name.split(/[-_\s]+/).map((w) => w.charAt(0).toUpperCase() + w.slice(1)).join("");
|
|
251154
251483
|
}
|
|
251155
251484
|
// src/core/types/update-project.ts
|
|
251156
|
-
import { join as
|
|
251485
|
+
import { join as join33 } from "node:path";
|
|
251157
251486
|
var TYPES_INCLUDE_PATH = `${PROJECT_SUBDIR}/${TYPES_OUTPUT_SUBDIR}/*.d.ts`;
|
|
251158
251487
|
async function updateProjectConfig(projectRoot) {
|
|
251159
|
-
const tsconfigPath =
|
|
251488
|
+
const tsconfigPath = join33(projectRoot, "tsconfig.json");
|
|
251160
251489
|
if (!await pathExists(tsconfigPath)) {
|
|
251161
251490
|
return false;
|
|
251162
251491
|
}
|
|
@@ -251180,12 +251509,13 @@ var TYPES_FILE_PATH = "base44/.types/types.d.ts";
|
|
|
251180
251509
|
async function generateTypesAction({
|
|
251181
251510
|
runTask
|
|
251182
251511
|
}) {
|
|
251183
|
-
const { entities, functions, agents, connectors, project } = await readProjectConfig();
|
|
251512
|
+
const { entities, functions, actors, agents, connectors, project } = await readProjectConfig();
|
|
251184
251513
|
await runTask("Generating types", async () => {
|
|
251185
251514
|
await generateTypesFile({
|
|
251186
251515
|
projectRoot: project.root,
|
|
251187
251516
|
entities,
|
|
251188
251517
|
functions,
|
|
251518
|
+
actors,
|
|
251189
251519
|
agents,
|
|
251190
251520
|
connectors
|
|
251191
251521
|
});
|
|
@@ -251672,7 +252002,7 @@ function createDevLogger(label, labelColor = theme.styles.dim) {
|
|
|
251672
252002
|
// src/cli/dev/dev-server/main.ts
|
|
251673
252003
|
var import_cors = __toESM(require_lib4(), 1);
|
|
251674
252004
|
var import_express6 = __toESM(require_express(), 1);
|
|
251675
|
-
import { dirname as
|
|
252005
|
+
import { dirname as dirname27, join as join38 } from "node:path";
|
|
251676
252006
|
|
|
251677
252007
|
// ../../node_modules/get-port/index.js
|
|
251678
252008
|
import net from "node:net";
|
|
@@ -251802,7 +252132,7 @@ var $tmpName = promisify11(tmp.tmpName);
|
|
|
251802
252132
|
|
|
251803
252133
|
// src/cli/dev/dev-server/function-manager.ts
|
|
251804
252134
|
import { spawn as spawn2 } from "node:child_process";
|
|
251805
|
-
import { dirname as
|
|
252135
|
+
import { dirname as dirname24, join as join34 } from "node:path";
|
|
251806
252136
|
import { pathToFileURL } from "node:url";
|
|
251807
252137
|
|
|
251808
252138
|
// src/cli/dev/dev-server/base-function-manager.ts
|
|
@@ -251907,7 +252237,7 @@ class FunctionManager extends BaseFunctionManager {
|
|
|
251907
252237
|
}
|
|
251908
252238
|
spawnFunction(func, port) {
|
|
251909
252239
|
this.logger.log(`Spawning function "${func.name}" on port ${port}`);
|
|
251910
|
-
const importMapPath =
|
|
252240
|
+
const importMapPath = join34(dirname24(this.wrapperPath), "import-map.json");
|
|
251911
252241
|
const process2 = spawn2("deno", ["run", "--allow-all", "--import-map", importMapPath, this.wrapperPath], {
|
|
251912
252242
|
env: {
|
|
251913
252243
|
...globalThis.process.env,
|
|
@@ -251981,7 +252311,7 @@ class FunctionManager extends BaseFunctionManager {
|
|
|
251981
252311
|
import { mkdirSync as mkdirSync2, writeFileSync as writeFileSync2 } from "node:fs";
|
|
251982
252312
|
import { isBuiltin } from "node:module";
|
|
251983
252313
|
import { homedir as homedir3 } from "node:os";
|
|
251984
|
-
import { join as
|
|
252314
|
+
import { join as join35 } from "node:path";
|
|
251985
252315
|
import { pathToFileURL as pathToFileURL6 } from "node:url";
|
|
251986
252316
|
var depsPromise;
|
|
251987
252317
|
function loadDeps() {
|
|
@@ -252102,9 +252432,9 @@ export default {
|
|
|
252102
252432
|
};
|
|
252103
252433
|
`;
|
|
252104
252434
|
function ensureBundlerConfig() {
|
|
252105
|
-
const dir =
|
|
252435
|
+
const dir = join35(homedir3(), ".base44", "function-bundler");
|
|
252106
252436
|
mkdirSync2(dir, { recursive: true });
|
|
252107
|
-
const configPath =
|
|
252437
|
+
const configPath = join35(dir, "deno.json");
|
|
252108
252438
|
writeFileSync2(configPath, `${JSON.stringify({ nodeModulesDir: "auto" }, null, 2)}
|
|
252109
252439
|
`);
|
|
252110
252440
|
return configPath;
|
|
@@ -253574,7 +253904,7 @@ function createCustomIntegrationRoutes(remoteProxy, logger) {
|
|
|
253574
253904
|
|
|
253575
253905
|
// src/cli/dev/dev-server/watcher.ts
|
|
253576
253906
|
import { EventEmitter as EventEmitter4 } from "node:events";
|
|
253577
|
-
import { relative as
|
|
253907
|
+
import { relative as relative9 } from "node:path";
|
|
253578
253908
|
|
|
253579
253909
|
// ../../node_modules/chokidar/index.js
|
|
253580
253910
|
import { EventEmitter as EventEmitter3 } from "node:events";
|
|
@@ -255259,7 +255589,7 @@ class WatchBase44 extends EventEmitter4 {
|
|
|
255259
255589
|
ignoreInitial: true
|
|
255260
255590
|
});
|
|
255261
255591
|
watcher.on("all", import_debounce.default(async (_event, path) => {
|
|
255262
|
-
this.emit("change", name,
|
|
255592
|
+
this.emit("change", name, relative9(targetPath, path));
|
|
255263
255593
|
}, WATCH_DEBOUNCE_MS));
|
|
255264
255594
|
watcher.on("error", (err) => {
|
|
255265
255595
|
this.logger.error(`Watch handler failed for ${targetPath}`, err);
|
|
@@ -255296,6 +255626,11 @@ async function createDevServer(options) {
|
|
|
255296
255626
|
next();
|
|
255297
255627
|
});
|
|
255298
255628
|
const devLogger = createDevLogger("backend", theme.styles.info);
|
|
255629
|
+
app.use("/api/apps/:appId/actors", (_req, res) => {
|
|
255630
|
+
const message = "Actors are not available in local development";
|
|
255631
|
+
devLogger.error(message);
|
|
255632
|
+
res.status(500).json({ error: message });
|
|
255633
|
+
});
|
|
255299
255634
|
const functionManager = await createFunctionRuntime(functions, devLogger, options.denoWrapperPath);
|
|
255300
255635
|
const functionRoutes = createFunctionRouter(functionManager, devLogger);
|
|
255301
255636
|
app.use("/api/apps/:appId/functions", functionRoutes);
|
|
@@ -255366,8 +255701,8 @@ async function createDevServer(options) {
|
|
|
255366
255701
|
broadcastEntityEvent(io, appId, entityName, event);
|
|
255367
255702
|
};
|
|
255368
255703
|
const base44ConfigWatcher = new WatchBase44({
|
|
255369
|
-
functions:
|
|
255370
|
-
entities:
|
|
255704
|
+
functions: join38(dirname27(project.configPath), project.functionsDir),
|
|
255705
|
+
entities: join38(dirname27(project.configPath), project.entitiesDir)
|
|
255371
255706
|
}, devLogger);
|
|
255372
255707
|
base44ConfigWatcher.on("change", async (name) => {
|
|
255373
255708
|
try {
|
|
@@ -255895,7 +256230,7 @@ function createProgram(context) {
|
|
|
255895
256230
|
program.addCommand(getScaffoldCommand());
|
|
255896
256231
|
program.addCommand(getDashboardCommand());
|
|
255897
256232
|
program.addCommand(getBuildCommand());
|
|
255898
|
-
program.addCommand(
|
|
256233
|
+
program.addCommand(getDeployCommand3());
|
|
255899
256234
|
program.addCommand(getVisibilityCommand());
|
|
255900
256235
|
program.addCommand(getLinkCommand());
|
|
255901
256236
|
program.addCommand(getEjectCommand());
|
|
@@ -255905,6 +256240,7 @@ function createProgram(context) {
|
|
|
255905
256240
|
program.addCommand(getAgentSkillsCommand());
|
|
255906
256241
|
program.addCommand(getConnectorsCommand());
|
|
255907
256242
|
program.addCommand(getFunctionsCommand());
|
|
256243
|
+
program.addCommand(getActorsCommand());
|
|
255908
256244
|
program.addCommand(getWorkflowsCommand());
|
|
255909
256245
|
program.addCommand(getSecretsCommand());
|
|
255910
256246
|
program.addCommand(getSandboxCommand());
|
|
@@ -255927,7 +256263,7 @@ var import_detect_agent = __toESM(require_dist5(), 1);
|
|
|
255927
256263
|
import { release, type } from "node:os";
|
|
255928
256264
|
|
|
255929
256265
|
// ../../node_modules/posthog-node/dist/extensions/error-tracking/modifiers/module.node.mjs
|
|
255930
|
-
import { dirname as
|
|
256266
|
+
import { dirname as dirname28, posix, sep as sep2 } from "path";
|
|
255931
256267
|
function createModulerModifier() {
|
|
255932
256268
|
const getModuleFromFileName = createGetModuleFromFilename();
|
|
255933
256269
|
return async (frames) => {
|
|
@@ -255936,7 +256272,7 @@ function createModulerModifier() {
|
|
|
255936
256272
|
return frames;
|
|
255937
256273
|
};
|
|
255938
256274
|
}
|
|
255939
|
-
function createGetModuleFromFilename(basePath = process.argv[1] ?
|
|
256275
|
+
function createGetModuleFromFilename(basePath = process.argv[1] ? dirname28(process.argv[1]) : process.cwd(), isWindows = sep2 === "\\") {
|
|
255940
256276
|
const normalizedBase = isWindows ? normalizeWindowsPath2(basePath) : basePath;
|
|
255941
256277
|
return (filename) => {
|
|
255942
256278
|
if (!filename)
|
|
@@ -259925,9 +260261,9 @@ function addCommandInfoToErrorReporter(program, errorReporter) {
|
|
|
259925
260261
|
});
|
|
259926
260262
|
}
|
|
259927
260263
|
// src/cli/index.ts
|
|
259928
|
-
var __dirname4 =
|
|
260264
|
+
var __dirname4 = dirname29(fileURLToPath6(import.meta.url));
|
|
259929
260265
|
async function runCLI(options) {
|
|
259930
|
-
ensureNpmAssets(
|
|
260266
|
+
ensureNpmAssets(join39(__dirname4, "../assets"));
|
|
259931
260267
|
const errorReporter = new ErrorReporter;
|
|
259932
260268
|
errorReporter.registerProcessErrorHandlers();
|
|
259933
260269
|
const jsonMode = process.argv.includes("--json");
|
|
@@ -259966,4 +260302,4 @@ export {
|
|
|
259966
260302
|
runCLI
|
|
259967
260303
|
};
|
|
259968
260304
|
|
|
259969
|
-
//# debugId=
|
|
260305
|
+
//# debugId=552C10C2A6541CE164756E2164756E21
|