Feat v0.8.2 capability negotiation (#69)
All checks were successful
CI/CD / detect-changes (push) Successful in 4s
CI/CD / test-frontend (push) Has been skipped
CI/CD / test-runners (push) Has been skipped
CI/CD / e2e-smoke (push) Has been skipped
CI/CD / test-go-pg (push) Successful in 2m47s
CI/CD / test-sqlite (push) Successful in 2m52s
CI/CD / build-and-deploy (push) Successful in 30s

Co-authored-by: Jeffrey Smith <jasafpro@gmail.com>
Co-committed-by: Jeffrey Smith <jasafpro@gmail.com>
This commit was merged in pull request #69.
This commit is contained in:
2026-04-03 09:14:00 +00:00
committed by xcaliber
parent 435f972ded
commit 00ef970163
16 changed files with 593 additions and 96 deletions

View File

@@ -81,6 +81,7 @@ type Runner struct {
objectStore storage.ObjectStore // nil = files module unavailable
workspaceRoot string // empty = workspace module unavailable
workspaceQuota int // MB, 0 = unlimited
capabilities map[string]bool // detected environment capabilities
}
// NewRunner creates a runner with the given sandbox and dependencies.
@@ -132,6 +133,12 @@ func (r *Runner) SetWorkspaceRoot(root string, quotaMB int) {
r.workspaceQuota = quotaMB
}
// SetCapabilities stores the detected environment capabilities map.
// Passed to the settings module so extensions can call has_capability().
func (r *Runner) SetCapabilities(caps map[string]bool) {
r.capabilities = caps
}
// SetAllowPrivateIPs disables the SSRF check that blocks connections to
// private/loopback IPs. For self-hosted environments where extensions
// reach internal services. Controlled by EXT_ALLOW_PRIVATE_IPS env var.
@@ -441,7 +448,7 @@ func (r *Runner) buildModulesWithLibCtx(ctx context.Context, packageID string, m
userID = rc.UserID
teamID = rc.TeamID
}
modules["settings"] = BuildSettingsModule(ctx, r.stores, packageID, userID, teamID)
modules["settings"] = BuildSettingsModule(ctx, r.stores, packageID, userID, teamID, r.capabilities)
// Always available — read-only check against kernel permission data
modules["permissions"] = BuildPermissionsModule(ctx, r.stores)