aisc-cli 0.1.9__tar.gz → 0.1.10__tar.gz
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.
- {aisc_cli-0.1.9/src/aisc_cli.egg-info → aisc_cli-0.1.10}/PKG-INFO +2 -2
- {aisc_cli-0.1.9 → aisc_cli-0.1.10}/README.md +1 -1
- aisc_cli-0.1.10/src/aisc/VERSION +1 -0
- {aisc_cli-0.1.9 → aisc_cli-0.1.10}/src/aisc/application/bundle_fetch.py +144 -3
- {aisc_cli-0.1.9 → aisc_cli-0.1.10}/src/aisc/application/conversation.py +73 -36
- {aisc_cli-0.1.9 → aisc_cli-0.1.10}/src/aisc/application/doctor.py +3 -0
- {aisc_cli-0.1.9 → aisc_cli-0.1.10}/src/aisc/application/extensions.py +118 -9
- {aisc_cli-0.1.9 → aisc_cli-0.1.10}/src/aisc/application/tool_versions.py +2 -1
- aisc_cli-0.1.10/src/aisc/application/update_health.py +94 -0
- {aisc_cli-0.1.9 → aisc_cli-0.1.10}/src/aisc/cli/commands/build.py +132 -1
- {aisc_cli-0.1.9 → aisc_cli-0.1.10}/src/aisc/cli/commands/extensions.py +101 -0
- {aisc_cli-0.1.9 → aisc_cli-0.1.10}/src/aisc/cli/main.py +69 -0
- {aisc_cli-0.1.9 → aisc_cli-0.1.10}/src/aisc/domain/cc_switch_release.py +2 -2
- {aisc_cli-0.1.9 → aisc_cli-0.1.10}/src/aisc/domain/models.py +9 -1
- {aisc_cli-0.1.9 → aisc_cli-0.1.10/src/aisc_cli.egg-info}/PKG-INFO +2 -2
- {aisc_cli-0.1.9 → aisc_cli-0.1.10}/src/aisc_cli.egg-info/SOURCES.txt +1 -0
- aisc_cli-0.1.9/src/aisc/VERSION +0 -1
- {aisc_cli-0.1.9 → aisc_cli-0.1.10}/LICENSE +0 -0
- {aisc_cli-0.1.9 → aisc_cli-0.1.10}/MANIFEST.in +0 -0
- {aisc_cli-0.1.9 → aisc_cli-0.1.10}/pyproject.toml +0 -0
- {aisc_cli-0.1.9 → aisc_cli-0.1.10}/setup.cfg +0 -0
- {aisc_cli-0.1.9 → aisc_cli-0.1.10}/src/aisc/__init__.py +0 -0
- {aisc_cli-0.1.9 → aisc_cli-0.1.10}/src/aisc/__main__.py +0 -0
- {aisc_cli-0.1.9 → aisc_cli-0.1.10}/src/aisc/adapters/__init__.py +0 -0
- {aisc_cli-0.1.9 → aisc_cli-0.1.10}/src/aisc/adapters/config_reader.py +0 -0
- {aisc_cli-0.1.9 → aisc_cli-0.1.10}/src/aisc/adapters/container_registry.py +0 -0
- {aisc_cli-0.1.9 → aisc_cli-0.1.10}/src/aisc/adapters/data_root_store.py +0 -0
- {aisc_cli-0.1.9 → aisc_cli-0.1.10}/src/aisc/adapters/docker_.py +0 -0
- {aisc_cli-0.1.9 → aisc_cli-0.1.10}/src/aisc/adapters/docker_gateway.py +0 -0
- {aisc_cli-0.1.9 → aisc_cli-0.1.10}/src/aisc/adapters/docker_sdk_backed.py +0 -0
- {aisc_cli-0.1.9 → aisc_cli-0.1.10}/src/aisc/adapters/maintenance_lock.py +0 -0
- {aisc_cli-0.1.9 → aisc_cli-0.1.10}/src/aisc/adapters/state_file.py +0 -0
- {aisc_cli-0.1.9 → aisc_cli-0.1.10}/src/aisc/adapters/system.py +0 -0
- {aisc_cli-0.1.9 → aisc_cli-0.1.10}/src/aisc/adapters/windows_config_reader.py +0 -0
- {aisc_cli-0.1.9 → aisc_cli-0.1.10}/src/aisc/adapters/workspace_lease_store.py +0 -0
- {aisc_cli-0.1.9 → aisc_cli-0.1.10}/src/aisc/application/__init__.py +0 -0
- {aisc_cli-0.1.9 → aisc_cli-0.1.10}/src/aisc/application/artifact.py +0 -0
- {aisc_cli-0.1.9 → aisc_cli-0.1.10}/src/aisc/application/cc_switch_provider.py +0 -0
- {aisc_cli-0.1.9 → aisc_cli-0.1.10}/src/aisc/application/cc_switch_resolver.py +0 -0
- {aisc_cli-0.1.9 → aisc_cli-0.1.10}/src/aisc/application/config_service.py +0 -0
- {aisc_cli-0.1.9 → aisc_cli-0.1.10}/src/aisc/application/data_migration.py +0 -0
- {aisc_cli-0.1.9 → aisc_cli-0.1.10}/src/aisc/application/data_root.py +0 -0
- {aisc_cli-0.1.9 → aisc_cli-0.1.10}/src/aisc/application/docker_lifecycle.py +0 -0
- {aisc_cli-0.1.9 → aisc_cli-0.1.10}/src/aisc/application/legacy_scan.py +0 -0
- {aisc_cli-0.1.9 → aisc_cli-0.1.10}/src/aisc/application/network_subscription.py +0 -0
- {aisc_cli-0.1.9 → aisc_cli-0.1.10}/src/aisc/application/profile_service.py +0 -0
- {aisc_cli-0.1.9 → aisc_cli-0.1.10}/src/aisc/application/provider.py +0 -0
- {aisc_cli-0.1.9 → aisc_cli-0.1.10}/src/aisc/application/repair.py +0 -0
- {aisc_cli-0.1.9 → aisc_cli-0.1.10}/src/aisc/application/resources.py +0 -0
- {aisc_cli-0.1.9 → aisc_cli-0.1.10}/src/aisc/application/runtime.py +0 -0
- {aisc_cli-0.1.9 → aisc_cli-0.1.10}/src/aisc/application/session.py +0 -0
- {aisc_cli-0.1.9 → aisc_cli-0.1.10}/src/aisc/application/toolchain.py +0 -0
- {aisc_cli-0.1.9 → aisc_cli-0.1.10}/src/aisc/application/update.py +0 -0
- {aisc_cli-0.1.9 → aisc_cli-0.1.10}/src/aisc/application/usage.py +0 -0
- {aisc_cli-0.1.9 → aisc_cli-0.1.10}/src/aisc/application/version.py +0 -0
- {aisc_cli-0.1.9 → aisc_cli-0.1.10}/src/aisc/application/web_gateway.py +0 -0
- {aisc_cli-0.1.9 → aisc_cli-0.1.10}/src/aisc/application/work_collection.py +0 -0
- {aisc_cli-0.1.9 → aisc_cli-0.1.10}/src/aisc/application/worklog.py +0 -0
- {aisc_cli-0.1.9 → aisc_cli-0.1.10}/src/aisc/application/workspace_reconcile.py +0 -0
- {aisc_cli-0.1.9 → aisc_cli-0.1.10}/src/aisc/applog.py +0 -0
- {aisc_cli-0.1.9 → aisc_cli-0.1.10}/src/aisc/cli/__init__.py +0 -0
- {aisc_cli-0.1.9 → aisc_cli-0.1.10}/src/aisc/cli/build_progress_parser.py +0 -0
- {aisc_cli-0.1.9 → aisc_cli-0.1.10}/src/aisc/cli/commands/__init__.py +0 -0
- {aisc_cli-0.1.9 → aisc_cli-0.1.10}/src/aisc/cli/commands/agents.py +0 -0
- {aisc_cli-0.1.9 → aisc_cli-0.1.10}/src/aisc/cli/commands/artifact.py +0 -0
- {aisc_cli-0.1.9 → aisc_cli-0.1.10}/src/aisc/cli/commands/bundle.py +0 -0
- {aisc_cli-0.1.9 → aisc_cli-0.1.10}/src/aisc/cli/commands/cc_switch.py +0 -0
- {aisc_cli-0.1.9 → aisc_cli-0.1.10}/src/aisc/cli/commands/config.py +0 -0
- {aisc_cli-0.1.9 → aisc_cli-0.1.10}/src/aisc/cli/commands/container.py +0 -0
- {aisc_cli-0.1.9 → aisc_cli-0.1.10}/src/aisc/cli/commands/conversation.py +0 -0
- {aisc_cli-0.1.9 → aisc_cli-0.1.10}/src/aisc/cli/commands/data_root.py +0 -0
- {aisc_cli-0.1.9 → aisc_cli-0.1.10}/src/aisc/cli/commands/logs.py +0 -0
- {aisc_cli-0.1.9 → aisc_cli-0.1.10}/src/aisc/cli/commands/network.py +0 -0
- {aisc_cli-0.1.9 → aisc_cli-0.1.10}/src/aisc/cli/commands/profile.py +0 -0
- {aisc_cli-0.1.9 → aisc_cli-0.1.10}/src/aisc/cli/commands/provider.py +0 -0
- {aisc_cli-0.1.9 → aisc_cli-0.1.10}/src/aisc/cli/commands/run.py +0 -0
- {aisc_cli-0.1.9 → aisc_cli-0.1.10}/src/aisc/cli/commands/runs.py +0 -0
- {aisc_cli-0.1.9 → aisc_cli-0.1.10}/src/aisc/cli/commands/runtime.py +0 -0
- {aisc_cli-0.1.9 → aisc_cli-0.1.10}/src/aisc/cli/commands/serve.py +0 -0
- {aisc_cli-0.1.9 → aisc_cli-0.1.10}/src/aisc/cli/commands/serve_fs.py +0 -0
- {aisc_cli-0.1.9 → aisc_cli-0.1.10}/src/aisc/cli/commands/session.py +0 -0
- {aisc_cli-0.1.9 → aisc_cli-0.1.10}/src/aisc/cli/commands/update.py +0 -0
- {aisc_cli-0.1.9 → aisc_cli-0.1.10}/src/aisc/cli/commands/usage.py +0 -0
- {aisc_cli-0.1.9 → aisc_cli-0.1.10}/src/aisc/cli/commands/wizard.py +0 -0
- {aisc_cli-0.1.9 → aisc_cli-0.1.10}/src/aisc/cli/commands/work_record.py +0 -0
- {aisc_cli-0.1.9 → aisc_cli-0.1.10}/src/aisc/cli/commands/worklog.py +0 -0
- {aisc_cli-0.1.9 → aisc_cli-0.1.10}/src/aisc/cli/commands/workspaces.py +0 -0
- {aisc_cli-0.1.9 → aisc_cli-0.1.10}/src/aisc/cli/help_i18n.py +0 -0
- {aisc_cli-0.1.9 → aisc_cli-0.1.10}/src/aisc/cli/output.py +0 -0
- {aisc_cli-0.1.9 → aisc_cli-0.1.10}/src/aisc/cli/tutorial.py +0 -0
- {aisc_cli-0.1.9 → aisc_cli-0.1.10}/src/aisc/domain/__init__.py +0 -0
- {aisc_cli-0.1.9 → aisc_cli-0.1.10}/src/aisc/domain/artifacts.py +0 -0
- {aisc_cli-0.1.9 → aisc_cli-0.1.10}/src/aisc/domain/config.py +0 -0
- {aisc_cli-0.1.9 → aisc_cli-0.1.10}/src/aisc/domain/data_migration.py +0 -0
- {aisc_cli-0.1.9 → aisc_cli-0.1.10}/src/aisc/domain/data_root.py +0 -0
- {aisc_cli-0.1.9 → aisc_cli-0.1.10}/src/aisc/domain/docker_ownership.py +0 -0
- {aisc_cli-0.1.9 → aisc_cli-0.1.10}/src/aisc/domain/gateway.py +0 -0
- {aisc_cli-0.1.9 → aisc_cli-0.1.10}/src/aisc/domain/toolchain.py +0 -0
- {aisc_cli-0.1.9 → aisc_cli-0.1.10}/src/aisc/domain/web_services.py +0 -0
- {aisc_cli-0.1.9 → aisc_cli-0.1.10}/src/aisc/domain/workspace_lease.py +0 -0
- {aisc_cli-0.1.9 → aisc_cli-0.1.10}/src/aisc/schemas/__init__.py +0 -0
- {aisc_cli-0.1.9 → aisc_cli-0.1.10}/src/aisc/schemas/config_schema.py +0 -0
- {aisc_cli-0.1.9 → aisc_cli-0.1.10}/src/aisc_cli.egg-info/dependency_links.txt +0 -0
- {aisc_cli-0.1.9 → aisc_cli-0.1.10}/src/aisc_cli.egg-info/entry_points.txt +0 -0
- {aisc_cli-0.1.9 → aisc_cli-0.1.10}/src/aisc_cli.egg-info/requires.txt +0 -0
- {aisc_cli-0.1.9 → aisc_cli-0.1.10}/src/aisc_cli.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: aisc-cli
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.10
|
|
4
4
|
Summary: AISC CLI — Super Claude workstation management
|
|
5
5
|
Author: AISC contributors
|
|
6
6
|
License-Expression: MIT
|
|
@@ -116,7 +116,7 @@ AISC 尚未代码签名。SmartScreen 提示时,请先确认文件来自项目
|
|
|
116
116
|
- **多工作区**:最多同时打开 3 个工作区,页签条切换;关闭即自动停止并清理对应容器。顶栏「关闭工作区」可随时回到选择页重选(清理运行环境,窗口保留)。
|
|
117
117
|
- **彻底忘记工作区**:工作区历史右键 -> 彻底忘记,单事务清理 AISC 数据根内该工作区的状态与记录(容器先停止删除,失败自动回滚);你磁盘上的原始文件永不被触碰。
|
|
118
118
|
- **诊断**:任何页面可打开诊断对话框(环境检查、最近日志、导出诊断包)。
|
|
119
|
-
-
|
|
119
|
+
- **应用自更新**:Windows 设置页「检查更新」→「下载更新」,校验完成后点击「退出更新」并确认,资源管理器选中安装包、正常打开安装向导后 Workbench 退出;可按向导完成更新。下载完成本身不会退出,取消或启动失败仍保留应用。其他平台按提示手动安装。
|
|
120
120
|
|
|
121
121
|
### Provider 模板清单
|
|
122
122
|
|
|
@@ -85,7 +85,7 @@ AISC 尚未代码签名。SmartScreen 提示时,请先确认文件来自项目
|
|
|
85
85
|
- **多工作区**:最多同时打开 3 个工作区,页签条切换;关闭即自动停止并清理对应容器。顶栏「关闭工作区」可随时回到选择页重选(清理运行环境,窗口保留)。
|
|
86
86
|
- **彻底忘记工作区**:工作区历史右键 -> 彻底忘记,单事务清理 AISC 数据根内该工作区的状态与记录(容器先停止删除,失败自动回滚);你磁盘上的原始文件永不被触碰。
|
|
87
87
|
- **诊断**:任何页面可打开诊断对话框(环境检查、最近日志、导出诊断包)。
|
|
88
|
-
-
|
|
88
|
+
- **应用自更新**:Windows 设置页「检查更新」→「下载更新」,校验完成后点击「退出更新」并确认,资源管理器选中安装包、正常打开安装向导后 Workbench 退出;可按向导完成更新。下载完成本身不会退出,取消或启动失败仍保留应用。其他平台按提示手动安装。
|
|
89
89
|
|
|
90
90
|
### Provider 模板清单
|
|
91
91
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
0.1.10
|
|
@@ -23,6 +23,7 @@ Two halves:
|
|
|
23
23
|
from __future__ import annotations
|
|
24
24
|
|
|
25
25
|
import hashlib
|
|
26
|
+
import gzip
|
|
26
27
|
import json
|
|
27
28
|
import os
|
|
28
29
|
import re
|
|
@@ -35,6 +36,7 @@ import time
|
|
|
35
36
|
import urllib.error
|
|
36
37
|
import urllib.request
|
|
37
38
|
import zipfile
|
|
39
|
+
import zlib
|
|
38
40
|
from pathlib import Path
|
|
39
41
|
from typing import Any, Callable, Dict, List, Optional, Sequence, Set, Tuple
|
|
40
42
|
|
|
@@ -350,6 +352,8 @@ def verify_staged_bundle(bundle_root: Path) -> List[str]:
|
|
|
350
352
|
else:
|
|
351
353
|
errors.append("container/Dockerfile missing")
|
|
352
354
|
errors.extend(_verify_vendor_checksums(bundle_root))
|
|
355
|
+
errors.extend(_verify_npm_presets(bundle_root))
|
|
356
|
+
errors.extend(_verify_yazi_payload(bundle_root))
|
|
353
357
|
errors.extend(_audit_forbidden(bundle_root))
|
|
354
358
|
if not (bundle_root / "container" / "_bundle" / "plugins").exists():
|
|
355
359
|
errors.append("container/_bundle/plugins missing")
|
|
@@ -358,6 +362,140 @@ def verify_staged_bundle(bundle_root: Path) -> List[str]:
|
|
|
358
362
|
return errors
|
|
359
363
|
|
|
360
364
|
|
|
365
|
+
def _verify_npm_presets(bundle_root: Path) -> List[str]:
|
|
366
|
+
"""Check ignored native payloads too: filenames alone cannot prove pairing.
|
|
367
|
+
|
|
368
|
+
Companions may be absent (the pinned online fallback remains supported),
|
|
369
|
+
but every payload included in a bundle must match its factory main package.
|
|
370
|
+
"""
|
|
371
|
+
from aisc.application.tool_versions import _parse_env_file
|
|
372
|
+
|
|
373
|
+
pins = _parse_env_file(bundle_root / "config" / "versions.env")
|
|
374
|
+
dl = bundle_root / "container" / "downloads"
|
|
375
|
+
errors: List[str] = []
|
|
376
|
+
|
|
377
|
+
def metadata(path: Path) -> dict:
|
|
378
|
+
# tarfile can stop at the tar EOF before gzip validates its trailer.
|
|
379
|
+
# Drain the compression stream so truncated/CRC-damaged companions
|
|
380
|
+
# cannot pass merely because their package.json is still readable.
|
|
381
|
+
with gzip.open(path, "rb") as compressed:
|
|
382
|
+
while compressed.read(1024 * 1024):
|
|
383
|
+
pass
|
|
384
|
+
with tarfile.open(path, "r:gz") as archive:
|
|
385
|
+
member = archive.getmember("package/package.json")
|
|
386
|
+
if not member.isfile() or member.size > 1024 * 1024:
|
|
387
|
+
raise ValueError("invalid package metadata member")
|
|
388
|
+
stream = archive.extractfile(member)
|
|
389
|
+
if stream is None:
|
|
390
|
+
raise ValueError("missing package metadata")
|
|
391
|
+
data = json.load(stream)
|
|
392
|
+
if not isinstance(data, dict):
|
|
393
|
+
raise ValueError("package metadata must be an object")
|
|
394
|
+
return data
|
|
395
|
+
|
|
396
|
+
for prefix, name, key in (("codex", "@openai/codex", "CODEX_VERSION"),
|
|
397
|
+
("claude-code", "@anthropic-ai/claude-code", "CLAUDE_CODE_VERSION")):
|
|
398
|
+
payloads = list(dl.glob(f"{prefix}-*.tgz"))
|
|
399
|
+
if not payloads:
|
|
400
|
+
continue
|
|
401
|
+
version = pins.get(key, "")
|
|
402
|
+
main = dl / f"{prefix}-{version}.tgz"
|
|
403
|
+
try:
|
|
404
|
+
meta = metadata(main)
|
|
405
|
+
if (meta.get("name"), meta.get("version")) != (name, version):
|
|
406
|
+
raise ValueError("main metadata differs from factory pin")
|
|
407
|
+
allowed = {main.name: (name, version)}
|
|
408
|
+
optional = meta.get("optionalDependencies") or {}
|
|
409
|
+
for arch in ("x64", "arm64"):
|
|
410
|
+
dependency = f"{name}-linux-{arch}"
|
|
411
|
+
spec = optional.get(dependency)
|
|
412
|
+
if not isinstance(spec, str) or not spec:
|
|
413
|
+
continue
|
|
414
|
+
if spec.startswith("npm:"):
|
|
415
|
+
package_name, _, package_version = spec[4:].rpartition("@")
|
|
416
|
+
else:
|
|
417
|
+
package_name, package_version = dependency, spec
|
|
418
|
+
allowed[f"{prefix}-linux-{arch}-{package_version}.tgz"] = (package_name, package_version)
|
|
419
|
+
for path in payloads:
|
|
420
|
+
expected = allowed.get(path.name)
|
|
421
|
+
if expected is None:
|
|
422
|
+
errors.append(f"npm preset stale or unexpected: {path.name}")
|
|
423
|
+
continue
|
|
424
|
+
actual = meta if path == main else metadata(path)
|
|
425
|
+
if (actual.get("name"), actual.get("version")) != expected:
|
|
426
|
+
errors.append(f"npm preset metadata mismatch: {path.name}")
|
|
427
|
+
except (OSError, EOFError, zlib.error, tarfile.TarError, KeyError, ValueError, AttributeError) as exc:
|
|
428
|
+
errors.append(f"npm preset {prefix} invalid: {exc}")
|
|
429
|
+
return errors
|
|
430
|
+
|
|
431
|
+
|
|
432
|
+
def _verify_yazi_payload(bundle_root: Path) -> List[str]:
|
|
433
|
+
"""Require exactly one officially pinned yazi payload for the target arch."""
|
|
434
|
+
from aisc.application.tool_versions import _parse_env_file
|
|
435
|
+
|
|
436
|
+
pins = _parse_env_file(bundle_root / "config" / "versions.env")
|
|
437
|
+
version = str(pins.get("YAZI_VERSION", "")).removeprefix("v").strip()
|
|
438
|
+
expected = {
|
|
439
|
+
f"yazi-{arch}-unknown-linux-musl-v{version}.zip": (
|
|
440
|
+
str(pins.get(hash_key, "")).strip().lower(),
|
|
441
|
+
str(pins.get(size_key, "")).strip(),
|
|
442
|
+
arch,
|
|
443
|
+
)
|
|
444
|
+
for arch, hash_key, size_key in (
|
|
445
|
+
("x86_64", "YAZI_X86_64_SHA256", "YAZI_X86_64_BYTES"),
|
|
446
|
+
("aarch64", "YAZI_ARM64_SHA256", "YAZI_ARM64_BYTES"),
|
|
447
|
+
)
|
|
448
|
+
}
|
|
449
|
+
errors: List[str] = []
|
|
450
|
+
if not version or not re.fullmatch(r"[0-9]+\.[0-9]+\.[0-9]+", version):
|
|
451
|
+
errors.append("yazi payload version pin invalid")
|
|
452
|
+
return errors
|
|
453
|
+
for name, (digest, size, _arch) in expected.items():
|
|
454
|
+
if not re.fullmatch(r"[0-9a-f]{64}", digest):
|
|
455
|
+
errors.append(f"yazi payload digest pin invalid: {name}")
|
|
456
|
+
if not size.isdigit():
|
|
457
|
+
errors.append(f"yazi payload size pin invalid: {name}")
|
|
458
|
+
if errors:
|
|
459
|
+
return errors
|
|
460
|
+
|
|
461
|
+
downloads = bundle_root / "container" / "downloads"
|
|
462
|
+
found = {
|
|
463
|
+
path.name
|
|
464
|
+
for path in downloads.glob("yazi-*.zip")
|
|
465
|
+
if path.is_file()
|
|
466
|
+
}
|
|
467
|
+
targets = sorted(found & expected.keys())
|
|
468
|
+
if len(targets) != 1:
|
|
469
|
+
errors.append(
|
|
470
|
+
"bundle target yazi payload missing"
|
|
471
|
+
if not targets
|
|
472
|
+
else "bundle must contain exactly one target-architecture yazi payload"
|
|
473
|
+
)
|
|
474
|
+
if len(targets) > 1:
|
|
475
|
+
errors.append(f"duplicate target yazi payloads: {', '.join(targets)}")
|
|
476
|
+
for name in sorted(found - expected.keys()):
|
|
477
|
+
errors.append(f"unexpected yazi payload: {name}")
|
|
478
|
+
for name in targets:
|
|
479
|
+
path = downloads / name
|
|
480
|
+
digest, size, _arch = expected[name]
|
|
481
|
+
actual_digest = _sha256_file(path)
|
|
482
|
+
if actual_digest != digest:
|
|
483
|
+
errors.append(
|
|
484
|
+
f"yazi payload hash mismatch: {name}: expected {digest[:16]}..., "
|
|
485
|
+
f"got {actual_digest[:16]}..."
|
|
486
|
+
)
|
|
487
|
+
try:
|
|
488
|
+
actual_size = str(path.stat().st_size)
|
|
489
|
+
except OSError as exc:
|
|
490
|
+
errors.append(f"yazi payload unreadable: {name}: {exc}")
|
|
491
|
+
continue
|
|
492
|
+
if actual_size != size:
|
|
493
|
+
errors.append(
|
|
494
|
+
f"yazi payload size mismatch: {name}: expected {size}, got {actual_size}"
|
|
495
|
+
)
|
|
496
|
+
return errors
|
|
497
|
+
|
|
498
|
+
|
|
361
499
|
def _audit_forbidden(bundle_root: Path) -> List[str]:
|
|
362
500
|
es = []
|
|
363
501
|
for dp, dns, fns in os.walk(str(bundle_root)):
|
|
@@ -452,10 +590,13 @@ def bundle_compatible(bundle_root: Path, cli_version: str) -> Tuple[bool, str]:
|
|
|
452
590
|
mp = bundle_root / "manifest.json"
|
|
453
591
|
try:
|
|
454
592
|
m = json.loads(mp.read_text(encoding="utf-8"))
|
|
455
|
-
except (OSError, json.JSONDecodeError) as exc:
|
|
593
|
+
except (OSError, UnicodeError, json.JSONDecodeError) as exc:
|
|
456
594
|
return False, f"manifest unreadable: {exc}"
|
|
457
|
-
if m
|
|
458
|
-
return False,
|
|
595
|
+
if not isinstance(m, dict):
|
|
596
|
+
return False, "manifest must be a JSON object"
|
|
597
|
+
schema = m.get("schema_version")
|
|
598
|
+
if type(schema) is not int or schema != 1:
|
|
599
|
+
return False, f"manifest schema_version={schema!r}, expected integer 1"
|
|
459
600
|
compat = m.get("compatible_cli_versions")
|
|
460
601
|
if not isinstance(compat, list) or not all(isinstance(v, str) for v in compat):
|
|
461
602
|
return False, "manifest compatible_cli_versions malformed"
|
|
@@ -9,9 +9,10 @@ filename carries the id).
|
|
|
9
9
|
Oversized files (>10MB) are never fully parsed: a streaming head scan of
|
|
10
10
|
the first 200 parseable lines yields title/time, ``message_count`` stays
|
|
11
11
|
``null`` and the entry is annotated ``file_too_large``. Malformed JSON
|
|
12
|
-
lines are skipped
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
lines are skipped. R4: scan limits and a damaged tail do not disable native
|
|
13
|
+
provider resume for a file with parseable user messages. The reader reports
|
|
14
|
+
malformed/omitted entries; provider files stay untouched. Entries with zero
|
|
15
|
+
parseable user messages are excluded.
|
|
15
16
|
|
|
16
17
|
D-5 (decisions.md): conversation ids are provider-native — Codex uses
|
|
17
18
|
time-ordered UUIDv7 in the wild (see the frozen T0 codex fixtures), so id
|
|
@@ -22,6 +23,7 @@ still rejected (the check's stated intent).
|
|
|
22
23
|
from __future__ import annotations
|
|
23
24
|
|
|
24
25
|
import json
|
|
26
|
+
from collections import deque
|
|
25
27
|
import os
|
|
26
28
|
import re
|
|
27
29
|
from dataclasses import dataclass
|
|
@@ -303,16 +305,9 @@ def _summarize(agent: str, conv_id: str, file_size: int,
|
|
|
303
305
|
excluded from the list (zero parseable user messages)."""
|
|
304
306
|
if scan.user_messages == 0:
|
|
305
307
|
return None
|
|
306
|
-
resumable = True
|
|
307
|
-
reason: Optional[str] = None
|
|
308
308
|
message_count: Optional[int] = scan.user_messages
|
|
309
309
|
if file_size > MAX_JSONL_BYTES:
|
|
310
|
-
resumable = False
|
|
311
|
-
reason = "file_too_large"
|
|
312
310
|
message_count = None # head scan only — a full count was not taken
|
|
313
|
-
elif scan.malformed_seen:
|
|
314
|
-
resumable = False
|
|
315
|
-
reason = "malformed"
|
|
316
311
|
entry: Dict[str, Any] = {
|
|
317
312
|
"conversation_id": conv_id,
|
|
318
313
|
"agent": agent,
|
|
@@ -321,11 +316,11 @@ def _summarize(agent: str, conv_id: str, file_size: int,
|
|
|
321
316
|
"last_at": scan.last_ts,
|
|
322
317
|
"message_count": message_count,
|
|
323
318
|
"file_size": file_size,
|
|
324
|
-
|
|
319
|
+
# The list's parser budget is not a provider resume limit. A partial
|
|
320
|
+
# final write after a crash must not grey out the Resume action.
|
|
321
|
+
"resumable": True,
|
|
325
322
|
"parent_thread_id": scan.parent_thread_id,
|
|
326
323
|
}
|
|
327
|
-
if not resumable:
|
|
328
|
-
entry["unavailable_reason"] = reason
|
|
329
324
|
return entry
|
|
330
325
|
|
|
331
326
|
|
|
@@ -574,9 +569,9 @@ def rename_conversation(workspace: str, conversation_id: str, agent: str,
|
|
|
574
569
|
# ---------------------------------------------------------------------------
|
|
575
570
|
|
|
576
571
|
CONVERSATION_READ_SCHEMA = "aisc.conversation-read/v1"
|
|
577
|
-
_READ_TEXT_CAP =
|
|
578
|
-
_READ_REASONING_CAP =
|
|
579
|
-
_READ_TOOL_CAP =
|
|
572
|
+
_READ_TEXT_CAP = 256_000 # preserve complete long-form Markdown answers
|
|
573
|
+
_READ_REASONING_CAP = 32_000
|
|
574
|
+
_READ_TOOL_CAP = 32_000
|
|
580
575
|
_READ_MAX_MESSAGES = 4000 # hard bound on the rendered stream
|
|
581
576
|
|
|
582
577
|
|
|
@@ -635,6 +630,29 @@ def _read_summary_text(summary: Any) -> Optional[str]:
|
|
|
635
630
|
return None
|
|
636
631
|
|
|
637
632
|
|
|
633
|
+
def _read_attachment(block: Dict[str, Any]) -> Dict[str, Any]:
|
|
634
|
+
"""Keep non-text objects visible without interpreting executable content."""
|
|
635
|
+
bt = str(block.get("type", "attachment"))
|
|
636
|
+
kind = "image" if "image" in bt else "audio" if "audio" in bt else "video" if "video" in bt else "file"
|
|
637
|
+
source = block.get("source")
|
|
638
|
+
source = source if isinstance(source, dict) else {}
|
|
639
|
+
url = block.get("image_url") or block.get("file_url") or block.get("url") or source.get("url") or block.get("path")
|
|
640
|
+
if isinstance(url, dict):
|
|
641
|
+
url = url.get("url")
|
|
642
|
+
mime = source.get("media_type") or block.get("mime_type")
|
|
643
|
+
if source.get("type") == "base64" and isinstance(source.get("data"), str) and isinstance(mime, str):
|
|
644
|
+
url = f"data:{mime};base64,{source['data']}"
|
|
645
|
+
attachment: Dict[str, Any] = {
|
|
646
|
+
"kind": kind,
|
|
647
|
+
"name": _read_cap(block.get("filename") or block.get("title") or block.get("name") or bt, 256),
|
|
648
|
+
}
|
|
649
|
+
if isinstance(url, str) and len(url) <= 12_000_000:
|
|
650
|
+
attachment["url"] = url
|
|
651
|
+
else:
|
|
652
|
+
attachment["detail"] = _read_cap(_read_as_text(block), _READ_TOOL_CAP)
|
|
653
|
+
return attachment
|
|
654
|
+
|
|
655
|
+
|
|
638
656
|
def _read_entries_codex(obj: Dict[str, Any]) -> List[Dict[str, Any]]:
|
|
639
657
|
"""One codex rollout line → zero or more rendered entries. Rendered:
|
|
640
658
|
user/assistant messages, reasoning summaries, function calls/results.
|
|
@@ -649,39 +667,44 @@ def _read_entries_codex(obj: Dict[str, Any]) -> List[Dict[str, Any]]:
|
|
|
649
667
|
kind = payload.get("type")
|
|
650
668
|
if kind == "message":
|
|
651
669
|
role = payload.get("role")
|
|
652
|
-
if role
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
if
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
670
|
+
if role not in ("user", "assistant"):
|
|
671
|
+
return []
|
|
672
|
+
content = payload.get("content")
|
|
673
|
+
text = _read_join_text(content, "input_text" if role == "user" else "output_text") or ""
|
|
674
|
+
if role == "user" and _CONTEXT_TITLE_RE.match(text.lstrip()):
|
|
675
|
+
return []
|
|
676
|
+
attachments = [_read_attachment(b) for b in content if isinstance(b, dict) and b.get("type") not in ("input_text", "output_text")] if isinstance(content, list) else []
|
|
677
|
+
if not text.strip() and not attachments:
|
|
678
|
+
return []
|
|
679
|
+
entry = {"role": role, "kind": "message", "text": text, "ts": ts}
|
|
680
|
+
if attachments:
|
|
681
|
+
entry["attachments"] = attachments
|
|
682
|
+
if isinstance(payload.get("phase"), str):
|
|
683
|
+
entry["phase"] = payload["phase"]
|
|
684
|
+
return [entry]
|
|
665
685
|
if kind == "reasoning":
|
|
666
686
|
text = _read_summary_text(payload.get("summary"))
|
|
667
687
|
if not text:
|
|
668
688
|
return []
|
|
669
689
|
return [{"role": "assistant", "kind": "reasoning", "text": text, "ts": ts}]
|
|
670
|
-
if kind
|
|
690
|
+
if kind in ("function_call", "custom_tool_call", "local_shell_call", "web_search_call"):
|
|
671
691
|
name = payload.get("name")
|
|
672
692
|
call_id = payload.get("call_id")
|
|
673
693
|
return [{
|
|
674
694
|
"role": "assistant", "kind": "tool_use",
|
|
675
695
|
"name": name if isinstance(name, str) else "tool",
|
|
676
|
-
"text": _read_as_text(payload.get("arguments")),
|
|
696
|
+
"text": _read_as_text(payload.get("arguments", payload.get("input", payload.get("action")))),
|
|
677
697
|
"call_id": call_id if isinstance(call_id, str) else None,
|
|
678
698
|
"ts": ts,
|
|
679
699
|
}]
|
|
680
|
-
if kind
|
|
700
|
+
if kind in ("function_call_output", "custom_tool_call_output"):
|
|
681
701
|
call_id = payload.get("call_id")
|
|
702
|
+
output = payload.get("output")
|
|
703
|
+
attachments = [_read_attachment(b) for b in output if isinstance(b, dict) and b.get("type") not in ("text", "input_text", "output_text")] if isinstance(output, list) else []
|
|
682
704
|
return [{
|
|
683
705
|
"role": "tool", "kind": "tool_result",
|
|
684
|
-
"text":
|
|
706
|
+
"text": _read_join_text(output, "text") if isinstance(output, list) else _read_as_text(output),
|
|
707
|
+
"attachments": attachments,
|
|
685
708
|
"call_id": call_id if isinstance(call_id, str) else None,
|
|
686
709
|
"ts": ts,
|
|
687
710
|
}]
|
|
@@ -738,13 +761,23 @@ def _read_entries_claude(obj: Dict[str, Any]) -> List[Dict[str, Any]]:
|
|
|
738
761
|
elif bt == "tool_result":
|
|
739
762
|
inner = block.get("content")
|
|
740
763
|
text = inner if isinstance(inner, str) else _read_join_text(inner, "text")
|
|
764
|
+
attachments = [_read_attachment(b) for b in inner if isinstance(b, dict) and b.get("type") != "text"] if isinstance(inner, list) else []
|
|
741
765
|
call_id = block.get("tool_use_id")
|
|
742
766
|
out.append({
|
|
743
767
|
"role": "tool", "kind": "tool_result",
|
|
744
768
|
"text": text,
|
|
769
|
+
"attachments": attachments,
|
|
745
770
|
"call_id": call_id if isinstance(call_id, str) else None,
|
|
746
771
|
"ts": ts,
|
|
747
772
|
})
|
|
773
|
+
elif bt != "redacted_thinking":
|
|
774
|
+
# Image-only user entries must remain a user turn too.
|
|
775
|
+
attachment = _read_attachment(block)
|
|
776
|
+
if out and out[-1]["kind"] == "message":
|
|
777
|
+
out[-1].setdefault("attachments", []).append(attachment)
|
|
778
|
+
else:
|
|
779
|
+
out.append({"role": role, "kind": "message", "text": "", "ts": ts,
|
|
780
|
+
"attachments": [attachment]})
|
|
748
781
|
return out
|
|
749
782
|
|
|
750
783
|
|
|
@@ -785,7 +818,8 @@ def read_conversation(workspace: str, conversation_id: str, agent: str,
|
|
|
785
818
|
error_code=ERROR_UNRESUMABLE,
|
|
786
819
|
)
|
|
787
820
|
extract = _READ_EXTRACTORS[agent]
|
|
788
|
-
entries:
|
|
821
|
+
entries: deque[Dict[str, Any]] = deque(maxlen=_READ_MAX_MESSAGES)
|
|
822
|
+
omitted_entries = 0
|
|
789
823
|
malformed_lines = 0
|
|
790
824
|
try:
|
|
791
825
|
fh = path.open("r", encoding="utf-8", errors="replace")
|
|
@@ -808,8 +842,8 @@ def read_conversation(workspace: str, conversation_id: str, agent: str,
|
|
|
808
842
|
if not isinstance(obj, dict):
|
|
809
843
|
continue
|
|
810
844
|
for entry in extract(obj):
|
|
811
|
-
if len(entries)
|
|
812
|
-
|
|
845
|
+
if len(entries) == _READ_MAX_MESSAGES:
|
|
846
|
+
omitted_entries += 1
|
|
813
847
|
entries.append(entry)
|
|
814
848
|
# Pair tool results into their calls (nearest preceding unmatched match);
|
|
815
849
|
# unpaired results stay standalone so nothing is silently dropped.
|
|
@@ -821,6 +855,8 @@ def read_conversation(workspace: str, conversation_id: str, agent: str,
|
|
|
821
855
|
call = open_calls.get(entry["call_id"])
|
|
822
856
|
if call is not None and "result" not in call:
|
|
823
857
|
call["result"] = entry.pop("text")
|
|
858
|
+
if entry.get("attachments"):
|
|
859
|
+
call["result_attachments"] = entry["attachments"]
|
|
824
860
|
entry["consumed"] = True
|
|
825
861
|
rendered = [e for e in entries if not e.get("consumed")]
|
|
826
862
|
for i, entry in enumerate(rendered):
|
|
@@ -854,4 +890,5 @@ def read_conversation(workspace: str, conversation_id: str, agent: str,
|
|
|
854
890
|
"messages": rendered[start:end],
|
|
855
891
|
"malformed_lines": malformed_lines,
|
|
856
892
|
"degraded_reason": "malformed" if malformed_lines else None,
|
|
893
|
+
"omitted_entries": omitted_entries,
|
|
857
894
|
}
|
|
@@ -781,6 +781,9 @@ def run_doctor(
|
|
|
781
781
|
# the pip install form has no repo, so the aisc-root WARN above is
|
|
782
782
|
# misleading there. This check names the fetch path explicitly.
|
|
783
783
|
checks.append(_check_bundle_store(root))
|
|
784
|
+
from aisc.application.update_health import pairing_check
|
|
785
|
+
|
|
786
|
+
checks.append(pairing_check(root))
|
|
784
787
|
|
|
785
788
|
# 6c. A8 (guide 3.5.5): channel + platform-support — multi-channel
|
|
786
789
|
# installs are the #1 "upgraded but still old version" confusion.
|
|
@@ -21,16 +21,43 @@ from aisc.application.cc_switch_provider import _SCOPE_WRAPPER
|
|
|
21
21
|
|
|
22
22
|
PROTOCOL = "aisc.extensions/v1"
|
|
23
23
|
ADAPTER_PATH = "/usr/local/bin/aisc-extensions-adapter"
|
|
24
|
+
UNSUPPORTED_OP = "AISC_ERR_EXTENSIONS_UNSUPPORTED_OP"
|
|
24
25
|
|
|
25
26
|
_OPS = (
|
|
26
27
|
"list", "toggle", "delete", "skill-install", "mcp-add",
|
|
27
28
|
"plugin-install", "plugin-uninstall", "plugin-update",
|
|
28
|
-
"skill-search", "deeplink", "skill-repo-add",
|
|
29
|
-
"skill-
|
|
30
|
-
"
|
|
29
|
+
"skill-install-group", "skill-search", "skill-describe", "deeplink", "skill-repo-add",
|
|
30
|
+
"skill-repos-list", "skill-repo-remove", "skill-update-group",
|
|
31
|
+
"skill-update", "plugin-market-list", "plugin-market-add",
|
|
32
|
+
"plugin-market-remove", "plugin-search",
|
|
33
|
+
"mcp-search", "mcp-market-install", "updates-check",
|
|
31
34
|
)
|
|
32
35
|
_KINDS = ("skills", "mcp", "plugins")
|
|
33
36
|
_AGENTS = ("claude", "codex")
|
|
37
|
+
_SOURCE_MAINTENANCE_OPS = frozenset({
|
|
38
|
+
"skill-repos-list", "skill-repo-remove",
|
|
39
|
+
"plugin-market-list", "plugin-market-add", "plugin-market-remove",
|
|
40
|
+
})
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
def _legacy_argparse_source_unsupported(op: str, stderr: str) -> bool:
|
|
44
|
+
"""Match only an old in-container adapter's exact argparse boundary.
|
|
45
|
+
|
|
46
|
+
Old images reject R2 source ops before the JSON envelope exists. Keep
|
|
47
|
+
database/network stderr and unrelated argparse failures retryable/visible
|
|
48
|
+
rather than mislabeling them as an upgrade-only condition.
|
|
49
|
+
"""
|
|
50
|
+
return (
|
|
51
|
+
op in _SOURCE_MAINTENANCE_OPS
|
|
52
|
+
and "usage: aisc-extensions-adapter" in stderr
|
|
53
|
+
and f"invalid choice: '{op}'" in stderr
|
|
54
|
+
)
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
def _group_timeout_seconds(specs: list[str]) -> float:
|
|
58
|
+
"""Cover probe + up to three clones + installs/enables in the adapter."""
|
|
59
|
+
repos = len({spec.split(":", 1)[0] for spec in specs})
|
|
60
|
+
return 30.0 + 450.0 * repos + 240.0 * len(specs)
|
|
34
61
|
|
|
35
62
|
|
|
36
63
|
def _validate(op: str, kind: Optional[str], agent: Optional[str]) -> None:
|
|
@@ -68,6 +95,8 @@ def _exec_adapter(
|
|
|
68
95
|
apps: Optional[str] = None,
|
|
69
96
|
query: Optional[str] = None,
|
|
70
97
|
url: Optional[str] = None,
|
|
98
|
+
specs: Optional[list[str]] = None,
|
|
99
|
+
timeout: float = 600.0,
|
|
71
100
|
stdin_text: str = "",
|
|
72
101
|
) -> Dict[str, Any]:
|
|
73
102
|
from aisc.adapters.docker_ import RealDockerExecutor
|
|
@@ -98,11 +127,21 @@ def _exec_adapter(
|
|
|
98
127
|
argv.extend(["--query", query])
|
|
99
128
|
if url:
|
|
100
129
|
argv.extend(["--url", url])
|
|
130
|
+
if specs is not None:
|
|
131
|
+
argv.extend(["--specs", json.dumps(specs, ensure_ascii=False,
|
|
132
|
+
separators=(",", ":"))])
|
|
101
133
|
|
|
102
|
-
result = executor.run_captured(argv, timeout=
|
|
134
|
+
result = executor.run_captured(argv, timeout=timeout, input_text=stdin_text)
|
|
103
135
|
if result.exit_code != 0 and not (result.stdout or "").strip():
|
|
136
|
+
stderr = (result.stderr or "").strip()
|
|
137
|
+
if _legacy_argparse_source_unsupported(op, stderr):
|
|
138
|
+
raise CliError(
|
|
139
|
+
message="当前运行环境不支持扩展来源维护,请升级或重建运行时镜像",
|
|
140
|
+
exit_code=1,
|
|
141
|
+
error_code=UNSUPPORTED_OP,
|
|
142
|
+
)
|
|
104
143
|
raise CliError(
|
|
105
|
-
message=f"extensions {op} failed: {
|
|
144
|
+
message=f"extensions {op} failed: {stderr[:200]}",
|
|
106
145
|
exit_code=1,
|
|
107
146
|
error_code="AISC_ERR_EXTENSIONS_EXEC_FAILED",
|
|
108
147
|
)
|
|
@@ -122,10 +161,25 @@ def _exec_adapter(
|
|
|
122
161
|
)
|
|
123
162
|
if not envelope.get("ok"):
|
|
124
163
|
error = envelope.get("error") or {}
|
|
164
|
+
code = str(error.get("code") or "AISC_ERR_EXTENSIONS_EXEC_FAILED")
|
|
165
|
+
message = str(error.get("message") or f"extensions {op} failed")
|
|
166
|
+
# R2 source maintenance must distinguish an old runtime from transient
|
|
167
|
+
# database/network failures. Legacy adapters have no dedicated code, so
|
|
168
|
+
# classify only their exact unknown-op and stale-schema responses.
|
|
169
|
+
legacy_unsupported = (
|
|
170
|
+
op in _SOURCE_MAINTENANCE_OPS
|
|
171
|
+
and code == "AISC_ERR_USAGE"
|
|
172
|
+
and message == f"unhandled op: {op}"
|
|
173
|
+
)
|
|
174
|
+
stale_schema = (
|
|
175
|
+
op == "skill-repos-list"
|
|
176
|
+
and code == "AISC_ERR_EXTENSIONS_SNAPSHOT_FAILED"
|
|
177
|
+
and message == "skill repository table is unavailable; upgrade the runtime image"
|
|
178
|
+
)
|
|
125
179
|
raise CliError(
|
|
126
|
-
message=
|
|
180
|
+
message=message,
|
|
127
181
|
exit_code=1,
|
|
128
|
-
error_code=
|
|
182
|
+
error_code=UNSUPPORTED_OP if legacy_unsupported or stale_schema else code,
|
|
129
183
|
)
|
|
130
184
|
return envelope
|
|
131
185
|
|
|
@@ -176,6 +230,32 @@ def extensions_skill_install(runtime_id: str, spec: str,
|
|
|
176
230
|
return {"kind": "skills", "spec": spec}
|
|
177
231
|
|
|
178
232
|
|
|
233
|
+
def extensions_skill_install_group(
|
|
234
|
+
runtime_id: str, specs: list[str], workspace: Optional[str], executor: Any,
|
|
235
|
+
) -> Dict[str, Any]:
|
|
236
|
+
if not isinstance(specs, list) or not specs or not all(
|
|
237
|
+
isinstance(spec, str) and spec.strip() for spec in specs
|
|
238
|
+
):
|
|
239
|
+
raise CliError(
|
|
240
|
+
message="Invalid extensions skill specs: expected a non-empty string array",
|
|
241
|
+
exit_code=RuntimeExitCode.USAGE_ERROR,
|
|
242
|
+
error_code="AISC_ERR_USAGE",
|
|
243
|
+
)
|
|
244
|
+
_validate("skill-install-group", None, None)
|
|
245
|
+
envelope = _exec_adapter(
|
|
246
|
+
runtime_id, _registry_root(workspace), executor, "skill-install-group",
|
|
247
|
+
specs=specs, timeout=_group_timeout_seconds(specs),
|
|
248
|
+
)
|
|
249
|
+
items = envelope.get("items") or []
|
|
250
|
+
return {
|
|
251
|
+
"kind": "skills",
|
|
252
|
+
"total": envelope.get("total", len(items)),
|
|
253
|
+
"completed": envelope.get("completed", 0),
|
|
254
|
+
"items": items,
|
|
255
|
+
"operation_id": envelope.get("operation_id"),
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
|
|
179
259
|
def extensions_skill_update(runtime_id: str, spec: str,
|
|
180
260
|
workspace: Optional[str], executor: Any) -> Dict[str, Any]:
|
|
181
261
|
_validate("skill-update", None, None)
|
|
@@ -185,6 +265,32 @@ def extensions_skill_update(runtime_id: str, spec: str,
|
|
|
185
265
|
return {"kind": "skills", "spec": spec}
|
|
186
266
|
|
|
187
267
|
|
|
268
|
+
def extensions_skill_update_group(
|
|
269
|
+
runtime_id: str, specs: list[str], workspace: Optional[str], executor: Any,
|
|
270
|
+
) -> Dict[str, Any]:
|
|
271
|
+
if not isinstance(specs, list) or not specs or not all(
|
|
272
|
+
isinstance(spec, str) and spec.strip() for spec in specs
|
|
273
|
+
):
|
|
274
|
+
raise CliError(
|
|
275
|
+
message="Invalid extensions skill specs: expected a non-empty string array",
|
|
276
|
+
exit_code=RuntimeExitCode.USAGE_ERROR,
|
|
277
|
+
error_code="AISC_ERR_USAGE",
|
|
278
|
+
)
|
|
279
|
+
_validate("skill-update-group", None, None)
|
|
280
|
+
envelope = _exec_adapter(
|
|
281
|
+
runtime_id, _registry_root(workspace), executor, "skill-update-group",
|
|
282
|
+
specs=specs, timeout=_group_timeout_seconds(specs),
|
|
283
|
+
)
|
|
284
|
+
items = envelope.get("items") or []
|
|
285
|
+
return {
|
|
286
|
+
"kind": "skills",
|
|
287
|
+
"total": envelope.get("total", len(items)),
|
|
288
|
+
"completed": envelope.get("completed", 0),
|
|
289
|
+
"items": items,
|
|
290
|
+
"operation_id": envelope.get("operation_id"),
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
|
|
188
294
|
def extensions_mcp_add(runtime_id: str, config: Dict[str, Any], apps: str,
|
|
189
295
|
workspace: Optional[str], executor: Any) -> Dict[str, Any]:
|
|
190
296
|
_validate("mcp-add", None, None)
|
|
@@ -235,5 +341,8 @@ def extensions_call_raw(runtime_id: str, op: str, workspace: Optional[str],
|
|
|
235
341
|
runtime_id, _registry_root(workspace), executor, op,
|
|
236
342
|
kind=kind, item_id=item_id, query=query, url=url,
|
|
237
343
|
)
|
|
238
|
-
|
|
239
|
-
|
|
344
|
+
result = {"op": op, "items": envelope.get("items") or [],
|
|
345
|
+
"operation_id": envelope.get("operation_id")}
|
|
346
|
+
if isinstance(envelope.get("cache"), dict):
|
|
347
|
+
result["cache"] = envelope["cache"]
|
|
348
|
+
return result
|
|
@@ -18,6 +18,7 @@ a bundle refresh) is structurally impossible under this split.
|
|
|
18
18
|
from __future__ import annotations
|
|
19
19
|
|
|
20
20
|
import os
|
|
21
|
+
import re
|
|
21
22
|
import tempfile
|
|
22
23
|
from pathlib import Path
|
|
23
24
|
from typing import Callable, Dict, List, Optional, Tuple
|
|
@@ -147,7 +148,7 @@ def _npm_latest(pkg: str, opener: Callable[[str], dict]) -> Optional[dict]:
|
|
|
147
148
|
if not isinstance(d, dict):
|
|
148
149
|
return None
|
|
149
150
|
latest = d.get("dist-tags", {}).get("latest")
|
|
150
|
-
if not latest:
|
|
151
|
+
if not isinstance(latest, str) or not re.fullmatch(r"(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)", latest):
|
|
151
152
|
return None
|
|
152
153
|
engines = (d.get("versions", {}) or {}).get(latest, {}).get("engines") or {}
|
|
153
154
|
return {"latest": latest, "node": engines.get("node") or ""}
|