Commit graph

16 commits

Author SHA1 Message Date
b9860a93a1 feat: Complete C library API and migrate all languages to clients/
C SDK Library API:
- Implement all 43+ library functions with JSON parsing
- Add Image API (15 functions): list, get, publish, delete, lock/unlock,
  visibility, grant/revoke access, transfer, spawn, clone
- Add infrastructure helpers: count_json_array_objects, skip_json_object,
  set_last_error with thread-local storage
- Functional tests: 30/30 passing

Migration:
- Create 6 new language directories: awk, cpp, forth, lisp, objective-c, v
- Migrate all 42 un.* files to clients/*/sync/src/
- Convert root un.* files to symlinks pointing to clients/
- Add Makefiles for new languages

Files:
- clients/c/src/un.c: Full library API implementation
- clients/c/src/un.h: Image types and function declarations
- clients/c/tests/test_functional.c: API functional tests
- CLAUDE.md: Updated migration status
2026-01-17 00:11:53 -05:00
783ca52963 Refactor 5 SDKs: Ruby, Perl, PHP, Lua, Bash with library exports + HMAC auth
- Ruby (un.rb): Full module with execute, executeAsync, wait, job management
- Perl (un.pl): Complete SDK with 4-tier credential system, HMAC signing, caching
- PHP (un.php): Static class-based API with proper error handling
- Lua (un.lua): Module-based implementation with socket and JSON support
- Bash (un.sh): Shell functions using curl, openssl, and jq for JSON

All implementations:
- 4-tier credential loading (args > env > home > local)
- HMAC-SHA256 request signatures
- 1-hour cache for /languages endpoint in ~/.unsandbox/
- Exponential backoff job polling
- Preserved original CLI functionality
- Language-appropriate docstrings/comments
- Full permacomputer public domain license headers
2026-01-15 15:17:02 -05:00
dc69bf4959 Rename sleep/wake to freeze/unfreeze across all 42 implementations
API endpoint changes:
- /services/{id}/sleep → /services/{id}/freeze
- /services/{id}/wake → /services/{id}/unfreeze

CLI flag changes:
- --sleep → --freeze
- --wake → --unfreeze

Message changes:
- 'Service sleeping' → 'Service frozen'
- 'Service waking' → 'Service unfreezing'
2026-01-15 11:52:15 -05:00
c219d6e550 Add service resize command to all 38 language implementations
Adds --resize ID --vcpu N flag to resize running services live.
PATCH /services/{id} with {"vcpu": 1-8} applies CPU/memory limits
without restart. Memory formula: 2GB per vCPU.
2026-01-11 17:19:50 -05:00
87397949d1 Add service environment vault to all 40 un-inception implementations
Implements encrypted vault for storing service environment variables:
- service env status <id> - Check vault status (GET /services/:id/env)
- service env set <id> -e KEY=VAL - Set vault contents (PUT /services/:id/env)
- service env export <id> - Export vault as .env format (POST /services/:id/env/export)
- service env delete <id> - Delete vault (DELETE /services/:id/env)
- Auto-vault on service creation with -e or --env-file flags

All implementations use HMAC-SHA256 authentication and text/plain content type
for vault PUT requests.
2026-01-10 04:22:07 -05:00
1b35f1099e Add -s/--shell flag and bash default for inline code execution
Matches un.c CLI behavior:
- If -s/--shell LANG is specified, treat argument as inline code
- If argument doesn't exist as a file, default to bash for inline execution
- Normal file execution unchanged
2026-01-09 09:43:44 -05:00
35b3ab615a Fix: catch unknown flags in session command before API request
Previously, invalid flags like --invalid-flag were silently ignored,
causing the CLI to make API requests that returned confusing
'timestamp expired' errors. Now prints 'Unknown option' and exits.

Fixed in 21 implementations: rb, pl, php, lua, sh, cpp, d, rs, zig,
v, kt, groovy, dart, cr, raku, ps1, m, nim, hs
2026-01-03 12:26:38 -05:00
c6813e5a18 Add -f FILE flag support for session and service commands
All 38+ implementations now support:
- session -f FILE: Upload files to /tmp/ in session container
- service -f FILE: Upload files to /tmp/ in service container
- service --bootstrap-file FILE: Read bootstrap script from file
2026-01-02 14:06:36 -05:00
ae8f9ee8c8 Add helpful clock drift message for timestamp auth errors 2025-12-28 14:36:00 -05:00
a4f9bfa377 Add HMAC authentication to all 42 implementations
- Update all un.* implementations to use HMAC-SHA256 signing
- Headers: Authorization (Bearer public_key), X-Timestamp, X-Signature
- Signature: HMAC-SHA256(secret_key, "timestamp:METHOD:path:body")
- Fix test suite issues (bash arithmetic, ES module compat, TCL shebang)
- Add CLAUDE.md with inception testing documentation
- Update README.md with HMAC auth and dependency table
- All 38 implementations pass inception test via un2
2025-12-28 14:24:03 -05:00
ee15bc8a5f Add --dump-bootstrap command to all un-inception implementations 2025-12-27 16:40:49 -05:00
5380af54cb Add key subcommand to all 31 implementations
- Validate API keys via portal endpoint
- Show key status, tier, expiration with color-coded output
- Add --extend flag to open browser for key renewal
- Update .gitignore for compiled binaries
- Update README with key command documentation
2025-12-27 11:50:34 -05:00
eb5d4ca8bf Add --type option for services across all 42 implementations
Support service_type for SRV records (minecraft, mumble, teamspeak, source, tcp, udp).
Each implementation now parses --type and sends service_type in the JSON payload.
2025-12-26 08:39:34 -05:00
e31c988dab Update license values in all 42 inception source files 2025-12-23 22:03:31 -05:00
fd2268e11b Fix license comment syntax for JS/TS/Lua/Elixir
- JavaScript/TypeScript: Use // comments after shebang (not # which is invalid)
- Lua: Use -- comments after shebang (not # which is invalid)
- Elixir: Use # comments after shebang (not %% which is Erlang)

All 42 implementations validated passing after fixes.
2025-12-23 11:18:14 -05:00
2b35819393 Initial commit: 42 UN CLI implementations
Unsandbox CLI implementations in 42 programming languages for the
permacomputer project. Public domain software for code execution
across all ecosystems.

Languages: Python, JavaScript, Ruby, Go, Rust, C, C++, Java, Kotlin,
C#, F#, Haskell, OCaml, Clojure, Scheme, Common Lisp, Erlang, Elixir,
D, Nim, Zig, V, Dart, Groovy, Scala, Julia, R, Crystal, Fortran,
COBOL, Prolog, Forth, Tcl, Raku, Lua, PHP, Perl, Bash, TypeScript,
Objective-C, PowerShell, AWK

Includes test suites and service lifecycle tests.
2025-12-23 09:57:08 -05:00