dsh-permission-rules 0.6.21 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -0
- package/README.es.md +6 -1
- package/README.hi.md +6 -1
- package/README.md +6 -1
- package/README.pt.md +6 -1
- package/README.zh.md +6 -1
- package/docs/rules-format.en.md +2 -1
- package/docs/rules-format.md +2 -1
- package/lib/client.js +6924 -37
- package/lib/client.js.map +1 -1
- package/lib/index.js +671 -28
- package/lib/typert.host.js +74 -3
- package/lib/types/allow-host.d.ts +151 -0
- package/lib/types/allow-host.d.ts.map +1 -0
- package/lib/types/client/index.d.ts.map +1 -1
- package/lib/types/client/locales.d.ts +1 -1
- package/lib/types/client/locales.d.ts.map +1 -1
- package/lib/types/client/remote.d.ts +54 -1
- package/lib/types/client/remote.d.ts.map +1 -1
- package/lib/types/client/section.d.ts +3 -1
- package/lib/types/client/section.d.ts.map +1 -1
- package/lib/types/config.d.ts +22 -0
- package/lib/types/config.d.ts.map +1 -1
- package/lib/types/prose.d.ts +1 -0
- package/lib/types/prose.d.ts.map +1 -1
- package/lib/types/proxy.d.ts +73 -0
- package/lib/types/proxy.d.ts.map +1 -1
- package/lib/types/remote-service.d.ts +9 -1
- package/lib/types/remote-service.d.ts.map +1 -1
- package/lib/types/rules.d.ts +11 -0
- package/lib/types/rules.d.ts.map +1 -1
- package/lib/types/runtime.d.ts +76 -11
- package/lib/types/runtime.d.ts.map +1 -1
- package/lib/types/typert.host.d.ts +50 -0
- package/lib/types/typert.host.d.ts.map +1 -1
- package/lib/types/wire.d.ts +191 -0
- package/lib/types/wire.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/allow-host.ts +307 -0
- package/src/client/index.ts +7 -1
- package/src/client/locales.ts +36 -0
- package/src/client/remote.ts +4 -1
- package/src/client/section.ts +83 -10
- package/src/config.ts +56 -0
- package/src/prose.ts +6 -0
- package/src/proxy.ts +202 -16
- package/src/remote-service.ts +33 -1
- package/src/rules.ts +11 -2
- package/src/runtime.ts +243 -9
- package/src/wire.ts +119 -0
package/lib/typert.host.js
CHANGED
|
@@ -4137,13 +4137,26 @@ const PERMISSION_RULES_SNAPSHOT_SCHEMA = object({
|
|
|
4137
4137
|
matched: boolean(),
|
|
4138
4138
|
source: string(),
|
|
4139
4139
|
ruleIndex: number().int().nullable(),
|
|
4140
|
-
reason: string().nullable()
|
|
4140
|
+
reason: string().nullable(),
|
|
4141
|
+
cwd: string().nullable()
|
|
4141
4142
|
})),
|
|
4142
4143
|
sources: array(object({
|
|
4143
4144
|
path: string(),
|
|
4144
4145
|
exists: boolean(),
|
|
4145
4146
|
cwd: string().nullable()
|
|
4146
|
-
}))
|
|
4147
|
+
})),
|
|
4148
|
+
allowHostAction: boolean(),
|
|
4149
|
+
upstream: object({
|
|
4150
|
+
mode: union([
|
|
4151
|
+
literal("off"),
|
|
4152
|
+
literal("inherit"),
|
|
4153
|
+
literal("url")
|
|
4154
|
+
]),
|
|
4155
|
+
http: string().nullable(),
|
|
4156
|
+
https: string().nullable(),
|
|
4157
|
+
active: boolean(),
|
|
4158
|
+
chained: number().int()
|
|
4159
|
+
})
|
|
4147
4160
|
});
|
|
4148
4161
|
/** Strict wire schema for {@link RulesReadResult}. */
|
|
4149
4162
|
const RULES_READ_SCHEMA = object({
|
|
@@ -4163,6 +4176,32 @@ const RULES_RELOAD_SCHEMA = object({
|
|
|
4163
4176
|
ok: boolean(),
|
|
4164
4177
|
error: string().nullable()
|
|
4165
4178
|
});
|
|
4179
|
+
/** Strict wire schema for {@link AllowHostRequest}. */
|
|
4180
|
+
const ALLOW_HOST_REQUEST_SCHEMA = object({
|
|
4181
|
+
host: string(),
|
|
4182
|
+
scheme: union([
|
|
4183
|
+
literal("http"),
|
|
4184
|
+
literal("https"),
|
|
4185
|
+
_null()
|
|
4186
|
+
]),
|
|
4187
|
+
port: number().int().nullable(),
|
|
4188
|
+
cwd: string().nullable()
|
|
4189
|
+
});
|
|
4190
|
+
/** Strict wire schema for {@link AllowHostResult}. */
|
|
4191
|
+
const ALLOW_HOST_RESULT_SCHEMA = object({
|
|
4192
|
+
ok: boolean(),
|
|
4193
|
+
path: string().nullable(),
|
|
4194
|
+
created: boolean(),
|
|
4195
|
+
reloaded: number().int(),
|
|
4196
|
+
outcome: union([
|
|
4197
|
+
literal("allow"),
|
|
4198
|
+
literal("deny"),
|
|
4199
|
+
literal("ask"),
|
|
4200
|
+
_null()
|
|
4201
|
+
]),
|
|
4202
|
+
alreadyAllowed: boolean(),
|
|
4203
|
+
error: string().nullable()
|
|
4204
|
+
});
|
|
4166
4205
|
/** The `permissionRules/networkStatus` invocation descriptor (no parameters). */
|
|
4167
4206
|
const NETWORK_STATUS_DESCRIPTOR = Object.freeze({
|
|
4168
4207
|
id: "dsh-permission-rules#permissionRules/networkStatus",
|
|
@@ -4267,6 +4306,37 @@ const RULES_RELOAD_DESCRIPTOR = Object.freeze({
|
|
|
4267
4306
|
})
|
|
4268
4307
|
});
|
|
4269
4308
|
/**
|
|
4309
|
+
* The `permissionRules/allowHost` invocation descriptor: one request object in,
|
|
4310
|
+
* one result object out.
|
|
4311
|
+
*/
|
|
4312
|
+
const ALLOW_HOST_DESCRIPTOR = Object.freeze({
|
|
4313
|
+
id: "dsh-permission-rules#permissionRules/allowHost",
|
|
4314
|
+
service: "permissionRules",
|
|
4315
|
+
namespace: "permissionRules",
|
|
4316
|
+
method: "allowHost",
|
|
4317
|
+
invocation: Object.freeze({ kind: "direct" }),
|
|
4318
|
+
parameters: Object.freeze([Object.freeze({
|
|
4319
|
+
name: "request",
|
|
4320
|
+
wire: "request",
|
|
4321
|
+
source: "json",
|
|
4322
|
+
codec: Object.freeze({
|
|
4323
|
+
mode: "strict",
|
|
4324
|
+
typeSymbol: "dsh-permission-rules/types#AllowHostRequest",
|
|
4325
|
+
schema: ALLOW_HOST_REQUEST_SCHEMA
|
|
4326
|
+
})
|
|
4327
|
+
})]),
|
|
4328
|
+
result: Object.freeze({
|
|
4329
|
+
mode: "strict",
|
|
4330
|
+
typeSymbol: "dsh-permission-rules/types#AllowHostResult",
|
|
4331
|
+
schema: ALLOW_HOST_RESULT_SCHEMA
|
|
4332
|
+
}),
|
|
4333
|
+
sourceLocation: Object.freeze({
|
|
4334
|
+
file: "src/wire.ts",
|
|
4335
|
+
line: 1,
|
|
4336
|
+
column: 1
|
|
4337
|
+
})
|
|
4338
|
+
});
|
|
4339
|
+
/**
|
|
4270
4340
|
* The canonical invocation list both Typert faces register — the host
|
|
4271
4341
|
* manifest and the client contribution share these exact descriptor
|
|
4272
4342
|
* objects, so the two wire codecs can never drift apart.
|
|
@@ -4275,7 +4345,8 @@ const PERMISSION_RULES_INVOCATIONS = Object.freeze([
|
|
|
4275
4345
|
NETWORK_STATUS_DESCRIPTOR,
|
|
4276
4346
|
RULES_READ_DESCRIPTOR,
|
|
4277
4347
|
RULES_SAVE_DESCRIPTOR,
|
|
4278
|
-
RULES_RELOAD_DESCRIPTOR
|
|
4348
|
+
RULES_RELOAD_DESCRIPTOR,
|
|
4349
|
+
ALLOW_HOST_DESCRIPTOR
|
|
4279
4350
|
]);
|
|
4280
4351
|
//#endregion
|
|
4281
4352
|
//#region src/typert.host.ts
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The settings-page "allow this host" action, as pure pieces: normalizing
|
|
3
|
+
* and validating a blocked host, inserting ONE minimal
|
|
4
|
+
* `match.network.domains` allow rule at the HEAD of a rule document, choosing
|
|
5
|
+
* which rule file the rule belongs in, and mapping the action's result onto
|
|
6
|
+
* the notice the page renders.
|
|
7
|
+
*
|
|
8
|
+
* Three invariants hold here and are asserted by `test/allow-host.spec.ts`:
|
|
9
|
+
*
|
|
10
|
+
* 1. the rule is inserted at index 0 — rules are first-match-wins, so a rule
|
|
11
|
+
* appended after an existing `deny` would be dead text;
|
|
12
|
+
* 2. a document the yaml parser reports an error for, or whose `rules` is not
|
|
13
|
+
* a list, is REFUSED (a {@link RuleError}) — the caller never overwrites a
|
|
14
|
+
* file it could not read; and
|
|
15
|
+
* 3. the insertion goes through the yaml Document API (`parseDocument` +
|
|
16
|
+
* `createNode` + `items.unshift` + `String(doc)`), so comments and the
|
|
17
|
+
* existing formatting of the untouched rules survive.
|
|
18
|
+
*
|
|
19
|
+
* Nothing here reads the filesystem or the process cwd: the runtime injects
|
|
20
|
+
* `exists`, `processCwd`, and the source lists it already computed, which is
|
|
21
|
+
* what makes the target choice testable without touching a real host.
|
|
22
|
+
* @module dsh-permission-rules/allow-host
|
|
23
|
+
*/
|
|
24
|
+
import type { AllowHostResult, RuleSourceView } from './wire.js';
|
|
25
|
+
/**
|
|
26
|
+
* Canonical spelling of a host for the allow action, matching target parsing
|
|
27
|
+
* exactly (see `normalizeHost`): lowercase, IPv6 brackets stripped, one
|
|
28
|
+
* trailing dot stripped.
|
|
29
|
+
* @param host - the host as the block record reported it.
|
|
30
|
+
* @returns the canonical spelling.
|
|
31
|
+
*/
|
|
32
|
+
export declare function normalizeAllowHost(host: string): string;
|
|
33
|
+
/**
|
|
34
|
+
* Whether a normalized host may be written into a rule: a host name or an IP
|
|
35
|
+
* literal, nothing else. This is the syntactic half of the action's safety —
|
|
36
|
+
* a newline, a `rules:` fragment, a glob, a URL, or a `host:port` authority is
|
|
37
|
+
* refused here rather than relying on the YAML emitter to quote it. The IP
|
|
38
|
+
* check is `node:net`'s `isIP`, so a `host:port` string (which merely contains
|
|
39
|
+
* a colon) is not mistaken for an IPv6 literal.
|
|
40
|
+
* @param host - the normalized host.
|
|
41
|
+
* @returns true when the host may be allowed.
|
|
42
|
+
*/
|
|
43
|
+
export declare function isWritableHost(host: string): boolean;
|
|
44
|
+
/**
|
|
45
|
+
* The `reason` carried by every generated rule. English on purpose: rule
|
|
46
|
+
* `reason`s are never translated (they are quoted verbatim in denial messages
|
|
47
|
+
* and in the session audit), so a localized reason would make one rule read
|
|
48
|
+
* differently per UI language.
|
|
49
|
+
* @param host - the allowed host.
|
|
50
|
+
* @returns the reason line.
|
|
51
|
+
*/
|
|
52
|
+
export declare function allowHostReason(host: string): string;
|
|
53
|
+
/** The outcome of one insertion attempt. */
|
|
54
|
+
export interface AllowHostInsertion {
|
|
55
|
+
/** The document text to write; identical to the input when `inserted` is false. */
|
|
56
|
+
readonly text: string;
|
|
57
|
+
/** Whether the rule was added (false = the file already leads with this exact allow). */
|
|
58
|
+
readonly inserted: boolean;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Insert the minimal allow rule for `host` at the HEAD of a rule document.
|
|
62
|
+
*
|
|
63
|
+
* `inserted: false` (with the input text returned unchanged) means the first
|
|
64
|
+
* rule of the file is ALREADY this exact allow — first-match semantics make a
|
|
65
|
+
* second copy do nothing, so the caller must not rewrite the file (repeated
|
|
66
|
+
* clicks would otherwise pile up duplicate lines in the user's git diff).
|
|
67
|
+
*
|
|
68
|
+
* @param text - the current file text (empty for a file to be created).
|
|
69
|
+
* @param host - the normalized, validated host.
|
|
70
|
+
* @returns the text to write plus whether anything was added.
|
|
71
|
+
* @throws RuleError when the document cannot be parsed or has no `rules` list.
|
|
72
|
+
*/
|
|
73
|
+
export declare function insertAllowRule(text: string, host: string): AllowHostInsertion;
|
|
74
|
+
/** Everything {@link resolveAllowHostTarget} needs, injected so the choice is pure and testable. */
|
|
75
|
+
export interface AllowHostTargetInput {
|
|
76
|
+
/** The workspace the request named, or null for a host-level (session-less) block. */
|
|
77
|
+
readonly cwd: string | null;
|
|
78
|
+
/** The absolute workspace roots whose rule chains are currently loaded (the cwd whitelist). */
|
|
79
|
+
readonly loadedCwds: readonly string[];
|
|
80
|
+
/** The paths the editor/action may touch (`PermissionRulesRuntime.knownRuleSources()`). */
|
|
81
|
+
readonly knownSources: readonly string[];
|
|
82
|
+
/** The configured `rulesFile`: relative to a workspace, or absolute for every one. */
|
|
83
|
+
readonly rulesFile: string;
|
|
84
|
+
/** The configured `fallbackPath`, or undefined when unset. */
|
|
85
|
+
readonly fallbackPath: string | undefined;
|
|
86
|
+
/** The host process's working directory (the session-less workspace). */
|
|
87
|
+
readonly processCwd: string;
|
|
88
|
+
/** The shipped baseline path when the baseline is enabled; never writable. */
|
|
89
|
+
readonly builtinPath: string | undefined;
|
|
90
|
+
/** Existence probe for the host-level project file. */
|
|
91
|
+
readonly exists: (path: string) => boolean;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* The one rule file this action may write for a request: the nearest file of
|
|
95
|
+
* the chain that will actually judge the connection.
|
|
96
|
+
*
|
|
97
|
+
* With a workspace cwd the target is that workspace's project file (the
|
|
98
|
+
* absolute `rulesFile` when one is configured), and the cwd must be a
|
|
99
|
+
* workspace whose chain is loaded — an unknown cwd is refused instead of being
|
|
100
|
+
* turned into a path.
|
|
101
|
+
*
|
|
102
|
+
* Without one, the order mirrors `resolveUserSources(process.cwd())` exactly,
|
|
103
|
+
* so the file written is the file the host chain reads: the absolute
|
|
104
|
+
* `rulesFile`, else `<processCwd>/<rulesFile>` when it already exists, else
|
|
105
|
+
* the configured fallback, else `<processCwd>/<rulesFile>` (created — the
|
|
106
|
+
* host chain picks it up on the next load).
|
|
107
|
+
*
|
|
108
|
+
* The result must be a known rule source and must never be the built-in
|
|
109
|
+
* baseline.
|
|
110
|
+
*
|
|
111
|
+
* @param input - the injected config, cwd, and source state.
|
|
112
|
+
* @returns the absolute path to write.
|
|
113
|
+
* @throws RuleError when the request names an unknown workspace or resolves to
|
|
114
|
+
* a path outside the writable set.
|
|
115
|
+
*/
|
|
116
|
+
export declare function resolveAllowHostTarget(input: AllowHostTargetInput): string;
|
|
117
|
+
/**
|
|
118
|
+
* The workspaces a host-level block may be allowed in: the distinct non-null
|
|
119
|
+
* `cwd`s of the loaded rule sources.
|
|
120
|
+
*
|
|
121
|
+
* A block with no cwd was judged by the proxy's session-less host chain, which
|
|
122
|
+
* any loaded workspace chain outranks the moment one exists — so writing the
|
|
123
|
+
* host file can leave the connection blocked while the rule sits in a file
|
|
124
|
+
* nothing consults. The settings page therefore offers these workspaces and
|
|
125
|
+
* sends the chosen one as the request's cwd; when there is exactly one (or
|
|
126
|
+
* none), there is nothing to choose between.
|
|
127
|
+
* @param sources - the snapshot's rule sources.
|
|
128
|
+
* @returns the distinct workspace roots, in source order.
|
|
129
|
+
*/
|
|
130
|
+
export declare function allowHostWorkspaces(sources: readonly RuleSourceView[]): string[];
|
|
131
|
+
/** The locale keys the allow action reports through. */
|
|
132
|
+
export type AllowHostNoticeKey = 'allowHostSaved' | 'allowHostAlready' | 'allowHostStillBlocked' | 'allowHostFailed';
|
|
133
|
+
/** The notice one action result maps onto: a locale key plus its interpolation values. */
|
|
134
|
+
export interface AllowHostNotice {
|
|
135
|
+
readonly ok: boolean;
|
|
136
|
+
readonly key: AllowHostNoticeKey;
|
|
137
|
+
readonly vars: Record<string, string | number>;
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Map an action result onto the page notice.
|
|
141
|
+
*
|
|
142
|
+
* A non-`allow` outcome outranks `alreadyAllowed`: the whole point of
|
|
143
|
+
* returning the RECOMPUTED decision is that the page can never say "allowed"
|
|
144
|
+
* while the connection is still blocked (a nearer chain with an earlier deny,
|
|
145
|
+
* or a mode default, still wins). `alreadyAllowed` therefore only ever reads
|
|
146
|
+
* as success when the decision really is `allow`.
|
|
147
|
+
* @param result - the `permissionRules/allowHost` result.
|
|
148
|
+
* @returns the notice to render.
|
|
149
|
+
*/
|
|
150
|
+
export declare function allowHostNotice(result: AllowHostResult): AllowHostNotice;
|
|
151
|
+
//# sourceMappingURL=allow-host.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"allow-host.d.ts","sourceRoot":"","sources":["../../src/allow-host.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAOH,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA;AAqBhE;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAA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EAAE,SAAS,cAAc,EAAE,GAAG,MAAM,EAAE,CAShF;AAED,wDAAwD;AACxD,MAAM,MAAM,kBAAkB,GAAG,gBAAgB,GAAG,kBAAkB,GAAG,uBAAuB,GAAG,iBAAiB,CAAA;AAEpH,0FAA0F;AAC1F,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,EAAE,EAAE,OAAO,CAAA;IACpB,QAAQ,CAAC,GAAG,EAAE,kBAAkB,CAAA;IAChC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,CAAA;CAC/C;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,eAAe,GAAG,eAAe,CAOxE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/client/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAQlD,iDAAiD;AACjD,eAAO,MAAM,EAAE,6BAA6B,CAAA;AAE5C,kFAAkF;AAClF,eAAO,MAAM,IAAI,yBAAyB,CAAA;AAE1C,0GAA0G;AAC1G,eAAO,MAAM,MAAM,UAAgC,CAAA;AAmBnD;;;;GAIG;AACH,wBAAsB,KAAK,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/client/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAQlD,iDAAiD;AACjD,eAAO,MAAM,EAAE,6BAA6B,CAAA;AAE5C,kFAAkF;AAClF,eAAO,MAAM,IAAI,yBAAyB,CAAA;AAE1C,0GAA0G;AAC1G,eAAO,MAAM,MAAM,UAAgC,CAAA;AAmBnD;;;;GAIG;AACH,wBAAsB,KAAK,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CA8DvD"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* language codes the harness locale registry accepts today).
|
|
4
4
|
* @module dsh-permission-rules/client/locales
|
|
5
5
|
*/
|
|
6
|
-
export type PermissionRulesLocaleKey = 'nav' | 'policyTitle' | 'mode' | 'preset' | 'configured' | 'proxy' | 'proxyActive' | 'proxyInactive' | 'proxyDisabled' | 'counters' | 'denied' | 'askBlocked' | 'recentTitle' | 'noBlocks' | 'blockBy' | 'blockDefault' | 'blockUnattributed' | 'editorTitle' | 'editorPath' | 'editorLoad' | 'editorSave' | 'editorReload' | 'editorEmpty' | 'editorSaved' | 'editorFailed' | 'editorUntitled' | 'unknown';
|
|
6
|
+
export type PermissionRulesLocaleKey = 'nav' | 'policyTitle' | 'mode' | 'preset' | 'configured' | 'proxy' | 'proxyActive' | 'proxyInactive' | 'proxyDisabled' | 'upstream' | 'upstreamOff' | 'upstreamInherit' | 'upstreamInactive' | 'upstreamChained' | 'counters' | 'denied' | 'askBlocked' | 'recentTitle' | 'noBlocks' | 'blockBy' | 'blockDefault' | 'blockUnattributed' | 'allowHost' | 'allowHostPickWorkspace' | 'allowHostSaved' | 'allowHostAlready' | 'allowHostStillBlocked' | 'allowHostFailed' | 'allowHostDisabled' | 'editorTitle' | 'editorPath' | 'editorLoad' | 'editorSave' | 'editorReload' | 'editorEmpty' | 'editorSaved' | 'editorFailed' | 'editorUntitled' | 'unknown';
|
|
7
7
|
export declare const en: Record<PermissionRulesLocaleKey, string>;
|
|
8
8
|
export declare const zh: Record<PermissionRulesLocaleKey, string>;
|
|
9
9
|
//# sourceMappingURL=locales.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"locales.d.ts","sourceRoot":"","sources":["../../../src/client/locales.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,MAAM,wBAAwB,GAChC,KAAK,GACL,aAAa,GACb,MAAM,GACN,QAAQ,GACR,YAAY,GACZ,OAAO,GACP,aAAa,GACb,eAAe,GACf,eAAe,GACf,UAAU,GACV,QAAQ,GACR,YAAY,GACZ,aAAa,GACb,UAAU,GACV,SAAS,GACT,cAAc,GACd,mBAAmB,GACnB,aAAa,GACb,YAAY,GACZ,YAAY,GACZ,YAAY,GACZ,cAAc,GACd,aAAa,GACb,aAAa,GACb,cAAc,GACd,gBAAgB,GAChB,SAAS,CAAA;AAEb,eAAO,MAAM,EAAE,EAAE,MAAM,CAAC,wBAAwB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"locales.d.ts","sourceRoot":"","sources":["../../../src/client/locales.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,MAAM,wBAAwB,GAChC,KAAK,GACL,aAAa,GACb,MAAM,GACN,QAAQ,GACR,YAAY,GACZ,OAAO,GACP,aAAa,GACb,eAAe,GACf,eAAe,GACf,UAAU,GACV,aAAa,GACb,iBAAiB,GACjB,kBAAkB,GAClB,iBAAiB,GACjB,UAAU,GACV,QAAQ,GACR,YAAY,GACZ,aAAa,GACb,UAAU,GACV,SAAS,GACT,cAAc,GACd,mBAAmB,GACnB,WAAW,GACX,wBAAwB,GACxB,gBAAgB,GAChB,kBAAkB,GAClB,uBAAuB,GACvB,iBAAiB,GACjB,mBAAmB,GACnB,aAAa,GACb,YAAY,GACZ,YAAY,GACZ,YAAY,GACZ,cAAc,GACd,aAAa,GACb,aAAa,GACb,cAAc,GACd,gBAAgB,GAChB,SAAS,CAAA;AAEb,eAAO,MAAM,EAAE,EAAE,MAAM,CAAC,wBAAwB,EAAE,MAAM,CAwCvD,CAAA;AAED,eAAO,MAAM,EAAE,EAAE,MAAM,CAAC,wBAAwB,EAAE,MAAM,CAwCvD,CAAA"}
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* @module dsh-permission-rules/client/remote
|
|
9
9
|
*/
|
|
10
10
|
import type { RemoteResult } from '@deepseek-ai/dsh-typert-protocol';
|
|
11
|
-
import type { PermissionRulesSnapshot, RulesReadResult, RulesReloadResult, RulesSaveResult } from '../wire.js';
|
|
11
|
+
import type { AllowHostRequest, AllowHostResult, PermissionRulesSnapshot, RulesReadResult, RulesReloadResult, RulesSaveResult } from '../wire.js';
|
|
12
12
|
declare module '@deepseek-ai/dsh-typert-protocol' {
|
|
13
13
|
interface TypertRemoteNamespace$permissionRules {
|
|
14
14
|
/** Read the network-policy snapshot (mode, counters, recent blocks, editable rule sources). */
|
|
@@ -19,12 +19,15 @@ declare module '@deepseek-ai/dsh-typert-protocol' {
|
|
|
19
19
|
rulesSave: (path: string, text: string) => Promise<RemoteResult<RulesSaveResult>>;
|
|
20
20
|
/** Re-read every cached workspace chain. */
|
|
21
21
|
reload: () => Promise<RemoteResult<RulesReloadResult>>;
|
|
22
|
+
/** Write one minimal allow rule for a blocked host into the nearest effective rule file. */
|
|
23
|
+
allowHost: (request: AllowHostRequest) => Promise<RemoteResult<AllowHostResult>>;
|
|
22
24
|
}
|
|
23
25
|
interface TypertRemoteMap {
|
|
24
26
|
'permissionRules/networkStatus': () => Promise<RemoteResult<PermissionRulesSnapshot>>;
|
|
25
27
|
'permissionRules/rulesRead': (path: string) => Promise<RemoteResult<RulesReadResult>>;
|
|
26
28
|
'permissionRules/rulesSave': (path: string, text: string) => Promise<RemoteResult<RulesSaveResult>>;
|
|
27
29
|
'permissionRules/reload': () => Promise<RemoteResult<RulesReloadResult>>;
|
|
30
|
+
'permissionRules/allowHost': (request: AllowHostRequest) => Promise<RemoteResult<AllowHostResult>>;
|
|
28
31
|
}
|
|
29
32
|
interface TypertRemoteNamespaceMap {
|
|
30
33
|
permissionRules: TypertRemoteNamespace$permissionRules;
|
|
@@ -67,12 +70,21 @@ export declare const PERMISSION_RULES_REMOTE: Readonly<{
|
|
|
67
70
|
source: import("zod").ZodString;
|
|
68
71
|
ruleIndex: import("zod").ZodNullable<import("zod").ZodNumber>;
|
|
69
72
|
reason: import("zod").ZodNullable<import("zod").ZodString>;
|
|
73
|
+
cwd: import("zod").ZodNullable<import("zod").ZodString>;
|
|
70
74
|
}, import("zod/v4/core").$strip>>;
|
|
71
75
|
sources: import("zod").ZodArray<import("zod").ZodObject<{
|
|
72
76
|
path: import("zod").ZodString;
|
|
73
77
|
exists: import("zod").ZodBoolean;
|
|
74
78
|
cwd: import("zod").ZodNullable<import("zod").ZodString>;
|
|
75
79
|
}, import("zod/v4/core").$strip>>;
|
|
80
|
+
allowHostAction: import("zod").ZodBoolean;
|
|
81
|
+
upstream: import("zod").ZodObject<{
|
|
82
|
+
mode: import("zod").ZodUnion<readonly [import("zod").ZodLiteral<"off">, import("zod").ZodLiteral<"inherit">, import("zod").ZodLiteral<"url">]>;
|
|
83
|
+
http: import("zod").ZodNullable<import("zod").ZodString>;
|
|
84
|
+
https: import("zod").ZodNullable<import("zod").ZodString>;
|
|
85
|
+
active: import("zod").ZodBoolean;
|
|
86
|
+
chained: import("zod").ZodNumber;
|
|
87
|
+
}, import("zod/v4/core").$strip>;
|
|
76
88
|
}, import("zod/v4/core").$strip>;
|
|
77
89
|
}>;
|
|
78
90
|
readonly sourceLocation: Readonly<{
|
|
@@ -176,6 +188,47 @@ export declare const PERMISSION_RULES_REMOTE: Readonly<{
|
|
|
176
188
|
line: 1;
|
|
177
189
|
column: 1;
|
|
178
190
|
}>;
|
|
191
|
+
}> | Readonly<{
|
|
192
|
+
readonly id: "dsh-permission-rules#permissionRules/allowHost";
|
|
193
|
+
readonly service: "permissionRules";
|
|
194
|
+
readonly namespace: "permissionRules";
|
|
195
|
+
readonly method: "allowHost";
|
|
196
|
+
readonly invocation: Readonly<{
|
|
197
|
+
kind: "direct";
|
|
198
|
+
}>;
|
|
199
|
+
readonly parameters: readonly Readonly<{
|
|
200
|
+
name: string;
|
|
201
|
+
wire: string;
|
|
202
|
+
source: "json";
|
|
203
|
+
codec: Readonly<{
|
|
204
|
+
mode: "strict";
|
|
205
|
+
typeSymbol: "dsh-permission-rules/types#AllowHostRequest";
|
|
206
|
+
schema: import("zod").ZodObject<{
|
|
207
|
+
host: import("zod").ZodString;
|
|
208
|
+
scheme: import("zod").ZodUnion<readonly [import("zod").ZodLiteral<"http">, import("zod").ZodLiteral<"https">, import("zod").ZodNull]>;
|
|
209
|
+
port: import("zod").ZodNullable<import("zod").ZodNumber>;
|
|
210
|
+
cwd: import("zod").ZodNullable<import("zod").ZodString>;
|
|
211
|
+
}, import("zod/v4/core").$strip>;
|
|
212
|
+
}>;
|
|
213
|
+
}>[];
|
|
214
|
+
readonly result: Readonly<{
|
|
215
|
+
mode: "strict";
|
|
216
|
+
typeSymbol: "dsh-permission-rules/types#AllowHostResult";
|
|
217
|
+
schema: import("zod").ZodObject<{
|
|
218
|
+
ok: import("zod").ZodBoolean;
|
|
219
|
+
path: import("zod").ZodNullable<import("zod").ZodString>;
|
|
220
|
+
created: import("zod").ZodBoolean;
|
|
221
|
+
reloaded: import("zod").ZodNumber;
|
|
222
|
+
outcome: import("zod").ZodUnion<readonly [import("zod").ZodLiteral<"allow">, import("zod").ZodLiteral<"deny">, import("zod").ZodLiteral<"ask">, import("zod").ZodNull]>;
|
|
223
|
+
alreadyAllowed: import("zod").ZodBoolean;
|
|
224
|
+
error: import("zod").ZodNullable<import("zod").ZodString>;
|
|
225
|
+
}, import("zod/v4/core").$strip>;
|
|
226
|
+
}>;
|
|
227
|
+
readonly sourceLocation: Readonly<{
|
|
228
|
+
file: "src/wire.ts";
|
|
229
|
+
line: 1;
|
|
230
|
+
column: 1;
|
|
231
|
+
}>;
|
|
179
232
|
}>)[];
|
|
180
233
|
}>;
|
|
181
234
|
//# sourceMappingURL=remote.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remote.d.ts","sourceRoot":"","sources":["../../../src/client/remote.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,YAAY,EAA4B,MAAM,kCAAkC,CAAA;AAE9F,OAA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M,KAAK,OAAO,CAAC,YAAY,CAAC,eAAe,CAAC,CAAC,CAAA;QACnG,wBAAwB,EAAE,MAAM,OAAO,CAAC,YAAY,CAAC,iBAAiB,CAAC,CAAC,CAAA;QACxE,2BAA2B,EAAE,CAAC,OAAO,EAAE,gBAAgB,KAAK,OAAO,CAAC,YAAY,CAAC,eAAe,CAAC,CAAC,CAAA;KACnG;IACD,UAAU,wBAAwB;QAChC,eAAe,EAAE,qCAAqC,CAAA;KACvD;CACF;AAED,0EAA0E;AAC1E,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAGC,CAAA"}
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
*/
|
|
11
11
|
import type { ReactElement } from 'react';
|
|
12
12
|
import type { PermissionRulesLocaleKey } from './locales.js';
|
|
13
|
-
import type { PermissionRulesSnapshot, RulesReadResult, RulesReloadResult, RulesSaveResult } from '../wire.js';
|
|
13
|
+
import type { AllowHostRequest, AllowHostResult, PermissionRulesSnapshot, RulesReadResult, RulesReloadResult, RulesSaveResult } from '../wire.js';
|
|
14
14
|
/** Functions the registration injects (wired to the Remote namespace in `./index.ts`). */
|
|
15
15
|
export interface PermissionRulesSectionInjected {
|
|
16
16
|
/** Read the network-policy snapshot. */
|
|
@@ -21,6 +21,8 @@ export interface PermissionRulesSectionInjected {
|
|
|
21
21
|
rulesSave: (path: string, text: string) => Promise<RulesSaveResult>;
|
|
22
22
|
/** Re-read every cached workspace chain. */
|
|
23
23
|
reload: () => Promise<RulesReloadResult>;
|
|
24
|
+
/** Write one minimal allow rule for one blocked host. */
|
|
25
|
+
allowHost: (request: AllowHostRequest) => Promise<AllowHostResult>;
|
|
24
26
|
/** The locale-bound translator. */
|
|
25
27
|
t: T;
|
|
26
28
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"section.d.ts","sourceRoot":"","sources":["../../../src/client/section.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"section.d.ts","sourceRoot":"","sources":["../../../src/client/section.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAA;AAEzC,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAA;AAC5D,OAAO,KAAK,EAAE,gBAAgB,EAAE,eAAe,EAAoB,uBAAuB,EAAE,eAAe,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAEnK,0FAA0F;AAC1F,MAAM,WAAW,8BAA8B;IAC7C,wCAAwC;IACxC,MAAM,EAAE,MAAM,OAAO,CAAC,uBAAuB,CAAC,CAAA;IAC9C,gCAAgC;IAChC,SAAS,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,eAAe,CAAC,CAAA;IACrD,8CAA8C;IAC9C,SAAS,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,eAAe,CAAC,CAAA;IACnE,4CAA4C;IAC5C,MAAM,EAAE,MAAM,OAAO,CAAC,iBAAiB,CAAC,CAAA;IACxC,yDAAyD;IACzD,SAAS,EAAE,CAAC,OAAO,EAAE,gBAAgB,KAAK,OAAO,CAAC,eAAe,CAAC,CAAA;IAClE,mCAAmC;IACnC,CAAC,EAAE,CAAC,CAAA;CACL;AAED,4BAA4B;AAC5B,MAAM,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,wBAAwB,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,KAAK,MAAM,CAAA;AAEjG,sFAAsF;AACtF,MAAM,MAAM,2BAA2B,GAAG,8BAA8B,GAAG;IACzE,KAAK,EAAE,MAAM,IAAI,CAAA;CAClB,CAAA;AAwBD,sCAAsC;AACtC,wBAAgB,sBAAsB,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,GAAG,QAAQ,EAAE,EAAE,2BAA2B,GAAG,YAAY,CAiN3G"}
|
package/lib/types/config.d.ts
CHANGED
|
@@ -54,7 +54,27 @@ export interface NetworkConfig {
|
|
|
54
54
|
injectEnv?: boolean;
|
|
55
55
|
/** Subprocess NO_PROXY handling: `clear` enforces the policy (default) or `preserve` keeps ambient values. */
|
|
56
56
|
noProxy?: NoProxyPolicy;
|
|
57
|
+
/**
|
|
58
|
+
* Upstream proxy for connections this proxy ALLOWS: `off` (default — dial
|
|
59
|
+
* directly), `inherit` (reuse the proxy names from the launch environment),
|
|
60
|
+
* or an explicit `http(s)://` proxy URL. A blocked connection never reaches
|
|
61
|
+
* it, and `ips`-scoped decisions plus loopback targets are never chained —
|
|
62
|
+
* see the network section of the READMEs.
|
|
63
|
+
*/
|
|
64
|
+
upstreamProxy?: UpstreamProxySetting;
|
|
65
|
+
/**
|
|
66
|
+
* Whether the settings page may run its "allow this host" action, which
|
|
67
|
+
* writes one minimal `domains` allow rule into the nearest effective rule
|
|
68
|
+
* file (`true` by default). `false` hides the button and makes the
|
|
69
|
+
* `permissionRules/allowHost` RPC refuse: the page's rule EDITOR is
|
|
70
|
+
* strictly wider (it writes arbitrary rule text) and is not affected, so
|
|
71
|
+
* this is a narrow safety switch for deployments that want rule changes to
|
|
72
|
+
* stay a deliberate, hand-written act.
|
|
73
|
+
*/
|
|
74
|
+
allowHostAction?: boolean;
|
|
57
75
|
}
|
|
76
|
+
/** Upstream chaining setting: `off`, `inherit`, or an explicit http(s) proxy URL. */
|
|
77
|
+
export type UpstreamProxySetting = 'off' | 'inherit' | string;
|
|
58
78
|
/** Raw plugin config — every field optional; {@link Config} supplies the defaults. */
|
|
59
79
|
export interface Config {
|
|
60
80
|
/**
|
|
@@ -130,6 +150,8 @@ export interface ResolvedNetworkConfig {
|
|
|
130
150
|
readonly loopback: LoopbackPolicy;
|
|
131
151
|
readonly injectEnv: boolean;
|
|
132
152
|
readonly noProxy: NoProxyPolicy;
|
|
153
|
+
readonly upstreamProxy: UpstreamProxySetting;
|
|
154
|
+
readonly allowHostAction: boolean;
|
|
133
155
|
}
|
|
134
156
|
/** Builtin baseline after {@link resolveConfig}: the switch plus the resolved absolute path. */
|
|
135
157
|
export interface ResolvedBuiltinConfig {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/config.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,CAAC,MAAM,0BAA0B,CAAA;AACxC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAC7C,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAG/D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAE5C,wFAAwF;AACxF,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,qBAAqB,CAAA;AAE1D,uEAAuE;AACvE,MAAM,MAAM,gBAAgB,GAAG,KAAK,GAAG,MAAM,CAAA;AAE7C,mDAAmD;AACnD,MAAM,MAAM,cAAc,GAAG,OAAO,GAAG,QAAQ,CAAA;AAE/C,oEAAoE;AACpE,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,UAAU,CAAA;AAEhD,6CAA6C;AAC7C,MAAM,WAAW,aAAa;IAC5B,+EAA+E;IAC/E,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,wGAAwG;IACxG,IAAI,CAAC,EAAE,MAAM,CAAA;CACd;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,aAAa;IAC5B,oGAAoG;IACpG,OAA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ACzF,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,YAAY,EAAE,MAAM,GAAG,SAAS,CAAA;IACzC,QAAQ,CAAC,aAAa,EAAE,aAAa,CAAA;IACrC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;IACzB,QAAQ,CAAC,mBAAmB,EAAE,MAAM,CAAA;IACpC,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAA;IACjC,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAA;IACvB,QAAQ,CAAC,yBAAyB,EAAE,MAAM,CAAA;IAC1C,QAAQ,CAAC,QAAQ,EAAE,UAAU,CAAA;IAC7B,QAAQ,CAAC,oBAAoB,EAAE,OAAO,CAAA;IACtC,QAAQ,CAAC,KAAK,EAAE,gBAAgB,CAAA;IAChC,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAA;IAC1B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAA;IAC7B,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;IACzB,QAAQ,CAAC,kBAAkB,EAAE,OAAO,CAAA;IACpC,QAAQ,CAAC,OAAO,EAAE,qBAAqB,CAAA;IACvC,QAAQ,CAAC,OAAO,EAAE,qBAAqB,CAAA;CACxC;AAED,kFAAkF;AAClF,eAAO,MAAM,MAAM,EAAE,CAAC,CAAC,MAAM,CAkC3B,CAAA;AAEF;;;;;;;;;GASG;AACH,wBAAgB,aAAa,CAAC,MAAM,GAAE,MAAW,GAAG,cAAc,CAoDjE"}
|
package/lib/types/prose.d.ts
CHANGED
|
@@ -62,6 +62,7 @@ export interface UiProse {
|
|
|
62
62
|
networkHeader: (mode: string, sandboxMode: string | undefined, configuredMode: string, proxyActive: boolean, proxyPort: number) => string;
|
|
63
63
|
/** Cumulative block counters line. */
|
|
64
64
|
networkCounters: (denied: number, askBlocked: number) => string;
|
|
65
|
+
networkUpstream: (mode: 'off' | 'inherit' | 'url', http: string | null, https: string | null, active: boolean, chained: number) => string;
|
|
65
66
|
/** Line shown when no proxy blocks were recorded yet. */
|
|
66
67
|
noNetworkBlocks: string;
|
|
67
68
|
/** One recent proxy-block row. */
|
package/lib/types/prose.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prose.d.ts","sourceRoot":"","sources":["../../src/prose.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,0CAA0C;AAC1C,MAAM,MAAM,UAAU,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAA;AAEzD,2EAA2E;AAC3E,MAAM,WAAW,OAAO;IACtB,6EAA6E;IAC7E,WAAW,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,KAAK,MAAM,CAAA;IAC/E,iDAAiD;IACjD,OAAO,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,KAAK,MAAM,CAAA;IACtD,oEAAoE;IACpE,eAAe,EAAE,MAAM,CAAA;IACvB,uCAAuC;IACvC,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,MAAM,CAAA;IACnD,qCAAqC;IACrC,YAAY,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAA;IACvC,8DAA8D;IAC9D,iBAAiB,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAA;IAC5C,mFAAmF;IACnF,YAAY,EAAE,MAAM,CAAA;IACpB,iDAAiD;IACjD,UAAU,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,CAAA;IACnC,kBAAkB;IAClB,KAAK,EAAE,MAAM,CAAA;IACb,0DAA0D;IAC1D,eAAe,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,MAAM,CAAA;IACzD,gEAAgE;IAChE,WAAW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,yDAAyD;AACzD,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,MAAM,CAAC,UAAU,EAAE,cAAc,CAAC,CAMxE,CAAA"}
|
package/lib/types/proxy.d.ts
CHANGED
|
@@ -21,6 +21,29 @@ import type { NetworkTarget, SchemeName } from './rules.js';
|
|
|
21
21
|
export declare const PROXY_ENV_NAMES: readonly string[];
|
|
22
22
|
/** NO_PROXY names cleared (or preserved) by the injector. */
|
|
23
23
|
export declare const NO_PROXY_ENV_NAMES: readonly string[];
|
|
24
|
+
/** The upstream proxies the launch environment supplies, resolved per scheme. */
|
|
25
|
+
export interface AmbientUpstream {
|
|
26
|
+
readonly http?: string;
|
|
27
|
+
readonly https?: string;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Resolve ambient upstream candidates the way the harness's own proxy policy
|
|
31
|
+
* does: the scheme-specific name (lowercase first, blank treated as unset),
|
|
32
|
+
* then `ALL_PROXY`, then — for https only — the http name. A value that is not
|
|
33
|
+
* a parseable `http(s)://` URL is dropped here; the runtime reports those once.
|
|
34
|
+
* @param lookup - reads one environment name (the launch snapshot, or `process.env`).
|
|
35
|
+
* @returns the usable candidates, each absent when it is unusable.
|
|
36
|
+
*/
|
|
37
|
+
export declare function readAmbientProxy(lookup: (name: string) => string | undefined): AmbientUpstream;
|
|
38
|
+
/**
|
|
39
|
+
* The loggable form of a proxy URL: the password is replaced, everything else
|
|
40
|
+
* is kept verbatim. An upstream URL may carry credentials, and a proxy URL is
|
|
41
|
+
* printed in warnings, `/rules network` and the settings snapshot, so it must
|
|
42
|
+
* never be emitted raw.
|
|
43
|
+
* @param value - the configured upstream URL.
|
|
44
|
+
* @returns the same URL with its password masked, or the input when unparseable.
|
|
45
|
+
*/
|
|
46
|
+
export declare function redactProxyUrl(value: string): string;
|
|
24
47
|
/** One recorded proxy-layer block (settings-page list + session audit + logger). */
|
|
25
48
|
export interface NetworkBlockRecord {
|
|
26
49
|
readonly time: number;
|
|
@@ -36,6 +59,13 @@ export interface NetworkBlockRecord {
|
|
|
36
59
|
readonly source: string;
|
|
37
60
|
readonly ruleIndex?: number;
|
|
38
61
|
readonly reason?: string;
|
|
62
|
+
/**
|
|
63
|
+
* The attributed agent's workspace root, when the block could be attributed
|
|
64
|
+
* to a session at all. The settings page needs it to name the rule file an
|
|
65
|
+
* "allow this host" action would write; an unattributed (host-level) block
|
|
66
|
+
* leaves it unset.
|
|
67
|
+
*/
|
|
68
|
+
readonly cwd?: string;
|
|
39
69
|
}
|
|
40
70
|
/** Cumulative proxy-layer block counters. */
|
|
41
71
|
export interface NetworkStats {
|
|
@@ -48,6 +78,10 @@ export interface ProxyAttribution {
|
|
|
48
78
|
readonly callId?: CallId;
|
|
49
79
|
readonly agent?: {
|
|
50
80
|
readonly session: {
|
|
81
|
+
/** The session header the block's workspace is read from. */
|
|
82
|
+
readonly header: {
|
|
83
|
+
readonly cwd?: string;
|
|
84
|
+
};
|
|
51
85
|
append(type: 'permissionRules/network', data: unknown, options?: {
|
|
52
86
|
ignorable?: true;
|
|
53
87
|
}): unknown;
|
|
@@ -72,6 +106,12 @@ export interface NetworkProxyOptions {
|
|
|
72
106
|
readonly logger: {
|
|
73
107
|
warn(message: string): void;
|
|
74
108
|
};
|
|
109
|
+
/**
|
|
110
|
+
* The upstream proxies an ALLOWED connection may be chained through, or
|
|
111
|
+
* undefined to dial directly. A getter, so a live settings change takes
|
|
112
|
+
* effect on the next connection.
|
|
113
|
+
*/
|
|
114
|
+
readonly upstream?: () => AmbientUpstream | undefined;
|
|
75
115
|
}
|
|
76
116
|
/**
|
|
77
117
|
* The local HTTP/CONNECT policy proxy. Binds on demand (the plugin calls
|
|
@@ -86,7 +126,10 @@ export declare class NetworkProxy {
|
|
|
86
126
|
private readonly recent;
|
|
87
127
|
private readonly stats;
|
|
88
128
|
private actualPort;
|
|
129
|
+
private chained;
|
|
89
130
|
constructor(options: NetworkProxyOptions);
|
|
131
|
+
/** Connections dispatched through the configured upstream since mount. */
|
|
132
|
+
chainedConnections(): number;
|
|
90
133
|
/** The bound port (valid after {@link start} resolves). */
|
|
91
134
|
get port(): number;
|
|
92
135
|
/** Deny/ask blocks recorded since mount, newest first (settings-page list). */
|
|
@@ -97,6 +140,36 @@ export declare class NetworkProxy {
|
|
|
97
140
|
start(): Promise<number>;
|
|
98
141
|
/** Stop the server and destroy every tunnel; resolves when sockets are closed. */
|
|
99
142
|
close(): Promise<void>;
|
|
143
|
+
/**
|
|
144
|
+
* The upstream one ALLOWED connection may be chained through, or undefined to
|
|
145
|
+
* dial directly. Three vetoes, in order:
|
|
146
|
+
*
|
|
147
|
+
* 1. a loopback target never chains — a proxy outside this host cannot route
|
|
148
|
+
* its loopback, and the harness's own policy bypasses loopback for the same
|
|
149
|
+
* reason;
|
|
150
|
+
* 2. an `ips`-scoped decision never chains — chaining hands the hostname to
|
|
151
|
+
* the upstream, so "the connection lands on an address the rules saw"
|
|
152
|
+
* (the issue #21 invariant) would stop holding exactly where the rules
|
|
153
|
+
* cared about the address;
|
|
154
|
+
* 3. no usable upstream for the target's scheme.
|
|
155
|
+
*
|
|
156
|
+
* A blocked connection never reaches this method: it is called only on the
|
|
157
|
+
* `allow` branch, after the decision is final.
|
|
158
|
+
* @param target - the adjudicated target.
|
|
159
|
+
* @param decision - the decision that allowed it.
|
|
160
|
+
* @returns the upstream URL to chain through, or undefined.
|
|
161
|
+
*/
|
|
162
|
+
private upstreamRouteFor;
|
|
163
|
+
/**
|
|
164
|
+
* Open a tunnel by asking the upstream for one, and hand back the socket it
|
|
165
|
+
* established. The upstream's own hostname is resolved by the system: it is
|
|
166
|
+
* operator configuration, not agent input, so it takes no part in rule
|
|
167
|
+
* adjudication and is outside the adjudicated-address invariant.
|
|
168
|
+
* @param upstream - the upstream proxy URL.
|
|
169
|
+
* @param authority - the `host:port` to ask for (IPv6 already bracketed).
|
|
170
|
+
* @returns the established tunnel socket.
|
|
171
|
+
*/
|
|
172
|
+
private connectViaUpstream;
|
|
100
173
|
/** Plain-HTTP proxying: absolute-form requests are adjudicated and forwarded (or blocked with a structured 403). */
|
|
101
174
|
private handleRequest;
|
|
102
175
|
/**
|
package/lib/types/proxy.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"proxy.d.ts","sourceRoot":"","sources":["../../src/proxy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AASH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAC1C,OAAO,KAAK,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAGhE,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAE3D,oHAAoH;AACpH,eAAO,MAAM,eAAe,EAAE,SAAS,MAAM,EAAyF,CAAA;AAEtI,6DAA6D;AAC7D,eAAO,MAAM,kBAAkB,EAAE,SAAS,MAAM,EAA6B,CAAA;
|
|
1
|
+
{"version":3,"file":"proxy.d.ts","sourceRoot":"","sources":["../../src/proxy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AASH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAC1C,OAAO,KAAK,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAGhE,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAE3D,oHAAoH;AACpH,eAAO,MAAM,eAAe,EAAE,SAAS,MAAM,EAAyF,CAAA;AAEtI,6DAA6D;AAC7D,eAAO,MAAM,kBAAkB,EAAE,SAAS,MAAM,EAA6B,CAAA;AAK7E,iFAAiF;AACjF,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CACxB;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,M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