@base44-preview/cli 0.3.4-pr.701.87b0681 → 0.3.4-pr.703.4ec4bf2
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 +250 -57
- package/dist/cli/index.js.map +10 -9
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -31560,7 +31560,7 @@ function cleanDoc(doc) {
|
|
|
31560
31560
|
return mapDoc(doc, (currentDoc) => cleanDocFn(currentDoc));
|
|
31561
31561
|
}
|
|
31562
31562
|
function replaceEndOfLine(doc, replacement = literalline) {
|
|
31563
|
-
return mapDoc(doc, (currentDoc) => typeof currentDoc === "string" ?
|
|
31563
|
+
return mapDoc(doc, (currentDoc) => typeof currentDoc === "string" ? join33(replacement, currentDoc.split(`
|
|
31564
31564
|
`)) : currentDoc);
|
|
31565
31565
|
}
|
|
31566
31566
|
function canBreakFn(doc) {
|
|
@@ -31640,7 +31640,7 @@ function indentIfBreak(contents, options) {
|
|
|
31640
31640
|
negate: options.negate
|
|
31641
31641
|
};
|
|
31642
31642
|
}
|
|
31643
|
-
function
|
|
31643
|
+
function join33(separator, docs) {
|
|
31644
31644
|
assertDoc(separator);
|
|
31645
31645
|
assertDocArray(docs);
|
|
31646
31646
|
const parts = [];
|
|
@@ -32351,7 +32351,7 @@ var init_doc = __esm(() => {
|
|
|
32351
32351
|
MODE_FLAT = Symbol("MODE_FLAT");
|
|
32352
32352
|
DOC_FILL_PRINTED_LENGTH = Symbol("DOC_FILL_PRINTED_LENGTH");
|
|
32353
32353
|
builders = {
|
|
32354
|
-
join:
|
|
32354
|
+
join: join33,
|
|
32355
32355
|
line,
|
|
32356
32356
|
softline,
|
|
32357
32357
|
hardline,
|
|
@@ -125190,7 +125190,7 @@ var require2, __filename2, __dirname3, __create2, __defProp3, __getOwnPropDesc2,
|
|
|
125190
125190
|
}
|
|
125191
125191
|
}
|
|
125192
125192
|
}, ast_path_default, is_object_default, skipWhitespace, skipSpaces, skipToLineEnd, skipEverythingButNewLine, isNewlineCharacter = (character) => character === `
|
|
125193
|
-
` || character === "\r" || character === "\u2028" || character === "\u2029", skip_newline_default, has_newline_default, is_non_empty_array_default, get_sorted_child_nodes_default, childNodesCache, returnFalse = () => false, isAllEmptyAndNoLineBreak = (text) => !/[\S\n\u2028\u2029]/u.test(text), is_previous_line_empty_default, breakParent2, hardline2, indent2,
|
|
125193
|
+
` || character === "\r" || character === "\u2028" || character === "\u2029", skip_newline_default, has_newline_default, is_non_empty_array_default, get_sorted_child_nodes_default, childNodesCache, returnFalse = () => false, isAllEmptyAndNoLineBreak = (text) => !/[\S\n\u2028\u2029]/u.test(text), is_previous_line_empty_default, breakParent2, hardline2, indent2, join35, line22, lineSuffix2, create_print_pre_check_function_default = () => noop_default2, core_options_evaluate_default, arrayToReversed, toReversed, method_to_reversed_default, import_n_readlines, get_interpreter_default, getFileBasename = (file) => {
|
|
125194
125194
|
try {
|
|
125195
125195
|
return path112.basename(toPath3(file));
|
|
125196
125196
|
} catch {
|
|
@@ -135219,7 +135219,7 @@ ${codeblock}`, options8);
|
|
|
135219
135219
|
breakParent: breakParent2,
|
|
135220
135220
|
hardline: hardline2,
|
|
135221
135221
|
indent: indent2,
|
|
135222
|
-
join:
|
|
135222
|
+
join: join35,
|
|
135223
135223
|
line: line22,
|
|
135224
135224
|
lineSuffix: lineSuffix2
|
|
135225
135225
|
} = builders);
|
|
@@ -228889,7 +228889,7 @@ function normalizeBase44Env() {
|
|
|
228889
228889
|
loadProjectEnvFiles();
|
|
228890
228890
|
|
|
228891
228891
|
// src/cli/index.ts
|
|
228892
|
-
import { dirname as dirname31, join as
|
|
228892
|
+
import { dirname as dirname31, join as join43 } from "node:path";
|
|
228893
228893
|
import { fileURLToPath as fileURLToPath7 } from "node:url";
|
|
228894
228894
|
|
|
228895
228895
|
// ../../node_modules/@clack/core/dist/index.mjs
|
|
@@ -230847,7 +230847,8 @@ var TestOverridesSchema = object({
|
|
|
230847
230847
|
projectRoot: string2()
|
|
230848
230848
|
}).optional(),
|
|
230849
230849
|
latestVersion: string2().nullable().optional(),
|
|
230850
|
-
claudeBin: string2().optional()
|
|
230850
|
+
claudeBin: string2().optional(),
|
|
230851
|
+
skipRetryWait: boolean2().optional()
|
|
230851
230852
|
});
|
|
230852
230853
|
|
|
230853
230854
|
// src/core/config.ts
|
|
@@ -252930,6 +252931,7 @@ async function createVersion(artifacts, options = {}) {
|
|
|
252930
252931
|
agents: artifacts.agents,
|
|
252931
252932
|
mcp_config: artifacts.mcpConfig,
|
|
252932
252933
|
agent_skills: artifacts.agentSkills,
|
|
252934
|
+
...artifacts.pages ? { pages: artifacts.pages } : {},
|
|
252933
252935
|
source_commit: options.sourceCommit
|
|
252934
252936
|
}, "declaring a version")).json(), "declare");
|
|
252935
252937
|
const declaredFiles = [
|
|
@@ -252975,7 +252977,7 @@ async function setEnvironmentVersion(environment, versionId, options = {}) {
|
|
|
252975
252977
|
}
|
|
252976
252978
|
// src/core/version/artifacts.ts
|
|
252977
252979
|
import { createHash as createHash3 } from "node:crypto";
|
|
252978
|
-
import { join as
|
|
252980
|
+
import { join as join31, resolve as resolve14 } from "node:path";
|
|
252979
252981
|
|
|
252980
252982
|
// src/core/version/actors.ts
|
|
252981
252983
|
import { dirname as dirname22, relative as relative7, resolve as resolve13 } from "node:path";
|
|
@@ -264699,6 +264701,154 @@ function compiledModule(name, result) {
|
|
|
264699
264701
|
return result.module;
|
|
264700
264702
|
}
|
|
264701
264703
|
|
|
264704
|
+
// src/core/version/pages.ts
|
|
264705
|
+
import { join as join30 } from "node:path";
|
|
264706
|
+
var ROUTES_DIR = "src/routes";
|
|
264707
|
+
var ROUTE_TREE = "src/routeTree.gen.ts";
|
|
264708
|
+
var ROUTE_EXTENSIONS = [".tsx", ".ts", ".jsx", ".js"];
|
|
264709
|
+
var DOT_SPLIT = /\.(?![^[]*\])/;
|
|
264710
|
+
var BRACKETS = /\[([^\]]*)\]/g;
|
|
264711
|
+
var BRACE_PARAM = /\{(-?)\$([^{}[\]]+)\}(?![^[]*\])/;
|
|
264712
|
+
var COMPANION_SUFFIXES = new Set([
|
|
264713
|
+
"component",
|
|
264714
|
+
"errorComponent",
|
|
264715
|
+
"notFoundComponent",
|
|
264716
|
+
"pendingComponent",
|
|
264717
|
+
"loader"
|
|
264718
|
+
]);
|
|
264719
|
+
var SERVER_KEY = /\bserver\s*:\s*\{/;
|
|
264720
|
+
var COMPONENT_KEY = /\bcomponent['"]?\s*[:,}(]/;
|
|
264721
|
+
|
|
264722
|
+
class Segment {
|
|
264723
|
+
text;
|
|
264724
|
+
url;
|
|
264725
|
+
leadEscaped;
|
|
264726
|
+
literal;
|
|
264727
|
+
constructor(raw) {
|
|
264728
|
+
this.text = raw.replace(BRACKETS, "$1");
|
|
264729
|
+
this.leadEscaped = raw.startsWith("[");
|
|
264730
|
+
this.literal = raw === this.text;
|
|
264731
|
+
const name = raw.length > 1 && raw.endsWith("_") ? raw.slice(0, -1) : raw;
|
|
264732
|
+
const param = BRACE_PARAM.exec(name);
|
|
264733
|
+
this.url = param ? `:${param[2]}${param[1] ? "?" : ""}` : name.replace(BRACKETS, "$1");
|
|
264734
|
+
}
|
|
264735
|
+
isToken(...tokens) {
|
|
264736
|
+
return this.literal && tokens.includes(this.text);
|
|
264737
|
+
}
|
|
264738
|
+
isPathless() {
|
|
264739
|
+
return !this.leadEscaped && this.text.startsWith("_");
|
|
264740
|
+
}
|
|
264741
|
+
isGroup() {
|
|
264742
|
+
return !this.leadEscaped && this.text.startsWith("(") && this.text.endsWith(")");
|
|
264743
|
+
}
|
|
264744
|
+
}
|
|
264745
|
+
function segmentsOf(relativePath) {
|
|
264746
|
+
const segments = [];
|
|
264747
|
+
for (const name of relativePath.split("/")) {
|
|
264748
|
+
if (name.startsWith("-")) {
|
|
264749
|
+
return null;
|
|
264750
|
+
}
|
|
264751
|
+
for (const raw of name.split(DOT_SPLIT)) {
|
|
264752
|
+
if (!raw) {
|
|
264753
|
+
continue;
|
|
264754
|
+
}
|
|
264755
|
+
const segment = new Segment(raw);
|
|
264756
|
+
if (!segment.text || !segment.leadEscaped && segment.text.startsWith("__")) {
|
|
264757
|
+
return null;
|
|
264758
|
+
}
|
|
264759
|
+
segments.push(segment);
|
|
264760
|
+
}
|
|
264761
|
+
}
|
|
264762
|
+
return segments.length > 0 ? segments : null;
|
|
264763
|
+
}
|
|
264764
|
+
function pageName(parts) {
|
|
264765
|
+
if (parts.length === 0) {
|
|
264766
|
+
return "Home";
|
|
264767
|
+
}
|
|
264768
|
+
return parts.flatMap((part) => part.split(/[^A-Za-z0-9]/)).filter(Boolean).map((piece) => piece.charAt(0).toUpperCase() + piece.slice(1)).join("");
|
|
264769
|
+
}
|
|
264770
|
+
function pageOfRouteFile(relativePath) {
|
|
264771
|
+
const segments = segmentsOf(relativePath);
|
|
264772
|
+
if (segments === null || segments[0].isToken("api")) {
|
|
264773
|
+
return null;
|
|
264774
|
+
}
|
|
264775
|
+
if (segments[segments.length - 1].isToken("lazy")) {
|
|
264776
|
+
segments.pop();
|
|
264777
|
+
}
|
|
264778
|
+
const last = () => segments[segments.length - 1];
|
|
264779
|
+
if (last()?.isToken(...COMPANION_SUFFIXES)) {
|
|
264780
|
+
return null;
|
|
264781
|
+
}
|
|
264782
|
+
let poppedIndex = false;
|
|
264783
|
+
while (last()?.isToken("index", "route")) {
|
|
264784
|
+
poppedIndex ||= last()?.text === "index";
|
|
264785
|
+
segments.pop();
|
|
264786
|
+
}
|
|
264787
|
+
const end = last();
|
|
264788
|
+
if (end && !poppedIndex && (end.isPathless() || end.isGroup())) {
|
|
264789
|
+
return null;
|
|
264790
|
+
}
|
|
264791
|
+
const urlSegments = [];
|
|
264792
|
+
for (const segment of segments) {
|
|
264793
|
+
if (segment.isPathless() || segment.isGroup()) {
|
|
264794
|
+
continue;
|
|
264795
|
+
}
|
|
264796
|
+
let url = segment.url;
|
|
264797
|
+
if (!segment.leadEscaped && url === "$") {
|
|
264798
|
+
return null;
|
|
264799
|
+
}
|
|
264800
|
+
if (!segment.leadEscaped && url.startsWith("$")) {
|
|
264801
|
+
url = `:${url.slice(1)}`;
|
|
264802
|
+
}
|
|
264803
|
+
urlSegments.push(url);
|
|
264804
|
+
}
|
|
264805
|
+
return { path: `/${urlSegments.join("/")}`, name: pageName(urlSegments) };
|
|
264806
|
+
}
|
|
264807
|
+
function isServerOnly(source) {
|
|
264808
|
+
return SERVER_KEY.test(source) && !COMPONENT_KEY.test(source);
|
|
264809
|
+
}
|
|
264810
|
+
function byCodePoint2(a, b) {
|
|
264811
|
+
return a < b ? -1 : a > b ? 1 : 0;
|
|
264812
|
+
}
|
|
264813
|
+
async function collectPages(projectRoot) {
|
|
264814
|
+
if (!await pathExists(join30(projectRoot, ROUTE_TREE))) {
|
|
264815
|
+
return null;
|
|
264816
|
+
}
|
|
264817
|
+
const routesDir = join30(projectRoot, ROUTES_DIR);
|
|
264818
|
+
const files = await pathExists(routesDir) ? await globby("**/*", {
|
|
264819
|
+
cwd: routesDir,
|
|
264820
|
+
onlyFiles: true,
|
|
264821
|
+
followSymbolicLinks: false
|
|
264822
|
+
}) : [];
|
|
264823
|
+
const byPath = new Map;
|
|
264824
|
+
for (const relativeFile of files.sort(byCodePoint2)) {
|
|
264825
|
+
const extension = ROUTE_EXTENSIONS.find((ext) => relativeFile.endsWith(ext));
|
|
264826
|
+
if (!extension || relativeFile.endsWith(".d.ts")) {
|
|
264827
|
+
continue;
|
|
264828
|
+
}
|
|
264829
|
+
const page = pageOfRouteFile(relativeFile.slice(0, -extension.length));
|
|
264830
|
+
if (page === null || byPath.has(page.path)) {
|
|
264831
|
+
continue;
|
|
264832
|
+
}
|
|
264833
|
+
if (isServerOnly(await readTextFile(join30(routesDir, relativeFile)))) {
|
|
264834
|
+
continue;
|
|
264835
|
+
}
|
|
264836
|
+
byPath.set(page.path, {
|
|
264837
|
+
name: page.name,
|
|
264838
|
+
file: `${ROUTES_DIR}/${relativeFile}`
|
|
264839
|
+
});
|
|
264840
|
+
}
|
|
264841
|
+
const taken = new Set;
|
|
264842
|
+
return [...byPath].sort(([a], [b]) => a === "/" ? -1 : b === "/" ? 1 : byCodePoint2(a, b)).map(([path, { name, file }]) => {
|
|
264843
|
+
let unique = name;
|
|
264844
|
+
for (let n = 2;taken.has(unique); n++) {
|
|
264845
|
+
unique = `${name}${n}`;
|
|
264846
|
+
}
|
|
264847
|
+
taken.add(unique);
|
|
264848
|
+
return { path, name: unique, file };
|
|
264849
|
+
});
|
|
264850
|
+
}
|
|
264851
|
+
|
|
264702
264852
|
// src/core/version/publish.ts
|
|
264703
264853
|
import { randomUUID as randomUUID4 } from "node:crypto";
|
|
264704
264854
|
var DEFAULT_ENVIRONMENT = "production";
|
|
@@ -264782,12 +264932,12 @@ async function readRawResources(dir) {
|
|
|
264782
264932
|
const payloads = {};
|
|
264783
264933
|
for (const relativePath of files.sort()) {
|
|
264784
264934
|
const name = relativePath.replace(/\.jsonc?$/, "");
|
|
264785
|
-
payloads[name] = await readJsonFile(
|
|
264935
|
+
payloads[name] = await readJsonFile(join31(dir, ...relativePath.split("/")));
|
|
264786
264936
|
}
|
|
264787
264937
|
return payloads;
|
|
264788
264938
|
}
|
|
264789
264939
|
async function readMcpConfig(configDir) {
|
|
264790
|
-
const path =
|
|
264940
|
+
const path = join31(configDir, "mcp", "config.json");
|
|
264791
264941
|
return await pathExists(path) ? await readTextFile(path) : "";
|
|
264792
264942
|
}
|
|
264793
264943
|
async function readAgentSkillFiles(dir) {
|
|
@@ -264801,30 +264951,32 @@ async function readAgentSkillFiles(dir) {
|
|
|
264801
264951
|
});
|
|
264802
264952
|
const skills = {};
|
|
264803
264953
|
for (const file of files.sort()) {
|
|
264804
|
-
skills[file.replace(/\.md$/, "")] = await readTextFile(
|
|
264954
|
+
skills[file.replace(/\.md$/, "")] = await readTextFile(join31(dir, file));
|
|
264805
264955
|
}
|
|
264806
264956
|
return skills;
|
|
264807
264957
|
}
|
|
264808
264958
|
async function collectResources(configDir, dirs) {
|
|
264809
264959
|
const [entities, agents, mcpConfig, agentSkills] = await Promise.all([
|
|
264810
|
-
readRawResources(
|
|
264811
|
-
readRawResources(
|
|
264960
|
+
readRawResources(join31(configDir, dirs.entitiesDir)),
|
|
264961
|
+
readRawResources(join31(configDir, dirs.agentsDir)),
|
|
264812
264962
|
readMcpConfig(configDir),
|
|
264813
|
-
readAgentSkillFiles(
|
|
264963
|
+
readAgentSkillFiles(join31(configDir, dirs.agentSkillsDir))
|
|
264814
264964
|
]);
|
|
264815
264965
|
return { entities, agents, mcpConfig, agentSkills };
|
|
264816
264966
|
}
|
|
264817
264967
|
async function collectArtifacts(target) {
|
|
264818
264968
|
const built = await resolveFullStackBuild(target.root);
|
|
264819
264969
|
const siteWorker = built ? await describeSiteWorker(built) : null;
|
|
264970
|
+
const pages = await collectPages(target.root);
|
|
264820
264971
|
return {
|
|
264821
264972
|
assets: built ? built.assetsDir ? await collectBuildOutput(built.assetsDir) : [] : await collectBuildOutput(target.outputDir, {
|
|
264822
264973
|
entryFile: ENTRY2
|
|
264823
264974
|
}),
|
|
264824
264975
|
...siteWorker ? { siteWorker } : {},
|
|
264825
|
-
backendBundles: await tagStep2("build", () => compileBackendBundles(target.root,
|
|
264826
|
-
actors: await tagStep2("build", () => compileActors(
|
|
264827
|
-
...await collectResources(target.configDir, target)
|
|
264976
|
+
backendBundles: await tagStep2("build", () => compileBackendBundles(target.root, join31(target.configDir, target.functionsDir))),
|
|
264977
|
+
actors: await tagStep2("build", () => compileActors(join31(target.configDir, target.actorsDir))),
|
|
264978
|
+
...await collectResources(target.configDir, target),
|
|
264979
|
+
...pages ? { pages } : {}
|
|
264828
264980
|
};
|
|
264829
264981
|
}
|
|
264830
264982
|
// src/core/version/gate.ts
|
|
@@ -265367,11 +265519,14 @@ var SessionImportResponseSchema = object({
|
|
|
265367
265519
|
var ErrorEnvelopeSchema = object({
|
|
265368
265520
|
error: object({
|
|
265369
265521
|
code: string2().optional(),
|
|
265522
|
+
message: string2().optional(),
|
|
265370
265523
|
details: object({ branch_name: string2(), branch_url: string2() }).partial().optional()
|
|
265371
265524
|
})
|
|
265372
265525
|
});
|
|
265373
265526
|
var NETWORK_BLOCKED = "Your Claude cloud environment can't reach Base44 yet. In the environment's settings, open Network access, add `app.base44.com` to Allowed domains, and try again.";
|
|
265374
|
-
function messageFor(status, code, details, viaToken) {
|
|
265527
|
+
function messageFor(status, code, details, viaToken, serverMessage) {
|
|
265528
|
+
if (code === "authority_unavailable" && serverMessage)
|
|
265529
|
+
return serverMessage;
|
|
265375
265530
|
if (code === "branch_exists" && details?.branch_url) {
|
|
265376
265531
|
return `Base Code already has ${details.branch_name ?? "a branch for this session"}. Open it: ${new URL(details.branch_url, getBase44ApiUrl())}`;
|
|
265377
265532
|
}
|
|
@@ -265415,9 +265570,9 @@ async function toImportError(error, viaToken) {
|
|
|
265415
265570
|
const { status } = error.response;
|
|
265416
265571
|
const fallback = await ApiError.fromHttpError(error, "importing session");
|
|
265417
265572
|
const envelope = ErrorEnvelopeSchema.safeParse(fallback.responseBody);
|
|
265418
|
-
const { code, details } = envelope.success ? envelope.data.error : {};
|
|
265573
|
+
const { code, details, message } = envelope.success ? envelope.data.error : {};
|
|
265419
265574
|
const blocked = process.env.CLAUDE_CODE_REMOTE && status === 403 && typeof fallback.responseBody !== "object";
|
|
265420
|
-
const known = blocked ? NETWORK_BLOCKED : messageFor(status, code, details, viaToken);
|
|
265575
|
+
const known = blocked ? NETWORK_BLOCKED : messageFor(status, code, details, viaToken, message);
|
|
265421
265576
|
return new ApiError(known ?? fallback.message, {
|
|
265422
265577
|
statusCode: status,
|
|
265423
265578
|
requestUrl: error.request.url,
|
|
@@ -265426,10 +265581,29 @@ async function toImportError(error, viaToken) {
|
|
|
265426
265581
|
hints: known ? [] : fallback.hints
|
|
265427
265582
|
});
|
|
265428
265583
|
}
|
|
265584
|
+
var MAX_RETRIES = 3;
|
|
265585
|
+
var MAX_TOTAL_WAIT_SECONDS = 600;
|
|
265586
|
+
async function retryDelay(error) {
|
|
265587
|
+
if (!(error instanceof HTTPError))
|
|
265588
|
+
return;
|
|
265589
|
+
const { status, headers } = error.response;
|
|
265590
|
+
if (status !== 503 && status !== 429)
|
|
265591
|
+
return;
|
|
265592
|
+
const body = await error.response.clone().json().catch(() => {
|
|
265593
|
+
return;
|
|
265594
|
+
});
|
|
265595
|
+
const code = ErrorEnvelopeSchema.safeParse(body).data?.error.code;
|
|
265596
|
+
if (!(status === 503 && code === "authority_unavailable") && !(status === 429 && code === "rate_limited")) {
|
|
265597
|
+
return;
|
|
265598
|
+
}
|
|
265599
|
+
const seconds = Number(headers.get("Retry-After") ?? Number.NaN);
|
|
265600
|
+
return Number.isFinite(seconds) && seconds >= 0 ? seconds : 60;
|
|
265601
|
+
}
|
|
265429
265602
|
async function uploadSession(appId, content, {
|
|
265430
265603
|
token,
|
|
265431
265604
|
sourceBranch,
|
|
265432
|
-
artifacts = []
|
|
265605
|
+
artifacts = [],
|
|
265606
|
+
onRetry
|
|
265433
265607
|
} = {}) {
|
|
265434
265608
|
const form = new FormData;
|
|
265435
265609
|
form.append("file", new Blob([content]), "session.jsonl");
|
|
@@ -265445,23 +265619,41 @@ async function uploadSession(appId, content, {
|
|
|
265445
265619
|
}))));
|
|
265446
265620
|
}
|
|
265447
265621
|
const idempotencyKey = randomUUID5();
|
|
265622
|
+
const post = () => token ? distribution_default.post(new URL(`/api/apps/${appId}/imported/session-imports`, getBase44ApiUrl()), {
|
|
265623
|
+
body: form,
|
|
265624
|
+
headers: {
|
|
265625
|
+
Authorization: `Bearer ${token}`,
|
|
265626
|
+
"User-Agent": "Base44 CLI",
|
|
265627
|
+
"Idempotency-Key": idempotencyKey
|
|
265628
|
+
},
|
|
265629
|
+
timeout: 180000
|
|
265630
|
+
}) : getAppClient().post("imported/session-imports", {
|
|
265631
|
+
body: form,
|
|
265632
|
+
headers: { "Idempotency-Key": idempotencyKey },
|
|
265633
|
+
timeout: 180000
|
|
265634
|
+
});
|
|
265448
265635
|
let response;
|
|
265449
|
-
|
|
265450
|
-
|
|
265451
|
-
|
|
265452
|
-
|
|
265453
|
-
|
|
265454
|
-
|
|
265455
|
-
|
|
265456
|
-
|
|
265457
|
-
|
|
265458
|
-
|
|
265459
|
-
|
|
265460
|
-
|
|
265461
|
-
|
|
265462
|
-
|
|
265463
|
-
|
|
265464
|
-
|
|
265636
|
+
let waited = 0;
|
|
265637
|
+
for (let attempt = 1;; attempt++) {
|
|
265638
|
+
try {
|
|
265639
|
+
response = await post();
|
|
265640
|
+
break;
|
|
265641
|
+
} catch (error) {
|
|
265642
|
+
const seconds = await retryDelay(error);
|
|
265643
|
+
if (seconds === undefined || attempt > MAX_RETRIES || waited + seconds > MAX_TOTAL_WAIT_SECONDS) {
|
|
265644
|
+
throw await toImportError(error, Boolean(token));
|
|
265645
|
+
}
|
|
265646
|
+
waited += seconds;
|
|
265647
|
+
onRetry?.({
|
|
265648
|
+
status: error.response.status,
|
|
265649
|
+
seconds,
|
|
265650
|
+
attempt: attempt + 1,
|
|
265651
|
+
attempts: MAX_RETRIES + 1
|
|
265652
|
+
});
|
|
265653
|
+
if (!getTestOverrides()?.skipRetryWait) {
|
|
265654
|
+
await new Promise((resolve) => setTimeout(resolve, seconds * 1000));
|
|
265655
|
+
}
|
|
265656
|
+
}
|
|
265465
265657
|
}
|
|
265466
265658
|
const result = SessionImportResponseSchema.safeParse(await response.json());
|
|
265467
265659
|
if (!result.success) {
|
|
@@ -265756,7 +265948,7 @@ async function prepareSessionImages(content) {
|
|
|
265756
265948
|
import { createReadStream as createReadStream3 } from "node:fs";
|
|
265757
265949
|
import { realpath, rm as rm3, stat as stat6 } from "node:fs/promises";
|
|
265758
265950
|
import { homedir as homedir4 } from "node:os";
|
|
265759
|
-
import { dirname as dirname23, join as
|
|
265951
|
+
import { dirname as dirname23, join as join32 } from "node:path";
|
|
265760
265952
|
import { createInterface as createInterface2 } from "node:readline";
|
|
265761
265953
|
|
|
265762
265954
|
// ../../node_modules/tmp-promise/index.js
|
|
@@ -265769,8 +265961,8 @@ var $dir = async (options) => dirWithOptions(options);
|
|
|
265769
265961
|
var $tmpName = promisify12(tmp.tmpName);
|
|
265770
265962
|
|
|
265771
265963
|
// src/core/session-import/sessions.ts
|
|
265772
|
-
var claudeDir = () => process.env.CLAUDE_CONFIG_DIR ||
|
|
265773
|
-
var codexDir = () => process.env.CODEX_HOME ||
|
|
265964
|
+
var claudeDir = () => process.env.CLAUDE_CONFIG_DIR || join32(homedir4(), ".claude");
|
|
265965
|
+
var codexDir = () => process.env.CODEX_HOME || join32(homedir4(), ".codex");
|
|
265774
265966
|
async function scanLines(path, pick, maxLines = Number.POSITIVE_INFINITY) {
|
|
265775
265967
|
const lines = createInterface2({ input: createReadStream3(path) });
|
|
265776
265968
|
let count = 0;
|
|
@@ -265926,7 +266118,7 @@ async function teleportSession(sessionId, cwd) {
|
|
|
265926
266118
|
throw new InvalidInputError("Run this from a folder with the app's GitHub repository, so the session can be checked out.");
|
|
265927
266119
|
}
|
|
265928
266120
|
const tmp = await $dir({ unsafeCleanup: true });
|
|
265929
|
-
const repo =
|
|
266121
|
+
const repo = join32(tmp.path, "repo");
|
|
265930
266122
|
let projectFolder;
|
|
265931
266123
|
try {
|
|
265932
266124
|
await execa("git", ["clone", "--quiet", origin.stdout, repo]);
|
|
@@ -266044,10 +266236,11 @@ async function importAction(ctx, link, options, command) {
|
|
|
266044
266236
|
for (const { fileName, reason } of skipped) {
|
|
266045
266237
|
ctx.log.warn(`Not sending ${fileName}: ${reason}.`);
|
|
266046
266238
|
}
|
|
266047
|
-
const imported = await ctx.runTask("Importing session", () => uploadSession(appId, content, {
|
|
266239
|
+
const imported = await ctx.runTask("Importing session", (updateMessage) => uploadSession(appId, content, {
|
|
266048
266240
|
token: options.token,
|
|
266049
266241
|
sourceBranch: git?.branch,
|
|
266050
|
-
artifacts
|
|
266242
|
+
artifacts,
|
|
266243
|
+
onRetry: ({ status, seconds, attempt, attempts }) => updateMessage(`${status === 503 ? "GitHub is rate-limiting access checks" : "Too many imports"}. Retrying in ${seconds}s (attempt ${attempt} of ${attempts})…`)
|
|
266051
266244
|
}));
|
|
266052
266245
|
const url = `${getBase44ApiUrl()}${imported.branchUrl}`;
|
|
266053
266246
|
const { importedArtifacts: saved, skippedArtifacts: refused } = imported;
|
|
@@ -266514,10 +266707,10 @@ function toPascalCase(name) {
|
|
|
266514
266707
|
return name.split(/[-_\s]+/).map((w) => w.charAt(0).toUpperCase() + w.slice(1)).join("");
|
|
266515
266708
|
}
|
|
266516
266709
|
// src/core/types/update-project.ts
|
|
266517
|
-
import { join as
|
|
266710
|
+
import { join as join36 } from "node:path";
|
|
266518
266711
|
var TYPES_INCLUDE_PATH = `${PROJECT_SUBDIR}/${TYPES_OUTPUT_SUBDIR}/*.d.ts`;
|
|
266519
266712
|
async function updateProjectConfig(projectRoot) {
|
|
266520
|
-
const tsconfigPath =
|
|
266713
|
+
const tsconfigPath = join36(projectRoot, "tsconfig.json");
|
|
266521
266714
|
if (!await pathExists(tsconfigPath)) {
|
|
266522
266715
|
return false;
|
|
266523
266716
|
}
|
|
@@ -266998,7 +267191,7 @@ function getWorkspaceCommand() {
|
|
|
266998
267191
|
// src/cli/dev/dev-server/main.ts
|
|
266999
267192
|
var import_cors = __toESM(require_lib4(), 1);
|
|
267000
267193
|
var import_express6 = __toESM(require_express(), 1);
|
|
267001
|
-
import { dirname as dirname29, join as
|
|
267194
|
+
import { dirname as dirname29, join as join41 } from "node:path";
|
|
267002
267195
|
|
|
267003
267196
|
// ../../node_modules/get-port/index.js
|
|
267004
267197
|
import net from "node:net";
|
|
@@ -267119,7 +267312,7 @@ var import_http_proxy_middleware2 = __toESM(require_dist2(), 1);
|
|
|
267119
267312
|
|
|
267120
267313
|
// src/cli/dev/dev-server/function-manager.ts
|
|
267121
267314
|
import { spawn as spawn3 } from "node:child_process";
|
|
267122
|
-
import { dirname as dirname26, join as
|
|
267315
|
+
import { dirname as dirname26, join as join37 } from "node:path";
|
|
267123
267316
|
import { pathToFileURL as pathToFileURL6 } from "node:url";
|
|
267124
267317
|
|
|
267125
267318
|
// src/cli/dev/dev-server/base-function-manager.ts
|
|
@@ -267224,7 +267417,7 @@ class FunctionManager extends BaseFunctionManager {
|
|
|
267224
267417
|
}
|
|
267225
267418
|
spawnFunction(func, port) {
|
|
267226
267419
|
this.logger.log(`Spawning function "${func.name}" on port ${port}`);
|
|
267227
|
-
const importMapPath =
|
|
267420
|
+
const importMapPath = join37(dirname26(this.wrapperPath), "import-map.json");
|
|
267228
267421
|
const process2 = spawn3("deno", ["run", "--allow-all", "--import-map", importMapPath, this.wrapperPath], {
|
|
267229
267422
|
env: {
|
|
267230
267423
|
...globalThis.process.env,
|
|
@@ -267298,7 +267491,7 @@ class FunctionManager extends BaseFunctionManager {
|
|
|
267298
267491
|
import { mkdirSync as mkdirSync2, writeFileSync as writeFileSync2 } from "node:fs";
|
|
267299
267492
|
import { isBuiltin as isBuiltin3 } from "node:module";
|
|
267300
267493
|
import { homedir as homedir5 } from "node:os";
|
|
267301
|
-
import { join as
|
|
267494
|
+
import { join as join38 } from "node:path";
|
|
267302
267495
|
import { pathToFileURL as pathToFileURL7 } from "node:url";
|
|
267303
267496
|
var depsPromise;
|
|
267304
267497
|
function loadDeps() {
|
|
@@ -267419,9 +267612,9 @@ export default {
|
|
|
267419
267612
|
};
|
|
267420
267613
|
`;
|
|
267421
267614
|
function ensureBundlerConfig() {
|
|
267422
|
-
const dir =
|
|
267615
|
+
const dir = join38(homedir5(), ".base44", "function-bundler");
|
|
267423
267616
|
mkdirSync2(dir, { recursive: true });
|
|
267424
|
-
const configPath =
|
|
267617
|
+
const configPath = join38(dir, "deno.json");
|
|
267425
267618
|
writeFileSync2(configPath, `${JSON.stringify({ nodeModulesDir: "auto" }, null, 2)}
|
|
267426
267619
|
`);
|
|
267427
267620
|
return configPath;
|
|
@@ -270750,8 +270943,8 @@ async function createDevServer(options) {
|
|
|
270750
270943
|
broadcastEntityEvent(io, appId, entityName, event);
|
|
270751
270944
|
};
|
|
270752
270945
|
const base44ConfigWatcher = new WatchBase44({
|
|
270753
|
-
functions:
|
|
270754
|
-
entities:
|
|
270946
|
+
functions: join41(dirname29(project.configPath), project.functionsDir),
|
|
270947
|
+
entities: join41(dirname29(project.configPath), project.entitiesDir)
|
|
270755
270948
|
}, devLogger);
|
|
270756
270949
|
base44ConfigWatcher.on("change", async (name) => {
|
|
270757
270950
|
try {
|
|
@@ -270954,7 +271147,7 @@ function readExecEnvTarget(env = process.env) {
|
|
|
270954
271147
|
// src/core/exec/run-script.ts
|
|
270955
271148
|
import { spawn as spawn4 } from "node:child_process";
|
|
270956
271149
|
import { readFileSync as readFileSync4, writeFileSync as writeFileSync3 } from "node:fs";
|
|
270957
|
-
import { join as
|
|
271150
|
+
import { join as join42 } from "node:path";
|
|
270958
271151
|
var SDK_SPECIFIER = '"npm:@base44/sdk"';
|
|
270959
271152
|
function wrapperSource(sdkVersion) {
|
|
270960
271153
|
const source = readFileSync4(getExecWrapperPath(), "utf-8");
|
|
@@ -271001,7 +271194,7 @@ async function runScript(options) {
|
|
|
271001
271194
|
writeFileSync3(tempWrapper.path, wrapperSource(sdkVersion), "utf-8");
|
|
271002
271195
|
const configDir = await $dir({ unsafeCleanup: true });
|
|
271003
271196
|
cleanupFns.push(configDir.cleanup);
|
|
271004
|
-
const configPath =
|
|
271197
|
+
const configPath = join42(configDir.path, "deno.json");
|
|
271005
271198
|
writeFileSync3(configPath, JSON.stringify(DENO_CONFIG), "utf-8");
|
|
271006
271199
|
try {
|
|
271007
271200
|
const exitCode = await new Promise((resolvePromise) => {
|
|
@@ -275293,7 +275486,7 @@ function addCommandInfoToErrorReporter(program, errorReporter) {
|
|
|
275293
275486
|
// src/cli/index.ts
|
|
275294
275487
|
var __dirname4 = dirname31(fileURLToPath7(import.meta.url));
|
|
275295
275488
|
async function runCLI(options) {
|
|
275296
|
-
ensureNpmAssets(
|
|
275489
|
+
ensureNpmAssets(join43(__dirname4, "../assets"));
|
|
275297
275490
|
const errorReporter = new ErrorReporter;
|
|
275298
275491
|
errorReporter.registerProcessErrorHandlers();
|
|
275299
275492
|
const jsonMode = process.argv.includes("--json");
|
|
@@ -275332,4 +275525,4 @@ export {
|
|
|
275332
275525
|
runCLI
|
|
275333
275526
|
};
|
|
275334
275527
|
|
|
275335
|
-
//# debugId=
|
|
275528
|
+
//# debugId=FB9FF0E01E1A0F2F64756E2164756E21
|