@base44-preview/cli 0.1.12-pr.595.db709c9 → 0.1.12-pr.609.10ab831
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 +32 -241
- package/dist/cli/index.js.map +5 -6
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -120898,7 +120898,7 @@ function parse42(toml, { maxDepth = 1000, integersAsBigInt } = {}) {
|
|
|
120898
120898
|
}
|
|
120899
120899
|
return res;
|
|
120900
120900
|
}
|
|
120901
|
-
async function
|
|
120901
|
+
async function readFile5(file2) {
|
|
120902
120902
|
if (isUrlString(file2)) {
|
|
120903
120903
|
file2 = new URL(file2);
|
|
120904
120904
|
}
|
|
@@ -134692,7 +134692,7 @@ ${codeblock}`, options8);
|
|
|
134692
134692
|
"\\": "\\"
|
|
134693
134693
|
};
|
|
134694
134694
|
KEY_PART_RE = /^[a-zA-Z0-9-_]+[ \t]*$/;
|
|
134695
|
-
read_file_default =
|
|
134695
|
+
read_file_default = readFile5;
|
|
134696
134696
|
loadConfigFromPackageJson = process.versions.bun ? async function loadConfigFromBunPackageJson(file2) {
|
|
134697
134697
|
const { prettier } = await readBunPackageJson(file2);
|
|
134698
134698
|
return prettier;
|
|
@@ -143927,7 +143927,7 @@ var require_parse7 = __commonJS(function(exports) {
|
|
|
143927
143927
|
extension: url3.getExtension(path18)
|
|
143928
143928
|
};
|
|
143929
143929
|
try {
|
|
143930
|
-
const resolver = await
|
|
143930
|
+
const resolver = await readFile6(file2, options8, $refs);
|
|
143931
143931
|
$ref.pathType = resolver.plugin.name;
|
|
143932
143932
|
file2.data = resolver.result;
|
|
143933
143933
|
const parser2 = await parseFile(file2, options8, $refs);
|
|
@@ -143940,7 +143940,7 @@ var require_parse7 = __commonJS(function(exports) {
|
|
|
143940
143940
|
throw err;
|
|
143941
143941
|
}
|
|
143942
143942
|
}
|
|
143943
|
-
async function
|
|
143943
|
+
async function readFile6(file2, options8, $refs) {
|
|
143944
143944
|
let resolvers = plugins.all(options8.resolve);
|
|
143945
143945
|
resolvers = plugins.filter(resolvers, "canRead", file2);
|
|
143946
143946
|
plugins.sort(resolvers);
|
|
@@ -221223,7 +221223,7 @@ var require_dist5 = __commonJS(function(exports, module) {
|
|
|
221223
221223
|
});
|
|
221224
221224
|
module.exports = __toCommonJS2(src_exports);
|
|
221225
221225
|
var import_promises25 = __require("node:fs/promises");
|
|
221226
|
-
var
|
|
221226
|
+
var import_node_fs25 = __require("node:fs");
|
|
221227
221227
|
var DEVIN_LOCAL_PATH = "/opt/.devin";
|
|
221228
221228
|
var CURSOR2 = "cursor";
|
|
221229
221229
|
var CURSOR_CLI = "cursor-cli";
|
|
@@ -221280,7 +221280,7 @@ var require_dist5 = __commonJS(function(exports, module) {
|
|
|
221280
221280
|
return { isAgent: true, agent: { name: REPLIT } };
|
|
221281
221281
|
}
|
|
221282
221282
|
try {
|
|
221283
|
-
await (0, import_promises25.access)(DEVIN_LOCAL_PATH,
|
|
221283
|
+
await (0, import_promises25.access)(DEVIN_LOCAL_PATH, import_node_fs25.constants.F_OK);
|
|
221284
221284
|
return { isAgent: true, agent: { name: DEVIN } };
|
|
221285
221285
|
} catch (error48) {}
|
|
221286
221286
|
return { isAgent: false, agent: undefined };
|
|
@@ -247752,137 +247752,6 @@ var functionResource = {
|
|
|
247752
247752
|
readAll: readAllFunctions,
|
|
247753
247753
|
push: (functions) => deployFunctionsSequentially(functions)
|
|
247754
247754
|
};
|
|
247755
|
-
// src/core/resources/function/stream-api.ts
|
|
247756
|
-
var StreamLogEventSchema = exports_external.object({
|
|
247757
|
-
time: exports_external.string(),
|
|
247758
|
-
level: exports_external.preprocess((value) => value === "warn" ? "warning" : value, LogLevelSchema),
|
|
247759
|
-
function: exports_external.string().nullable(),
|
|
247760
|
-
message: exports_external.string()
|
|
247761
|
-
});
|
|
247762
|
-
var StreamEndEventSchema = exports_external.object({
|
|
247763
|
-
reason: exports_external.string(),
|
|
247764
|
-
retriable: exports_external.boolean()
|
|
247765
|
-
});
|
|
247766
|
-
function buildStreamUrl(filters) {
|
|
247767
|
-
const { id } = getAppContext();
|
|
247768
|
-
const url2 = new URL(`/api/apps/${id}/functions-mgmt/logs/stream`, getBase44ApiUrl());
|
|
247769
|
-
if (filters.functions?.length) {
|
|
247770
|
-
url2.searchParams.set("function", filters.functions.join(","));
|
|
247771
|
-
}
|
|
247772
|
-
if (filters.env) {
|
|
247773
|
-
url2.searchParams.set("env", filters.env);
|
|
247774
|
-
}
|
|
247775
|
-
return url2.href;
|
|
247776
|
-
}
|
|
247777
|
-
async function buildStreamAuthHeaders() {
|
|
247778
|
-
const workspaceApiKey = getWorkspaceApiKeyFromEnv();
|
|
247779
|
-
if (workspaceApiKey && isWorkspaceApiKey(workspaceApiKey)) {
|
|
247780
|
-
return { api_key: workspaceApiKey };
|
|
247781
|
-
}
|
|
247782
|
-
const auth = await readAuth();
|
|
247783
|
-
if (isTokenExpired(auth)) {
|
|
247784
|
-
const refreshedToken = await refreshAndSaveTokens();
|
|
247785
|
-
if (refreshedToken) {
|
|
247786
|
-
return { Authorization: `Bearer ${refreshedToken}` };
|
|
247787
|
-
}
|
|
247788
|
-
}
|
|
247789
|
-
return { Authorization: `Bearer ${auth.accessToken}` };
|
|
247790
|
-
}
|
|
247791
|
-
function parseStreamEvent(eventName, data) {
|
|
247792
|
-
try {
|
|
247793
|
-
const payload = JSON.parse(data);
|
|
247794
|
-
if (eventName === "end") {
|
|
247795
|
-
const result = StreamEndEventSchema.safeParse(payload);
|
|
247796
|
-
return result.success ? { kind: "end", end: result.data } : null;
|
|
247797
|
-
}
|
|
247798
|
-
if (eventName === "") {
|
|
247799
|
-
const result = StreamLogEventSchema.safeParse(payload);
|
|
247800
|
-
return result.success ? { kind: "log", log: result.data } : null;
|
|
247801
|
-
}
|
|
247802
|
-
return null;
|
|
247803
|
-
} catch {
|
|
247804
|
-
return null;
|
|
247805
|
-
}
|
|
247806
|
-
}
|
|
247807
|
-
var STREAM_SILENCE_TIMEOUT_MS = 60000;
|
|
247808
|
-
async function readOrSilence(reader) {
|
|
247809
|
-
let timer;
|
|
247810
|
-
const silence = new Promise((resolve3) => {
|
|
247811
|
-
timer = setTimeout(() => resolve3("silence"), STREAM_SILENCE_TIMEOUT_MS);
|
|
247812
|
-
});
|
|
247813
|
-
try {
|
|
247814
|
-
return await Promise.race([reader.read(), silence]);
|
|
247815
|
-
} finally {
|
|
247816
|
-
clearTimeout(timer);
|
|
247817
|
-
}
|
|
247818
|
-
}
|
|
247819
|
-
async function* readLines(body) {
|
|
247820
|
-
const reader = body.getReader();
|
|
247821
|
-
const decoder = new TextDecoder;
|
|
247822
|
-
let buffered = "";
|
|
247823
|
-
try {
|
|
247824
|
-
while (true) {
|
|
247825
|
-
const result = await readOrSilence(reader);
|
|
247826
|
-
if (result === "silence") {
|
|
247827
|
-
await reader.cancel();
|
|
247828
|
-
return;
|
|
247829
|
-
}
|
|
247830
|
-
if (result.done || !result.value)
|
|
247831
|
-
return;
|
|
247832
|
-
buffered += decoder.decode(result.value, { stream: true });
|
|
247833
|
-
const lines = buffered.split(`
|
|
247834
|
-
`);
|
|
247835
|
-
buffered = lines.pop() ?? "";
|
|
247836
|
-
yield* lines;
|
|
247837
|
-
}
|
|
247838
|
-
} finally {
|
|
247839
|
-
reader.releaseLock();
|
|
247840
|
-
}
|
|
247841
|
-
}
|
|
247842
|
-
async function* readStreamEvents(body) {
|
|
247843
|
-
let eventName = "";
|
|
247844
|
-
for await (const line of readLines(body)) {
|
|
247845
|
-
if (line.startsWith("event:")) {
|
|
247846
|
-
eventName = line.slice(6).trim();
|
|
247847
|
-
continue;
|
|
247848
|
-
}
|
|
247849
|
-
if (line.startsWith("data:")) {
|
|
247850
|
-
const event = parseStreamEvent(eventName, line.slice(5));
|
|
247851
|
-
eventName = "";
|
|
247852
|
-
if (event)
|
|
247853
|
-
yield event;
|
|
247854
|
-
continue;
|
|
247855
|
-
}
|
|
247856
|
-
if (line.trim() === "")
|
|
247857
|
-
eventName = "";
|
|
247858
|
-
}
|
|
247859
|
-
}
|
|
247860
|
-
var STREAM_CONNECT_TIMEOUT_MS = 1e4;
|
|
247861
|
-
var isWorthReconnecting = (status) => status >= 500;
|
|
247862
|
-
async function openLogStream(filters) {
|
|
247863
|
-
const connectPhase = new AbortController;
|
|
247864
|
-
const connectTimer = setTimeout(() => connectPhase.abort(), STREAM_CONNECT_TIMEOUT_MS);
|
|
247865
|
-
let response;
|
|
247866
|
-
try {
|
|
247867
|
-
response = await fetch(buildStreamUrl(filters), {
|
|
247868
|
-
headers: {
|
|
247869
|
-
Accept: "text/event-stream",
|
|
247870
|
-
...await buildStreamAuthHeaders()
|
|
247871
|
-
},
|
|
247872
|
-
signal: connectPhase.signal
|
|
247873
|
-
});
|
|
247874
|
-
} catch {
|
|
247875
|
-
return { kind: "transient" };
|
|
247876
|
-
} finally {
|
|
247877
|
-
clearTimeout(connectTimer);
|
|
247878
|
-
}
|
|
247879
|
-
if (!response.ok) {
|
|
247880
|
-
return isWorthReconnecting(response.status) ? { kind: "transient" } : { kind: "refused" };
|
|
247881
|
-
}
|
|
247882
|
-
if (!response.body)
|
|
247883
|
-
return { kind: "transient" };
|
|
247884
|
-
return { kind: "stream", events: readStreamEvents(response.body) };
|
|
247885
|
-
}
|
|
247886
247755
|
// src/core/project/config.ts
|
|
247887
247756
|
class ProjectConfigReader {
|
|
247888
247757
|
pluginSourceByNamespace = new Map;
|
|
@@ -248396,9 +248265,9 @@ async function createArchive(pathToArchive, targetArchivePath) {
|
|
|
248396
248265
|
}
|
|
248397
248266
|
// src/core/site/manifest.ts
|
|
248398
248267
|
import { createHash } from "node:crypto";
|
|
248399
|
-
import {
|
|
248268
|
+
import { createReadStream } from "node:fs";
|
|
248269
|
+
import { stat } from "node:fs/promises";
|
|
248400
248270
|
import { basename as basename4, join as join15 } from "node:path";
|
|
248401
|
-
var MAX_ASSET_SIZE_BYTES = 25 * 1024 * 1024;
|
|
248402
248271
|
var MAX_ASSET_COUNT = 1e5;
|
|
248403
248272
|
var ASSETS_IGNORE_FILE = ".assetsignore";
|
|
248404
248273
|
var ALWAYS_IGNORED = new Set([
|
|
@@ -248406,8 +248275,12 @@ var ALWAYS_IGNORED = new Set([
|
|
|
248406
248275
|
"wrangler.json",
|
|
248407
248276
|
".dev.vars"
|
|
248408
248277
|
]);
|
|
248409
|
-
function
|
|
248410
|
-
|
|
248278
|
+
async function hashAssetFile(appId, absolutePath) {
|
|
248279
|
+
const hash2 = createHash("sha256").update(Buffer.from(appId, "utf8"));
|
|
248280
|
+
for await (const chunk of createReadStream(absolutePath)) {
|
|
248281
|
+
hash2.update(chunk);
|
|
248282
|
+
}
|
|
248283
|
+
return hash2.digest("hex").slice(0, 32);
|
|
248411
248284
|
}
|
|
248412
248285
|
async function buildAssetManifest(assetsDir, appId) {
|
|
248413
248286
|
const manifest = {};
|
|
@@ -248426,11 +248299,7 @@ async function buildAssetManifest(assetsDir, appId) {
|
|
|
248426
248299
|
for (const relativePath of relativeFilePaths.sort()) {
|
|
248427
248300
|
const absolutePath = join15(assetsDir, ...relativePath.split("/"));
|
|
248428
248301
|
const { size } = await stat(absolutePath);
|
|
248429
|
-
|
|
248430
|
-
throw new InvalidInputError(`Static asset "${relativePath}" is ${size} bytes, which exceeds the 25 MiB per-file limit.`);
|
|
248431
|
-
}
|
|
248432
|
-
const content = await readFile2(absolutePath);
|
|
248433
|
-
const hash2 = hashAsset(appId, content);
|
|
248302
|
+
const hash2 = await hashAssetFile(appId, absolutePath);
|
|
248434
248303
|
manifest[`/${relativePath}`] = { hash: hash2, size };
|
|
248435
248304
|
if (!filesByHash.has(hash2)) {
|
|
248436
248305
|
filesByHash.set(hash2, { absolutePath, hash: hash2, size });
|
|
@@ -248439,11 +248308,11 @@ async function buildAssetManifest(assetsDir, appId) {
|
|
|
248439
248308
|
return { manifest, filesByHash };
|
|
248440
248309
|
}
|
|
248441
248310
|
// src/core/site/static-site.ts
|
|
248442
|
-
import { readFile as
|
|
248311
|
+
import { readFile as readFile3 } from "node:fs/promises";
|
|
248443
248312
|
import { join as join16 } from "node:path";
|
|
248444
248313
|
|
|
248445
248314
|
// src/core/site/upload.ts
|
|
248446
|
-
import { readFile as
|
|
248315
|
+
import { readFile as readFile2 } from "node:fs/promises";
|
|
248447
248316
|
|
|
248448
248317
|
// ../../node_modules/p-map/index.js
|
|
248449
248318
|
async function pMap(iterable, mapper, {
|
|
@@ -248589,7 +248458,7 @@ async function uploadPresignedAsset(upload, assets) {
|
|
|
248589
248458
|
if (!file2) {
|
|
248590
248459
|
throw new InternalError(`Server requested upload of unknown asset path: ${upload.path}`);
|
|
248591
248460
|
}
|
|
248592
|
-
const content = await
|
|
248461
|
+
const content = await readFile2(file2.absolutePath);
|
|
248593
248462
|
try {
|
|
248594
248463
|
await distribution_default.put(upload.url, {
|
|
248595
248464
|
body: new Uint8Array(content),
|
|
@@ -248626,7 +248495,7 @@ async function deployStaticSite(options) {
|
|
|
248626
248495
|
onProgress: progress?.onAssetUpload
|
|
248627
248496
|
});
|
|
248628
248497
|
}
|
|
248629
|
-
const indexHtml = await
|
|
248498
|
+
const indexHtml = await readFile3(join16(outputDir, "index.html"));
|
|
248630
248499
|
const finalized = await finalizeStaticDeployment(created.deploymentId, new Uint8Array(indexHtml), created.sessionId);
|
|
248631
248500
|
return { deploymentId: finalized.deploymentId };
|
|
248632
248501
|
}
|
|
@@ -253790,7 +253659,7 @@ var duplex = () => new Duplex({ read() {}, write() {} });
|
|
|
253790
253659
|
var handleDummyPromise = async (error48, verboseInfo, options) => handleResult(error48, verboseInfo, options);
|
|
253791
253660
|
|
|
253792
253661
|
// ../../node_modules/execa/lib/stdio/handle-async.js
|
|
253793
|
-
import { createReadStream, createWriteStream } from "node:fs";
|
|
253662
|
+
import { createReadStream as createReadStream2, createWriteStream } from "node:fs";
|
|
253794
253663
|
import { Buffer as Buffer5 } from "node:buffer";
|
|
253795
253664
|
import { Readable as Readable4, Writable as Writable2, Duplex as Duplex2 } from "node:stream";
|
|
253796
253665
|
var handleStdioAsync = (options, verboseInfo) => handleStdio(addPropertiesAsync, options, verboseInfo, false);
|
|
@@ -253813,8 +253682,8 @@ var addProperties2 = {
|
|
|
253813
253682
|
var addPropertiesAsync = {
|
|
253814
253683
|
input: {
|
|
253815
253684
|
...addProperties2,
|
|
253816
|
-
fileUrl: ({ value }) => ({ stream:
|
|
253817
|
-
filePath: ({ value: { file: file2 } }) => ({ stream:
|
|
253685
|
+
fileUrl: ({ value }) => ({ stream: createReadStream2(value) }),
|
|
253686
|
+
filePath: ({ value: { file: file2 } }) => ({ stream: createReadStream2(file2) }),
|
|
253818
253687
|
webStream: ({ value }) => ({ stream: Readable4.fromWeb(value) }),
|
|
253819
253688
|
iterable: ({ value }) => ({ stream: Readable4.from(value) }),
|
|
253820
253689
|
asyncIterable: ({ value }) => ({ stream: Readable4.from(value) }),
|
|
@@ -258469,84 +258338,9 @@ function writeFollowLine(entry, jsonMode) {
|
|
|
258469
258338
|
process.stdout.write(`${line}
|
|
258470
258339
|
`);
|
|
258471
258340
|
}
|
|
258472
|
-
|
|
258473
|
-
|
|
258474
|
-
|
|
258475
|
-
time: event.time,
|
|
258476
|
-
level: event.level,
|
|
258477
|
-
message: event.function ? `[${event.function}] ${event.message}` : event.message,
|
|
258478
|
-
source: event.function ?? ""
|
|
258479
|
-
};
|
|
258480
|
-
}
|
|
258481
|
-
async function printStreamUntilEnd(stream, levelFilter, jsonMode, startTime) {
|
|
258482
|
-
let lastTime = startTime;
|
|
258483
|
-
let producedEvents = false;
|
|
258484
|
-
try {
|
|
258485
|
-
for await (const event of stream) {
|
|
258486
|
-
producedEvents = true;
|
|
258487
|
-
if (event.kind === "end")
|
|
258488
|
-
return { lastTime, producedEvents, end: event.end };
|
|
258489
|
-
if (levelFilter && event.log.level !== levelFilter)
|
|
258490
|
-
continue;
|
|
258491
|
-
writeFollowLine(streamEventToLogEntry(event.log), jsonMode);
|
|
258492
|
-
if (event.log.time > lastTime)
|
|
258493
|
-
lastTime = event.log.time;
|
|
258494
|
-
}
|
|
258495
|
-
} catch {}
|
|
258496
|
-
return { lastTime, producedEvents, end: null };
|
|
258497
|
-
}
|
|
258498
|
-
var STREAM_RECONNECT_DELAY_MS = 1000;
|
|
258499
|
-
var MAX_DROPS_SINCE_LAST_EVENT = 2;
|
|
258500
|
-
var CONNECT_RETRY_DELAYS_MS = [1000, 2000, 4000, 8000];
|
|
258501
|
-
async function connectWhileTransientlyUnavailable(filters) {
|
|
258502
|
-
let attempt = await openLogStream(filters);
|
|
258503
|
-
for (const retryDelay of CONNECT_RETRY_DELAYS_MS) {
|
|
258504
|
-
if (attempt.kind !== "transient")
|
|
258505
|
-
return attempt;
|
|
258506
|
-
await delay2(retryDelay);
|
|
258507
|
-
attempt = await openLogStream(filters);
|
|
258508
|
-
}
|
|
258509
|
-
return attempt;
|
|
258510
|
-
}
|
|
258511
|
-
async function streamUntilExhausted(options, jsonMode) {
|
|
258512
|
-
const filters = {
|
|
258513
|
-
functions: parseFunctionNames(options.function),
|
|
258514
|
-
env: options.env
|
|
258515
|
-
};
|
|
258516
|
-
let everConnected = false;
|
|
258517
|
-
let lastTime = "";
|
|
258518
|
-
let dropsSinceLastEvent = 0;
|
|
258519
|
-
while (true) {
|
|
258520
|
-
const attempt = await connectWhileTransientlyUnavailable(filters);
|
|
258521
|
-
if (attempt.kind !== "stream")
|
|
258522
|
-
break;
|
|
258523
|
-
everConnected = true;
|
|
258524
|
-
const ending = await printStreamUntilEnd(attempt.events, options.level, jsonMode, lastTime);
|
|
258525
|
-
lastTime = ending.lastTime;
|
|
258526
|
-
if (ending.end) {
|
|
258527
|
-
if (!ending.end.retriable)
|
|
258528
|
-
break;
|
|
258529
|
-
dropsSinceLastEvent = 0;
|
|
258530
|
-
} else {
|
|
258531
|
-
dropsSinceLastEvent = ending.producedEvents ? 1 : dropsSinceLastEvent + 1;
|
|
258532
|
-
if (dropsSinceLastEvent >= MAX_DROPS_SINCE_LAST_EVENT)
|
|
258533
|
-
break;
|
|
258534
|
-
}
|
|
258535
|
-
await delay2(STREAM_RECONNECT_DELAY_MS);
|
|
258536
|
-
}
|
|
258537
|
-
return { everConnected, lastTime };
|
|
258538
|
-
}
|
|
258539
|
-
async function followLogs(functionNames, options, availableFunctionNames, jsonMode, logger2) {
|
|
258540
|
-
const { everConnected, lastTime } = await streamUntilExhausted(options, jsonMode);
|
|
258541
|
-
logger2.warn(everConnected ? "Realtime stream disconnected — falling back to polling (lines may lag ~20-30s)." : "Realtime stream unavailable — falling back to polling (lines may lag ~20-30s).");
|
|
258542
|
-
return pollLogs(functionNames, options, availableFunctionNames, jsonMode, {
|
|
258543
|
-
lastTime,
|
|
258544
|
-
boundaryKeys: new Set
|
|
258545
|
-
});
|
|
258546
|
-
}
|
|
258547
|
-
async function pollLogs(functionNames, options, availableFunctionNames, jsonMode, initialState) {
|
|
258548
|
-
let state = initialState;
|
|
258549
|
-
let first = state.lastTime === "";
|
|
258341
|
+
async function followLogs(functionNames, options, availableFunctionNames, jsonMode) {
|
|
258342
|
+
let state = { lastTime: "", boundaryKeys: new Set };
|
|
258343
|
+
let first = true;
|
|
258550
258344
|
while (true) {
|
|
258551
258345
|
const pollOptions = first ? options : { ...options, since: state.lastTime };
|
|
258552
258346
|
const entries = await fetchLogsForFunctions(functionNames, pollOptions, availableFunctionNames);
|
|
@@ -258556,7 +258350,7 @@ async function pollLogs(functionNames, options, availableFunctionNames, jsonMode
|
|
|
258556
258350
|
for (const entry of fresh)
|
|
258557
258351
|
writeFollowLine(entry, jsonMode);
|
|
258558
258352
|
first = false;
|
|
258559
|
-
await
|
|
258353
|
+
await new Promise((resolve9) => setTimeout(resolve9, 2000));
|
|
258560
258354
|
}
|
|
258561
258355
|
}
|
|
258562
258356
|
function formatLogs(entries, env3) {
|
|
@@ -258648,9 +258442,6 @@ async function logsAction(ctx, options) {
|
|
|
258648
258442
|
return { outroMessage: "No functions found in this app." };
|
|
258649
258443
|
}
|
|
258650
258444
|
if (options.follow) {
|
|
258651
|
-
if (options.since) {
|
|
258652
|
-
throw new InvalidInputError("--since cannot be combined with --follow yet (the realtime stream starts from now).");
|
|
258653
|
-
}
|
|
258654
258445
|
if (options.until) {
|
|
258655
258446
|
throw new InvalidInputError("--until cannot be combined with --follow (a stream has no end).");
|
|
258656
258447
|
}
|
|
@@ -258658,7 +258449,7 @@ async function logsAction(ctx, options) {
|
|
|
258658
258449
|
throw new InvalidInputError("--order cannot be combined with --follow (a live tail always streams oldest to newest).");
|
|
258659
258450
|
}
|
|
258660
258451
|
options.order = "asc";
|
|
258661
|
-
return followLogs(functionNames, options, availableFunctionNames, ctx.jsonMode
|
|
258452
|
+
return followLogs(functionNames, options, availableFunctionNames, ctx.jsonMode);
|
|
258662
258453
|
}
|
|
258663
258454
|
let entries = await fetchLogsForFunctions(functionNames, options, availableFunctionNames);
|
|
258664
258455
|
const limit = options.limit ? Number.parseInt(options.limit, 10) : undefined;
|
|
@@ -258880,7 +258671,7 @@ async function callTool(appId, tool, payload, schema12, context, timeout2 = 6000
|
|
|
258880
258671
|
function listDirectory(appId, params) {
|
|
258881
258672
|
return callTool(appId, "list_directory", { ...params }, ListDirectoryResponseSchema, "listing directory");
|
|
258882
258673
|
}
|
|
258883
|
-
function
|
|
258674
|
+
function readFile4(appId, params) {
|
|
258884
258675
|
return callTool(appId, "read_file", { ...params }, ReadFileResponseSchema, "reading file");
|
|
258885
258676
|
}
|
|
258886
258677
|
function writeFile2(appId, params) {
|
|
@@ -259010,7 +258801,7 @@ async function readFileAction({ runTask: runTask2 }, paths, options) {
|
|
|
259010
258801
|
const { id: appId } = getAppContext();
|
|
259011
258802
|
const offset = parsePositiveInt(options.offset, "--offset");
|
|
259012
258803
|
const limit = parsePositiveInt(options.limit, "--limit");
|
|
259013
|
-
const result = await runTask2("Reading file", () =>
|
|
258804
|
+
const result = await runTask2("Reading file", () => readFile4(appId, { paths, offset, limit }));
|
|
259014
258805
|
return { outroMessage: "Read file", stdout: toJsonStdout(result) };
|
|
259015
258806
|
}
|
|
259016
258807
|
function getSandboxReadFileCommand() {
|
|
@@ -266312,7 +266103,7 @@ class ReduceableCache {
|
|
|
266312
266103
|
}
|
|
266313
266104
|
}
|
|
266314
266105
|
// ../../node_modules/posthog-node/dist/extensions/error-tracking/modifiers/context-lines.node.mjs
|
|
266315
|
-
import { createReadStream as
|
|
266106
|
+
import { createReadStream as createReadStream3 } from "node:fs";
|
|
266316
266107
|
import { createInterface as createInterface2 } from "node:readline";
|
|
266317
266108
|
var LRU_FILE_CONTENTS_CACHE = new exports_error_tracking.ReduceableCache(25);
|
|
266318
266109
|
var LRU_FILE_CONTENTS_FS_READ_FAILED = new exports_error_tracking.ReduceableCache(20);
|
|
@@ -266356,7 +266147,7 @@ async function addSourceContext(frames) {
|
|
|
266356
266147
|
}
|
|
266357
266148
|
function getContextLinesFromFile(path19, ranges, output) {
|
|
266358
266149
|
return new Promise((resolve16) => {
|
|
266359
|
-
const stream =
|
|
266150
|
+
const stream = createReadStream3(path19);
|
|
266360
266151
|
const lineReaded = createInterface2({
|
|
266361
266152
|
input: stream
|
|
266362
266153
|
});
|
|
@@ -268307,4 +268098,4 @@ export {
|
|
|
268307
268098
|
runCLI
|
|
268308
268099
|
};
|
|
268309
268100
|
|
|
268310
|
-
//# debugId=
|
|
268101
|
+
//# debugId=31021F5DECFABABC64756E2164756E21
|