feat(ptc): expose per-program timeout and sandbox approval controls
This commit is contained in:
1 parent
c5de252f8c
commit
a248cc4e64
5 files changed
+234
-5
No files matched your search
@@ -93,6 +93,10 @@ export class NodeCodeRuntime extends CodeRuntime {
|
||||
|
||||
override get sandboxMode(): SandboxMode { return this.ctx.sandboxPolicy.defaultMode }
|
||||
|
||||
override get timeout(): { defaultMs: number; maxMs: number } {
|
||||
return { defaultMs: Math.min(this.config.timeoutMs, this.config.maxTimeoutMs), maxMs: this.config.maxTimeoutMs }
|
||||
}
|
||||
|
||||
/**
|
||||
* Resolve an execution under explicit or deployment policy.
|
||||
* @param request - Program, bindings, optional cwd/deadline, and resolved authority.
|
||||
|
||||
@@ -124,6 +124,9 @@ export abstract class CodeRuntime extends Service {
|
||||
/** Deployment file-policy mode, or undefined for a provider without confinement support. */
|
||||
get sandboxMode(): SandboxMode | undefined { return undefined }
|
||||
|
||||
/** Configured elapsed-time defaults and cap, or undefined when per-call overrides are unsupported. */
|
||||
get timeout(): { defaultMs: number; maxMs: number } | undefined { return undefined }
|
||||
|
||||
constructor(ctx: Context) {
|
||||
super(ctx, 'codeRuntime')
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user