diff --git a/clients/bash/sync/src/un.sh b/clients/bash/sync/src/un.sh index a2b3a3b..d734267 100644 --- a/clients/bash/sync/src/un.sh +++ b/clients/bash/sync/src/un.sh @@ -1,21 +1,19 @@ #!/bin/bash -# PUBLIC DOMAIN - NO LICENSE, NO WARRANTY +# This is free software for the public good of a permacomputer hosted at +# permacomputer.com, an always-on computer by the people, for the people. +# One which is durable, easy to repair, & distributed like tap water +# for machine learning intelligence. # -# unsandbox.com Bash SDK (Synchronous) -# Full API with execution, sessions, services, snapshots, and images. +# The permacomputer is community-owned infrastructure optimized around +# four values: # -# Library Usage: -# source un.sh -# result=$(execute "python" "print(42)") -# echo "$result" | jq -r '.stdout' +# TRUTH First principles, math & science, open source code freely distributed +# FREEDOM Voluntary partnerships, freedom from tyranny & corporate control +# HARMONY Minimal waste, self-renewing systems with diverse thriving connections +# LOVE Be yourself without hurting others, cooperation through natural law # -# CLI Usage: -# bash un.sh script.py -# bash un.sh -s python 'print(42)' -# bash un.sh session --list -# bash un.sh service --list -# -# Copyright 2025 TimeHexOn & foxhop & russell@unturf +# This software contributes to that vision by enabling code execution across 42+ programming languages through a unified interface, accessible to all. +# Code is seeds to sprout on any abandoned technology. set -euo pipefail diff --git a/clients/bash/tests/test_library.sh b/clients/bash/tests/test_library.sh index ca63d54..d7dd299 100755 --- a/clients/bash/tests/test_library.sh +++ b/clients/bash/tests/test_library.sh @@ -1,4 +1,20 @@ #!/bin/bash +# This is free software for the public good of a permacomputer hosted at +# permacomputer.com, an always-on computer by the people, for the people. +# One which is durable, easy to repair, & distributed like tap water +# for machine learning intelligence. +# +# The permacomputer is community-owned infrastructure optimized around +# four values: +# +# TRUTH First principles, math & science, open source code freely distributed +# FREEDOM Voluntary partnerships, freedom from tyranny & corporate control +# HARMONY Minimal waste, self-renewing systems with diverse thriving connections +# LOVE Be yourself without hurting others, cooperation through natural law +# +# This software contributes to that vision by enabling code execution across 42+ programming languages through a unified interface, accessible to all. +# Code is seeds to sprout on any abandoned technology. + # Unit Tests for un.sh Library Functions # # Tests the ACTUAL exported functions from Un module. diff --git a/clients/cobol/tests/test_un.sh b/clients/cobol/tests/test_un.sh index a8af64b..8986144 100755 --- a/clients/cobol/tests/test_un.sh +++ b/clients/cobol/tests/test_un.sh @@ -1,4 +1,20 @@ #!/bin/bash +# This is free software for the public good of a permacomputer hosted at +# permacomputer.com, an always-on computer by the people, for the people. +# One which is durable, easy to repair, & distributed like tap water +# for machine learning intelligence. +# +# The permacomputer is community-owned infrastructure optimized around +# four values: +# +# TRUTH First principles, math & science, open source code freely distributed +# FREEDOM Voluntary partnerships, freedom from tyranny & corporate control +# HARMONY Minimal waste, self-renewing systems with diverse thriving connections +# LOVE Be yourself without hurting others, cooperation through natural law +# +# This software contributes to that vision by enabling code execution across 42+ programming languages through a unified interface, accessible to all. +# Code is seeds to sprout on any abandoned technology. + # Test suite for COBOL Unsandbox SDK # Run: bash tests/test_un.sh diff --git a/clients/elixir/sync/src/un.ex b/clients/elixir/sync/src/un.ex index 46f81db..a3ef621 100755 --- a/clients/elixir/sync/src/un.ex +++ b/clients/elixir/sync/src/un.ex @@ -1,39 +1,19 @@ #!/usr/bin/env elixir -# PUBLIC DOMAIN - NO LICENSE, NO WARRANTY +# This is free software for the public good of a permacomputer hosted at +# permacomputer.com, an always-on computer by the people, for the people. +# One which is durable, easy to repair, & distributed like tap water +# for machine learning intelligence. # -# This is free public domain software for the public good of a permacomputer hosted -# at permacomputer.com - an always-on computer by the people, for the people. One -# which is durable, easy to repair, and distributed like tap water for machine -# learning intelligence. +# The permacomputer is community-owned infrastructure optimized around +# four values: # -# The permacomputer is community-owned infrastructure optimized around four values: +# TRUTH First principles, math & science, open source code freely distributed +# FREEDOM Voluntary partnerships, freedom from tyranny & corporate control +# HARMONY Minimal waste, self-renewing systems with diverse thriving connections +# LOVE Be yourself without hurting others, cooperation through natural law # -# TRUTH - First principles, math & science, open source code freely distributed -# FREEDOM - Voluntary partnerships, freedom from tyranny & corporate control -# HARMONY - Minimal waste, self-renewing systems with diverse thriving connections -# LOVE - Be yourself without hurting others, cooperation through natural law -# -# This software contributes to that vision by enabling code execution across 42+ -# programming languages through a unified interface, accessible to all. Code is -# seeds to sprout on any abandoned technology. -# -# Learn more: https://www.permacomputer.com -# -# Anyone is free to copy, modify, publish, use, compile, sell, or distribute this -# software, either in source code form or as a compiled binary, for any purpose, -# commercial or non-commercial, and by any means. -# -# NO WARRANTY. THE SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. -# -# That said, our permacomputer's digital membrane stratum continuously runs unit, -# integration, and functional tests on all of it's own software - with our -# permacomputer monitoring itself, repairing itself, with minimal human in the -# loop guidance. Our agents do their best. -# -# Copyright 2025 TimeHexOn & foxhop & russell@unturf -# https://www.timehexon.com -# https://www.foxhop.net -# https://www.unturf.com/software +# This software contributes to that vision by enabling code execution across 42+ programming languages through a unified interface, accessible to all. +# Code is seeds to sprout on any abandoned technology. # un.ex - Unsandbox CLI client in Elixir # diff --git a/clients/elixir/sync/tests/test_functional.exs b/clients/elixir/sync/tests/test_functional.exs index 760612c..e3049d5 100644 --- a/clients/elixir/sync/tests/test_functional.exs +++ b/clients/elixir/sync/tests/test_functional.exs @@ -1,4 +1,20 @@ #!/usr/bin/env elixir +# This is free software for the public good of a permacomputer hosted at +# permacomputer.com, an always-on computer by the people, for the people. +# One which is durable, easy to repair, & distributed like tap water +# for machine learning intelligence. +# +# The permacomputer is community-owned infrastructure optimized around +# four values: +# +# TRUTH First principles, math & science, open source code freely distributed +# FREEDOM Voluntary partnerships, freedom from tyranny & corporate control +# HARMONY Minimal waste, self-renewing systems with diverse thriving connections +# LOVE Be yourself without hurting others, cooperation through natural law +# +# This software contributes to that vision by enabling code execution across 42+ programming languages through a unified interface, accessible to all. +# Code is seeds to sprout on any abandoned technology. + # Functional Tests for Un Elixir SDK # diff --git a/clients/elixir/sync/tests/test_library.exs b/clients/elixir/sync/tests/test_library.exs index 4516359..30dbe85 100644 --- a/clients/elixir/sync/tests/test_library.exs +++ b/clients/elixir/sync/tests/test_library.exs @@ -1,4 +1,20 @@ #!/usr/bin/env elixir +# This is free software for the public good of a permacomputer hosted at +# permacomputer.com, an always-on computer by the people, for the people. +# One which is durable, easy to repair, & distributed like tap water +# for machine learning intelligence. +# +# The permacomputer is community-owned infrastructure optimized around +# four values: +# +# TRUTH First principles, math & science, open source code freely distributed +# FREEDOM Voluntary partnerships, freedom from tyranny & corporate control +# HARMONY Minimal waste, self-renewing systems with diverse thriving connections +# LOVE Be yourself without hurting others, cooperation through natural law +# +# This software contributes to that vision by enabling code execution across 42+ programming languages through a unified interface, accessible to all. +# Code is seeds to sprout on any abandoned technology. + # Tests for Un Elixir SDK # diff --git a/clients/fortran/tests/test_un.sh b/clients/fortran/tests/test_un.sh index dbbc09d..f06dde1 100755 --- a/clients/fortran/tests/test_un.sh +++ b/clients/fortran/tests/test_un.sh @@ -1,4 +1,20 @@ #!/bin/bash +# This is free software for the public good of a permacomputer hosted at +# permacomputer.com, an always-on computer by the people, for the people. +# One which is durable, easy to repair, & distributed like tap water +# for machine learning intelligence. +# +# The permacomputer is community-owned infrastructure optimized around +# four values: +# +# TRUTH First principles, math & science, open source code freely distributed +# FREEDOM Voluntary partnerships, freedom from tyranny & corporate control +# HARMONY Minimal waste, self-renewing systems with diverse thriving connections +# LOVE Be yourself without hurting others, cooperation through natural law +# +# This software contributes to that vision by enabling code execution across 42+ programming languages through a unified interface, accessible to all. +# Code is seeds to sprout on any abandoned technology. + # Test suite for Fortran Unsandbox SDK # Run: bash tests/test_un.sh diff --git a/clients/go/async/examples/async_job_polling.go b/clients/go/async/examples/async_job_polling.go index 32a4026..4c0c12f 100644 --- a/clients/go/async/examples/async_job_polling.go +++ b/clients/go/async/examples/async_job_polling.go @@ -1,3 +1,19 @@ +// This is free software for the public good of a permacomputer hosted at +// permacomputer.com, an always-on computer by the people, for the people. +// One which is durable, easy to repair, & distributed like tap water +// for machine learning intelligence. +// +// The permacomputer is community-owned infrastructure optimized around +// four values: +// +// TRUTH First principles, math & science, open source code freely distributed +// FREEDOM Voluntary partnerships, freedom from tyranny & corporate control +// HARMONY Minimal waste, self-renewing systems with diverse thriving connections +// LOVE Be yourself without hurting others, cooperation through natural law +// +// This software contributes to that vision by enabling code execution across 42+ programming languages through a unified interface, accessible to all. +// Code is seeds to sprout on any abandoned technology. + /* Async Job Polling example - standalone version diff --git a/clients/go/async/examples/concurrent_execution.go b/clients/go/async/examples/concurrent_execution.go index 125417d..a958730 100644 --- a/clients/go/async/examples/concurrent_execution.go +++ b/clients/go/async/examples/concurrent_execution.go @@ -1,3 +1,19 @@ +// This is free software for the public good of a permacomputer hosted at +// permacomputer.com, an always-on computer by the people, for the people. +// One which is durable, easy to repair, & distributed like tap water +// for machine learning intelligence. +// +// The permacomputer is community-owned infrastructure optimized around +// four values: +// +// TRUTH First principles, math & science, open source code freely distributed +// FREEDOM Voluntary partnerships, freedom from tyranny & corporate control +// HARMONY Minimal waste, self-renewing systems with diverse thriving connections +// LOVE Be yourself without hurting others, cooperation through natural law +// +// This software contributes to that vision by enabling code execution across 42+ programming languages through a unified interface, accessible to all. +// Code is seeds to sprout on any abandoned technology. + /* Concurrent Execution example - standalone version diff --git a/clients/go/async/examples/hello_world.go b/clients/go/async/examples/hello_world.go index 384397e..121a799 100644 --- a/clients/go/async/examples/hello_world.go +++ b/clients/go/async/examples/hello_world.go @@ -1,3 +1,19 @@ +// This is free software for the public good of a permacomputer hosted at +// permacomputer.com, an always-on computer by the people, for the people. +// One which is durable, easy to repair, & distributed like tap water +// for machine learning intelligence. +// +// The permacomputer is community-owned infrastructure optimized around +// four values: +// +// TRUTH First principles, math & science, open source code freely distributed +// FREEDOM Voluntary partnerships, freedom from tyranny & corporate control +// HARMONY Minimal waste, self-renewing systems with diverse thriving connections +// LOVE Be yourself without hurting others, cooperation through natural law +// +// This software contributes to that vision by enabling code execution across 42+ programming languages through a unified interface, accessible to all. +// Code is seeds to sprout on any abandoned technology. + /* Hello World example - standalone version diff --git a/clients/go/async/src/un_async.go b/clients/go/async/src/un_async.go index ced6ea8..d53d80c 100644 --- a/clients/go/async/src/un_async.go +++ b/clients/go/async/src/un_async.go @@ -1,90 +1,18 @@ -/* -PUBLIC DOMAIN - NO LICENSE, NO WARRANTY - -unsandbox.com Go SDK (Asynchronous) - -Library Usage: - import "un_async" - - // Create credentials - creds, err := un_async.ResolveCredentials("", "") - if err != nil { - log.Fatal(err) - } - - // Execute code asynchronously (returns channel) - resultChan := un_async.ExecuteCode(creds, "python", `print("hello")`) - result := <-resultChan - if result.Err != nil { - log.Fatal(result.Err) - } - fmt.Println(result.Data) - - // Submit async job and get job ID - jobChan := un_async.ExecuteAsync(creds, "javascript", `console.log("hello")`) - jobResult := <-jobChan - if jobResult.Err != nil { - log.Fatal(jobResult.Err) - } - fmt.Println(jobResult.JobID) - - // Wait for job completion with timeout - waitChan := un_async.WaitForJob(creds, jobResult.JobID, 60*time.Second) - waitResult := <-waitChan - if waitResult.Err != nil { - log.Fatal(waitResult.Err) - } - - // List all jobs - listChan := un_async.ListJobs(creds) - listResult := <-listChan - if listResult.Err == nil { - for _, job := range listResult.Jobs { - fmt.Println(job) - } - } - - // Get supported languages (cached) - langChan := un_async.GetLanguages(creds) - langResult := <-langChan - if langResult.Err == nil { - for _, lang := range langResult.Languages { - fmt.Println(lang) - } - } - - // Detect language from filename (synchronous, no I/O) - lang := un_async.DetectLanguage("script.py") // Returns "python" - - // Snapshot operations - snapChan := un_async.SessionSnapshot(creds, sessionID, "my_snapshot", false) - snapResult := <-snapChan - -Authentication Priority (4-tier): - 1. Function arguments (creds struct with PublicKey, SecretKey) - 2. Environment variables (UNSANDBOX_PUBLIC_KEY, UNSANDBOX_SECRET_KEY) - 3. Config file (~/.unsandbox/accounts.csv, line 0 by default) - 4. Local directory (./accounts.csv, line 0 by default) - - Format: public_key,secret_key (one per line) - Account selection: UNSANDBOX_ACCOUNT=N env var (0-based index) - -Request Authentication (HMAC-SHA256): - Authorization: Bearer (identifies account) - X-Timestamp: (replay prevention) - X-Signature: HMAC-SHA256(secret_key, msg) (proves secret + body integrity) - - Message format: "timestamp:METHOD:path:body" - - timestamp: seconds since epoch - - METHOD: GET, POST, DELETE, etc. (uppercase) - - path: e.g., "/execute", "/jobs/123" - - body: JSON payload (empty string for GET/DELETE) - -Languages Cache: - - Cached in ~/.unsandbox/languages.json - - TTL: 1 hour - - Updated on successful API calls -*/ +// This is free software for the public good of a permacomputer hosted at +// permacomputer.com, an always-on computer by the people, for the people. +// One which is durable, easy to repair, & distributed like tap water +// for machine learning intelligence. +// +// The permacomputer is community-owned infrastructure optimized around +// four values: +// +// TRUTH First principles, math & science, open source code freely distributed +// FREEDOM Voluntary partnerships, freedom from tyranny & corporate control +// HARMONY Minimal waste, self-renewing systems with diverse thriving connections +// LOVE Be yourself without hurting others, cooperation through natural law +// +// This software contributes to that vision by enabling code execution across 42+ programming languages through a unified interface, accessible to all. +// Code is seeds to sprout on any abandoned technology. package un_async diff --git a/clients/go/async/tests/un_async_test.go b/clients/go/async/tests/un_async_test.go index 81e1341..1879ffb 100644 --- a/clients/go/async/tests/un_async_test.go +++ b/clients/go/async/tests/un_async_test.go @@ -1,3 +1,19 @@ +// This is free software for the public good of a permacomputer hosted at +// permacomputer.com, an always-on computer by the people, for the people. +// One which is durable, easy to repair, & distributed like tap water +// for machine learning intelligence. +// +// The permacomputer is community-owned infrastructure optimized around +// four values: +// +// TRUTH First principles, math & science, open source code freely distributed +// FREEDOM Voluntary partnerships, freedom from tyranny & corporate control +// HARMONY Minimal waste, self-renewing systems with diverse thriving connections +// LOVE Be yourself without hurting others, cooperation through natural law +// +// This software contributes to that vision by enabling code execution across 42+ programming languages through a unified interface, accessible to all. +// Code is seeds to sprout on any abandoned technology. + /* Tests for the unsandbox Go SDK (Asynchronous) diff --git a/clients/go/sync/examples/hello_world.go b/clients/go/sync/examples/hello_world.go index f20cafb..f22cf9f 100644 --- a/clients/go/sync/examples/hello_world.go +++ b/clients/go/sync/examples/hello_world.go @@ -1,3 +1,19 @@ +// This is free software for the public good of a permacomputer hosted at +// permacomputer.com, an always-on computer by the people, for the people. +// One which is durable, easy to repair, & distributed like tap water +// for machine learning intelligence. +// +// The permacomputer is community-owned infrastructure optimized around +// four values: +// +// TRUTH First principles, math & science, open source code freely distributed +// FREEDOM Voluntary partnerships, freedom from tyranny & corporate control +// HARMONY Minimal waste, self-renewing systems with diverse thriving connections +// LOVE Be yourself without hurting others, cooperation through natural law +// +// This software contributes to that vision by enabling code execution across 42+ programming languages through a unified interface, accessible to all. +// Code is seeds to sprout on any abandoned technology. + package main import "fmt" diff --git a/clients/go/sync/src/un.go b/clients/go/sync/src/un.go index 2281cd0..03097b2 100644 --- a/clients/go/sync/src/un.go +++ b/clients/go/sync/src/un.go @@ -1,81 +1,18 @@ -/* -PUBLIC DOMAIN - NO LICENSE, NO WARRANTY - -unsandbox.com Go SDK (Synchronous) - -Library Usage: - import "un" - - // Create credentials - creds, err := un.ResolveCredentials("", "") - if err != nil { - log.Fatal(err) - } - - // Execute code synchronously - result, err := un.ExecuteCode(creds, "python", `print("hello")`) - if err != nil { - log.Fatal(err) - } - - // Execute asynchronously - jobID, err := un.ExecuteAsync(creds, "javascript", `console.log("hello")`) - if err != nil { - log.Fatal(err) - } - - // Wait for job completion with exponential backoff - result, err := un.WaitForJob(creds, jobID) - if err != nil { - log.Fatal(err) - } - - // List all jobs - jobs, err := un.ListJobs(creds) - if err != nil { - log.Fatal(err) - } - - // Get supported languages - languages, err := un.GetLanguages(creds) - if err != nil { - log.Fatal(err) - } - - // Detect language from filename - lang := un.DetectLanguage("script.py") // Returns "python" - - // Snapshot operations (NEW) - snapshotID, err := un.SessionSnapshot(creds, sessionID, "my_snapshot", false) - snapshots, err := un.ListSnapshots(creds) - result, err := un.RestoreSnapshot(creds, snapshotID) - err = un.DeleteSnapshot(creds, snapshotID) - -Authentication Priority (4-tier): - 1. Function arguments (publicKey, secretKey) - 2. Environment variables (UNSANDBOX_PUBLIC_KEY, UNSANDBOX_SECRET_KEY) - 3. Config file (~/.unsandbox/accounts.csv, line 0 by default) - 4. Local directory (./accounts.csv, line 0 by default) - - Format: public_key,secret_key (one per line) - Account selection: UNSANDBOX_ACCOUNT=N env var (0-based index) - -Request Authentication (HMAC-SHA256): - Authorization: Bearer (identifies account) - X-Timestamp: (replay prevention) - X-Signature: HMAC-SHA256(secret_key, msg) (proves secret + body integrity) - - Message format: "timestamp:METHOD:path:body" - - timestamp: seconds since epoch - - METHOD: GET, POST, DELETE, etc. (uppercase) - - path: e.g., "/execute", "/jobs/123" - - body: JSON payload (empty string for GET/DELETE) - -Languages Cache: - - Cached in ~/.unsandbox/languages.json - - TTL: 1 hour - - Updated on successful API calls -*/ +// This is free software for the public good of a permacomputer hosted at +// permacomputer.com, an always-on computer by the people, for the people. +// One which is durable, easy to repair, & distributed like tap water +// for machine learning intelligence. +// +// The permacomputer is community-owned infrastructure optimized around +// four values: +// +// TRUTH First principles, math & science, open source code freely distributed +// FREEDOM Voluntary partnerships, freedom from tyranny & corporate control +// HARMONY Minimal waste, self-renewing systems with diverse thriving connections +// LOVE Be yourself without hurting others, cooperation through natural law +// +// This software contributes to that vision by enabling code execution across 42+ programming languages through a unified interface, accessible to all. +// Code is seeds to sprout on any abandoned technology. package un diff --git a/clients/go/sync/tests/un_test.go b/clients/go/sync/tests/un_test.go index 0bd06fb..27db114 100644 --- a/clients/go/sync/tests/un_test.go +++ b/clients/go/sync/tests/un_test.go @@ -1,3 +1,19 @@ +// This is free software for the public good of a permacomputer hosted at +// permacomputer.com, an always-on computer by the people, for the people. +// One which is durable, easy to repair, & distributed like tap water +// for machine learning intelligence. +// +// The permacomputer is community-owned infrastructure optimized around +// four values: +// +// TRUTH First principles, math & science, open source code freely distributed +// FREEDOM Voluntary partnerships, freedom from tyranny & corporate control +// HARMONY Minimal waste, self-renewing systems with diverse thriving connections +// LOVE Be yourself without hurting others, cooperation through natural law +// +// This software contributes to that vision by enabling code execution across 42+ programming languages through a unified interface, accessible to all. +// Code is seeds to sprout on any abandoned technology. + // Tests for the Go unsandbox SDK // Run with: go test -v ./tests/ package un diff --git a/clients/javascript/async/examples/async_job_polling.js b/clients/javascript/async/examples/async_job_polling.js index c4dadec..dff2e85 100644 --- a/clients/javascript/async/examples/async_job_polling.js +++ b/clients/javascript/async/examples/async_job_polling.js @@ -1,4 +1,20 @@ #!/usr/bin/env node +// This is free software for the public good of a permacomputer hosted at +// permacomputer.com, an always-on computer by the people, for the people. +// One which is durable, easy to repair, & distributed like tap water +// for machine learning intelligence. +// +// The permacomputer is community-owned infrastructure optimized around +// four values: +// +// TRUTH First principles, math & science, open source code freely distributed +// FREEDOM Voluntary partnerships, freedom from tyranny & corporate control +// HARMONY Minimal waste, self-renewing systems with diverse thriving connections +// LOVE Be yourself without hurting others, cooperation through natural law +// +// This software contributes to that vision by enabling code execution across 42+ programming languages through a unified interface, accessible to all. +// Code is seeds to sprout on any abandoned technology. + /** * Async Job Polling example for unsandbox JavaScript SDK * diff --git a/clients/javascript/async/examples/concurrent_execution.js b/clients/javascript/async/examples/concurrent_execution.js index c510616..ed830f7 100644 --- a/clients/javascript/async/examples/concurrent_execution.js +++ b/clients/javascript/async/examples/concurrent_execution.js @@ -1,4 +1,20 @@ #!/usr/bin/env node +// This is free software for the public good of a permacomputer hosted at +// permacomputer.com, an always-on computer by the people, for the people. +// One which is durable, easy to repair, & distributed like tap water +// for machine learning intelligence. +// +// The permacomputer is community-owned infrastructure optimized around +// four values: +// +// TRUTH First principles, math & science, open source code freely distributed +// FREEDOM Voluntary partnerships, freedom from tyranny & corporate control +// HARMONY Minimal waste, self-renewing systems with diverse thriving connections +// LOVE Be yourself without hurting others, cooperation through natural law +// +// This software contributes to that vision by enabling code execution across 42+ programming languages through a unified interface, accessible to all. +// Code is seeds to sprout on any abandoned technology. + /** * Concurrent Execution example for unsandbox JavaScript SDK * diff --git a/clients/javascript/async/examples/fibonacci.js b/clients/javascript/async/examples/fibonacci.js index 218e48d..3b8210f 100644 --- a/clients/javascript/async/examples/fibonacci.js +++ b/clients/javascript/async/examples/fibonacci.js @@ -1,4 +1,20 @@ #!/usr/bin/env node +// This is free software for the public good of a permacomputer hosted at +// permacomputer.com, an always-on computer by the people, for the people. +// One which is durable, easy to repair, & distributed like tap water +// for machine learning intelligence. +// +// The permacomputer is community-owned infrastructure optimized around +// four values: +// +// TRUTH First principles, math & science, open source code freely distributed +// FREEDOM Voluntary partnerships, freedom from tyranny & corporate control +// HARMONY Minimal waste, self-renewing systems with diverse thriving connections +// LOVE Be yourself without hurting others, cooperation through natural law +// +// This software contributes to that vision by enabling code execution across 42+ programming languages through a unified interface, accessible to all. +// Code is seeds to sprout on any abandoned technology. + /** * Fibonacci example - standalone version * diff --git a/clients/javascript/async/examples/hello_world.js b/clients/javascript/async/examples/hello_world.js index 0337ddb..fb2b086 100644 --- a/clients/javascript/async/examples/hello_world.js +++ b/clients/javascript/async/examples/hello_world.js @@ -1,4 +1,20 @@ #!/usr/bin/env node +// This is free software for the public good of a permacomputer hosted at +// permacomputer.com, an always-on computer by the people, for the people. +// One which is durable, easy to repair, & distributed like tap water +// for machine learning intelligence. +// +// The permacomputer is community-owned infrastructure optimized around +// four values: +// +// TRUTH First principles, math & science, open source code freely distributed +// FREEDOM Voluntary partnerships, freedom from tyranny & corporate control +// HARMONY Minimal waste, self-renewing systems with diverse thriving connections +// LOVE Be yourself without hurting others, cooperation through natural law +// +// This software contributes to that vision by enabling code execution across 42+ programming languages through a unified interface, accessible to all. +// Code is seeds to sprout on any abandoned technology. + /** * Hello World example - standalone version * diff --git a/clients/javascript/async/examples/language_detection.js b/clients/javascript/async/examples/language_detection.js index 263bbc8..1d2be0c 100644 --- a/clients/javascript/async/examples/language_detection.js +++ b/clients/javascript/async/examples/language_detection.js @@ -1,4 +1,20 @@ #!/usr/bin/env node +// This is free software for the public good of a permacomputer hosted at +// permacomputer.com, an always-on computer by the people, for the people. +// One which is durable, easy to repair, & distributed like tap water +// for machine learning intelligence. +// +// The permacomputer is community-owned infrastructure optimized around +// four values: +// +// TRUTH First principles, math & science, open source code freely distributed +// FREEDOM Voluntary partnerships, freedom from tyranny & corporate control +// HARMONY Minimal waste, self-renewing systems with diverse thriving connections +// LOVE Be yourself without hurting others, cooperation through natural law +// +// This software contributes to that vision by enabling code execution across 42+ programming languages through a unified interface, accessible to all. +// Code is seeds to sprout on any abandoned technology. + /** * Language Detection example - standalone version * diff --git a/clients/javascript/async/src/un_async.js b/clients/javascript/async/src/un_async.js index 35d21c7..446184c 100644 --- a/clients/javascript/async/src/un_async.js +++ b/clients/javascript/async/src/un_async.js @@ -1,68 +1,19 @@ #!/usr/bin/env node -/** - * PUBLIC DOMAIN - NO LICENSE, NO WARRANTY - * - * unsandbox.com JavaScript SDK (Asynchronous with native fetch) - * Isomorphic: Works in Node.js (CLI + SDK) and Browser environments - * - * Library Usage: - * import { - * // Code execution - * executeCode, executeAsync, getJob, waitForJob, cancelJob, listJobs, - * getLanguages, detectLanguage, - * // Session management - * listSessions, getSession, createSession, deleteSession, - * freezeSession, unfreezeSession, boostSession, unboostSession, shellSession, - * // Service management - * listServices, createService, getService, updateService, deleteService, - * freezeService, unfreezeService, lockService, unlockService, setUnfreezeOnDemand, setShowFreezePage, - * getServiceLogs, getServiceEnv, setServiceEnv, deleteServiceEnv, - * exportServiceEnv, redeployService, executeInService, - * // Snapshot management - * sessionSnapshot, serviceSnapshot, listSnapshots, restoreSnapshot, - * deleteSnapshot, lockSnapshot, unlockSnapshot, cloneSnapshot, - * // Key validation - * validateKeys, - * } from './un_async.js'; - * - * // Execute code (awaits until completion) - * const result = await executeCode('python', 'print("hello")', publicKey, secretKey); - * - * // Execute asynchronously (returns job_id immediately) - * const jobId = await executeAsync('javascript', 'console.log("hello")', publicKey, secretKey); - * - * // Wait for job completion with exponential backoff - * const result = await waitForJob(jobId, publicKey, secretKey); - * - * // Snapshot operations - * const snapshotId = await sessionSnapshot(sessionId, publicKey, secretKey, 'my-snapshot'); - * const snapshots = await listSnapshots(publicKey, secretKey); - * - * Authentication Priority (5-tier): - * 1. Function arguments (publicKey, secretKey) - * 2. Environment variables (UNSANDBOX_PUBLIC_KEY, UNSANDBOX_SECRET_KEY) [Node.js] - * 3. Encrypted vault or localStorage [Browser] (vault preferred if CryptoJS available) - * 4. ~/.unsandbox/accounts.csv [Node.js] - * 5. ./accounts.csv [Node.js] - * - * Request Authentication (HMAC-SHA256): - * Authorization: Bearer - * X-Timestamp: - * X-Signature: HMAC-SHA256(secretKey, "timestamp:METHOD:path:body") - * - * Languages Cache: - * - Cached in ~/.unsandbox/languages.json (Node.js only) - * - TTL: 1 hour - * - Updated on successful API calls - * - * Browser Usage: - * - Import as ES module: