skydive-cli 0.2.0-beta.423 → 0.2.0
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/{api-DcGNxnLr.mjs → api-CDTKq_5Q.mjs} +1 -1
- package/dist/js/bin.mjs +15 -15
- package/dist/js/{boot-BJeHUB6U.mjs → boot-CGaXUEer.mjs} +32 -103
- package/dist/js/{client-CxOKgU7M.mjs → client-B3ZhhF7e.mjs} +1 -1
- package/dist/js/client-D6NAkL9e.mjs +6 -0
- package/dist/js/{print-CKEKn9wS.mjs → print-BZH0b3KB.mjs} +2 -2
- package/dist/js/{print-CouegX9S.mjs → print-Bin4u16d.mjs} +2 -20
- package/dist/js/{print-share-BS60u1H2.mjs → print-share-D7OSxvE2.mjs} +1 -1
- package/dist/js/{rest-CHW9mvHI.mjs → rest-COkLEZOB.mjs} +1 -1
- package/dist/js/{rest-04eiQEA9.mjs → rest-CamHVOce.mjs} +1 -6
- package/package.json +1 -2
- package/dist/js/client-Blf9mdM0.mjs +0 -6
package/dist/js/bin.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { A as getShareMachineDefault, B as saveSession, C as DEFAULT_WEB_URL, D as getPromptHistoryPath, E as getLastSeenVersion, F as resolveConfig, H as setLastSeenVersion, I as resolveManagementAuth, L as resolveSession, M as getStoredApiKeyWorkspaceName, N as getUpdateCheckDisabled, P as resolveAppUrl, T as getConfigPath, _ as setActiveWorkspace, b as API_KEY_PREFIX, d as themes, g as listWorkspaces, h as getSessionIdentity, j as getStoredApiKeyId, m as getActiveWorkspaceId, p as ensureActiveOrganization, v as API_KEYS_URL, w as deleteConfig, x as DEFAULT_API_URL, y as API_KEY_FAMILY_PREFIX, z as saveConfig } from "./theme-CuQhvqzN.mjs";
|
|
3
3
|
import { n as printError, r as printTable, t as output } from "./output-B4cW10Ph.mjs";
|
|
4
|
-
import { n as createRestClient } from "./rest-
|
|
5
|
-
import { i as resolveAgent } from "./print-
|
|
6
|
-
import { a as registerPortalDevice, c as machineIdentity, n as findThisDevice, o as revokePortalAccess, r as grantPortalAccess, t as fetchPortalDevices } from "./api-
|
|
4
|
+
import { n as createRestClient } from "./rest-CamHVOce.mjs";
|
|
5
|
+
import { i as resolveAgent } from "./print-Bin4u16d.mjs";
|
|
6
|
+
import { a as registerPortalDevice, c as machineIdentity, n as findThisDevice, o as revokePortalAccess, r as grantPortalAccess, t as fetchPortalDevices } from "./api-CDTKq_5Q.mjs";
|
|
7
7
|
import { t as SandboxStream } from "./client-CpEvH2Pq.mjs";
|
|
8
8
|
import { hideBin } from "yargs/helpers";
|
|
9
9
|
import yargs from "yargs";
|
|
@@ -20,7 +20,7 @@ import semver from "semver";
|
|
|
20
20
|
|
|
21
21
|
//#region package.json
|
|
22
22
|
var name = "skydive-cli";
|
|
23
|
-
var version = "0.2.0
|
|
23
|
+
var version = "0.2.0";
|
|
24
24
|
|
|
25
25
|
//#endregion
|
|
26
26
|
//#region src/types.ts
|
|
@@ -1200,7 +1200,7 @@ const importCommand = {
|
|
|
1200
1200
|
process.exit(1);
|
|
1201
1201
|
}
|
|
1202
1202
|
}
|
|
1203
|
-
const { runChat } = await import("./boot-
|
|
1203
|
+
const { runChat } = await import("./boot-CGaXUEer.mjs");
|
|
1204
1204
|
await runChat({
|
|
1205
1205
|
appUrl,
|
|
1206
1206
|
sessionToken: session.value.sessionToken,
|
|
@@ -1226,7 +1226,7 @@ async function runImportPrintMode({ argv, appUrl }) {
|
|
|
1226
1226
|
printError(`${session.error.message} For non-interactive use, run \`skydive auth login --web\` first, or set SKYDIVE_SESSION_TOKEN.`);
|
|
1227
1227
|
process.exit(1);
|
|
1228
1228
|
}
|
|
1229
|
-
const { connectMachineShare } = await import("./print-share-
|
|
1229
|
+
const { connectMachineShare } = await import("./print-share-D7OSxvE2.mjs");
|
|
1230
1230
|
const machineShare = await connectMachineShare({
|
|
1231
1231
|
appUrl,
|
|
1232
1232
|
sessionToken: session.value.sessionToken,
|
|
@@ -1234,7 +1234,7 @@ async function runImportPrintMode({ argv, appUrl }) {
|
|
|
1234
1234
|
});
|
|
1235
1235
|
const extra = (argv.print ?? "").trim();
|
|
1236
1236
|
const prompt = buildImportSeedPrompt(process.cwd()) + (extra ? `\n\nAdditional instructions: ${extra}` : "");
|
|
1237
|
-
const { runPrint } = await import("./print-
|
|
1237
|
+
const { runPrint } = await import("./print-BZH0b3KB.mjs");
|
|
1238
1238
|
try {
|
|
1239
1239
|
const result = await runPrint({
|
|
1240
1240
|
appUrl,
|
|
@@ -1511,7 +1511,7 @@ const chatCommand = {
|
|
|
1511
1511
|
printError(`Unknown theme "${themeId}". Valid themes: ${themes.map((t) => t.id).join(", ")}`);
|
|
1512
1512
|
process.exit(1);
|
|
1513
1513
|
}
|
|
1514
|
-
const { runChat } = await import("./boot-
|
|
1514
|
+
const { runChat } = await import("./boot-CGaXUEer.mjs");
|
|
1515
1515
|
await runChat({
|
|
1516
1516
|
appUrl,
|
|
1517
1517
|
sessionToken: session.value.sessionToken,
|
|
@@ -1539,7 +1539,7 @@ async function runPrintMode({ argv, appUrl }) {
|
|
|
1539
1539
|
printError(`${session.error.message} For non-interactive use, run \`skydive auth login\` first, or set SKYDIVE_SESSION_TOKEN.`);
|
|
1540
1540
|
process.exit(1);
|
|
1541
1541
|
}
|
|
1542
|
-
const { runPrint, readStdin } = await import("./print-
|
|
1542
|
+
const { runPrint, readStdin } = await import("./print-BZH0b3KB.mjs");
|
|
1543
1543
|
let prompt = (argv.print ?? "").trim();
|
|
1544
1544
|
if (!prompt) {
|
|
1545
1545
|
if (process.stdin.isTTY) {
|
|
@@ -1554,7 +1554,7 @@ async function runPrintMode({ argv, appUrl }) {
|
|
|
1554
1554
|
}
|
|
1555
1555
|
let machineShare = null;
|
|
1556
1556
|
if (resolveShareMachine(argv)) {
|
|
1557
|
-
const { connectMachineShare } = await import("./print-share-
|
|
1557
|
+
const { connectMachineShare } = await import("./print-share-D7OSxvE2.mjs");
|
|
1558
1558
|
machineShare = await connectMachineShare({
|
|
1559
1559
|
appUrl,
|
|
1560
1560
|
sessionToken: session.value.sessionToken,
|
|
@@ -1613,7 +1613,7 @@ const getCommand = {
|
|
|
1613
1613
|
printError(`${session.error.message} Run \`skydive auth login\` first, or set SKYDIVE_SESSION_TOKEN.`);
|
|
1614
1614
|
process.exit(1);
|
|
1615
1615
|
}
|
|
1616
|
-
const { messageGet } = await import("./print-
|
|
1616
|
+
const { messageGet } = await import("./print-BZH0b3KB.mjs");
|
|
1617
1617
|
try {
|
|
1618
1618
|
const result = await messageGet({
|
|
1619
1619
|
appUrl,
|
|
@@ -1810,7 +1810,7 @@ const switchCommand = {
|
|
|
1810
1810
|
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.");
|
|
1811
1811
|
process.exit(1);
|
|
1812
1812
|
}
|
|
1813
|
-
const { runWorkspacePicker } = await import("./boot-
|
|
1813
|
+
const { runWorkspacePicker } = await import("./boot-CGaXUEer.mjs");
|
|
1814
1814
|
await runWorkspacePicker(session);
|
|
1815
1815
|
return;
|
|
1816
1816
|
}
|
|
@@ -1888,7 +1888,7 @@ const openCommand = {
|
|
|
1888
1888
|
const agent = argv.agent ? resolveAgent((await fetchPortalDevices(session)).agents, argv.agent) : null;
|
|
1889
1889
|
const cwd = argv.cwd ? path.resolve(argv.cwd) : process.cwd();
|
|
1890
1890
|
const { machineName } = machineIdentity();
|
|
1891
|
-
const { PortalClient } = await import("./client-
|
|
1891
|
+
const { PortalClient } = await import("./client-D6NAkL9e.mjs");
|
|
1892
1892
|
let lastLine = "";
|
|
1893
1893
|
let signalConnected;
|
|
1894
1894
|
const connected = new Promise((resolve) => {
|
|
@@ -2060,8 +2060,8 @@ const sandboxCommand = {
|
|
|
2060
2060
|
}).example("skydive sandbox --agent grace", "Live terminal (Ctrl-] detaches)").example("skydive sandbox --agent grace -- tail -n 50 /tmp/harness.log", "One-shot command (use `--` so its flags reach the sandbox)").example("skydive sandbox --agent grace -- sh -c 'ls /tmp | wc -l'", "Shell features go through an explicit `sh -c`"),
|
|
2061
2061
|
handler: async (argv) => {
|
|
2062
2062
|
const session = requireSession(argv);
|
|
2063
|
-
const { createRestClient } = await import("./rest-
|
|
2064
|
-
const { resolveAgent } = await import("./print-
|
|
2063
|
+
const { createRestClient } = await import("./rest-COkLEZOB.mjs");
|
|
2064
|
+
const { resolveAgent } = await import("./print-BZH0b3KB.mjs");
|
|
2065
2065
|
const client = createRestClient({
|
|
2066
2066
|
appUrl: session.appUrl,
|
|
2067
2067
|
sessionToken: session.sessionToken
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { O as getReviewStateDir, R as resolveWebUrl, S as DEFAULT_APP_URL, T as getConfigPath, V as saveTheme, _ as setActiveWorkspace, a as noColorRequested, c as themeMode, f as themesForMode, g as listWorkspaces, i as monoTheme, k as getSavedTheme, l as themeModeFromColorFgBg, m as getActiveWorkspaceId, n as applyTheme, o as theme, r as findTheme, s as themeForMode, t as DEFAULT_THEME_ID, u as themeVersion, x as DEFAULT_API_URL } from "./theme-CuQhvqzN.mjs";
|
|
3
|
-
import { n as createRestClient, r as errorDetail, t as HttpError } from "./rest-
|
|
3
|
+
import { n as createRestClient, r as errorDetail, t as HttpError } from "./rest-CamHVOce.mjs";
|
|
4
4
|
import { n as isRecord, t as errorMessage } from "./util-CeisaZVY.mjs";
|
|
5
|
-
import { c as cardActionErrorMessage, d as reconcileMaskedInput, f as resolveConnectUrl, i as resolveAgent, l as parseExternalOauthConnectParams,
|
|
6
|
-
import "./api-
|
|
5
|
+
import { c as cardActionErrorMessage, d as reconcileMaskedInput, f as resolveConnectUrl, i as resolveAgent, l as parseExternalOauthConnectParams, p as parseConnectCard, s as MASK_CHAR, u as parseOauthConnectParams } from "./print-Bin4u16d.mjs";
|
|
6
|
+
import "./api-CDTKq_5Q.mjs";
|
|
7
7
|
import { t as SandboxStream } from "./client-CpEvH2Pq.mjs";
|
|
8
|
-
import { t as PortalClient } from "./client-
|
|
8
|
+
import { t as PortalClient } from "./client-B3ZhhF7e.mjs";
|
|
9
9
|
import { t as runRawPtyPassthrough } from "./raw-pty-GAvxm2ol.mjs";
|
|
10
10
|
import * as os$1 from "node:os";
|
|
11
11
|
import { homedir, platform, release, tmpdir } from "node:os";
|
|
@@ -1564,10 +1564,9 @@ function ConversationPickerScreen({ agent }) {
|
|
|
1564
1564
|
const rest = useStore((s) => s.rest);
|
|
1565
1565
|
const goTo = useStore((s) => s.goTo);
|
|
1566
1566
|
const [showAutomated, setShowAutomated] = useState(false);
|
|
1567
|
-
const [showArchived, setShowArchived] = useState(false);
|
|
1568
1567
|
const [cache, setCache] = useState({});
|
|
1569
1568
|
const [state, setState] = useState({ kind: "loading" });
|
|
1570
|
-
const cacheKey =
|
|
1569
|
+
const cacheKey = showAutomated ? "all" : "human";
|
|
1571
1570
|
useEffect(() => {
|
|
1572
1571
|
if (!rest) return;
|
|
1573
1572
|
const cached = cache[cacheKey];
|
|
@@ -1586,7 +1585,6 @@ function ConversationPickerScreen({ agent }) {
|
|
|
1586
1585
|
const conversations = await rest.listConversations({
|
|
1587
1586
|
agentId: agent.id,
|
|
1588
1587
|
channels: showAutomated ? void 0 : humanChannels,
|
|
1589
|
-
archived: showArchived ? "include" : "exclude",
|
|
1590
1588
|
onPage: (partial) => {
|
|
1591
1589
|
if (!cancelled) setState({
|
|
1592
1590
|
kind: "ready",
|
|
@@ -1620,7 +1618,6 @@ function ConversationPickerScreen({ agent }) {
|
|
|
1620
1618
|
rest,
|
|
1621
1619
|
agent.id,
|
|
1622
1620
|
showAutomated,
|
|
1623
|
-
showArchived,
|
|
1624
1621
|
cacheKey,
|
|
1625
1622
|
cache
|
|
1626
1623
|
]);
|
|
@@ -1638,25 +1635,21 @@ function ConversationPickerScreen({ agent }) {
|
|
|
1638
1635
|
complete: state.complete,
|
|
1639
1636
|
showAutomated,
|
|
1640
1637
|
onToggleAutomated: () => setShowAutomated((shown) => !shown),
|
|
1641
|
-
showArchived,
|
|
1642
|
-
onToggleArchived: () => setShowArchived((shown) => !shown),
|
|
1643
1638
|
onPick: goTo
|
|
1644
1639
|
});
|
|
1645
1640
|
}
|
|
1646
|
-
function ConversationList({ agent, conversations, complete, showAutomated, onToggleAutomated,
|
|
1641
|
+
function ConversationList({ agent, conversations, complete, showAutomated, onToggleAutomated, onPick }) {
|
|
1647
1642
|
const { width, height } = useTerminalDimensions();
|
|
1648
1643
|
const rest = useStore((s) => s.rest);
|
|
1649
1644
|
const [query, setQuery] = useState("");
|
|
1650
1645
|
const [highlight, setHighlight] = useState(0);
|
|
1651
1646
|
const [removedIds, setRemovedIds] = useState(/* @__PURE__ */ new Set());
|
|
1652
|
-
const [archiveOverrides, setArchiveOverrides] = useState(/* @__PURE__ */ new Map());
|
|
1653
1647
|
const [confirmId, setConfirmId] = useState(null);
|
|
1654
1648
|
const [error, setError] = useState(null);
|
|
1655
|
-
const
|
|
1656
|
-
const list = conversations.filter((c) => !removedIds.has(c.id) && (showArchived || !isArchived(c)));
|
|
1649
|
+
const list = conversations.filter((c) => !removedIds.has(c.id));
|
|
1657
1650
|
useEffect(() => {
|
|
1658
1651
|
setHighlight(0);
|
|
1659
|
-
}, [showAutomated
|
|
1652
|
+
}, [showAutomated]);
|
|
1660
1653
|
const hits = fuzzyFilter(query, list, conversationKeys);
|
|
1661
1654
|
const rows = [{ kind: "new" }, ...hits.map((hit) => ({
|
|
1662
1655
|
kind: "conv",
|
|
@@ -1664,29 +1657,26 @@ function ConversationList({ agent, conversations, complete, showAutomated, onTog
|
|
|
1664
1657
|
}))];
|
|
1665
1658
|
const innerWidth = Math.max(1, width - 2);
|
|
1666
1659
|
const rowWidth = Math.max(1, innerWidth - 2);
|
|
1667
|
-
const clamped = Math.min(highlight, Math.max(0, rows.length - 1));
|
|
1668
|
-
const highlightRow = rows[clamped];
|
|
1669
|
-
const highlightArchived = highlightRow?.kind === "conv" && isArchived(highlightRow.hit.item);
|
|
1670
1660
|
const confirmConv = confirmId !== null ? list.find((c) => c.id === confirmId) : void 0;
|
|
1671
1661
|
const status = confirmConv ? {
|
|
1672
1662
|
fg: theme.error,
|
|
1673
1663
|
text: truncate(`delete “${confirmConv.title ?? "(untitled)"}”? y/n`, innerWidth)
|
|
1674
1664
|
} : error ? {
|
|
1675
1665
|
fg: theme.error,
|
|
1676
|
-
text: truncate(error
|
|
1666
|
+
text: truncate(`delete failed: ${error}`, innerWidth)
|
|
1677
1667
|
} : {
|
|
1678
1668
|
fg: theme.dim,
|
|
1679
1669
|
text: fitHintLine([
|
|
1680
1670
|
`${hits.length}/${list.length}${complete ? "" : " (loading…)"}`,
|
|
1681
|
-
|
|
1682
|
-
"ctrl+d delete",
|
|
1671
|
+
showAutomated ? "incl. agent runs" : "yours",
|
|
1683
1672
|
`tab ${showAutomated ? "hide" : "show"} agent runs`,
|
|
1684
|
-
`shift+tab ${showArchived ? "hide" : "show"} archived`,
|
|
1685
|
-
"esc back",
|
|
1686
1673
|
"↑/↓ move",
|
|
1687
|
-
"↵ open"
|
|
1674
|
+
"↵ open",
|
|
1675
|
+
"ctrl+d delete",
|
|
1676
|
+
"esc back"
|
|
1688
1677
|
], innerWidth)
|
|
1689
1678
|
};
|
|
1679
|
+
const clamped = Math.min(highlight, Math.max(0, rows.length - 1));
|
|
1690
1680
|
const visibleRows = Math.max(3, height - 6);
|
|
1691
1681
|
const start = windowStart(clamped, rows.length, visibleRows);
|
|
1692
1682
|
const windowed = rows.slice(start, start + visibleRows);
|
|
@@ -1706,50 +1696,18 @@ function ConversationList({ agent, conversations, complete, showAutomated, onTog
|
|
|
1706
1696
|
conversation: row.hit.item
|
|
1707
1697
|
});
|
|
1708
1698
|
};
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
* Delete only — archive keeps the row and flips its mark instead.
|
|
1712
|
-
*/
|
|
1713
|
-
const removeRow = (id, mutate, failure) => {
|
|
1699
|
+
const deleteConversation = (id) => {
|
|
1700
|
+
if (!rest) return;
|
|
1714
1701
|
if (!list.some((c) => c.id === id)) return;
|
|
1702
|
+
setConfirmId(null);
|
|
1715
1703
|
setRemovedIds((prev) => new Set([...prev, id]));
|
|
1716
|
-
|
|
1704
|
+
rest.deleteConversation({ conversationId: id }).catch((err) => {
|
|
1717
1705
|
setRemovedIds((prev) => {
|
|
1718
1706
|
const next = new Set(prev);
|
|
1719
1707
|
next.delete(id);
|
|
1720
1708
|
return next;
|
|
1721
1709
|
});
|
|
1722
|
-
setError(
|
|
1723
|
-
});
|
|
1724
|
-
};
|
|
1725
|
-
const deleteConversation = (id) => {
|
|
1726
|
-
if (!rest) return;
|
|
1727
|
-
setConfirmId(null);
|
|
1728
|
-
removeRow(id, () => rest.deleteConversation({ conversationId: id }), "delete failed");
|
|
1729
|
-
};
|
|
1730
|
-
/**
|
|
1731
|
-
* Archive is per-user, private and reversible, so unlike delete it needs no
|
|
1732
|
-
* y/n confirm. `ctrl+a` toggles: on a row you already archived (only
|
|
1733
|
-
* reachable with archived rows shown) it restores instead — which is the
|
|
1734
|
-
* only in-TUI way back.
|
|
1735
|
-
*/
|
|
1736
|
-
const toggleArchived = (conversation) => {
|
|
1737
|
-
if (!rest) return;
|
|
1738
|
-
const id = conversation.id;
|
|
1739
|
-
const archived = !isArchived(conversation);
|
|
1740
|
-
const revert = archiveOverrides.get(id);
|
|
1741
|
-
setArchiveOverrides((prev) => new Map(prev).set(id, archived));
|
|
1742
|
-
rest.setConversationArchived({
|
|
1743
|
-
conversationId: id,
|
|
1744
|
-
archived
|
|
1745
|
-
}).catch((err) => {
|
|
1746
|
-
setArchiveOverrides((prev) => {
|
|
1747
|
-
const next = new Map(prev);
|
|
1748
|
-
if (revert === void 0) next.delete(id);
|
|
1749
|
-
else next.set(id, revert);
|
|
1750
|
-
return next;
|
|
1751
|
-
});
|
|
1752
|
-
setError(`${archived ? "archive" : "unarchive"} failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
1710
|
+
setError(err instanceof Error ? err.message : String(err));
|
|
1753
1711
|
});
|
|
1754
1712
|
};
|
|
1755
1713
|
useKeyboard((key) => {
|
|
@@ -1767,14 +1725,7 @@ function ConversationList({ agent, conversations, complete, showAutomated, onTog
|
|
|
1767
1725
|
setError(null);
|
|
1768
1726
|
setConfirmId(row.hit.item.id);
|
|
1769
1727
|
}
|
|
1770
|
-
} else if (key.name === "
|
|
1771
|
-
const row = rows[clamped];
|
|
1772
|
-
if (row?.kind === "conv") {
|
|
1773
|
-
setError(null);
|
|
1774
|
-
toggleArchived(row.hit.item);
|
|
1775
|
-
}
|
|
1776
|
-
} else if (key.name === "tab" && key.shift) onToggleArchived();
|
|
1777
|
-
else if (key.name === "tab") onToggleAutomated();
|
|
1728
|
+
} else if (key.name === "tab") onToggleAutomated();
|
|
1778
1729
|
else if (key.name === "return") {
|
|
1779
1730
|
const row = rows[clamped];
|
|
1780
1731
|
if (row) open(row);
|
|
@@ -1821,10 +1772,9 @@ function ConversationList({ agent, conversations, complete, showAutomated, onTog
|
|
|
1821
1772
|
fg,
|
|
1822
1773
|
children: [marker, truncate("+ new conversation", rowWidth)]
|
|
1823
1774
|
}, "new");
|
|
1824
|
-
const
|
|
1825
|
-
const { title, detail } = fitRowText(singleLine(row.hit.item.title ?? "(untitled)"), `${archived ? "archived · " : ""}${previewLine(row.hit.item)}`, rowWidth);
|
|
1775
|
+
const { title, detail } = fitRowText(singleLine(row.hit.item.title ?? "(untitled)"), previewLine(row.hit.item), rowWidth);
|
|
1826
1776
|
return /* @__PURE__ */ jsxs("text", {
|
|
1827
|
-
fg
|
|
1777
|
+
fg,
|
|
1828
1778
|
children: [
|
|
1829
1779
|
marker,
|
|
1830
1780
|
/* @__PURE__ */ jsx(FuzzyText, {
|
|
@@ -3462,19 +3412,17 @@ function applyChunk(items, chunk, agentName = null) {
|
|
|
3462
3412
|
if (!isRecord(data)) return [...items];
|
|
3463
3413
|
const card = parseConnectCard(data.spec);
|
|
3464
3414
|
if (!card) return [...items];
|
|
3465
|
-
const
|
|
3466
|
-
const
|
|
3467
|
-
if (items.some((m) => m.kind === "card" && m.toolCallId === toolCallId && m.specKey === specKey)) return [...items];
|
|
3468
|
-
return [...items, {
|
|
3415
|
+
const id = (typeof data.toolCallId === "string" ? data.toolCallId : null) ?? cryptoId();
|
|
3416
|
+
const next = {
|
|
3469
3417
|
kind: "card",
|
|
3470
|
-
id
|
|
3471
|
-
toolCallId,
|
|
3472
|
-
specKey,
|
|
3418
|
+
id,
|
|
3473
3419
|
card,
|
|
3474
3420
|
status: "idle",
|
|
3475
3421
|
detail: null,
|
|
3476
3422
|
agentName
|
|
3477
|
-
}
|
|
3423
|
+
};
|
|
3424
|
+
if (items.some((m) => m.kind === "card" && m.id === id)) return items.map((m) => m.kind === "card" && m.id === id ? next : m);
|
|
3425
|
+
return [...items, next];
|
|
3478
3426
|
}
|
|
3479
3427
|
case "data-anyone-conversation-started": return [...items];
|
|
3480
3428
|
default: return [...items];
|
|
@@ -3577,12 +3525,6 @@ function directiveIdsFrom(data) {
|
|
|
3577
3525
|
function cryptoId() {
|
|
3578
3526
|
return crypto.randomUUID();
|
|
3579
3527
|
}
|
|
3580
|
-
/** Distinct id per card, so cards from one tool call stay independently
|
|
3581
|
-
* addressable (status updates and the React key both go by `id`). */
|
|
3582
|
-
function nextCardId(items, toolCallId) {
|
|
3583
|
-
if (!toolCallId) return cryptoId();
|
|
3584
|
-
return `${toolCallId}#c${items.filter((m) => m.kind === "card" && m.toolCallId === toolCallId).length}`;
|
|
3585
|
-
}
|
|
3586
3528
|
|
|
3587
3529
|
//#endregion
|
|
3588
3530
|
//#region src/chat/tui/chat/attribution.ts
|
|
@@ -3696,16 +3638,11 @@ function uiMessagesToItems(messages) {
|
|
|
3696
3638
|
if (part.type === "data-anyone-render-spec") {
|
|
3697
3639
|
const data = isRecord(part) && isRecord(part.data) ? part.data : null;
|
|
3698
3640
|
const card = data ? parseConnectCard(data.spec) : null;
|
|
3699
|
-
if (card
|
|
3700
|
-
const toolCallId = typeof data.toolCallId === "string" ? data.toolCallId : null;
|
|
3701
|
-
const specKey = specKeyFor(data.spec);
|
|
3702
|
-
if (out.some((item) => item.kind === "card" && item.toolCallId === toolCallId && item.specKey === specKey)) continue;
|
|
3703
|
-
const ordinal = out.filter((item) => item.kind === "card" && item.toolCallId === toolCallId).length;
|
|
3641
|
+
if (card) {
|
|
3642
|
+
const toolCallId = data && typeof data.toolCallId === "string" ? data.toolCallId : null;
|
|
3704
3643
|
out.push({
|
|
3705
3644
|
kind: "card",
|
|
3706
|
-
id: toolCallId
|
|
3707
|
-
toolCallId,
|
|
3708
|
-
specKey,
|
|
3645
|
+
id: toolCallId ?? `${m.id}#c${textIdx++}`,
|
|
3709
3646
|
card,
|
|
3710
3647
|
status: "idle",
|
|
3711
3648
|
detail: null,
|
|
@@ -4432,22 +4369,14 @@ const keybindGroups = [
|
|
|
4432
4369
|
keys: "↵",
|
|
4433
4370
|
action: "open conversation"
|
|
4434
4371
|
},
|
|
4435
|
-
{
|
|
4436
|
-
keys: "ctrl+a",
|
|
4437
|
-
action: "archive conversation (hides it for you only; again to restore)"
|
|
4438
|
-
},
|
|
4439
4372
|
{
|
|
4440
4373
|
keys: "ctrl+d",
|
|
4441
|
-
action: "delete conversation
|
|
4374
|
+
action: "delete conversation (y/↵ confirm, n/esc keep)"
|
|
4442
4375
|
},
|
|
4443
4376
|
{
|
|
4444
4377
|
keys: "tab",
|
|
4445
4378
|
action: "show / hide the agent's own runs (schedules, webhooks, subagents)"
|
|
4446
4379
|
},
|
|
4447
|
-
{
|
|
4448
|
-
keys: "shift+tab",
|
|
4449
|
-
action: "show / hide the conversations you archived"
|
|
4450
|
-
},
|
|
4451
4380
|
{
|
|
4452
4381
|
keys: "esc",
|
|
4453
4382
|
action: "back to agent picker"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { t as errorMessage } from "./util-CeisaZVY.mjs";
|
|
3
|
-
import { c as machineIdentity, i as mintPortalDeviceToken, l as portalWsUrl, n as findThisDevice, r as grantPortalAccess, s as buildEnv, t as fetchPortalDevices } from "./api-
|
|
3
|
+
import { c as machineIdentity, i as mintPortalDeviceToken, l as portalWsUrl, n as findThisDevice, r as grantPortalAccess, s as buildEnv, t as fetchPortalDevices } from "./api-CDTKq_5Q.mjs";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
import { spawn } from "node:child_process";
|
|
6
6
|
import { WebSocket } from "ws";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import "./rest-
|
|
3
|
-
import { a as runPrint, i as resolveAgent, n as messageGet, o as toPrintError, r as readStdin, t as collectRunText } from "./print-
|
|
2
|
+
import "./rest-CamHVOce.mjs";
|
|
3
|
+
import { a as runPrint, i as resolveAgent, n as messageGet, o as toPrintError, r as readStdin, t as collectRunText } from "./print-Bin4u16d.mjs";
|
|
4
4
|
|
|
5
5
|
export { messageGet, readStdin, resolveAgent, runPrint };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { n as createRestClient, t as HttpError } from "./rest-
|
|
2
|
+
import { n as createRestClient, t as HttpError } from "./rest-CamHVOce.mjs";
|
|
3
3
|
import { n as isRecord, t as errorMessage } from "./util-CeisaZVY.mjs";
|
|
4
|
-
import stableStringify from "safe-stable-stringify";
|
|
5
4
|
|
|
6
5
|
//#region src/chat/tui/chat/card.ts
|
|
7
6
|
const urlActionKinds = [
|
|
@@ -56,23 +55,6 @@ function parseButton(element) {
|
|
|
56
55
|
primary
|
|
57
56
|
};
|
|
58
57
|
}
|
|
59
|
-
/**
|
|
60
|
-
* Content identity for a card's spec, which is what separates a re-delivery of
|
|
61
|
-
* one card from two distinct cards: the same card reaches us twice (live on the
|
|
62
|
-
* run stream and again as the persisted message part when history is loaded for
|
|
63
|
-
* an in-flight run), while a single tool call can legitimately post SEVERAL
|
|
64
|
-
* different cards — `platform` subprocesses chained in one bash command all
|
|
65
|
-
* read the same TOOL_CALL_ID, so `toolCallId` alone identifies neither. Applies
|
|
66
|
-
* the same identity rule as the web client (web/src/features/chat-v2/turn-segments.ts).
|
|
67
|
-
*
|
|
68
|
-
* The serialization has to be key-order-independent, because the persisted copy
|
|
69
|
-
* of a spec comes back through a jsonb round-trip that can reorder keys and
|
|
70
|
-
* order-sensitive `JSON.stringify` would read that as a different card.
|
|
71
|
-
* `safe-stable-stringify` sorts keys and tolerates cycles.
|
|
72
|
-
*/
|
|
73
|
-
function specKeyFor(spec) {
|
|
74
|
-
return stableStringify(spec) ?? crypto.randomUUID();
|
|
75
|
-
}
|
|
76
58
|
function parseConnectCard(spec) {
|
|
77
59
|
if (!isRecord(spec)) return null;
|
|
78
60
|
const { root, elements } = spec;
|
|
@@ -481,4 +463,4 @@ async function readStdin() {
|
|
|
481
463
|
}
|
|
482
464
|
|
|
483
465
|
//#endregion
|
|
484
|
-
export { runPrint as a, cardActionErrorMessage as c, reconcileMaskedInput as d, resolveConnectUrl as f, resolveAgent as i, parseExternalOauthConnectParams as l,
|
|
466
|
+
export { runPrint as a, cardActionErrorMessage as c, reconcileMaskedInput as d, resolveConnectUrl as f, resolveAgent as i, parseExternalOauthConnectParams as l, messageGet as n, toPrintError as o, parseConnectCard as p, readStdin as r, MASK_CHAR as s, collectRunText as t, parseOauthConnectParams as u };
|
|
@@ -14,7 +14,7 @@ import { n as printError } from "./output-B4cW10Ph.mjs";
|
|
|
14
14
|
* the reply (and to --json).
|
|
15
15
|
*/
|
|
16
16
|
async function connectMachineShare({ appUrl, sessionToken, timeoutHint }) {
|
|
17
|
-
const { PortalClient } = await import("./client-
|
|
17
|
+
const { PortalClient } = await import("./client-D6NAkL9e.mjs");
|
|
18
18
|
let signalConnected;
|
|
19
19
|
const connected = new Promise((resolve) => {
|
|
20
20
|
signalConnected = resolve;
|
|
@@ -150,7 +150,7 @@ function createRestClient({ appUrl, sessionToken }) {
|
|
|
150
150
|
const { agent } = await post(`/api/v1/agents/${encodeURIComponent(agentId)}`, { model }, updateAgentResponseSchema, "PATCH");
|
|
151
151
|
return { model: agent.model ?? null };
|
|
152
152
|
},
|
|
153
|
-
listConversations: async ({ agentId, limit, channels,
|
|
153
|
+
listConversations: async ({ agentId, limit, channels, onPage }) => {
|
|
154
154
|
const all = [];
|
|
155
155
|
const maxConversations = limit ?? 5e3;
|
|
156
156
|
let cursor;
|
|
@@ -162,7 +162,6 @@ function createRestClient({ appUrl, sessionToken }) {
|
|
|
162
162
|
});
|
|
163
163
|
params.set("limit", String(Math.min(remaining, 100)));
|
|
164
164
|
if (cursor) params.set("cursor", cursor);
|
|
165
|
-
if (archived) params.set("archived", archived);
|
|
166
165
|
for (const channel of channels ?? []) params.append("channels", channel);
|
|
167
166
|
const page = await get(`/api/v1/conversations?${params.toString()}`, listConversationsResponseSchema);
|
|
168
167
|
all.push(...page.conversations);
|
|
@@ -226,9 +225,6 @@ function createRestClient({ appUrl, sessionToken }) {
|
|
|
226
225
|
deleteConversation: async ({ conversationId }) => {
|
|
227
226
|
await del(`/api/v1/conversations/${encodeURIComponent(conversationId)}`);
|
|
228
227
|
},
|
|
229
|
-
setConversationArchived: async ({ conversationId, archived }) => {
|
|
230
|
-
await post(`/api/v1/conversations/${encodeURIComponent(conversationId)}/archive`, { archived }, z.object({ archived: z.boolean() }));
|
|
231
|
-
},
|
|
232
228
|
sendMessage: async ({ clientSurface, ...input }) => post("/api/v1/chat/send", {
|
|
233
229
|
...input,
|
|
234
230
|
clientSurface
|
|
@@ -355,7 +351,6 @@ const conversationSummarySchema = z.object({
|
|
|
355
351
|
preview: z.string().nullable(),
|
|
356
352
|
channel: z.string().nullable(),
|
|
357
353
|
channelLabel: z.string().nullable(),
|
|
358
|
-
viewerArchivedAt: z.string().nullable().optional(),
|
|
359
354
|
agent: z.object({
|
|
360
355
|
id: z.string().uuid(),
|
|
361
356
|
name: z.string(),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "skydive-cli",
|
|
3
|
-
"version": "0.2.0
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Skydive CLI — cloud agents from the command line",
|
|
5
5
|
"homepage": "https://skydive.com",
|
|
6
6
|
"license": "MIT",
|
|
@@ -38,7 +38,6 @@
|
|
|
38
38
|
"open": "^10.1.0",
|
|
39
39
|
"react": "^19.0.0",
|
|
40
40
|
"react-devtools-core": "^7.0.1",
|
|
41
|
-
"safe-stable-stringify": "^2.3.1",
|
|
42
41
|
"semver": "^7.7.4",
|
|
43
42
|
"web-tree-sitter": "0.25.10",
|
|
44
43
|
"ws": "^8.21.0",
|