tabby-bianbu-mcp 0.5.0 → 0.5.2
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/CHANGELOG.md +11 -0
- package/README.md +3 -2
- package/assets/bianbu_agent_proxy.meta.json +4 -4
- package/assets/bianbu_agent_proxy.sh +152 -16
- package/dist/commands.d.ts +7 -7
- package/dist/configProvider.d.ts +25 -25
- package/dist/filesTab.component.d.ts +104 -104
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/mcp.service.d.ts +59 -55
- package/dist/profileProvider.d.ts +16 -16
- package/dist/remoteRelease.d.ts +48 -37
- package/dist/settingsTab.component.d.ts +28 -28
- package/dist/settingsTabProvider.d.ts +8 -8
- package/dist/shellSession.d.ts +28 -28
- package/dist/shellTab.component.d.ts +15 -15
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to `tabby-bianbu-mcp` will be documented in this file.
|
|
4
4
|
|
|
5
|
+
## [0.5.2] - 2026-03-20
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
- remote push-upgrade now launches through a completion status file and waits for the installer to actually finish instead of trusting the first recovered health response
|
|
9
|
+
- bundled `bianbu_agent_proxy.sh` now stages the next release before cutover and auto-rolls back to the previous install if activation fails, preventing half-upgraded broken remotes
|
|
10
|
+
|
|
11
|
+
## [0.5.1] - 2026-03-19
|
|
12
|
+
|
|
13
|
+
### Fixed
|
|
14
|
+
- remote installer bootstrap/upgrade now defines `MAX_REQUEST_BODY_MB` in the shell layer, fixing the `未绑定的变量` failure during `write_env`
|
|
15
|
+
|
|
5
16
|
## [0.5.0] - 2026-03-19
|
|
6
17
|
|
|
7
18
|
### Added
|
package/README.md
CHANGED
|
@@ -62,8 +62,9 @@ When you click `Push latest installer + upgrade`:
|
|
|
62
62
|
1. the plugin uploads the bundled installer to `installerRemotePath`
|
|
63
63
|
2. it makes the script executable remotely
|
|
64
64
|
3. it starts the installer in the background with `up` or `repair`
|
|
65
|
-
4.
|
|
66
|
-
5.
|
|
65
|
+
4. the launcher writes a remote status file when the installer exits, including the exit code and log path
|
|
66
|
+
5. the plugin waits for both installer completion and the expected remote health/version report before declaring success
|
|
67
|
+
6. if the cutover fails, the installer auto-rolls back to the previous backup instead of leaving the remote half-upgraded
|
|
67
68
|
|
|
68
69
|
This is the intended commercial-release upgrade path because the client and remote installer ship together.
|
|
69
70
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"fileName": "bianbu_agent_proxy.sh",
|
|
3
3
|
"sourceFile": "bianbu_agent_proxy.sh",
|
|
4
|
-
"scriptVersion": "1.2.
|
|
4
|
+
"scriptVersion": "1.2.1",
|
|
5
5
|
"serverVersion": "1.2.0",
|
|
6
|
-
"sha256": "
|
|
7
|
-
"bytes":
|
|
8
|
-
"generatedAt": "2026-03-
|
|
6
|
+
"sha256": "2579a96d69100625feef3ac205a877a3b742c62adec1db2ee284dcd3cc834fb4",
|
|
7
|
+
"bytes": 67586,
|
|
8
|
+
"generatedAt": "2026-03-20T04:59:13.343Z"
|
|
9
9
|
}
|
|
@@ -4,7 +4,7 @@ set -Eeuo pipefail
|
|
|
4
4
|
umask 077
|
|
5
5
|
|
|
6
6
|
SCRIPT_NAME="$(basename "$0")"
|
|
7
|
-
SCRIPT_VERSION="${SCRIPT_VERSION:-1.2.
|
|
7
|
+
SCRIPT_VERSION="${SCRIPT_VERSION:-1.2.1}"
|
|
8
8
|
SERVER_VERSION="${SERVER_VERSION:-1.2.0}"
|
|
9
9
|
APP_NAME="bianbu-mcp-server"
|
|
10
10
|
INSTALL_ROOT="/opt/${APP_NAME}"
|
|
@@ -24,10 +24,17 @@ FILE_ROOT="${FILE_ROOT:-/home/${RUN_USER}}"
|
|
|
24
24
|
ENABLE_PASSWORDLESS_SUDO="${ENABLE_PASSWORDLESS_SUDO:-false}"
|
|
25
25
|
MAX_FILE_MB="${MAX_FILE_MB:-64}"
|
|
26
26
|
MAX_COMMAND_OUTPUT_KB="${MAX_COMMAND_OUTPUT_KB:-256}"
|
|
27
|
+
MAX_REQUEST_BODY_MB="${MAX_REQUEST_BODY_MB:-8}"
|
|
27
28
|
TLS_CERT_FILE="${TLS_CERT_FILE:-}"
|
|
28
29
|
TLS_KEY_FILE="${TLS_KEY_FILE:-}"
|
|
29
30
|
MCP_TRANSPORT_MODE="${MCP_TRANSPORT_MODE:-stateless}"
|
|
30
31
|
|
|
32
|
+
LAST_BACKUP_DIR=""
|
|
33
|
+
ROLLBACK_ON_EXIT=0
|
|
34
|
+
ROLLBACK_BACKUP_DIR=""
|
|
35
|
+
ROLLBACK_STAGING_ROOT=""
|
|
36
|
+
ROLLBACK_PREVIOUS_ROOT=""
|
|
37
|
+
|
|
31
38
|
log() {
|
|
32
39
|
printf '[%s] %s\n' "$SCRIPT_NAME" "$*"
|
|
33
40
|
}
|
|
@@ -215,6 +222,7 @@ backup_existing_installation() {
|
|
|
215
222
|
local backup_dir
|
|
216
223
|
local has_content=0
|
|
217
224
|
|
|
225
|
+
LAST_BACKUP_DIR=""
|
|
218
226
|
timestamp="$(date -u +%Y%m%dT%H%M%SZ)"
|
|
219
227
|
backup_dir="${BACKUP_ROOT}/${timestamp}"
|
|
220
228
|
run_as_root install -d -m 700 "$BACKUP_ROOT" "$backup_dir"
|
|
@@ -244,6 +252,7 @@ backup_existing_installation() {
|
|
|
244
252
|
fi
|
|
245
253
|
|
|
246
254
|
log "已创建备份: $backup_dir"
|
|
255
|
+
LAST_BACKUP_DIR="$backup_dir"
|
|
247
256
|
}
|
|
248
257
|
|
|
249
258
|
ensure_runtime_user() {
|
|
@@ -338,7 +347,8 @@ ensure_node_version() {
|
|
|
338
347
|
}
|
|
339
348
|
|
|
340
349
|
write_package() {
|
|
341
|
-
|
|
350
|
+
local package_file="${1:-$PACKAGE_FILE}"
|
|
351
|
+
write_root_file "$package_file" 644 <<EOF
|
|
342
352
|
{
|
|
343
353
|
"name": "bianbu-mcp-server",
|
|
344
354
|
"version": "${SERVER_VERSION}",
|
|
@@ -354,7 +364,8 @@ EOF
|
|
|
354
364
|
}
|
|
355
365
|
|
|
356
366
|
write_app() {
|
|
357
|
-
|
|
367
|
+
local app_file="${1:-$APP_FILE}"
|
|
368
|
+
write_root_file "$app_file" 755 <<'EOF'
|
|
358
369
|
import { randomBytes, randomUUID } from 'node:crypto';
|
|
359
370
|
import { exec as execCb } from 'node:child_process';
|
|
360
371
|
import { promisify } from 'node:util';
|
|
@@ -1609,7 +1620,7 @@ process.on('uncaughtException', (error) => {
|
|
|
1609
1620
|
process.on('SIGINT', () => process.exit(0));
|
|
1610
1621
|
process.on('SIGTERM', () => process.exit(0));
|
|
1611
1622
|
EOF
|
|
1612
|
-
run_as_root python3 - "$
|
|
1623
|
+
run_as_root python3 - "$app_file" "$SERVER_VERSION" "$SCRIPT_VERSION" <<'PY'
|
|
1613
1624
|
from pathlib import Path
|
|
1614
1625
|
import sys
|
|
1615
1626
|
|
|
@@ -1624,15 +1635,61 @@ PY
|
|
|
1624
1635
|
}
|
|
1625
1636
|
|
|
1626
1637
|
install_node_modules() {
|
|
1638
|
+
local install_root="${1:-$INSTALL_ROOT}"
|
|
1627
1639
|
ensure_node_version
|
|
1628
|
-
log "安装 Node 依赖到: $
|
|
1629
|
-
run_as_root rm -rf "$
|
|
1630
|
-
run_as_root sh -c "cd '$
|
|
1631
|
-
run_as_root test -f "$
|
|
1632
|
-
run_as_root test -f "$
|
|
1633
|
-
run_as_root test -f "$
|
|
1634
|
-
run_as_root chmod -R a+rX "$
|
|
1635
|
-
run_as_root sh -c "cd '$
|
|
1640
|
+
log "安装 Node 依赖到: $install_root"
|
|
1641
|
+
run_as_root rm -rf "$install_root/node_modules" "$install_root/package-lock.json"
|
|
1642
|
+
run_as_root sh -c "cd '$install_root' && npm install --omit=dev --no-fund --no-audit"
|
|
1643
|
+
run_as_root test -f "$install_root/node_modules/@modelcontextprotocol/sdk/package.json" || die "npm 安装后缺少 @modelcontextprotocol/sdk"
|
|
1644
|
+
run_as_root test -f "$install_root/node_modules/express/package.json" || die "npm 安装后缺少 express"
|
|
1645
|
+
run_as_root test -f "$install_root/node_modules/zod/package.json" || die "npm 安装后缺少 zod"
|
|
1646
|
+
run_as_root chmod -R a+rX "$install_root/node_modules"
|
|
1647
|
+
run_as_root sh -c "cd '$install_root' && node -e \"import('./server.mjs').then(() => process.exit(0)).catch((err) => { console.error(err); process.exit(1); })\"" || die "Node 运行时无法解析 MCP server"
|
|
1648
|
+
}
|
|
1649
|
+
|
|
1650
|
+
prepare_release_root() {
|
|
1651
|
+
local release_root="$1"
|
|
1652
|
+
local release_package_file="${release_root}/package.json"
|
|
1653
|
+
local release_app_file="${release_root}/server.mjs"
|
|
1654
|
+
|
|
1655
|
+
log "预构建新版本到暂存目录: $release_root"
|
|
1656
|
+
run_as_root rm -rf "$release_root"
|
|
1657
|
+
run_as_root install -d -m 755 "$release_root"
|
|
1658
|
+
write_package "$release_package_file"
|
|
1659
|
+
write_app "$release_app_file"
|
|
1660
|
+
install_node_modules "$release_root"
|
|
1661
|
+
}
|
|
1662
|
+
|
|
1663
|
+
activate_release_root() {
|
|
1664
|
+
local release_root="$1"
|
|
1665
|
+
local previous_root="$2"
|
|
1666
|
+
|
|
1667
|
+
stop_existing_service_if_needed
|
|
1668
|
+
|
|
1669
|
+
if run_as_root test -d "$INSTALL_ROOT"; then
|
|
1670
|
+
log "暂存当前安装目录: $INSTALL_ROOT -> $previous_root"
|
|
1671
|
+
run_as_root rm -rf "$previous_root"
|
|
1672
|
+
run_as_root mv "$INSTALL_ROOT" "$previous_root"
|
|
1673
|
+
fi
|
|
1674
|
+
|
|
1675
|
+
log "切换新版本安装目录: $release_root -> $INSTALL_ROOT"
|
|
1676
|
+
run_as_root rm -rf "$INSTALL_ROOT"
|
|
1677
|
+
run_as_root mv "$release_root" "$INSTALL_ROOT"
|
|
1678
|
+
}
|
|
1679
|
+
|
|
1680
|
+
clear_release_rollback_state() {
|
|
1681
|
+
ROLLBACK_ON_EXIT=0
|
|
1682
|
+
ROLLBACK_BACKUP_DIR=""
|
|
1683
|
+
ROLLBACK_STAGING_ROOT=""
|
|
1684
|
+
ROLLBACK_PREVIOUS_ROOT=""
|
|
1685
|
+
}
|
|
1686
|
+
|
|
1687
|
+
cleanup_release_artifacts() {
|
|
1688
|
+
local release_root="$1"
|
|
1689
|
+
local previous_root="$2"
|
|
1690
|
+
|
|
1691
|
+
run_as_root rm -rf "$release_root" >/dev/null 2>&1 || true
|
|
1692
|
+
run_as_root rm -rf "$previous_root" >/dev/null 2>&1 || true
|
|
1636
1693
|
}
|
|
1637
1694
|
|
|
1638
1695
|
write_env() {
|
|
@@ -1702,18 +1759,34 @@ log_release_summary() {
|
|
|
1702
1759
|
}
|
|
1703
1760
|
|
|
1704
1761
|
apply_release() {
|
|
1762
|
+
local release_id
|
|
1763
|
+
local staging_root
|
|
1764
|
+
local previous_root
|
|
1765
|
+
|
|
1705
1766
|
require_systemd
|
|
1706
1767
|
cmd_install
|
|
1707
1768
|
ensure_runtime_user
|
|
1708
1769
|
configure_passwordless_sudo
|
|
1709
1770
|
backup_existing_installation
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1771
|
+
|
|
1772
|
+
release_id="$(date -u +%Y%m%dT%H%M%SZ)-$$"
|
|
1773
|
+
staging_root="${INSTALL_ROOT}.staging-${release_id}"
|
|
1774
|
+
previous_root="${INSTALL_ROOT}.previous-${release_id}"
|
|
1775
|
+
|
|
1776
|
+
prepare_release_root "$staging_root"
|
|
1777
|
+
|
|
1778
|
+
ROLLBACK_ON_EXIT=1
|
|
1779
|
+
ROLLBACK_BACKUP_DIR="$LAST_BACKUP_DIR"
|
|
1780
|
+
ROLLBACK_STAGING_ROOT="$staging_root"
|
|
1781
|
+
ROLLBACK_PREVIOUS_ROOT="$previous_root"
|
|
1782
|
+
|
|
1783
|
+
activate_release_root "$staging_root" "$previous_root"
|
|
1714
1784
|
write_env
|
|
1715
1785
|
write_service
|
|
1716
1786
|
finalize_service_start
|
|
1787
|
+
|
|
1788
|
+
clear_release_rollback_state
|
|
1789
|
+
cleanup_release_artifacts "$staging_root" "$previous_root"
|
|
1717
1790
|
}
|
|
1718
1791
|
|
|
1719
1792
|
cmd_bootstrap() {
|
|
@@ -1817,6 +1890,69 @@ SERVICE_NAME=${SERVICE_NAME}
|
|
|
1817
1890
|
EOF
|
|
1818
1891
|
}
|
|
1819
1892
|
|
|
1893
|
+
cleanup_failed_release() {
|
|
1894
|
+
local exit_code="${1:-0}"
|
|
1895
|
+
local backup_dir="$ROLLBACK_BACKUP_DIR"
|
|
1896
|
+
local staging_root="$ROLLBACK_STAGING_ROOT"
|
|
1897
|
+
local previous_root="$ROLLBACK_PREVIOUS_ROOT"
|
|
1898
|
+
|
|
1899
|
+
if [ "$ROLLBACK_ON_EXIT" -ne 1 ] || [ "$exit_code" -eq 0 ]; then
|
|
1900
|
+
return 0
|
|
1901
|
+
fi
|
|
1902
|
+
|
|
1903
|
+
clear_release_rollback_state
|
|
1904
|
+
set +e
|
|
1905
|
+
|
|
1906
|
+
log "检测到发布失败,尝试自动回滚到上一版本"
|
|
1907
|
+
|
|
1908
|
+
if command -v systemctl >/dev/null 2>&1; then
|
|
1909
|
+
if service_file_exists && run_as_root systemctl is-active --quiet "$SERVICE_NAME"; then
|
|
1910
|
+
log "停止失败中的服务进程: $SERVICE_NAME"
|
|
1911
|
+
run_as_root systemctl stop "$SERVICE_NAME" || true
|
|
1912
|
+
fi
|
|
1913
|
+
fi
|
|
1914
|
+
|
|
1915
|
+
if [ -n "$staging_root" ]; then
|
|
1916
|
+
run_as_root rm -rf "$staging_root" >/dev/null 2>&1 || true
|
|
1917
|
+
fi
|
|
1918
|
+
|
|
1919
|
+
if [ -n "$previous_root" ] && run_as_root test -d "$previous_root"; then
|
|
1920
|
+
log "回滚安装目录: $previous_root -> $INSTALL_ROOT"
|
|
1921
|
+
run_as_root rm -rf "$INSTALL_ROOT"
|
|
1922
|
+
run_as_root mv "$previous_root" "$INSTALL_ROOT"
|
|
1923
|
+
elif [ -n "$backup_dir" ] && run_as_root test -d "$backup_dir/install_root"; then
|
|
1924
|
+
log "从备份恢复安装目录: $backup_dir/install_root -> $INSTALL_ROOT"
|
|
1925
|
+
run_as_root rm -rf "$INSTALL_ROOT"
|
|
1926
|
+
run_as_root cp -a "$backup_dir/install_root" "$INSTALL_ROOT"
|
|
1927
|
+
fi
|
|
1928
|
+
|
|
1929
|
+
if [ -n "$backup_dir" ] && run_as_root test -f "$backup_dir/${SERVICE_NAME}.service"; then
|
|
1930
|
+
log "回滚 systemd service"
|
|
1931
|
+
run_as_root cp -a "$backup_dir/${SERVICE_NAME}.service" "$SERVICE_FILE" || true
|
|
1932
|
+
fi
|
|
1933
|
+
|
|
1934
|
+
if [ -n "$backup_dir" ] && run_as_root test -f "$backup_dir/${SERVICE_NAME}.env"; then
|
|
1935
|
+
log "回滚环境文件"
|
|
1936
|
+
run_as_root cp -a "$backup_dir/${SERVICE_NAME}.env" "$ENV_FILE" || true
|
|
1937
|
+
fi
|
|
1938
|
+
|
|
1939
|
+
if command -v systemctl >/dev/null 2>&1 && service_file_exists; then
|
|
1940
|
+
run_as_root systemctl daemon-reload || true
|
|
1941
|
+
run_as_root systemctl reset-failed "$SERVICE_NAME" || true
|
|
1942
|
+
run_as_root systemctl enable --now "$SERVICE_NAME" || true
|
|
1943
|
+
run_as_root systemctl restart "$SERVICE_NAME" || true
|
|
1944
|
+
if wait_for_local_health 25 2; then
|
|
1945
|
+
log "自动回滚完成,远端已恢复到上一可用版本"
|
|
1946
|
+
else
|
|
1947
|
+
log "自动回滚后健康检查仍未通过,请执行 '$SCRIPT_NAME restore-latest'"
|
|
1948
|
+
run_as_root systemctl --no-pager --full status "$SERVICE_NAME" || true
|
|
1949
|
+
run_as_root journalctl -u "$SERVICE_NAME" -n 120 --no-pager || true
|
|
1950
|
+
fi
|
|
1951
|
+
fi
|
|
1952
|
+
}
|
|
1953
|
+
|
|
1954
|
+
trap 'exit_code=$?; trap - EXIT; cleanup_failed_release "$exit_code"; exit "$exit_code"' EXIT
|
|
1955
|
+
|
|
1820
1956
|
main() {
|
|
1821
1957
|
local cmd="${1:-up}"
|
|
1822
1958
|
shift || true
|
package/dist/commands.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { AppService, Command, CommandProvider } from 'tabby-core';
|
|
2
|
-
/** @hidden */
|
|
3
|
-
export declare class BianbuCloudCommandProvider extends CommandProvider {
|
|
4
|
-
private app;
|
|
5
|
-
constructor(app: AppService);
|
|
6
|
-
provide(): Promise<Command[]>;
|
|
7
|
-
}
|
|
1
|
+
import { AppService, Command, CommandProvider } from 'tabby-core';
|
|
2
|
+
/** @hidden */
|
|
3
|
+
export declare class BianbuCloudCommandProvider extends CommandProvider {
|
|
4
|
+
private app;
|
|
5
|
+
constructor(app: AppService);
|
|
6
|
+
provide(): Promise<Command[]>;
|
|
7
|
+
}
|
package/dist/configProvider.d.ts
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import { ConfigProvider } from 'tabby-core';
|
|
2
|
-
/** @hidden */
|
|
3
|
-
export declare class BianbuMcpConfigProvider extends ConfigProvider {
|
|
4
|
-
defaults: {
|
|
5
|
-
bianbuMcp: {
|
|
6
|
-
enabled: boolean;
|
|
7
|
-
name: string;
|
|
8
|
-
url: string;
|
|
9
|
-
apiKey: string;
|
|
10
|
-
minIntervalMs: number;
|
|
11
|
-
maxRetries: number;
|
|
12
|
-
retryBaseMs: number;
|
|
13
|
-
interactiveConcurrency: number;
|
|
14
|
-
transferConcurrency: number;
|
|
15
|
-
workerCadenceMs: number;
|
|
16
|
-
uploadChunkBytes: number;
|
|
17
|
-
downloadChunkBytes: number;
|
|
18
|
-
notes: string;
|
|
19
|
-
installerRemotePath: string;
|
|
20
|
-
maintenanceAsRoot: boolean;
|
|
21
|
-
reconnectPollMs: number;
|
|
22
|
-
upgradeHealthTimeoutMs: number;
|
|
23
|
-
};
|
|
24
|
-
};
|
|
25
|
-
}
|
|
1
|
+
import { ConfigProvider } from 'tabby-core';
|
|
2
|
+
/** @hidden */
|
|
3
|
+
export declare class BianbuMcpConfigProvider extends ConfigProvider {
|
|
4
|
+
defaults: {
|
|
5
|
+
bianbuMcp: {
|
|
6
|
+
enabled: boolean;
|
|
7
|
+
name: string;
|
|
8
|
+
url: string;
|
|
9
|
+
apiKey: string;
|
|
10
|
+
minIntervalMs: number;
|
|
11
|
+
maxRetries: number;
|
|
12
|
+
retryBaseMs: number;
|
|
13
|
+
interactiveConcurrency: number;
|
|
14
|
+
transferConcurrency: number;
|
|
15
|
+
workerCadenceMs: number;
|
|
16
|
+
uploadChunkBytes: number;
|
|
17
|
+
downloadChunkBytes: number;
|
|
18
|
+
notes: string;
|
|
19
|
+
installerRemotePath: string;
|
|
20
|
+
maintenanceAsRoot: boolean;
|
|
21
|
+
reconnectPollMs: number;
|
|
22
|
+
upgradeHealthTimeoutMs: number;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
}
|
|
@@ -1,104 +1,104 @@
|
|
|
1
|
-
import { Injector } from '@angular/core';
|
|
2
|
-
import { BaseTabComponent, NotificationsService, PlatformService } from 'tabby-core';
|
|
3
|
-
import { BianbuMcpService } from './mcp.service';
|
|
4
|
-
interface TransferItem {
|
|
5
|
-
id: number;
|
|
6
|
-
name: string;
|
|
7
|
-
direction: 'upload' | 'download';
|
|
8
|
-
status: 'queued' | 'running' | 'done' | 'error' | 'cancelled';
|
|
9
|
-
bytesDone: number;
|
|
10
|
-
bytesTotal: number | null;
|
|
11
|
-
startedAt: number;
|
|
12
|
-
finishedAt?: number;
|
|
13
|
-
error?: string;
|
|
14
|
-
controller?: AbortController;
|
|
15
|
-
}
|
|
16
|
-
/** @hidden */
|
|
17
|
-
export declare class BianbuCloudFilesTabComponent extends BaseTabComponent {
|
|
18
|
-
private mcp;
|
|
19
|
-
private notifications;
|
|
20
|
-
private platform;
|
|
21
|
-
currentPath: string;
|
|
22
|
-
pathInput: string;
|
|
23
|
-
asRoot: boolean;
|
|
24
|
-
busy: boolean;
|
|
25
|
-
items: any[];
|
|
26
|
-
filteredItems: any[];
|
|
27
|
-
selectedPath: string;
|
|
28
|
-
selectedContent: string;
|
|
29
|
-
selectedIsText: boolean;
|
|
30
|
-
status: string;
|
|
31
|
-
dragActive: boolean;
|
|
32
|
-
searchText: string;
|
|
33
|
-
history: string[];
|
|
34
|
-
historyIndex: number;
|
|
35
|
-
selectedIndex: number;
|
|
36
|
-
contextMenuVisible: boolean;
|
|
37
|
-
contextMenuX: number;
|
|
38
|
-
contextMenuY: number;
|
|
39
|
-
contextItem: any;
|
|
40
|
-
promptVisible: boolean;
|
|
41
|
-
promptTitle: string;
|
|
42
|
-
promptPlaceholder: string;
|
|
43
|
-
promptValue: string;
|
|
44
|
-
promptAction: null | 'mkdir' | 'newfile' | 'rename';
|
|
45
|
-
promptTarget: any;
|
|
46
|
-
transfersVisible: boolean;
|
|
47
|
-
transfers: TransferItem[];
|
|
48
|
-
private transferSeq;
|
|
49
|
-
private transferQueue;
|
|
50
|
-
private transferQueueRunning;
|
|
51
|
-
constructor(injector: Injector, mcp: BianbuMcpService, notifications: NotificationsService, platform: PlatformService);
|
|
52
|
-
ngOnInit(): void;
|
|
53
|
-
get breadcrumbs(): string[];
|
|
54
|
-
get selectedItem(): any | null;
|
|
55
|
-
onDocumentClick(): void;
|
|
56
|
-
onKeyDown(event: KeyboardEvent): void;
|
|
57
|
-
refresh(): Promise<void>;
|
|
58
|
-
applyFilter(): void;
|
|
59
|
-
navigateToInput(): void;
|
|
60
|
-
navigate(path: string, pushHistory?: boolean): void;
|
|
61
|
-
navigateBreadcrumb(index: number): void;
|
|
62
|
-
goBack(): void;
|
|
63
|
-
goForward(): void;
|
|
64
|
-
goUp(): void;
|
|
65
|
-
moveSelection(delta: number): void;
|
|
66
|
-
selectItem(item: any): void;
|
|
67
|
-
openItem(item: any): Promise<void>;
|
|
68
|
-
saveSelected(): Promise<void>;
|
|
69
|
-
openCreateDirectoryPrompt(): void;
|
|
70
|
-
openCreateFilePrompt(): void;
|
|
71
|
-
openRenamePrompt(item: any): void;
|
|
72
|
-
closePrompt(): void;
|
|
73
|
-
confirmPrompt(): Promise<void>;
|
|
74
|
-
createDirectory(name: string): Promise<void>;
|
|
75
|
-
createFile(name: string): Promise<void>;
|
|
76
|
-
renameItem(item: any, name: string): Promise<void>;
|
|
77
|
-
deleteItem(item: any): Promise<void>;
|
|
78
|
-
showContextMenu(event: MouseEvent, item: any): void;
|
|
79
|
-
hideContextMenu(): void;
|
|
80
|
-
uploadFile(event: Event): Promise<void>;
|
|
81
|
-
private createTransfer;
|
|
82
|
-
cancelTransfer(transfer: TransferItem): void;
|
|
83
|
-
transferPercent(transfer: TransferItem): number | null;
|
|
84
|
-
transferRate(transfer: TransferItem): string;
|
|
85
|
-
uploadDroppedFile(file: File): Promise<void>;
|
|
86
|
-
onDragOver(event: DragEvent): void;
|
|
87
|
-
onDragLeave(): void;
|
|
88
|
-
onDrop(event: DragEvent): Promise<void>;
|
|
89
|
-
downloadSelected(): Promise<void>;
|
|
90
|
-
private enqueueUpload;
|
|
91
|
-
private enqueueDownload;
|
|
92
|
-
private queueTransferJob;
|
|
93
|
-
private pumpTransferQueue;
|
|
94
|
-
private runUploadTransfer;
|
|
95
|
-
private runDownloadTransfer;
|
|
96
|
-
private clearPreview;
|
|
97
|
-
private baseName;
|
|
98
|
-
private isTextLike;
|
|
99
|
-
private joinPath;
|
|
100
|
-
private uint8ToBase64;
|
|
101
|
-
private base64ToUint8;
|
|
102
|
-
private readFileAsBase64;
|
|
103
|
-
}
|
|
104
|
-
export {};
|
|
1
|
+
import { Injector } from '@angular/core';
|
|
2
|
+
import { BaseTabComponent, NotificationsService, PlatformService } from 'tabby-core';
|
|
3
|
+
import { BianbuMcpService } from './mcp.service';
|
|
4
|
+
interface TransferItem {
|
|
5
|
+
id: number;
|
|
6
|
+
name: string;
|
|
7
|
+
direction: 'upload' | 'download';
|
|
8
|
+
status: 'queued' | 'running' | 'done' | 'error' | 'cancelled';
|
|
9
|
+
bytesDone: number;
|
|
10
|
+
bytesTotal: number | null;
|
|
11
|
+
startedAt: number;
|
|
12
|
+
finishedAt?: number;
|
|
13
|
+
error?: string;
|
|
14
|
+
controller?: AbortController;
|
|
15
|
+
}
|
|
16
|
+
/** @hidden */
|
|
17
|
+
export declare class BianbuCloudFilesTabComponent extends BaseTabComponent {
|
|
18
|
+
private mcp;
|
|
19
|
+
private notifications;
|
|
20
|
+
private platform;
|
|
21
|
+
currentPath: string;
|
|
22
|
+
pathInput: string;
|
|
23
|
+
asRoot: boolean;
|
|
24
|
+
busy: boolean;
|
|
25
|
+
items: any[];
|
|
26
|
+
filteredItems: any[];
|
|
27
|
+
selectedPath: string;
|
|
28
|
+
selectedContent: string;
|
|
29
|
+
selectedIsText: boolean;
|
|
30
|
+
status: string;
|
|
31
|
+
dragActive: boolean;
|
|
32
|
+
searchText: string;
|
|
33
|
+
history: string[];
|
|
34
|
+
historyIndex: number;
|
|
35
|
+
selectedIndex: number;
|
|
36
|
+
contextMenuVisible: boolean;
|
|
37
|
+
contextMenuX: number;
|
|
38
|
+
contextMenuY: number;
|
|
39
|
+
contextItem: any;
|
|
40
|
+
promptVisible: boolean;
|
|
41
|
+
promptTitle: string;
|
|
42
|
+
promptPlaceholder: string;
|
|
43
|
+
promptValue: string;
|
|
44
|
+
promptAction: null | 'mkdir' | 'newfile' | 'rename';
|
|
45
|
+
promptTarget: any;
|
|
46
|
+
transfersVisible: boolean;
|
|
47
|
+
transfers: TransferItem[];
|
|
48
|
+
private transferSeq;
|
|
49
|
+
private transferQueue;
|
|
50
|
+
private transferQueueRunning;
|
|
51
|
+
constructor(injector: Injector, mcp: BianbuMcpService, notifications: NotificationsService, platform: PlatformService);
|
|
52
|
+
ngOnInit(): void;
|
|
53
|
+
get breadcrumbs(): string[];
|
|
54
|
+
get selectedItem(): any | null;
|
|
55
|
+
onDocumentClick(): void;
|
|
56
|
+
onKeyDown(event: KeyboardEvent): void;
|
|
57
|
+
refresh(): Promise<void>;
|
|
58
|
+
applyFilter(): void;
|
|
59
|
+
navigateToInput(): void;
|
|
60
|
+
navigate(path: string, pushHistory?: boolean): void;
|
|
61
|
+
navigateBreadcrumb(index: number): void;
|
|
62
|
+
goBack(): void;
|
|
63
|
+
goForward(): void;
|
|
64
|
+
goUp(): void;
|
|
65
|
+
moveSelection(delta: number): void;
|
|
66
|
+
selectItem(item: any): void;
|
|
67
|
+
openItem(item: any): Promise<void>;
|
|
68
|
+
saveSelected(): Promise<void>;
|
|
69
|
+
openCreateDirectoryPrompt(): void;
|
|
70
|
+
openCreateFilePrompt(): void;
|
|
71
|
+
openRenamePrompt(item: any): void;
|
|
72
|
+
closePrompt(): void;
|
|
73
|
+
confirmPrompt(): Promise<void>;
|
|
74
|
+
createDirectory(name: string): Promise<void>;
|
|
75
|
+
createFile(name: string): Promise<void>;
|
|
76
|
+
renameItem(item: any, name: string): Promise<void>;
|
|
77
|
+
deleteItem(item: any): Promise<void>;
|
|
78
|
+
showContextMenu(event: MouseEvent, item: any): void;
|
|
79
|
+
hideContextMenu(): void;
|
|
80
|
+
uploadFile(event: Event): Promise<void>;
|
|
81
|
+
private createTransfer;
|
|
82
|
+
cancelTransfer(transfer: TransferItem): void;
|
|
83
|
+
transferPercent(transfer: TransferItem): number | null;
|
|
84
|
+
transferRate(transfer: TransferItem): string;
|
|
85
|
+
uploadDroppedFile(file: File): Promise<void>;
|
|
86
|
+
onDragOver(event: DragEvent): void;
|
|
87
|
+
onDragLeave(): void;
|
|
88
|
+
onDrop(event: DragEvent): Promise<void>;
|
|
89
|
+
downloadSelected(): Promise<void>;
|
|
90
|
+
private enqueueUpload;
|
|
91
|
+
private enqueueDownload;
|
|
92
|
+
private queueTransferJob;
|
|
93
|
+
private pumpTransferQueue;
|
|
94
|
+
private runUploadTransfer;
|
|
95
|
+
private runDownloadTransfer;
|
|
96
|
+
private clearPreview;
|
|
97
|
+
private baseName;
|
|
98
|
+
private isTextLike;
|
|
99
|
+
private joinPath;
|
|
100
|
+
private uint8ToBase64;
|
|
101
|
+
private base64ToUint8;
|
|
102
|
+
private readFileAsBase64;
|
|
103
|
+
}
|
|
104
|
+
export {};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export default class BianbuMcpModule {
|
|
2
|
-
}
|
|
1
|
+
export default class BianbuMcpModule {
|
|
2
|
+
}
|