Cross-platform agents, standalone server, script engines, custom roles, platform binaries #3

Merged
gsadmin merged 13 commits from dev into main 2026-08-08 02:04:50 +00:00

13 Commits

Author SHA256 Message Date
gsadmin 682dcfe929 Refresh screenshots: Access page, role editor, engine selector
CI / build-test (push) Successful in 9m33s
CI / images (push) Successful in 1m41s
CI / build-test (pull_request) Successful in 3m14s
CI / images (pull_request) Has been skipped
Re-captures every nav-bearing page (the rail gained Access), the
script editor showing the engine selector with loaded Monaco content,
and adds two Access-control shots: the users/roles overview and the
role editor with the permission grid, OIDC claim values and device
scope. README embeds them in the custom-roles section and the gallery.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-07 21:41:21 -04:00
gsadmin e696feb217 Download bundled modules with WebClient
Skips Invoke-WebRequest progress-rendering overhead; the gallery
redirect is followed automatically.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-07 21:41:20 -04:00
gsadmin deff3158e6 Bundle PSResourceGet, Archive and ThreadJob with the agent
CI / build-test (push) Successful in 8m46s
CI / images (push) Successful in 1m41s
The PowerShell SDK ships only the core engine modules, so gallery
access on a bare endpoint depended on whatever happened to be
installed. Package-Agent now stages pinned PSGallery downloads
(PSResourceGet 1.2.0, Archive 1.2.6, ThreadJob 2.2.0) into a Modules
directory next to the binary for every platform, the MSI installs it,
and the agent prepends it to PSModulePath — covering the embedded
engine and, via process-environment inheritance, Windows PowerShell
5.1 child processes too. Install-PSResource needs no NuGet-provider
bootstrap, and AllUsers installs land on the standard module path
where later jobs resolve them.

Verified in the embedded host with only the bundled directory on the
path: PSResourceGet loads and reports PSGallery, Compress-Archive
produces a zip, Start-ThreadJob round-trips. Also drops the payload
trim rules for modules the SDK no longer ships.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-07 21:23:29 -04:00
gsadmin 6be8b9b57b Expand parameter strings through the runspace intrinsic directly
runspace.SessionStateProxy.InvokeCommand.ExpandString is a direct .NET
call into the engine on the job's idle in-process runspace — identical
double-quoted-string semantics without compiling a wrapper pipeline per
value. Malformed interpolation now falls back to the env-expanded text
explicitly instead of relying on an empty pipeline result.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-07 21:23:28 -04:00
gsadmin 5c0f16c2a9 Test the full cookie sign-in flow against permission-gated endpoints
CI / build-test (push) Successful in 8m0s
CI / images (push) Successful in 2m22s
Admin sign-in returns the wildcard permission set and reaches role
administration; a Viewer session reads devices but is refused
management. Exercises login, claims, the policy provider and the
role cache end to end over HTTP.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-07 20:07:33 -04:00
gsadmin 34c10b2f87 README: standalone server, unix agents, script engines, custom roles
CI / build-test (push) Successful in 8m28s
CI / images (push) Successful in 2m15s
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-07 20:03:47 -04:00
gsadmin 1ff1a2273e CI builds every platform binary: agent x5 RIDs, standalone server x2
Package-Agent gains -Runtimes and picks the right flavor per RID
(net10.0-windows for win, portable net10.0 elsewhere) — this also fixes
publishing after the multi-targeting change, which requires an explicit
framework. Unix binaries ship as executer-agent; the MSI still harvests
the win-x64 output.

CI packages the agent for win-x64/linux-x64/linux-arm64/osx-x64/
osx-arm64 plus the combined standalone server (win-x64, linux-x64) and
uploads everything as a "binaries" artifact with checksums. Releases
attach the same set (Server zips included), and the release workflow
sets up Node 22 for the static WebUI build the server bundle needs.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-07 20:02:18 -04:00
gsadmin 1fdc4aedc6 Custom roles: permission-based access control with device scoping
Replaces the fixed Viewer/Operator/Admin policy tiers with role objects.
A role bundles grantable permissions (devices, groups, scripts,
functions, jobs, automation, secrets, shell, files, settings, access),
optionally limits members to a device-group scope, and lists the OIDC
claim values that map identity-provider groups onto it — so who can do
what over which devices is fully configurable for local and SSO users
alike.

Three system roles matching the old tiers are seeded and immutable;
pre-upgrade users and cookies resolve onto them by name. Endpoints now
demand specific permissions ("perm:{key}" policies resolved through a
cached role snapshot, so edits apply without re-login). Scoped roles
only see and target their groups' devices across device listing,
job dispatch (single and group fan-out), shell, file delivery,
inventory refresh and tags. Safety rails: the last full-access user
can never be deleted or demoted, system roles cannot be edited, and
roles with assigned users cannot be dropped.

