diff --git a/Cargo.lock b/Cargo.lock index 6dab71f4..267da949 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -69,12 +69,6 @@ dependencies = [ "windows-sys 0.61.2", ] -[[package]] -name = "anyhow" -version = "1.0.104" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "330a5ed07fa54e4702c9d6c4174f74427fc0ef6e214bbd677ae50a5099946470" - [[package]] name = "async-broadcast" version = "0.7.2" @@ -773,12 +767,6 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" -[[package]] -name = "foldhash" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77ce24cb58228fbb8aa041425bb1050850ac19177686ea6e0f41a70416f56fdb" - [[package]] name = "foreign-types" version = "0.3.2" @@ -927,7 +915,7 @@ checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1" dependencies = [ "allocator-api2", "equivalent", - "foldhash 0.1.5", + "foldhash", ] [[package]] @@ -935,9 +923,6 @@ name = "hashbrown" version = "0.17.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed5909b6e89a2db4456e54cd5f673791d7eca6732202bbf2a9cc504fe2f9b84a" -dependencies = [ - "foldhash 0.2.0", -] [[package]] name = "heck" @@ -1081,12 +1066,6 @@ dependencies = [ "zerovec", ] -[[package]] -name = "id-arena" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d3067d79b975e8844ca9eb072e16b31c3c1c36928edf9c6789548c524d0d954" - [[package]] name = "ident_case" version = "1.0.1" @@ -1122,8 +1101,6 @@ checksum = "d466e9454f08e4a911e14806c24e16fba1b4c121d1ea474396f396069cf949d9" dependencies = [ "equivalent", "hashbrown 0.17.1", - "serde", - "serde_core", ] [[package]] @@ -1197,12 +1174,6 @@ dependencies = [ "zeroize", ] -[[package]] -name = "leb128fmt" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09edd9e8b54e49e587e4f6295a7d29c3ea94d469cb40ab8ca70b288248a81db2" - [[package]] name = "libc" version = "0.2.189" @@ -1271,17 +1242,6 @@ dependencies = [ "hashbrown 0.15.5", ] -[[package]] -name = "macro-string" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59a9dbbfc75d2688ed057456ce8a3ee3f48d12eec09229f560f3643b9f275653" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.119", -] - [[package]] name = "memchr" version = "2.8.3" @@ -1583,16 +1543,6 @@ dependencies = [ "zerocopy", ] -[[package]] -name = "prettyplease" -version = "0.2.37" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "479ca8adacdd7ce8f1fb39ce9ecccbfe93a3f1344b3d0d97f20bc0196208f62b" -dependencies = [ - "proc-macro2", - "syn 2.0.119", -] - [[package]] name = "proc-macro-crate" version = "3.5.0" @@ -2058,15 +2008,6 @@ dependencies = [ "unicode-width 0.2.0", ] -[[package]] -name = "skilld-wasi" -version = "3.0.0-beta.1" -dependencies = [ - "skilld-command", - "skilld-core", - "wit-bindgen 0.60.0", -] - [[package]] name = "slab" version = "0.4.12" @@ -2432,41 +2373,7 @@ version = "1.0.1+wasi-0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0562428422c63773dad2c345a1882263bbf4d65cf3f42e90921f787ef5ad58e7" dependencies = [ - "wit-bindgen 0.46.0", -] - -[[package]] -name = "wasm-encoder" -version = "0.254.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09480d646178e5fdd12bb06e812d0af9a3a191dbc9cd697fdc86687beade7393" -dependencies = [ - "leb128fmt", - "wasmparser", -] - -[[package]] -name = "wasm-metadata" -version = "0.254.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b01df5f3b4ca7881e843f3bc0fb8a3905d79c68692250dcb8e33e698705ccdb6" -dependencies = [ - "anyhow", - "indexmap", - "wasm-encoder", - "wasmparser", -] - -[[package]] -name = "wasmparser" -version = "0.254.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5769a29f799fbab136aaf65b4fe5384cd7d93fe6fc9ba0dcb6c8382a1f16e27" -dependencies = [ - "bitflags", - "hashbrown 0.17.1", - "indexmap", - "semver", + "wit-bindgen", ] [[package]] @@ -2686,97 +2593,6 @@ version = "0.46.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f17a85883d4e6d00e8a97c586de764dabcc06133f7f1d55dce5cdc070ad7fe59" -[[package]] -name = "wit-bindgen" -version = "0.60.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a301904d6657d6364c758d869e5389d05d393b16d5b65db60b4f03cbe71bb80d" -dependencies = [ - "bitflags", - "wit-bindgen-rust-macro", -] - -[[package]] -name = "wit-bindgen-core" -version = "0.60.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48521bb96e56cbb9e031ad306c80dc20e89e69e49ada02781ee06f60fbcb545f" -dependencies = [ - "anyhow", - "heck", - "wit-parser", -] - -[[package]] -name = "wit-bindgen-rust" -version = "0.60.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3df3fe9b9a0066f82fd0c2f07f79d0ffc0f85c53fa5f998516d8722712479042" -dependencies = [ - "anyhow", - "heck", - "indexmap", - "prettyplease", - "syn 2.0.119", - "wasm-metadata", - "wit-bindgen-core", - "wit-component", -] - -[[package]] -name = "wit-bindgen-rust-macro" -version = "0.60.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d689c4bc9d6af067c651cfba444766343c9a4bdef15fad1e2efab95c0c277af0" -dependencies = [ - "anyhow", - "macro-string", - "prettyplease", - "proc-macro2", - "quote", - "syn 2.0.119", - "wit-bindgen-core", - "wit-bindgen-rust", -] - -[[package]] -name = "wit-component" -version = "0.254.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0e65bb94c369b3c4741ce3d1d2704b1fec93db7c540df0e521a097e7ceeb5be" -dependencies = [ - "anyhow", - "bitflags", - "indexmap", - "log", - "serde", - "serde_derive", - "serde_json", - "wasm-encoder", - "wasm-metadata", - "wasmparser", - "wit-parser", -] - -[[package]] -name = "wit-parser" -version = "0.254.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1655131e4f7d3f0cb141f6eca71315ca40eff0f3d4de7cff0a82bacedd8c89b4" -dependencies = [ - "anyhow", - "hashbrown 0.17.1", - "id-arena", - "indexmap", - "log", - "semver", - "serde", - "serde_derive", - "serde_json", - "unicode-ident", - "wasmparser", -] - [[package]] name = "writeable" version = "0.6.4" diff --git a/Cargo.toml b/Cargo.toml index c7f49dec..358cc6a8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,7 +5,6 @@ members = [ "crates/skilld-core", "crates/skilld-native", "crates/skilld-ui", - "crates/skilld-wasi", ] resolver = "3" @@ -34,7 +33,6 @@ tempfile = "3.27.0" terminal_size = "0.4.4" unicode-width = "=0.2.0" url = "2.5.8" -wit-bindgen = "0.60.0" zeroize = "1.9.0" [profile.release] diff --git a/crates/skilld-wasi/Cargo.toml b/crates/skilld-wasi/Cargo.toml deleted file mode 100644 index 6b672f81..00000000 --- a/crates/skilld-wasi/Cargo.toml +++ /dev/null @@ -1,23 +0,0 @@ -[package] -name = "skilld-wasi" - -version.workspace = true - -edition.workspace = true - -license.workspace = true - -repository.workspace = true - -rust-version.workspace = true - -[lib] -crate-type = [ "cdylib" ] -path = "src/lib.rs" - -[dependencies] -skilld-command.workspace = true - -skilld-core.workspace = true - -wit-bindgen.workspace = true diff --git a/crates/skilld-wasi/src/lib.rs b/crates/skilld-wasi/src/lib.rs deleted file mode 100644 index 0a8e6d9e..00000000 --- a/crates/skilld-wasi/src/lib.rs +++ /dev/null @@ -1,178 +0,0 @@ -use std::env; -use std::path::PathBuf; - -use skilld_command::{ - CommandError, Host, LocalHost, OutputContext, run_stdio_probe, run_with_output, -}; -use skilld_core::{InstallScope, InstallSource}; - -wit_bindgen::generate!({ - path: "../../wit", - world: "command", -}); - -struct SkilldComponent; - -impl Guest for SkilldComponent { - fn run() -> u32 { - if env::var_os("SKILLD_PROBE_CREDENTIALS").as_deref() == Some(std::ffi::OsStr::new("1")) { - return run_credential_probe(); - } - if env::var_os("SKILLD_PROBE_GIT").as_deref() == Some(std::ffi::OsStr::new("1")) { - return run_git_probe(); - } - if env::var_os("SKILLD_PROBE_STDIO").as_deref() == Some(std::ffi::OsStr::new("1")) { - let mut stdin = std::io::stdin().lock(); - let mut stdout = std::io::stdout().lock(); - let mut stderr = std::io::stderr().lock(); - return run_stdio_probe(&mut stdin, &mut stdout, &mut stderr) - .exit_code - .into(); - } - - let project_root = PathBuf::from("."); - let global_root = global_root(); - let mut local = LocalHost::new(project_root, global_root); - if let Some(path) = env::var_os("SKILLD_BUNDLED_SKILL_DIR") { - local = local.with_bundled_skill(PathBuf::from(path)); - } - let host = WasiHost { local }; - let mut stdout = std::io::stdout().lock(); - let mut stderr = std::io::stderr().lock(); - let result = run_with_output( - env::args_os(), - &host, - OutputContext::Plain, - &mut stdout, - &mut stderr, - ); - result.exit_code.into() - } -} - -fn run_credential_probe() -> u32 { - use skilld::host::credentials; - - let service = "skilld.dev"; - let account = "proof"; - let secret = "credential-boundary-proof"; - let result = credentials::set(service, account, secret) - .and_then(|()| credentials::get(service, account)) - .and_then(|stored| { - if stored.as_deref() == Some(secret) { - Ok(()) - } else { - Err(credentials::ErrorCode::Invalid) - } - }) - .and_then(|()| credentials::delete(service, account)) - .and_then(|deleted| { - if deleted { - Ok(()) - } else { - Err(credentials::ErrorCode::NotFound) - } - }) - .and_then(|()| credentials::get(service, account)) - .and_then(|stored| { - if stored.is_none() { - Ok(()) - } else { - Err(credentials::ErrorCode::Invalid) - } - }); - - match result { - Ok(()) => { - println!("Credential host operations passed."); - 0 - } - Err(error) => { - eprintln!("UNSUPPORTED_HOST: credential capability probe failed: {error:?}"); - 2 - } - } -} - -fn run_git_probe() -> u32 { - let command = skilld::host::process::GitCommand { - args: vec!["--version".to_owned()], - cwd: None, - stdin: None, - max_output_bytes: 4096, - timeout_ms: 5000, - }; - match skilld::host::process::run_git(&command) { - Ok(output) => { - print!("{}", String::from_utf8_lossy(&output.stdout)); - eprint!("{}", String::from_utf8_lossy(&output.stderr)); - if (0..=255).contains(&output.exit_code) { - output.exit_code as u32 - } else { - 2 - } - } - Err(error) => { - eprintln!("UNSUPPORTED_HOST: Git process capability failed: {error:?}"); - 2 - } - } -} - -struct WasiHost { - local: LocalHost, -} - -impl Host for WasiHost { - fn list(&self, scope: InstallScope) -> Result, CommandError> { - self.local.list(scope) - } - - fn install(&self, source: InstallSource, scope: InstallScope) -> Result { - self.local.install(source, scope) - } - - fn auth_status(&self) -> Result { - skilld::host::credentials::get("skilld.dev", "default") - .map(|credential| credential.is_some()) - .map_err(|error| credential_error("read", error)) - } - - fn auth_login(&self) -> Result<(), CommandError> { - skilld::host::process::open_url("https://skilld.dev/auth/cli") - .map_err(|error| process_error("open the authentication URL", error)) - } - - fn auth_logout(&self) -> Result<(), CommandError> { - skilld::host::credentials::delete("skilld.dev", "default") - .map(|_| ()) - .map_err(|error| credential_error("delete", error)) - } -} - -fn credential_error(operation: &str, error: skilld::host::credentials::ErrorCode) -> CommandError { - CommandError::unsupported_host(format!( - "credential capability could not {operation} the account: {error:?}" - )) -} - -fn process_error(operation: &str, error: skilld::host::process::ErrorCode) -> CommandError { - CommandError::unsupported_host(format!( - "process capability could not {operation}: {error:?}" - )) -} - -fn global_root() -> PathBuf { - if let Some(path) = env::var_os("SKILLD_DATA_DIR") { - return PathBuf::from(path); - } - if let Some(path) = env::var_os("LOCALAPPDATA") { - return PathBuf::from(path).join("skilld"); - } - if let Some(path) = env::var_os("HOME") { - return PathBuf::from(path).join(".skilld"); - } - PathBuf::from(".skilld") -} - -export!(SkilldComponent); diff --git a/package.json b/package.json index 3f83db85..625b26e5 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ "loader" ], "engines": { - "node": ">=18.18.0" + "node": ">=22.0.0" }, "scripts": { "build": "pnpm --filter skilld-protocol build && pnpm --filter skilld-harness build && cargo build --workspace", diff --git a/packages/cli-wasm32-wasi/.gitignore b/packages/cli-wasm32-wasi/.gitignore deleted file mode 100644 index f3ced814..00000000 --- a/packages/cli-wasm32-wasi/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -component/ -node_modules/ diff --git a/packages/cli-wasm32-wasi/host-imports.mjs b/packages/cli-wasm32-wasi/host-imports.mjs deleted file mode 100644 index 43fbec3d..00000000 --- a/packages/cli-wasm32-wasi/host-imports.mjs +++ /dev/null @@ -1,64 +0,0 @@ -import { spawnSync } from 'node:child_process' - -const credentialProof = new Map() - -const ok = value => ({ tag: 'ok', val: value }) -const err = code => ({ tag: 'err', val: code }) - -export const credentials = { - get(service, account) { - if (globalThis.process.env.SKILLD_WASI_MEMORY_CREDENTIAL !== '1') - return err('unsupported-host') - - return ok(credentialProof.get(`${service}\0${account}`)) - }, - - set(service, account, secret) { - if (globalThis.process.env.SKILLD_WASI_MEMORY_CREDENTIAL !== '1') - return err('unsupported-host') - - credentialProof.set(`${service}\0${account}`, secret) - return ok(undefined) - }, - - delete(service, account) { - if (globalThis.process.env.SKILLD_WASI_MEMORY_CREDENTIAL !== '1') - return err('unsupported-host') - - return ok(credentialProof.delete(`${service}\0${account}`)) - }, -} - -export const process = { - runGit(command) { - if (globalThis.process.env.SKILLD_WASI_ENABLE_GIT !== '1') - return err('unsupported-host') - - if (!Array.isArray(command.args) || !command.args.every(arg => typeof arg === 'string')) - return err('invalid') - - const result = spawnSync('git', command.args, { - cwd: command.cwd ?? undefined, - input: command.stdin ? Buffer.from(command.stdin) : undefined, - maxBuffer: Number(command.maxOutputBytes), - shell: false, - timeout: Number(command.timeoutMs), - }) - if (result.error?.code === 'ENOENT') - return err('not-found') - if (result.error?.code === 'ETIMEDOUT') - return err('timed-out') - if (result.error) - return err('io') - - return ok({ - exitCode: result.status ?? 1, - stdout: new Uint8Array(result.stdout), - stderr: new Uint8Array(result.stderr), - }) - }, - - openUrl() { - return err('unsupported-host') - }, -} diff --git a/packages/cli-wasm32-wasi/package.json b/packages/cli-wasm32-wasi/package.json deleted file mode 100644 index 76436b1f..00000000 --- a/packages/cli-wasm32-wasi/package.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "name": "skilld-cli-wasm32-wasi", - "type": "module", - "version": "3.0.0-beta.1", - "private": true, - "description": "WASIp2 fallback host for the skilld CLI", - "license": "MIT", - "exports": { - "./package.json": "./package.json", - "./runner": "./run-component.mjs" - }, - "files": [ - "component", - "host-imports.mjs", - "run-component.mjs" - ], - "engines": { - "node": ">=22.0.0" - }, - "dependencies": { - "@bytecodealliance/preview2-shim": "catalog:" - } -} diff --git a/packages/cli-wasm32-wasi/run-component.mjs b/packages/cli-wasm32-wasi/run-component.mjs deleted file mode 100644 index b200a4e6..00000000 --- a/packages/cli-wasm32-wasi/run-component.mjs +++ /dev/null @@ -1,17 +0,0 @@ -import { _setPreopens } from '@bytecodealliance/preview2-shim/filesystem' - -async function main() { - _setPreopens({ '/': process.cwd() }) - - const componentUrl = process.env.SKILLD_WASI_COMPONENT - ? new URL(process.env.SKILLD_WASI_COMPONENT, `file://${process.cwd()}/`) - : new URL('./component/skilld-wasi.js', import.meta.url) - - const component = await import(componentUrl.href) - process.exitCode = component.run() -} - -main().catch((error) => { - process.stderr.write(`SERVICE_UNAVAILABLE: ${error instanceof Error ? error.message : String(error)}\n`) - process.exitCode = 2 -}) diff --git a/packages/harness/package.json b/packages/harness/package.json index 697f1007..cf433c72 100644 --- a/packages/harness/package.json +++ b/packages/harness/package.json @@ -57,7 +57,6 @@ }, "dependencies": { "@ai-sdk/harness": "catalog:", - "ws": "catalog:", "yaml": "catalog:", "zod": "catalog:" }, diff --git a/packages/protocol/package.json b/packages/protocol/package.json index 0c1e5c70..e3efd722 100644 --- a/packages/protocol/package.json +++ b/packages/protocol/package.json @@ -45,7 +45,7 @@ "openapi" ], "engines": { - "node": ">=18" + "node": ">=22.0.0" }, "scripts": { "build": "pnpm generate:v1 && obuild", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index d0af54d9..9b5cbad6 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -15,9 +15,6 @@ catalogs: '@arethetypeswrong/cli': specifier: ^0.18.5 version: 0.18.5 - '@bytecodealliance/preview2-shim': - specifier: 0.20.2 - version: 0.20.2 '@redocly/cli': specifier: ^2.46.2 version: 2.46.2 @@ -33,9 +30,6 @@ catalogs: typescript: specifier: npm:@typescript/typescript6@^6.0.2 version: 6.0.2 - ws: - specifier: ^8.21.0 - version: 8.21.2 yaml: specifier: ^2.9.0 version: 2.9.0 @@ -112,12 +106,6 @@ importers: packages/cli-linux-x64-musl: {} - packages/cli-wasm32-wasi: - dependencies: - '@bytecodealliance/preview2-shim': - specifier: 'catalog:' - version: 0.20.2 - packages/cli-win32-arm64-msvc: {} packages/cli-win32-x64-msvc: {} @@ -127,9 +115,6 @@ importers: '@ai-sdk/harness': specifier: 'catalog:' version: 1.0.77(ws@8.21.2)(zod@4.4.3) - ws: - specifier: 'catalog:' - version: 8.21.2 yaml: specifier: 'catalog:' version: 2.9.0 @@ -343,9 +328,6 @@ packages: '@braidai/lang@1.1.2': resolution: {integrity: sha512-qBcknbBufNHlui137Hft8xauQMTZDKdophmLFv05r2eNmdIv/MlPuP4TdUknHG68UdWLgVZwgxVe735HzJNIwA==} - '@bytecodealliance/preview2-shim@0.20.2': - resolution: {integrity: sha512-Bp1cer1jztaQamLv1YKdc4MimI9LNAAKM2lNxOtGTLs7/At5KlA0fW1HWTi3ZJ5McaWNwJUDWSe5Lr0EgUpsnA==} - '@clack/core@1.4.3': resolution: {integrity: sha512-/kr3UWNtdJfxZtPgDqUOmG2pvwlmcLGheex5yiZKdwbzZJxhV+HMNR9QNmyY5cGwTNV6LrR7Jtp+KjhUAP1qBQ==} engines: {node: '>= 20.12.0'} @@ -3251,8 +3233,6 @@ snapshots: '@braidai/lang@1.1.2': {} - '@bytecodealliance/preview2-shim@0.20.2': {} - '@clack/core@1.4.3': dependencies: fast-wrap-ansi: 0.2.2 @@ -6250,7 +6230,8 @@ snapshots: string-width: 4.2.3 strip-ansi: 6.0.1 - ws@8.21.2: {} + ws@8.21.2: + optional: true xml-name-validator@5.0.0: {} diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 40003747..10afb005 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -14,13 +14,11 @@ catalog: '@ai-sdk/harness': ^1.0.77 '@ai-sdk/provider-utils': ^5.0.28 '@arethetypeswrong/cli': ^0.18.5 - '@bytecodealliance/preview2-shim': 0.20.2 '@redocly/cli': ^2.46.2 '@typescript/native': npm:typescript@7.0.2 openapi-typescript: ^7.13.0 publint: ^0.3.23 typescript: npm:@typescript/typescript6@^6.0.2 - ws: ^8.21.0 yaml: ^2.9.0 zod: ^4.4.3 catalogs: diff --git a/scripts/v3-rust/build-component.sh b/scripts/v3-rust/build-component.sh deleted file mode 100755 index 588e243e..00000000 --- a/scripts/v3-rust/build-component.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash - -set -euo pipefail - -repository_root=$(git rev-parse --show-toplevel) -component_package="$repository_root/packages/cli-wasm32-wasi" -component_output="$component_package/component" - -cargo build --manifest-path "$repository_root/Cargo.toml" --release --target wasm32-wasip2 -p skilld-wasi -npm install --prefix "$component_package" --ignore-scripts --no-audit --no-fund --package-lock=false -mkdir -p "$component_output" -npm exec --yes --package=@bytecodealliance/jco@1.30.0 -- jco transpile \ - "$repository_root/target/wasm32-wasip2/release/skilld_wasi.wasm" \ - --name skilld-wasi \ - --map 'skilld:host/*@3.0.0=./host-imports.mjs#*' \ - --out-dir "$component_output" -cp "$component_package/host-imports.mjs" "$component_output/host-imports.mjs" diff --git a/scripts/v3-rust/test-parity.sh b/scripts/v3-rust/test-parity.sh deleted file mode 100755 index 413db6e5..00000000 --- a/scripts/v3-rust/test-parity.sh +++ /dev/null @@ -1,91 +0,0 @@ -#!/usr/bin/env bash - -set -euo pipefail - -repository_root=$(git rev-parse --show-toplevel) -fixture="$repository_root/tests/fixtures/v3-rust/local-skill" -runner="$repository_root/packages/cli-wasm32-wasi/run-component.mjs" -native="$repository_root/target/release/skilld" - -bash "$repository_root/scripts/v3-rust/build-component.sh" -cargo build --manifest-path "$repository_root/Cargo.toml" --release -p skilld-native - -native_project=$(mktemp -d) -wasi_project=$(mktemp -d) -trap 'rm -rf "$native_project" "$wasi_project"' EXIT -cp -R "$fixture" "$native_project/local-skill" -cp -R "$fixture" "$wasi_project/local-skill" - -( - cd "$native_project" - "$native" install ./local-skill -) > "$native_project/install.out" - -set +e -( - cd "$wasi_project" - node "$runner" install ./local-skill -) > "$wasi_project/install.out" 2> "$wasi_project/install.err" -wasi_install_status=$? -set -e - -test "$wasi_install_status" -eq 2 -rg -q 'WASIp2 Skill store locking is unavailable' "$wasi_project/install.err" -mkdir -p "$wasi_project/.skills" -cp -R "$fixture" "$wasi_project/.skills/local-skill" - -( - cd "$native_project" - "$native" list -) > "$native_project/list.out" -( - cd "$wasi_project" - node "$runner" list -) > "$wasi_project/list.out" - -diff -u "$native_project/list.out" "$wasi_project/list.out" -diff -u "$native_project/.skills/local-skill/SKILL.md" "$wasi_project/.skills/local-skill/SKILL.md" - -"$native" --version > "$native_project/version.out" -node "$runner" --version > "$wasi_project/version.out" -diff -u "$native_project/version.out" "$wasi_project/version.out" - -printf 'stdio-proof\n' | SKILLD_PROBE_STDIO=1 node "$runner" \ - > "$wasi_project/stdio.out" 2> "$wasi_project/stdio.err" -test "$(cat "$wasi_project/stdio.out")" = 'stdin:stdio-proof' -test "$(cat "$wasi_project/stdio.err")" = 'stderr:probe' - -set +e -node "$runner" auth status > "$wasi_project/auth.out" 2> "$wasi_project/auth.err" -auth_status=$? -node "$runner" auth login > "$wasi_project/login.out" 2> "$wasi_project/login.err" -login_status=$? -set -e - -test "$auth_status" -eq 2 -test "$login_status" -eq 2 -rg -q '^UNSUPPORTED_HOST: credential capability' "$wasi_project/auth.err" -rg -q '^UNSUPPORTED_HOST: process capability' "$wasi_project/login.err" - -SKILLD_WASI_MEMORY_CREDENTIAL=1 node "$runner" auth status \ - > "$wasi_project/auth-memory.out" -test "$(cat "$wasi_project/auth-memory.out")" = 'Not authenticated.' - -SKILLD_PROBE_CREDENTIALS=1 SKILLD_WASI_MEMORY_CREDENTIAL=1 node "$runner" \ - > "$wasi_project/credential-proof.out" -test "$(cat "$wasi_project/credential-proof.out")" = 'Credential host operations passed.' - -set +e -SKILLD_PROBE_GIT=1 node "$runner" \ - > "$wasi_project/git-missing.out" 2> "$wasi_project/git-missing.err" -git_missing_status=$? -set -e -test "$git_missing_status" -eq 2 -rg -q '^UNSUPPORTED_HOST: Git process capability failed' "$wasi_project/git-missing.err" - -SKILLD_PROBE_GIT=1 SKILLD_WASI_ENABLE_GIT=1 node "$runner" \ - > "$wasi_project/git.out" -rg -q '^git version ' "$wasi_project/git.out" - -echo 'Native and WASIp2 read behavior matches.' -echo 'WASIp2 write parity is blocked by exclusive Skill store locking.' diff --git a/tests/fixtures/v3-rust/wasip2-no-go.json b/tests/fixtures/v3-rust/wasip2-no-go.json deleted file mode 100644 index 7d96ec80..00000000 --- a/tests/fixtures/v3-rust/wasip2-no-go.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "target": "wasm32-wasip2", - "host": { - "node": "24.18.0", - "jco": "1.30.0", - "preview2Shim": "0.20.2" - }, - "operation": "lock the Skill store before a filesystem transaction", - "result": { - "type": "unsupported", - "message": "WASIp2 Skill store locking is unavailable" - }, - "additionalEvidence": "preview2-shim file creation returned Not supported (os error 58)", - "decision": "Keep WASIp2 unpublished until Skill install parity passes." -} diff --git a/wit/skilld-host.wit b/wit/skilld-host.wit deleted file mode 100644 index 79ce03c9..00000000 --- a/wit/skilld-host.wit +++ /dev/null @@ -1,51 +0,0 @@ -package skilld:host@3.0.0; - -interface credentials { - enum error-code { - unsupported-host, - unavailable, - denied, - not-found, - invalid, - io, - } - - get: func(service: string, account: string) -> result, error-code>; - set: func(service: string, account: string, secret: string) -> result<_, error-code>; - delete: func(service: string, account: string) -> result; -} - -interface process { - enum error-code { - unsupported-host, - unavailable, - not-found, - denied, - invalid, - timed-out, - io, - } - - record git-command { - args: list, - cwd: option, - stdin: option>, - max-output-bytes: u64, - timeout-ms: u64, - } - - record output { - exit-code: s32, - stdout: list, - stderr: list, - } - - run-git: func(command: git-command) -> result; - open-url: func(url: string) -> result<_, error-code>; -} - -world command { - import credentials; - import process; - export run: func() -> u32; -}