skydive-cli 0.1.0-beta.65 → 0.1.0-beta.83
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/js/bin.mjs
CHANGED
|
@@ -13,7 +13,7 @@ import fs from "node:fs";
|
|
|
13
13
|
import zlib from "node:zlib";
|
|
14
14
|
|
|
15
15
|
//#region package.json
|
|
16
|
-
var version$1 = "0.1.0-beta.
|
|
16
|
+
var version$1 = "0.1.0-beta.83";
|
|
17
17
|
|
|
18
18
|
//#endregion
|
|
19
19
|
//#region src/types.ts
|
|
@@ -2046,7 +2046,7 @@ const chatCommand = {
|
|
|
2046
2046
|
printError(`Unknown theme "${themeId}". Valid themes: ${themes.map((t) => t.id).join(", ")}`);
|
|
2047
2047
|
process.exit(1);
|
|
2048
2048
|
}
|
|
2049
|
-
const { runChat } = await import("./boot-
|
|
2049
|
+
const { runChat } = await import("./boot-DTUbLzPt.mjs");
|
|
2050
2050
|
await runChat({
|
|
2051
2051
|
appUrl,
|
|
2052
2052
|
sessionToken: session.value.sessionToken,
|
|
@@ -2163,7 +2163,7 @@ const switchCommand = {
|
|
|
2163
2163
|
printError("The workspace picker needs the Bun runtime and it could not be set up automatically. Pass a workspace slug instead, or install Bun and retry.");
|
|
2164
2164
|
process.exit(1);
|
|
2165
2165
|
}
|
|
2166
|
-
const { runWorkspacePicker } = await import("./boot-
|
|
2166
|
+
const { runWorkspacePicker } = await import("./boot-DTUbLzPt.mjs");
|
|
2167
2167
|
await runWorkspacePicker(session);
|
|
2168
2168
|
return;
|
|
2169
2169
|
}
|
|
@@ -3231,6 +3231,28 @@ function ToolItem({ item }) {
|
|
|
3231
3231
|
}
|
|
3232
3232
|
}
|
|
3233
3233
|
|
|
3234
|
+
//#endregion
|
|
3235
|
+
//#region src/chat/tui/format-elapsed.ts
|
|
3236
|
+
/**
|
|
3237
|
+
* Human-readable elapsed time for live counters (e.g. the ActivityRow's
|
|
3238
|
+
* "working · 29m 40s"). Raw seconds get unreadable on long runs — `1780s`
|
|
3239
|
+
* says nothing at a glance — so roll up into minutes and hours:
|
|
3240
|
+
*
|
|
3241
|
+
* 45 → "45s"
|
|
3242
|
+
* 1780 → "29m 40s"
|
|
3243
|
+
* 3600 → "1h 0m"
|
|
3244
|
+
* 5025 → "1h 23m"
|
|
3245
|
+
*
|
|
3246
|
+
* Past the hour mark the seconds digit is noise, so it's dropped.
|
|
3247
|
+
*/
|
|
3248
|
+
function formatElapsed(totalSeconds) {
|
|
3249
|
+
const seconds = Math.max(0, Math.floor(totalSeconds));
|
|
3250
|
+
if (seconds < 60) return `${seconds}s`;
|
|
3251
|
+
const minutes = Math.floor(seconds / 60);
|
|
3252
|
+
if (minutes < 60) return `${minutes}m ${seconds % 60}s`;
|
|
3253
|
+
return `${Math.floor(minutes / 60)}h ${minutes % 60}m`;
|
|
3254
|
+
}
|
|
3255
|
+
|
|
3234
3256
|
//#endregion
|
|
3235
3257
|
//#region src/chat/tui/chat/card.ts
|
|
3236
3258
|
const urlActionKinds = [
|
|
@@ -3706,6 +3728,27 @@ function safeUrl(url) {
|
|
|
3706
3728
|
return null;
|
|
3707
3729
|
}
|
|
3708
3730
|
}
|
|
3731
|
+
/**
|
|
3732
|
+
* Resolve a connect URL to an absolute one the OS can open in a browser.
|
|
3733
|
+
*
|
|
3734
|
+
* The server builds lazy connect links as server-relative paths (e.g.
|
|
3735
|
+
* `/api/v1/oauth/start/slack?connect_session_token=...`). The web client
|
|
3736
|
+
* resolves these against its own origin implicitly; the TUI runs outside a
|
|
3737
|
+
* browser, so `open()` on a scheme-less path is a silent no-op — the browser
|
|
3738
|
+
* never launches and the connect card sits in `launched` forever (the Slack
|
|
3739
|
+
* channel-connect deadlock). Resolve against `appUrl` first, mirroring the
|
|
3740
|
+
* `open_github_app` / `fulfillCredential` branches, so both the browser we
|
|
3741
|
+
* launch and the URL shown on the card are absolute. An already-absolute URL
|
|
3742
|
+
* passes through unchanged; if `appUrl` is missing we return the input as-is.
|
|
3743
|
+
*/
|
|
3744
|
+
function resolveConnectUrl(url, appUrl) {
|
|
3745
|
+
if (!appUrl) return url;
|
|
3746
|
+
try {
|
|
3747
|
+
return new URL(url, appUrl).toString();
|
|
3748
|
+
} catch (_error) {
|
|
3749
|
+
return url;
|
|
3750
|
+
}
|
|
3751
|
+
}
|
|
3709
3752
|
function parseOauthConnectParams(url) {
|
|
3710
3753
|
const parsed = safeUrl(url);
|
|
3711
3754
|
if (!parsed) return null;
|
|
@@ -5180,27 +5223,29 @@ function ChatScreen({ agent, conversation }) {
|
|
|
5180
5223
|
const params = parseOauthConnectParams(action.url);
|
|
5181
5224
|
if (!params) throw new Error("this connect link is missing required parameters");
|
|
5182
5225
|
const { connectLink } = await rest.oauthConnect(params);
|
|
5183
|
-
|
|
5226
|
+
const oauthUrl = resolveConnectUrl(connectLink, appUrl);
|
|
5227
|
+
await openUrlInBrowser(oauthUrl);
|
|
5184
5228
|
updateCard(item.id, {
|
|
5185
5229
|
status: "launched",
|
|
5186
|
-
detail:
|
|
5230
|
+
detail: oauthUrl
|
|
5187
5231
|
});
|
|
5188
5232
|
} else if (action.kind === "open_external_oauth") {
|
|
5189
5233
|
const params = parseExternalOauthConnectParams(action.url);
|
|
5190
5234
|
if (!params) throw new Error("this connect link is missing required parameters");
|
|
5191
5235
|
const { authorizationUrl } = await rest.externalOauthConnect(params);
|
|
5192
5236
|
if (authorizationUrl) {
|
|
5193
|
-
|
|
5237
|
+
const externalUrl = resolveConnectUrl(authorizationUrl, appUrl);
|
|
5238
|
+
await openUrlInBrowser(externalUrl);
|
|
5194
5239
|
updateCard(item.id, {
|
|
5195
5240
|
status: "launched",
|
|
5196
|
-
detail:
|
|
5241
|
+
detail: externalUrl
|
|
5197
5242
|
});
|
|
5198
5243
|
} else updateCard(item.id, {
|
|
5199
5244
|
status: "done",
|
|
5200
5245
|
detail: "already connected"
|
|
5201
5246
|
});
|
|
5202
5247
|
} else if (action.kind === "open_github_app") {
|
|
5203
|
-
const url =
|
|
5248
|
+
const url = resolveConnectUrl(action.url, appUrl);
|
|
5204
5249
|
await openUrlInBrowser(url);
|
|
5205
5250
|
updateCard(item.id, {
|
|
5206
5251
|
status: "launched",
|
|
@@ -5883,7 +5928,7 @@ function ActivityRow({ label }) {
|
|
|
5883
5928
|
" ",
|
|
5884
5929
|
/* @__PURE__ */ jsxs("span", {
|
|
5885
5930
|
fg: theme.muted,
|
|
5886
|
-
children: [label, elapsed > 0 ? ` · ${elapsed}
|
|
5931
|
+
children: [label, elapsed > 0 ? ` · ${formatElapsed(elapsed)}` : ""]
|
|
5887
5932
|
})
|
|
5888
5933
|
]
|
|
5889
5934
|
})
|