New Access page manages users (create local accounts, assign roles,
reset passwords) and roles (permission grid, OIDC claim values, device
scope); navigation hides sections the session cannot use. Session
responses now carry the role name and effective permissions.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-07 19:59:21 -04:00
gsadmin 48d165e360 Script engines: PowerShell 7 in-process, Windows PowerShell 5.1, Bash
CI / build-test (push) Failing after 3m13s
CI / images (push) Has been skipped
Each script picks its engine. The embedded PowerShell 7 engine remains
the default with the full feature set on every platform. Windows
PowerShell 5.1 shells out to powershell.exe with near parity: a
generated wrapper renders parameters as typed PowerShell literals
(hashtables and arrays included), defines the secrets dictionary
(natively case-insensitive), dot-sources the prelude and splats the
payload; progress records are the accepted limitation. Bash runs the
prelude+script with parameters and secrets as environment variables
(complex values as JSON) on unix or via Git Bash on Windows — the WSL
System32 shim is deliberately ignored because it drops environment
variables. Engines unavailable on a device fail the job with a clear
message instead of running.

The editor gains an engine selector that also switches Monaco's
language. Verified with real out-of-process runs: powershell.exe 5.1
(v=5, typed splat, $Secrets) and Git Bash (env-var params + secrets).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-07 19:39:20 -04:00
gsadmin 32e5c690a5 Agent runs on linux and macOS
CI / build-test (push) Failing after 3m24s
CI / images (push) Has been skipped
The agent multi-targets net10.0-windows (full stack: WMI inventory,
ConPTY shell, DPAPI, registry, SCM service) and net10.0 for linux/macOS:

- Configuration: /etc/executer/agent.json stands in for the registry —
  the same key paths address JSON sections, so the policy > config >
  default precedence chain is unchanged (FileRegistryStore, atomic
  writes, chmod 600).
- Credentials: root-owned mode-600 file in /var/lib/executer (DPAPI has
  no unix analogue; directory is 700).
- Identity: DMI sysfs + /etc/machine-id on linux, IOPlatformUUID/serial
  via ioreg + sysctl on macOS.
- Inventory: os-release/sw_vers, /proc/cpuinfo/meminfo or sysctl,
  /sys/block disks (linux), DriveInfo volumes, NetworkInterface adapters.
- Service: systemd unit on linux, launchd daemon on macOS, behind the
  same install/remove/start/stop/initialize/status commands.
- PowerShell scripts still run IN-PROCESS via the embedded SDK engine on
  every platform; a background idempotent bootstrap additionally installs
  the standalone pwsh host on unix (official installer script / brew) and
  never blocks or fails startup. Remote shell is ConPTY-based and refuses
  cleanly off Windows.

Payload trimming is now RID-aware so unix publishes keep their natives.
Windows behavior is unchanged; linux-x64 publish verified, all 169 tests
green with Agent.Tests exercising the cross-platform flavor.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-07 19:32:14 -04:00
gsadmin 86c8305ca3 Ignore the static WebUI build output
CI / build-test (push) Successful in 4m31s
CI / images (push) Successful in 3m8s
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-07 19:20:33 -04:00
gsadmin cf907afb4e Standalone combined server: one binary serving UI, API, messaging and NATS
`Package-Server.ps1` produces a self-contained single-file ExecuteRServer
per platform (win-x64/linux-x64) that embeds the WebUI as a static SPA
(ADAPTER=static build; SSR disabled — the app is fully client-driven),
relays /messaging/agent and /messaging/browser over WebSocket to a
bundled nats-server sidecar it supervises (spawned before the NATS
client connects, restarted with backoff, killed on shutdown), and runs
as a Windows service or systemd unit via `service install|uninstall`.
`setup` generates the NATS operator keys, sidecar config (relative
include paths — nats-server mangles Windows drive-letter absolutes) and
appsettings.json. Windows publishes carry the app icon.

Verified end to end from the packaged zip: setup → run → SPA served,
/api/ready shows natsConnected:true, admin login 200, and a WebSocket
to /messaging/browser receives the NATS INFO greeting through the relay.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-07 19:20:21 -04:00
gsadmin 7ea2efbca6 Agent package folder is an explicit host bind mount for out-of-band updates
/data/agent (the AGENT_PACKAGE_PATH default, checked before the baked
image copy) now maps to API/AgentPackage on the host, so dropping a new
Agent.msi/Agent.zip there ships an agent update with no backend build.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-07 18:59:33 -04:00