@buda-ai/connector 0.1.21 → 0.1.23
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.js +18 -5
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -517,7 +517,7 @@ import path2 from "path";
|
|
|
517
517
|
// package.json
|
|
518
518
|
var package_default = {
|
|
519
519
|
name: "@buda-ai/connector",
|
|
520
|
-
version: "0.1.
|
|
520
|
+
version: "0.1.23",
|
|
521
521
|
private: false,
|
|
522
522
|
type: "module",
|
|
523
523
|
publishConfig: {
|
|
@@ -2627,6 +2627,10 @@ var compareVersions = (left, right) => {
|
|
|
2627
2627
|
return 0;
|
|
2628
2628
|
};
|
|
2629
2629
|
var shouldReplaceDaemonVersion = (runningVersion, candidateVersion) => compareVersions(candidateVersion, runningVersion) > 0;
|
|
2630
|
+
var shouldDisplayConnectorLogEntry = (createdAt, startedAt) => {
|
|
2631
|
+
const timestamp = Date.parse(createdAt);
|
|
2632
|
+
return Number.isNaN(timestamp) || timestamp >= startedAt;
|
|
2633
|
+
};
|
|
2630
2634
|
var getErrorCode = (error) => typeof error === "object" && error !== null && "code" in error ? String(error.code) : "UNKNOWN";
|
|
2631
2635
|
var waitForChildSpawn = (child) => new Promise((resolve, reject) => {
|
|
2632
2636
|
const onError = (error) => {
|
|
@@ -2773,6 +2777,7 @@ var streamDaemonLogs = (options) => {
|
|
|
2773
2777
|
for (const line of lines.slice(seenLines)) {
|
|
2774
2778
|
try {
|
|
2775
2779
|
const entry = JSON.parse(line);
|
|
2780
|
+
if (!shouldDisplayConnectorLogEntry(entry.createdAt, options.startedAt)) continue;
|
|
2776
2781
|
const connectorId = entry.metadata?.connectorId;
|
|
2777
2782
|
if (options.dashboardActive && typeof connectorId === "string") {
|
|
2778
2783
|
const output2 = entry.metadata?.source === "daemon-console" ? entry.message : `[buda-connector] ${entry.message}`;
|
|
@@ -2883,6 +2888,7 @@ var waitForConnectorViewerExit = async (dashboardClosed) => {
|
|
|
2883
2888
|
process.off("SIGTERM", finishSignal);
|
|
2884
2889
|
};
|
|
2885
2890
|
async function runConnectorDashboard(launchConfig, options = {}) {
|
|
2891
|
+
const startedAt = Date.now();
|
|
2886
2892
|
let finishDashboard = () => void 0;
|
|
2887
2893
|
const dashboardClosed = new Promise((resolve) => {
|
|
2888
2894
|
finishDashboard = resolve;
|
|
@@ -2903,7 +2909,8 @@ async function runConnectorDashboard(launchConfig, options = {}) {
|
|
|
2903
2909
|
connectorId: config.connectorId,
|
|
2904
2910
|
dashboardActive: false,
|
|
2905
2911
|
plain: Boolean(options.plain),
|
|
2906
|
-
serverUrl: config.serverUrl
|
|
2912
|
+
serverUrl: config.serverUrl,
|
|
2913
|
+
startedAt
|
|
2907
2914
|
});
|
|
2908
2915
|
if (!process.stdin.isTTY) {
|
|
2909
2916
|
stopLogs2();
|
|
@@ -2930,7 +2937,8 @@ async function runConnectorDashboard(launchConfig, options = {}) {
|
|
|
2930
2937
|
const stopLogs = streamDaemonLogs({
|
|
2931
2938
|
dashboardActive: true,
|
|
2932
2939
|
plain: false,
|
|
2933
|
-
serverUrl: getServerUrl(launchConfig)
|
|
2940
|
+
serverUrl: getServerUrl(launchConfig),
|
|
2941
|
+
startedAt
|
|
2934
2942
|
});
|
|
2935
2943
|
let refreshing = false;
|
|
2936
2944
|
const refresh = async () => {
|
|
@@ -4400,6 +4408,11 @@ import {
|
|
|
4400
4408
|
writeFile as writeFile4
|
|
4401
4409
|
} from "fs/promises";
|
|
4402
4410
|
import path11 from "path";
|
|
4411
|
+
|
|
4412
|
+
// src/directory-link.ts
|
|
4413
|
+
var directoryLinkType = (platform4 = process.platform) => platform4 === "win32" ? "junction" : "dir";
|
|
4414
|
+
|
|
4415
|
+
// src/workspace-volume-lifecycle.ts
|
|
4403
4416
|
var MOUNT_DIRECTORY = "mount";
|
|
4404
4417
|
var ARCHIVE_MARKER = "archived.json";
|
|
4405
4418
|
var AGENT_CONTEXT_TEMPLATE_FILES = [
|
|
@@ -4551,7 +4564,7 @@ var ensureVolumeLink = async (target, linkPath) => {
|
|
|
4551
4564
|
} catch (error) {
|
|
4552
4565
|
if (!isMissingFile(error)) throw error;
|
|
4553
4566
|
try {
|
|
4554
|
-
await symlink2(target, linkPath,
|
|
4567
|
+
await symlink2(target, linkPath, directoryLinkType());
|
|
4555
4568
|
} catch (createError) {
|
|
4556
4569
|
if (!isAlreadyExists3(createError)) throw createError;
|
|
4557
4570
|
const info = await lstat2(linkPath);
|
|
@@ -5191,7 +5204,7 @@ async function ensureSymlink(target, linkPath) {
|
|
|
5191
5204
|
} catch {
|
|
5192
5205
|
}
|
|
5193
5206
|
await mkdir10(path13.dirname(linkPath), { recursive: true });
|
|
5194
|
-
await symlink3(target, linkPath,
|
|
5207
|
+
await symlink3(target, linkPath, directoryLinkType());
|
|
5195
5208
|
}
|
|
5196
5209
|
|
|
5197
5210
|
// src/workspace-registry.ts
|