Examples were trying to import SDK modules which aren't available
when executed via the unsandbox API. Made all examples standalone
with simulated results:
- JavaScript async examples (fibonacci.js, hello_world.js)
- PHP examples (fibonacci_client.php, hello_world_client.php)
- Python examples (several async + sync examples)
- Ruby hello_world.rb
- Rust examples (async_polling.rs, fibonacci.rs, hello_world.rs, multi_language.rs)
- Java HelloWorldClient.java
Also fixed validate-examples.sh:
- Fixed exit_code JSON serialization (empty value caused invalid JSON)
- Removed SDK file inclusion (caused "Argument list too long" errors)
- Simplified API request body construction
All 46 examples now pass validation with 100% success rate.
- Pass SDK files via input_files parameter to /tmp/
- Prepend import path fix for Python and Ruby
- Also made some examples standalone as fallback
SDK files from clients/{lang}/{variant}/src/ are now included
when running examples, so examples can import the SDK.
lint-all-sdks.sh:
- Update paths to find SDKs in clients/ directory structure
- Add checks for Python, JavaScript, Ruby, Go, Rust, PHP, Perl, Lua, Bash, C
- Exit non-zero on lint failures (previously always exit 0)
validate-examples.sh:
- Fix race condition with parallel execution - aggregate results from temp files
after all jobs complete (subshell variables don't propagate to parent)
- Add aggregate_results() function to collect stats from result JSON files
Python async SDK:
- Make aiohttp import optional with DependencyError exception
- Add _check_aiohttp() helper for clear error messages
Python examples (async + sync):
- Exit with code 0 when API keys missing (CI-friendly skip)
- Change "Error:" to "Skipping:" for missing credentials
- Wrap un_async imports in try/except for aiohttp ImportError
Add per-client Makefiles for C, Python, and Go with:
- CLI mode: Tests --help, arg parsing, syntax validation
- Library mode: Unit tests, import verification
- Integration mode: API contract validation (with credentials)
- Functional mode: Real-world scenario tests
C client:
- 22 library tests (SHA-256, HMAC-SHA256, detect_language)
- Full unsandbox.c implementation with examples
Python client (sync + async):
- Delegates to sync/ and async/ subdirectories
- pytest-based test suites with coverage
- Examples for concurrent execution, streaming
Go client:
- Delegates to sync/ and async/ subdirectories
- go test integration with vet and fmt
Also update detect-changes.sh to detect changes in
both root-level un.* files AND clients/ directory.