refactor: trim exec infra exports · openclaw/openclaw@45dee50
steipete
·
2026-05-02
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -82,7 +82,7 @@ function isKnownArchNameToken(token: string): boolean {
|
82 | 82 | |
83 | 83 | type WrapperScanDirective = "continue" | "consume-next" | "stop" | "invalid"; |
84 | 84 | |
85 | | -export function isEnvAssignment(token: string): boolean { |
| 85 | +function isEnvAssignment(token: string): boolean { |
86 | 86 | return /^[A-Za-z_][A-Za-z0-9_]*=.*/.test(token); |
87 | 87 | } |
88 | 88 | |
@@ -531,12 +531,12 @@ const DISPATCH_WRAPPER_SPEC_BY_NAME = new Map(
|
531 | 531 | DISPATCH_WRAPPER_SPECS.map((spec) => [spec.name, spec] as const), |
532 | 532 | ); |
533 | 533 | |
534 | | -export type DispatchWrapperUnwrapResult = |
| 534 | +type DispatchWrapperUnwrapResult = |
535 | 535 | | { kind: "not-wrapper" } |
536 | 536 | | { kind: "blocked"; wrapper: string } |
537 | 537 | | { kind: "unwrapped"; wrapper: string; argv: string[] }; |
538 | 538 | |
539 | | -export type DispatchWrapperTrustPlan = { |
| 539 | +type DispatchWrapperTrustPlan = { |
540 | 540 | argv: string[]; |
541 | 541 | wrappers: string[]; |
542 | 542 | policyBlocked: boolean; |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -40,8 +40,6 @@ import {
|
40 | 40 | } from "./plugin-approvals.js"; |
41 | 41 | |
42 | 42 | const log = createSubsystemLogger("gateway/exec-approvals"); |
43 | | -export type { ExecApprovalRequest, ExecApprovalResolved }; |
44 | | - |
45 | 43 | type DeliverOutboundPayloads = typeof import("./outbound/deliver.js").deliverOutboundPayloads; |
46 | 44 | type MaybePromise<T> = T | Promise<T>; |
47 | 45 | type ResolveSessionTargetFn = (params: { |
@@ -126,7 +124,7 @@ export type ExecApprovalForwarder = {
|
126 | 124 | stop: () => void; |
127 | 125 | }; |
128 | 126 | |
129 | | -export type ExecApprovalForwarderDeps = { |
| 127 | +type ExecApprovalForwarderDeps = { |
130 | 128 | getConfig?: () => OpenClawConfig; |
131 | 129 | deliver?: DeliverOutboundPayloads; |
132 | 130 | nowMs?: () => number; |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -26,12 +26,12 @@ type ExecPolicyConfig = {
|
26 | 26 | ask?: ExecAsk; |
27 | 27 | }; |
28 | 28 | |
29 | | -export type ExecPolicyHostSummary = { |
| 29 | +type ExecPolicyHostSummary = { |
30 | 30 | requested: ExecTarget; |
31 | 31 | requestedSource: string; |
32 | 32 | }; |
33 | 33 | |
34 | | -export type ExecPolicyFieldSummary<TValue extends ExecSecurity | ExecAsk> = { |
| 34 | +type ExecPolicyFieldSummary<TValue extends ExecSecurity | ExecAsk> = { |
35 | 35 | requested: TValue; |
36 | 36 | requestedSource: string; |
37 | 37 | host: TValue; |
@@ -54,7 +54,7 @@ export type ExecPolicyScopeSnapshot = {
|
54 | 54 | allowedDecisions: readonly ExecApprovalDecision[]; |
55 | 55 | }; |
56 | 56 | |
57 | | -export type ExecPolicyScopeSummary = Omit<ExecPolicyScopeSnapshot, "allowedDecisions">; |
| 57 | +type ExecPolicyScopeSummary = Omit<ExecPolicyScopeSnapshot, "allowedDecisions">; |
58 | 58 | |
59 | 59 | type ExecPolicyRequestedField = "security" | "ask"; |
60 | 60 | |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -64,7 +64,7 @@ export function makeMockCommandResolution(params: {
|
64 | 64 | }); |
65 | 65 | } |
66 | 66 | |
67 | | -export type ShellParserParityFixtureCase = { |
| 67 | +type ShellParserParityFixtureCase = { |
68 | 68 | id: string; |
69 | 69 | command: string; |
70 | 70 | ok: boolean; |
@@ -75,7 +75,7 @@ type ShellParserParityFixture = {
|
75 | 75 | cases: ShellParserParityFixtureCase[]; |
76 | 76 | }; |
77 | 77 | |
78 | | -export type WrapperResolutionParityFixtureCase = { |
| 78 | +type WrapperResolutionParityFixtureCase = { |
79 | 79 | id: string; |
80 | 80 | argv: string[]; |
81 | 81 | expectedRawExecutable: string | null; |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -22,7 +22,7 @@ export type ExecHostRunResult = {
|
22 | 22 | error?: string | null; |
23 | 23 | }; |
24 | 24 | |
25 | | -export type ExecHostError = { |
| 25 | +type ExecHostError = { |
26 | 26 | code: string; |
27 | 27 | message: string; |
28 | 28 | reason?: string; |
|
| Original file line number | Diff line number | Diff line change |
|---|
|
1 | 1 | import { normalizeLowercaseStringOrEmpty } from "../shared/string-coerce.js"; |
2 | 2 | import { normalizeExecutableToken } from "./exec-wrapper-resolution.js"; |
3 | 3 | |
4 | | -export type InterpreterInlineEvalHit = { |
| 4 | +type InterpreterInlineEvalHit = { |
5 | 5 | executable: string; |
6 | 6 | normalizedExecutable: string; |
7 | 7 | flag: string; |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -14,7 +14,7 @@ import {
|
14 | 14 | type WritableTrustedSafeBinDir, |
15 | 15 | } from "./exec-safe-bin-trust.js"; |
16 | 16 | |
17 | | -export type ExecSafeBinConfigScope = { |
| 17 | +type ExecSafeBinConfigScope = { |
18 | 18 | safeBins?: string[] | null; |
19 | 19 | safeBinProfiles?: SafeBinProfileFixtures | null; |
20 | 20 | safeBinTrustedDirs?: string[] | null; |
|
| Original file line number | Diff line number | Diff line change |
|---|
|
1 | 1 | import { normalizeLowercaseStringOrEmpty } from "../shared/string-coerce.js"; |
2 | 2 | |
3 | | -export type SafeBinSemanticValidationParams = { |
| 3 | +type SafeBinSemanticValidationParams = { |
4 | 4 | binName?: string; |
5 | 5 | positional: readonly string[]; |
6 | 6 | }; |
@@ -64,7 +64,7 @@ export function normalizeSafeBinName(raw: string): string {
|
64 | 64 | return normalized.replace(/\.(?:exe|cmd|bat|com)$/i, ""); |
65 | 65 | } |
66 | 66 | |
67 | | -export function getSafeBinSemanticRule(binName?: string): SafeBinSemanticRule | undefined { |
| 67 | +function getSafeBinSemanticRule(binName?: string): SafeBinSemanticRule | undefined { |
68 | 68 | const normalized = typeof binName === "string" ? normalizeSafeBinName(binName) : ""; |
69 | 69 | return normalized ? SAFE_BIN_SEMANTIC_RULES[normalized] : undefined; |
70 | 70 | } |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -9,7 +9,7 @@ import {
|
9 | 9 | unwrapKnownShellMultiplexerInvocation, |
10 | 10 | } from "./shell-wrapper-resolution.js"; |
11 | 11 | |
12 | | -export type ExecWrapperTrustPlan = { |
| 12 | +type ExecWrapperTrustPlan = { |
13 | 13 | argv: string[]; |
14 | 14 | policyArgv: string[]; |
15 | 15 | wrapperChain: string[]; |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -3,7 +3,7 @@ import path from "node:path";
|
3 | 3 | import { normalizeLowercaseStringOrEmpty } from "../shared/string-coerce.js"; |
4 | 4 | import { expandHomePrefix } from "./home-dir.js"; |
5 | 5 | |
6 | | -export function isDriveLessWindowsRootedPath(value: string): boolean { |
| 6 | +function isDriveLessWindowsRootedPath(value: string): boolean { |
7 | 7 | return process.platform === "win32" && /^:[\\/]/.test(value); |
8 | 8 | } |
9 | 9 | |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。