@parcha/agentrun-serve 0.1.0-beta.55 → 0.1.0-beta.57
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 +261 -0
- package/README.md +228 -45
- package/dist/acp-package.d.ts +2 -0
- package/dist/adapters.d.ts +18 -5
- package/dist/adapters.js +23 -9
- package/dist/agent-package.d.ts +3 -3
- package/dist/agent-package.js +17 -8
- package/dist/answer-json.d.ts +6 -2
- package/dist/answer-json.js +22 -4
- package/dist/api-keys.d.ts +76 -0
- package/dist/api-keys.js +217 -0
- package/dist/api-only.d.ts +17 -5
- package/dist/api-only.js +36 -8
- package/dist/browser-hold.d.ts +23 -0
- package/dist/browser-hold.js +48 -0
- package/dist/browser-person.d.ts +3 -0
- package/dist/browser-person.js +4 -1
- package/dist/calendar/tools.js +3 -2
- package/dist/chatgpt-plan.d.ts +28 -3
- package/dist/chatgpt-plan.js +182 -21
- package/dist/claude-login.d.ts +101 -14
- package/dist/claude-login.js +232 -49
- package/dist/claude-sign-in.d.ts +46 -0
- package/dist/claude-sign-in.js +93 -0
- package/dist/cli.js +63 -6
- package/dist/composio-made.d.ts +4 -0
- package/dist/composio-made.js +4 -0
- package/dist/composio-preset.d.ts +43 -2
- package/dist/composio-preset.js +92 -4
- package/dist/computer-held-routes.d.ts +5 -4
- package/dist/computer-held-routes.js +29 -8
- package/dist/computer-held.d.ts +6 -1
- package/dist/computer-held.js +14 -0
- package/dist/computer-record.js +4 -2
- package/dist/computer-viewer.js +4 -1
- package/dist/console/assets/{backend-D5EmB4N3.js → backend-DVhHzJX2.js} +19 -19
- package/dist/console/assets/index-Bwn1oTem.css +1 -0
- package/dist/console/assets/index-okP-y8PK.js +747 -0
- package/dist/console/index.html +2 -2
- package/dist/decisions.d.ts +1 -1
- package/dist/decisions.js +1 -1
- package/dist/docker-host-addresses.d.ts +22 -11
- package/dist/docker-host-addresses.js +38 -26
- package/dist/env-switch.d.ts +10 -0
- package/dist/env-switch.js +33 -2
- package/dist/errors.d.ts +1 -0
- package/dist/errors.js +2 -0
- package/dist/fal-price.d.ts +58 -20
- package/dist/fal-price.js +341 -82
- package/dist/handed-values.d.ts +43 -1
- package/dist/handed-values.js +119 -2
- package/dist/harness-archive.d.ts +13 -10
- package/dist/harness-archive.js +60 -34
- package/dist/harness-check.d.ts +3 -1
- package/dist/harness-check.js +25 -46
- package/dist/harness-keys.d.ts +73 -27
- package/dist/harness-keys.js +194 -61
- package/dist/harness-recipe-entry.d.ts +8 -7
- package/dist/harness-recipe-entry.js +21 -32
- package/dist/harness-recipe.d.ts +38 -25
- package/dist/harness-recipe.js +49 -36
- package/dist/harness-sign-in.js +12 -23
- package/dist/harness-table.d.ts +10 -3
- package/dist/harness-table.js +26 -21
- package/dist/harness.d.ts +1 -0
- package/dist/harness.js +17 -5
- package/dist/host-check.d.ts +4 -0
- package/dist/host-check.js +4 -0
- package/dist/hosted-search.d.ts +1 -1
- package/dist/hosted-search.js +1 -2
- package/dist/import-worker.d.ts +4 -2
- package/dist/import-worker.js +9 -2
- package/dist/in-flight.d.ts +26 -0
- package/dist/in-flight.js +52 -0
- package/dist/key-refusal.d.ts +26 -5
- package/dist/key-refusal.js +313 -37
- package/dist/learn/secrets.d.ts +31 -11
- package/dist/learn/secrets.js +152 -191
- package/dist/learning-cost.d.ts +6 -3
- package/dist/learning-cost.js +4 -2
- package/dist/link-check.js +1 -1
- package/dist/llms.txt +2 -2
- package/dist/marketplace.d.ts +77 -0
- package/dist/marketplace.js +224 -0
- package/dist/mcp-api-only-origins.d.ts +30 -0
- package/dist/mcp-api-only-origins.js +57 -0
- package/dist/mcp-gateway.d.ts +7 -5
- package/dist/mcp-gateway.js +9 -12
- package/dist/mcp-secret-writes.js +5 -3
- package/dist/mcp-servers-store.d.ts +28 -6
- package/dist/mcp-servers-store.js +53 -4
- package/dist/media-duration.d.ts +3 -0
- package/dist/media-duration.js +90 -9
- package/dist/model-form.d.ts +5 -4
- package/dist/model-form.js +11 -7
- package/dist/model.d.ts +5 -2
- package/dist/model.js +9 -5
- package/dist/ollama-provider.d.ts +7 -1
- package/dist/ollama-provider.js +14 -2
- package/dist/openapi.d.ts +3 -3
- package/dist/openapi.js +245 -42
- package/dist/otel/genai.d.ts +65 -0
- package/dist/otel/genai.js +116 -0
- package/dist/otel/tracer.d.ts +55 -0
- package/dist/otel/tracer.js +308 -0
- package/dist/page.d.ts +2 -0
- package/dist/page.js +3 -1
- package/dist/paid-calls.d.ts +1 -32
- package/dist/paid-calls.js +4 -39
- package/dist/place-offers.d.ts +14 -6
- package/dist/place-offers.js +26 -13
- package/dist/provider.d.ts +9 -0
- package/dist/provider.js +50 -3
- package/dist/redact/match.d.ts +101 -0
- package/dist/redact/match.js +1152 -0
- package/dist/refusal-words.d.ts +11 -0
- package/dist/refusal-words.js +11 -0
- package/dist/run-census.d.ts +67 -0
- package/dist/run-census.js +240 -0
- package/dist/run-computer.d.ts +6 -3
- package/dist/run-computer.js +4 -1
- package/dist/run-cut.d.ts +15 -6
- package/dist/run-cut.js +30 -9
- package/dist/run-files.d.ts +3 -0
- package/dist/run-files.js +3 -0
- package/dist/run-launch.d.ts +12 -1
- package/dist/run-launch.js +9 -10
- package/dist/run-learning-served.d.ts +2 -0
- package/dist/run-model-key.d.ts +8 -0
- package/dist/run-model-key.js +31 -1
- package/dist/run-reads-over-store.d.ts +24 -6
- package/dist/run-reads-over-store.js +67 -23
- package/dist/run-recordings.d.ts +5 -1
- package/dist/run-recordings.js +39 -14
- package/dist/run-timeline-served.d.ts +3 -1
- package/dist/run-timeline-served.js +4 -4
- package/dist/run-usage.d.ts +1 -0
- package/dist/runnable.d.ts +10 -1
- package/dist/runnable.js +20 -8
- package/dist/runner/adapter-loop.d.ts +14 -0
- package/dist/runner/adapter-loop.js +56 -11
- package/dist/runner/adapter-run-spec.d.ts +45 -8
- package/dist/runner/adapter-run-spec.js +154 -29
- package/dist/runner/adapters/pi.js +25 -3
- package/dist/runner/beside.js +11 -6
- package/dist/runner/big-writes.js +1 -10
- package/dist/runner/claim-secrets.d.ts +18 -3
- package/dist/runner/claim-secrets.js +35 -6
- package/dist/runner/cli-run-spec.d.ts +6 -0
- package/dist/runner/cli-run-spec.js +85 -36
- package/dist/runner/computer-journal.d.ts +9 -1
- package/dist/runner/computer-journal.js +26 -0
- package/dist/runner/conformance/harness.js +1 -1
- package/dist/runner/feedback-round.js +3 -0
- package/dist/runner/harness-loops.d.ts +6 -5
- package/dist/runner/harness-loops.js +7 -7
- package/dist/runner/held.d.ts +11 -5
- package/dist/runner/journal-kinds.d.ts +5 -0
- package/dist/runner/journal-kinds.js +5 -0
- package/dist/runner/loop-contract.d.ts +4 -0
- package/dist/runner/main.js +15 -6
- package/dist/runner/mcp-claim.js +30 -3
- package/dist/runner/mcp-run.d.ts +12 -0
- package/dist/runner/mcp-run.js +12 -5
- package/dist/runner/model-route.d.ts +17 -0
- package/dist/runner/model-route.js +120 -2
- package/dist/runner/presence.d.ts +4 -3
- package/dist/runner/presence.js +4 -2
- package/dist/runner/run-child-host.d.ts +5 -0
- package/dist/runner/run-child-host.js +71 -30
- package/dist/runner/run-child.js +5 -2
- package/dist/runner/runner.d.ts +18 -3
- package/dist/runner/runner.js +162 -36
- package/dist/runner/store-port.d.ts +1 -1
- package/dist/runner/store-secrets.d.ts +6 -0
- package/dist/runner/store-secrets.js +49 -7
- package/dist/runner/subagent.js +4 -40
- package/dist/runner/workflow-first.d.ts +11 -4
- package/dist/runner/workflow-first.js +14 -8
- package/dist/runner/workflow-spec.js +3 -2
- package/dist/runs-over-store.d.ts +15 -6
- package/dist/runs-over-store.js +33 -21
- package/dist/scrub-command.d.ts +73 -0
- package/dist/scrub-command.js +307 -0
- package/dist/secret-cut.d.ts +73 -0
- package/dist/secret-cut.js +291 -4
- package/dist/secret-rules.d.ts +143 -0
- package/dist/secret-rules.js +2564 -0
- package/dist/secrets.d.ts +7 -0
- package/dist/secrets.js +20 -0
- package/dist/server-keys.d.ts +20 -0
- package/dist/server-keys.js +25 -6
- package/dist/server.d.ts +57 -13
- package/dist/server.js +371 -113
- package/dist/skills/agentrun-serve/SKILL.md +4 -0
- package/dist/store/dialect.d.ts +3 -0
- package/dist/store/dialect.js +1 -0
- package/dist/store/index.d.ts +1 -1
- package/dist/store/index.js +1 -1
- package/dist/store/journal/storage.js +1 -1
- package/dist/store/postgres/dialect.js +3 -0
- package/dist/store/postgres/migrations/0027_run_launch_census.sql +31 -0
- package/dist/store/schema.d.ts +6 -0
- package/dist/store/schema.js +11 -1
- package/dist/store/seal.d.ts +6 -1
- package/dist/store/seal.js +5 -3
- package/dist/store/sqlite/run-launch.d.ts +9 -1
- package/dist/store/sqlite/run-launch.js +24 -13
- package/dist/store/sqlite/run-patch.d.ts +1 -1
- package/dist/store/sqlite/run-patch.js +13 -4
- package/dist/store/sqlite/store.js +76 -16
- package/dist/store/store.d.ts +53 -3
- package/dist/store/store.js +27 -0
- package/dist/store-reads/learning.d.ts +6 -3
- package/dist/store-reads/learning.js +22 -7
- package/dist/store-view.d.ts +3 -0
- package/dist/store-view.js +4 -4
- package/dist/suggestions.js +3 -2
- package/dist/template-eval.d.ts +22 -11
- package/dist/template-eval.js +124 -41
- package/dist/template-import.d.ts +10 -0
- package/dist/template-import.js +16 -7
- package/dist/templates.d.ts +10 -2
- package/dist/templates.js +28 -8
- package/dist/timeline/index.d.ts +1 -1
- package/dist/timeline/index.js +1 -1
- package/dist/timeline/labels.d.ts +6 -4
- package/dist/timeline/labels.js +18 -6
- package/dist/timeline/timeline.d.ts +17 -7
- package/dist/timeline/timeline.js +28 -14
- package/dist/timeline/util.js +1 -1
- package/dist/timeline/web-calls.d.ts +26 -9
- package/dist/timeline/web-calls.js +124 -37
- package/dist/tool-gate.d.ts +42 -3
- package/dist/tool-gate.js +69 -6
- package/dist/tool-keys-store.d.ts +2 -4
- package/dist/tool-keys-store.js +5 -21
- package/dist/tool-keys.d.ts +2 -2
- package/dist/tool-keys.js +2 -2
- package/dist/tool-list.js +1 -1
- package/dist/tool-plane.d.ts +2 -2
- package/dist/tool-plane.js +35 -33
- package/dist/tools.js +13 -7
- package/dist/trigger-targets.d.ts +4 -0
- package/dist/trigger-targets.js +9 -2
- package/dist/triggers.d.ts +67 -4
- package/dist/triggers.js +171 -22
- package/dist/until.d.ts +3 -0
- package/dist/until.js +11 -0
- package/dist/validate.js +1 -1
- package/dist/web-fake.d.ts +1 -3
- package/dist/web-fake.js +7 -18
- package/dist/web-fetch.d.ts +6 -72
- package/dist/web-fetch.js +11 -265
- package/dist/web-run.d.ts +31 -0
- package/dist/web-run.js +90 -0
- package/dist/web-save.d.ts +6 -4
- package/dist/web-save.js +9 -12
- package/dist/web-search.d.ts +9 -127
- package/dist/web-search.js +23 -259
- package/dist/wires.d.ts +13 -0
- package/dist/wires.js +11 -0
- package/dist/workflow-run.d.ts +5 -4
- package/dist/workflow-run.js +5 -4
- package/dist/workspace/computer-deps.d.ts +3 -1
- package/dist/workspace/computer-deps.js +12 -4
- package/dist/workspace/computer-for-claim.d.ts +19 -2
- package/dist/workspace/computer-for-claim.js +101 -13
- package/dist/workspace/computer-janitor.d.ts +15 -7
- package/dist/workspace/computer-janitor.js +33 -8
- package/dist/workspace/computer-kept.d.ts +55 -4
- package/dist/workspace/computer-kept.js +129 -8
- package/dist/workspace/index.d.ts +1 -1
- package/dist/workspace/index.js +1 -1
- package/dist/workspace/kind-skills.d.ts +4 -0
- package/dist/workspace/kind-skills.js +9 -0
- package/dist/workspace/run-end-computers.d.ts +5 -1
- package/dist/workspace/run-end-computers.js +27 -1
- package/dist/workspace/synced-folder.js +3 -4
- package/dist/wrapped.d.ts +65 -0
- package/dist/wrapped.js +77 -0
- package/package.json +17 -11
- package/skills/agentrun-serve/SKILL.md +4 -0
- package/templates/README.md +38 -15
- package/dist/console/assets/index-DUYLaqiR.js +0 -746
- package/dist/console/assets/index-DYhU4adm.css +0 -1
- package/dist/exa-keyless.d.ts +0 -34
- package/dist/exa-keyless.js +0 -118
- package/dist/firecrawl-keyless.d.ts +0 -41
- package/dist/firecrawl-keyless.js +0 -152
- package/dist/keyless-mcp.d.ts +0 -36
- package/dist/keyless-mcp.js +0 -127
- package/dist/text-urls.d.ts +0 -38
- package/dist/text-urls.js +0 -170
- package/dist/web-fetch-direct.d.ts +0 -119
- package/dist/web-fetch-direct.js +0 -190
package/dist/key-refusal.js
CHANGED
|
@@ -4,9 +4,10 @@
|
|
|
4
4
|
// count, a file name, a duration, another service's status) is no refused key, and the error is left as it is.
|
|
5
5
|
import { DEFAULT_HARNESS } from "./harness.js";
|
|
6
6
|
import { harnessOf } from "./harness-table.js";
|
|
7
|
-
import { endsInScheme, redactSecrets, valueMatcher } from "./learn/secrets.js";
|
|
7
|
+
import { cutSecrets, endsInScheme, redactSecrets, secretShapes, valueLeft, valueMatcher } from "./learn/secrets.js";
|
|
8
8
|
import { hostModel, MODEL_KEYS } from "./model.js";
|
|
9
9
|
import { modelWire, openRouterOnly, WIRES } from "./provider.js";
|
|
10
|
+
import { jsonEscapeAt, privateKeyEnd, scanned, squeeze } from "./redact/match.js";
|
|
10
11
|
import { savedGatewayIn } from "./model-gateway.js";
|
|
11
12
|
const row = (id) => {
|
|
12
13
|
const found = MODEL_KEYS.find((r) => r.id === id);
|
|
@@ -59,7 +60,7 @@ const SHOWN = 2000;
|
|
|
59
60
|
* form (6 times it, for JSON's \uXXXX; percent is 3, hex 2, base64 4/3) and 16 more. A key whose start the cut can show
|
|
60
61
|
* starts before SHOWN, so it ends inside that head and is found whole; one that starts later is never shown. So a long
|
|
61
62
|
* error costs no more to redact than a short one, whatever it holds. `shown`: a head of another length, for a reader
|
|
62
|
-
* that is shown more
|
|
63
|
+
* that is shown more. */
|
|
63
64
|
export function redacted(text, secrets, shown = SHOWN) {
|
|
64
65
|
const longest = secrets.reduce((most, value) => Math.max(most, value.length), 0);
|
|
65
66
|
const window = shown + 6 * longest + 16;
|
|
@@ -83,50 +84,325 @@ export const answerPasses = { count: 0 };
|
|
|
83
84
|
* in it, and NEVER cut: an answer is shown whole. The same rule as redacted() (redactSecrets over `secrets`), over the
|
|
84
85
|
* whole text, read in pieces of about ANSWER_PIECE characters cut at whitespace. No form of a held value redactSecrets
|
|
85
86
|
* finds as it stands (as written, JSON-escaped, base64, hex) holds whitespace, so a cut there splits none; the one shape
|
|
86
|
-
* read across whitespace, a Bearer scheme and its token, is never cut between the two (endsInScheme)
|
|
87
|
-
*
|
|
88
|
-
*
|
|
89
|
-
*
|
|
87
|
+
* read across whitespace, a Bearer scheme and its token, is never cut between the two (endsInScheme); nor is a private
|
|
88
|
+
* key block, cut whole by its shape from its BEGIN line to its END line (keyWhole). A run with no
|
|
89
|
+
* whitespace past a piece is cut at the end of a JSON string in it (never in a URL's user and password), or, a run of
|
|
90
|
+
* a JSON array's numbers only, after a comma (runCut), so compact JSON reads in pieces too. A run of more than ANSWER_PIECE characters with neither is no
|
|
91
|
+
* person's text and is shown as "[redacted]", unread, from where its run starts. A value or a secret shape split across
|
|
92
|
+
* a cut, or a form only found across pieces, still shows to one pass over the joined pieces (heldIn: valueLeft over
|
|
93
|
+
* them as they came, and secretShapes over them redacted; with the head of each run left unread, where the rest of a
|
|
94
|
+
* value split before it would be, and its tail, where the head of a value split after it would be), and then the whole
|
|
95
|
+
* answer is "[redacted]", as redactSecrets does with a text that still holds a value. So is an answer whose pieces,
|
|
96
|
+
* as shown, read as a held value together (heldIn reads the text it returns too). A value split inside one piece withholds only that piece, by the piece's own redaction. */
|
|
90
97
|
export function redactedAnswer(text, secrets) {
|
|
91
98
|
if (!text)
|
|
92
99
|
return text;
|
|
93
100
|
answerPasses.count++;
|
|
94
|
-
const
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
101
|
+
const { out, seen } = inPieces(text, secrets);
|
|
102
|
+
return heldIn(seen, secrets, out) ? "[redacted]" : out;
|
|
103
|
+
}
|
|
104
|
+
/** `text`, a call's result as a grader's read shows it (timeline calls, tool_result_text), with no held secret in it:
|
|
105
|
+
* read in pieces as redactedAnswer reads an answer, each piece redacted, then shown as `show` makes it (the timeline's
|
|
106
|
+
* scrubUrls), then one pass over the pieces (heldIn). Every check reads the text as it came, redacted, and not only as
|
|
107
|
+
* shown: shown, a URL's query, fragment and userinfo are cut apart, and a held value in one no longer reads as itself;
|
|
108
|
+
* what it returns is read too, for a held value its pieces show only together. A piece
|
|
109
|
+
* never splits a URL (it is cut at whitespace, after a quote, or in a run of numbers), so a piece shows as the whole
|
|
110
|
+
* text would. Only the head the reader is shown is read: pieces stop once they show more than `shown` characters, and
|
|
111
|
+
* the pass also reads the text where they stopped (peek), so a value or a shape the stop split is seen whole. Every
|
|
112
|
+
* character returned was read; the caller cuts it to `shown`. So no redaction pass reads more than a piece, however long
|
|
113
|
+
* the result or its head. */
|
|
114
|
+
export function redactedCall(text, secrets, shown, show = (piece) => piece) {
|
|
115
|
+
if (!text)
|
|
116
|
+
return text;
|
|
117
|
+
const { out, seen, short } = inPieces(text, secrets, shown, show);
|
|
118
|
+
// A read that stopped on what it read, before what it shows reached `shown`, ends as a cut does ("...", timeline/util.ts
|
|
119
|
+
// cut), so a reader (the link check) knows it is not whole.
|
|
120
|
+
const result = short ? `${out}...` : out;
|
|
121
|
+
return heldIn(seen, secrets, result) ? "[redacted]" : result;
|
|
122
|
+
}
|
|
123
|
+
/** Whether redactSecrets withholds `text` whole: it holds a held value or a secret shape no cut in place takes (split by
|
|
124
|
+
* whitespace, encoded, written as JSON's \uXXXX escapes). Read whole, never in pieces: the caller bounds what it reads
|
|
125
|
+
* (a web call's strings, joined: timeline calls.holds). */
|
|
126
|
+
export function withheldWhole(text, secrets) {
|
|
127
|
+
return redactSecrets(text, secrets, Number.POSITIVE_INFINITY) === "[redacted]";
|
|
128
|
+
}
|
|
129
|
+
/** Whether the text a reader is about to be shown (`shown`, what the caller returns) holds a held value, or the joined
|
|
130
|
+
* pieces still hold one or a secret shape: one a cut split. `shown` is read whole for a held value (valueMatcher, one
|
|
131
|
+
* linear pass): however the pieces were put together, as each was cut or shown, or an unread run's "[redacted]" between
|
|
132
|
+
* them, no text that reads as a held value is returned (a held value holding "[redacted]", its parts on either side of
|
|
133
|
+
* a cut in another piece). A value is also looked for in the pieces as they came, joined by line breaks, each piece's
|
|
134
|
+
* own cuts covering it (valueLeft): a piece's cut can take part of a value split across pieces (a credential
|
|
135
|
+
* parameter's value cut in place at the end of a piece, the rest of the held value in the next), and the rest then no
|
|
136
|
+
* longer reads as the value. A piece withheld whole covers all of itself, so a value split inside one piece is that
|
|
137
|
+
* piece's own redaction's, and only a value no cut covers across pieces (or in the text read past where they stopped)
|
|
138
|
+
* withholds the text. Each unread run's head and tail are covered (it shows as "[redacted]") and read: its head for the
|
|
139
|
+
* rest of a value split before it, its tail for the head of a value whose rest comes after it. A shape is looked for in
|
|
140
|
+
* the pieces each redacted (a shape whole in one is no shape a cut split). A peek too long to read (`unread`) withholds
|
|
141
|
+
* the text too. */
|
|
142
|
+
function heldIn(seen, secrets, shown) {
|
|
143
|
+
return seen.unread || valueMatcher(secrets)(shown) || valueLeft(seen.raw, secrets, seen.cuts) || secretShapes(seen.shapes).length > 0;
|
|
144
|
+
}
|
|
145
|
+
/** `text` read in pieces as redactedAnswer says (pieceEnd), each redacted by itself: what the pieces show, joined, and
|
|
146
|
+
* what the pass after them reads (heldIn): each piece as it came and the spans its redaction cut, and each piece
|
|
147
|
+
* redacted, with the head and the tail of each unread run put back (covered, as they came; the head redacted by itself
|
|
148
|
+
* before its "[redacted]" for the shapes). A run runCut cut that then goes on past a piece with
|
|
149
|
+
* no place to cut is unread from its start, the pieces of it already read taken back, so no piece shows the head of a
|
|
150
|
+
* value or a shape the cut split. With `enough`, no piece is read once the pieces show more than `enough` characters,
|
|
151
|
+
* and the text where they stopped, `hold` characters the matcher sees of it (peek), goes to the pass the same way.
|
|
152
|
+
* Each piece is redacted, then shown as `show` makes it: `out` is what the pieces show, the pass reads them unshown. */
|
|
153
|
+
function inPieces(text, secrets, enough = Number.POSITIVE_INFINITY, show = (piece) => piece) {
|
|
154
|
+
const hold = 6 * secrets.reduce((most, value) => Math.max(most, value.length), 0) + 16;
|
|
155
|
+
const out = [];
|
|
156
|
+
const shapes = [];
|
|
157
|
+
const reads = [];
|
|
158
|
+
let shown = 0;
|
|
159
|
+
let unread = false;
|
|
160
|
+
// The run runCut is cutting: where it starts in `text`, and its first piece's index in `out`.
|
|
161
|
+
let run;
|
|
162
|
+
let from = 0;
|
|
163
|
+
// Also stops past 4 × `enough` characters read: text that shows as almost nothing (URLs whose queries are elided) is
|
|
164
|
+
// not read to its end. Where it stops, the peek reads on as at any stop.
|
|
165
|
+
while (from < text.length && shown <= enough && from <= 4 * enough) {
|
|
166
|
+
const to = pieceEnd(text, from);
|
|
167
|
+
const raw = text.slice(from, to);
|
|
168
|
+
if (raw.length > ANSWER_PIECE) {
|
|
169
|
+
const start = run?.from ?? from;
|
|
170
|
+
if (run) {
|
|
171
|
+
for (const part of out.splice(run.at))
|
|
172
|
+
shown -= part.length;
|
|
173
|
+
shapes.splice(run.at);
|
|
174
|
+
reads.splice(run.at);
|
|
106
175
|
}
|
|
107
|
-
|
|
108
|
-
//
|
|
109
|
-
//
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
parts.push(to - from > ANSWER_PIECE ? "[redacted]" : redactSecrets(text.slice(from, to), secrets, Buffer.byteLength(text.slice(from, to))));
|
|
119
|
-
from = to;
|
|
120
|
-
continue;
|
|
121
|
-
}
|
|
176
|
+
// The run is shown as "[redacted]": its head is read, covered, for the rest of a value split before it, and its
|
|
177
|
+
// tail (tailOf: `hold` characters the matcher sees, at most a piece), covered too, for the head of a value whose
|
|
178
|
+
// rest comes after it. One read, the two joined by a line break, as each piece is one.
|
|
179
|
+
const head = peek(text, start, hold);
|
|
180
|
+
const tail = head === undefined ? undefined : tailOf(text, start, to, hold);
|
|
181
|
+
if (head === undefined || tail === undefined)
|
|
182
|
+
unread = true;
|
|
183
|
+
else {
|
|
184
|
+
shapes.push(`${redactSecrets(head, secrets, Buffer.byteLength(head))}[redacted]`);
|
|
185
|
+
const both = `${head}\n${tail}`;
|
|
186
|
+
reads.push({ text: both, cuts: [[0, both.length]] });
|
|
122
187
|
}
|
|
188
|
+
out.push("[redacted]");
|
|
189
|
+
shown += "[redacted]".length;
|
|
190
|
+
run = undefined;
|
|
191
|
+
}
|
|
192
|
+
else {
|
|
193
|
+
const cut = cutSecrets(raw, secrets, Buffer.byteLength(raw));
|
|
194
|
+
const part = cut === "whole" ? "[redacted]" : cut.out;
|
|
195
|
+
reads.push({ text: raw, cuts: cut === "whole" ? [[0, raw.length]] : cut.spans });
|
|
196
|
+
// A piece that ends inside a run (runCut's): its run goes on in the next piece.
|
|
197
|
+
if (to < text.length && /\S/.test(text[to - 1] ?? "") && /\S/.test(text[to] ?? ""))
|
|
198
|
+
run ??= { from, at: out.length };
|
|
199
|
+
else
|
|
200
|
+
run = undefined;
|
|
201
|
+
const showsAs = show(part);
|
|
202
|
+
out.push(showsAs);
|
|
203
|
+
shapes.push(part);
|
|
204
|
+
shown += showsAs.length;
|
|
123
205
|
}
|
|
124
|
-
const piece = text.slice(from, to);
|
|
125
|
-
parts.push(redactSecrets(piece, secrets, Buffer.byteLength(piece)));
|
|
126
206
|
from = to;
|
|
127
207
|
}
|
|
128
|
-
|
|
129
|
-
|
|
208
|
+
if (from < text.length) {
|
|
209
|
+
// Stopped inside a run runCut cut: the rest of it, to its next whitespace (at most a piece), goes to the pass too.
|
|
210
|
+
const space = run ? text.slice(from, from + ANSWER_PIECE).search(/\s/) : 0;
|
|
211
|
+
scanned.chars += space < 0 ? Math.min(ANSWER_PIECE, text.length - from) : space + 1;
|
|
212
|
+
const runTo = from + (space < 0 ? ANSWER_PIECE : space);
|
|
213
|
+
const ahead = peek(text, from, hold);
|
|
214
|
+
if (ahead === undefined)
|
|
215
|
+
unread = true;
|
|
216
|
+
else {
|
|
217
|
+
const rest = runTo > from + ahead.length ? text.slice(from, runTo) : ahead;
|
|
218
|
+
shapes.push(redactSecrets(rest, secrets, Buffer.byteLength(rest)));
|
|
219
|
+
reads.push({ text: rest, cuts: [] });
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
// The reads joined by line breaks, each one's cuts moved to where it stands in the join. The matcher's views read a
|
|
223
|
+
// line break as nothing, so a value whole across two pieces is no form found as it stands there, and is left.
|
|
224
|
+
let raw = "";
|
|
225
|
+
const cuts = [];
|
|
226
|
+
reads.forEach((read, at) => {
|
|
227
|
+
if (at > 0)
|
|
228
|
+
raw += "\n";
|
|
229
|
+
for (const [start, end] of read.cuts)
|
|
230
|
+
cuts.push([raw.length + start, raw.length + end]);
|
|
231
|
+
raw += read.text;
|
|
232
|
+
});
|
|
233
|
+
const [shows, cutShapes] = [out.join(""), shapes.join("")];
|
|
234
|
+
// Each of the three joins read once.
|
|
235
|
+
scanned.chars += raw.length + shows.length + cutShapes.length;
|
|
236
|
+
return { out: shows, seen: { raw, cuts, shapes: cutShapes, unread }, short: from < text.length && shown <= enough };
|
|
237
|
+
}
|
|
238
|
+
/** text from `from` on, as far as `count` characters the matcher sees (all of it, if it holds fewer), each run of
|
|
239
|
+
* whitespace in it one space. The matcher reads "+" as a space and decodes percent-encoded bytes and JSON's escapes
|
|
240
|
+
* (one level and two, as the JSON view reads them), so a "+", an encoded byte and an escape that decodes to whitespace
|
|
241
|
+
* count no more than whitespace does, and any other escape counts as what the view keeps of the character it decodes
|
|
242
|
+
* to. A character that renders as nothing (a zero-width space, a soft hyphen) counts as nothing too: the views drop it.
|
|
243
|
+
* Padding of any of them never hides the rest of a value split before it. Undefined, so the caller withholds the text,
|
|
244
|
+
* when that takes more than a piece of text (a run of whitespace counted as one): no redaction pass reads more than a
|
|
245
|
+
* piece. */
|
|
246
|
+
function peek(text, from, count) {
|
|
247
|
+
const read = visible(text, from, count, text.length);
|
|
248
|
+
return read.span > ANSWER_PIECE ? undefined : read.parts.join("");
|
|
249
|
+
}
|
|
250
|
+
/** The end of the run text[start, to) the pass reads for the head of a value whose rest comes after the run: as few of
|
|
251
|
+
* its last characters as hold `count` characters the matcher sees (at most a piece's worth), counted as peek counts
|
|
252
|
+
* them, so padding the views read as nothing (whitespace, a zero-width space, a soft hyphen, an escape or encoded bytes
|
|
253
|
+
* that decode to either) between that head and the run's end never pushes the head out of it. Read forward from a
|
|
254
|
+
* start moved back from `to`, twice as far each time, so it reads at most two pieces in all. Undefined, so the caller
|
|
255
|
+
* withholds the text, when that takes more than a piece of text. */
|
|
256
|
+
function tailOf(text, start, to, count) {
|
|
257
|
+
const want = Math.min(count, ANSWER_PIECE);
|
|
258
|
+
for (let width = Math.min(want, to - start);; width = Math.min(2 * width, ANSWER_PIECE, to - start)) {
|
|
259
|
+
const from = to - width;
|
|
260
|
+
if (from === start || visible(text, from, want, to).found >= want)
|
|
261
|
+
return text.slice(from, to);
|
|
262
|
+
if (width >= ANSWER_PIECE)
|
|
263
|
+
return undefined;
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
/** text[from, to) read as peek says, until `count` characters the matcher sees are found or the read passes a piece
|
|
267
|
+
* of text (`span`, a run of whitespace counted as one): what it read, as peek returns it, and how many it found. */
|
|
268
|
+
function visible(text, from, count, to) {
|
|
269
|
+
const parts = [];
|
|
270
|
+
let span = 0;
|
|
271
|
+
let found = 0;
|
|
272
|
+
let escape;
|
|
273
|
+
for (let at = from; at < to && found < count && span <= ANSWER_PIECE;) {
|
|
274
|
+
SPACES.lastIndex = at;
|
|
275
|
+
let end = SPACES.test(text) ? SPACES.lastIndex : at;
|
|
276
|
+
if (end > at) {
|
|
277
|
+
parts.push(" ");
|
|
278
|
+
span++;
|
|
279
|
+
}
|
|
280
|
+
else {
|
|
281
|
+
while (end - at <= ANSWER_PIECE && end + 3 <= to && text[end] === "%" && HEX_PAIR.test(text.slice(end + 1, end + 3)))
|
|
282
|
+
end += 3;
|
|
283
|
+
if (end > at)
|
|
284
|
+
found += squeeze(Buffer.from(text.slice(at, end).replaceAll("%", ""), "hex").toString("utf8")).length;
|
|
285
|
+
else if (text[at] === "\\" && (escape = jsonEscapeAt(text, at)) !== undefined) {
|
|
286
|
+
end = escape.end;
|
|
287
|
+
found += squeeze(escape.char).length;
|
|
288
|
+
}
|
|
289
|
+
else {
|
|
290
|
+
end = at + 1;
|
|
291
|
+
if (text[at] !== "+")
|
|
292
|
+
found += squeeze(text[at]).length;
|
|
293
|
+
}
|
|
294
|
+
parts.push(text.slice(at, end));
|
|
295
|
+
span += end - at;
|
|
296
|
+
}
|
|
297
|
+
// Each character read, a percent-encoded run's twice more (its hex parsed, then decoded).
|
|
298
|
+
scanned.chars += text[at] === "%" && end > at + 1 ? 3 * (end - at) : end - at;
|
|
299
|
+
at = end;
|
|
300
|
+
}
|
|
301
|
+
return { parts, found, span };
|
|
302
|
+
}
|
|
303
|
+
const SPACES = /\s+/y;
|
|
304
|
+
const HEX_PAIR = /^[0-9A-Fa-f]{2}$/;
|
|
305
|
+
/** Where the piece of `text` read from `from` ends: at its last whitespace before ANSWER_PIECE characters; with none, at
|
|
306
|
+
* runCut's place, else at the next whitespace (a run read as one, or unread past ANSWER_PIECE). Never inside a private
|
|
307
|
+
* key block whose END line is in reach (keyWhole). */
|
|
308
|
+
function pieceEnd(text, from) {
|
|
309
|
+
return keyWhole(text, from, spaceEnd(text, from));
|
|
310
|
+
}
|
|
311
|
+
/** `end`, the end of the piece read from `from`, or, where a private key block crosses it, where the piece ends instead,
|
|
312
|
+
* so the block is read whole in one piece and cut whole by its shape: a piece cut inside it would show the rest of its
|
|
313
|
+
* body and its END line in the next piece, where no shape starts. Only the last "-----BEGIN" in the piece (at most a
|
|
314
|
+
* piece back from `end`) can start a block that crosses it: the END line an earlier one reads stops at that one's
|
|
315
|
+
* dashes. The piece ends at the last whitespace before the block's BEGIN line, so the next piece starts with the block;
|
|
316
|
+
* with none in the piece (the block starts it, a run glued to it), at the block's END line, so the block is one piece
|
|
317
|
+
* (or, longer than a piece, one run read as "[redacted]"). */
|
|
318
|
+
function keyWhole(text, from, end) {
|
|
319
|
+
if (end >= text.length)
|
|
320
|
+
return end;
|
|
321
|
+
const start = Math.max(from, end - ANSWER_PIECE);
|
|
322
|
+
const window = text.slice(start, end);
|
|
323
|
+
const begin = window.lastIndexOf("-----BEGIN");
|
|
324
|
+
scanned.chars += window.length;
|
|
325
|
+
if (begin < 0)
|
|
326
|
+
return end;
|
|
327
|
+
const block = privateKeyEnd(text, start + begin);
|
|
328
|
+
if (block <= end)
|
|
329
|
+
return end;
|
|
330
|
+
const space = window.slice(0, begin).search(/\s\S*$/);
|
|
331
|
+
return space >= 0 ? start + space + 1 : block;
|
|
332
|
+
}
|
|
333
|
+
/** pieceEnd's place, before keyWhole moves it. */
|
|
334
|
+
function spaceEnd(text, from) {
|
|
335
|
+
const to = Math.min(text.length, from + ANSWER_PIECE);
|
|
336
|
+
if (to === text.length)
|
|
337
|
+
return to;
|
|
338
|
+
const head = text.slice(from, to);
|
|
339
|
+
const space = head.search(/\s[^\s]*$/);
|
|
340
|
+
// The search for the piece's last whitespace reads each run of the piece twice at most (to the run's end, then back);
|
|
341
|
+
// the scheme's check after it, as much again.
|
|
342
|
+
scanned.chars += 4 * head.length;
|
|
343
|
+
if (space <= 0) {
|
|
344
|
+
const cut = runCut(text, from, to);
|
|
345
|
+
return cut > from ? cut : runEnd(text, to);
|
|
346
|
+
}
|
|
347
|
+
const end = from + space + 1;
|
|
348
|
+
// A cut after a Bearer scheme would leave its token at the head of the next piece, where no shape reads it (the shape
|
|
349
|
+
// is the scheme, then the token). The cut moves back to the whitespace before the scheme; with none in this piece, the
|
|
350
|
+
// scheme and its token are read as one run, to the next whitespace, as a run with no whitespace is.
|
|
351
|
+
if (!endsInScheme(text.slice(from, end)))
|
|
352
|
+
return end;
|
|
353
|
+
const before = text.slice(from, end).trimEnd().search(/\s[^\s]*$/);
|
|
354
|
+
return before > 0 ? from + before + 1 : runEnd(text, end);
|
|
355
|
+
}
|
|
356
|
+
/** The next whitespace in `text` at or after `at`, or its end. */
|
|
357
|
+
function runEnd(text, at) {
|
|
358
|
+
const next = text.slice(at).search(/\s/);
|
|
359
|
+
scanned.chars += next < 0 ? text.length - at : next + 1;
|
|
360
|
+
return next < 0 ? text.length : at + next;
|
|
361
|
+
}
|
|
362
|
+
/** Where a run with no whitespace in text[from, to) may be cut, or -1: after the last quote in it that ends a JSON
|
|
363
|
+
* string (no backslash before it; a comma, colon or closing bracket after it) and is in no URL's authority
|
|
364
|
+
* (authorities); or, a run of a JSON array's numbers only, after its last comma. The one secret shape that may hold a
|
|
365
|
+
* quote is a URL's user and password, so no cut splits a shape, whatever its length: a run with no other place to cut
|
|
366
|
+
* is read to its end, or unread from its start. A held value cut there still shows to the pass over the joined pieces
|
|
367
|
+
* (heldIn), and withholds the text whole. Each search keeps to text[from, to), but for where a URL's authority ends,
|
|
368
|
+
* which is read once per URL, to the end of its run at most. */
|
|
369
|
+
function runCut(text, from, to) {
|
|
370
|
+
const head = text.slice(from, to);
|
|
371
|
+
// The head read three times: back from its end for each quote, and for a JSON array's numbers twice.
|
|
372
|
+
scanned.chars += 3 * head.length;
|
|
373
|
+
const urls = authorities(text, from, head);
|
|
374
|
+
let url = urls.length - 1;
|
|
375
|
+
for (let at = head.lastIndexOf('"'); at >= 0; at = at > 0 ? head.lastIndexOf('"', at - 1) : -1) {
|
|
376
|
+
// The authority starting last before this quote, the one it could be in: they do not overlap.
|
|
377
|
+
while (url >= 0 && urls[url][0] >= at)
|
|
378
|
+
url--;
|
|
379
|
+
const inUrl = url >= 0 && at < urls[url][1];
|
|
380
|
+
if (!inUrl && (at > 0 ? head[at - 1] : text[from - 1]) !== "\\" && /[,:\]}]/.test(text[from + at + 1] ?? ""))
|
|
381
|
+
return from + at + 1;
|
|
382
|
+
}
|
|
383
|
+
const comma = head.lastIndexOf(",");
|
|
384
|
+
return comma > 0 && /^\s?[-+.\deE,[\]{}:]+$/.test(head) ? from + comma + 1 : -1;
|
|
385
|
+
}
|
|
386
|
+
/** Each URL authority in `head` (text from `from`) that holds a user and password, as [start, end) in `head`: from its
|
|
387
|
+
* "://" to the "@" that ends it, past the head's end if need be. One whose first whitespace, "/", "?" or "#" comes
|
|
388
|
+
* before any "@" (a URL with no password, then the rest of the JSON it is in) holds none, so none of it is kept whole. */
|
|
389
|
+
function authorities(text, from, head) {
|
|
390
|
+
const found = [];
|
|
391
|
+
const stop = /[\s/?#@]/g;
|
|
392
|
+
for (let at = head.indexOf("://"); at >= 0; at = head.indexOf("://", at)) {
|
|
393
|
+
stop.lastIndex = from + at + 3;
|
|
394
|
+
const hit = stop.exec(text);
|
|
395
|
+
const end = (hit?.index ?? text.length) - from;
|
|
396
|
+
// Its authority, from the "://" to the stop (the head's search for "://" counts with runCut's reads).
|
|
397
|
+
scanned.chars += end - at;
|
|
398
|
+
if (hit?.[0] === "@")
|
|
399
|
+
found.push([at, end]);
|
|
400
|
+
if (end >= head.length)
|
|
401
|
+
break;
|
|
402
|
+
// Past an "@", on; past any other stop, from the character before it: a "/" may be the first of the next "://".
|
|
403
|
+
at = hit?.[0] === "@" ? end : end - 1;
|
|
404
|
+
}
|
|
405
|
+
return found;
|
|
130
406
|
}
|
|
131
407
|
/** Whether a number shows a held value. A held value can be all digits (a gateway's key), and a record or a call's
|
|
132
408
|
* arguments can quote it as a number: one whose digits hold a held value, by the same rule as a string's, is held. A
|
package/dist/learn/secrets.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import { type Needles, type Span } from "../redact/match.js";
|
|
1
2
|
/** Whether `text` ends in a `Bearer` scheme and the blanks after it: the one place a shape is read across whitespace
|
|
2
3
|
* (the scheme, then its token), so a reader that cuts a text at whitespace must not cut there (key-refusal.ts
|
|
3
4
|
* redactedAnswer). */
|
|
4
5
|
export declare const endsInScheme: (text: string) => boolean;
|
|
5
|
-
/** The kinds of secret-shaped text in `text
|
|
6
|
+
/** The kinds of secret-shaped text in `text` (redact/match.ts SECRET_SHAPES). */
|
|
6
7
|
export declare const secretShapes: (text: string) => string[];
|
|
7
8
|
/** The kinds of text in `text` learning never keeps: every secret shape, and a bank's numbers beside their words. */
|
|
8
9
|
export declare const learnedSecretShapes: (text: string) => string[];
|
|
@@ -14,18 +15,38 @@ export declare const PRINT_MAX = 4096;
|
|
|
14
15
|
* any case, base64, a hex identifier in it folded) and each secret-shaped run replaced by "[redacted]": what the
|
|
15
16
|
* checker prints never holds a secret, wherever it was found, a file's name included, each value as a path names it too
|
|
16
17
|
* (pathSpellings) and as a URL's path writes it (percentForms). Every form is found in `text` as given, and overlapping
|
|
17
|
-
* finds are redacted as one, so
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
|
|
24
|
-
|
|
18
|
+
* finds are redacted as one, so one value never hides part of another from the search. A text that holds a value in a
|
|
19
|
+
* form not found as it stands (percent encoded, split by whitespace, an NFKC variant), read in `text` as given, is
|
|
20
|
+
* redacted whole, never in part, unless every character of it is inside what the finds cut: a cut can hide part of a
|
|
21
|
+
* value, so the rest is looked for before the cut (redact/match.ts planCut). So is a text over `max` bytes (PRINT_MAX
|
|
22
|
+
* unless the caller names more), and one whose cut leaves a value or a shape. `held`: spans of `text` cut in place
|
|
23
|
+
* beside the finds (heldSpans, of values no longer at hand). */
|
|
24
|
+
export declare function redactSecrets(text: string, values: readonly string[], max?: number, held?: readonly (readonly [number, number])[]): string;
|
|
25
|
+
/** Where redactSecrets cuts `values` in `text`, shapes left out: each span it cuts in place (UTF-16 offsets, overlapping
|
|
26
|
+
* ones merged, in order), or "whole" when its checks over them cut the text whole (a value split by a line break,
|
|
27
|
+
* percent encoded, an NFKC variant, read in the text as it came: redact/match.ts planCut). What a run's census keeps of
|
|
28
|
+
* a file, never the values (run-census.ts): redactSecrets given these spans as `held` cuts the text as it would have
|
|
29
|
+
* with the values among its own. */
|
|
30
|
+
export declare function heldSpans(text: string, values: readonly string[]): Span[] | "whole";
|
|
25
31
|
/** `text` as redactSecrets cuts it, and of a bank's numbers beside their words too (MONEY_SHAPES): what learning prints
|
|
26
32
|
* and serves of what it learned or refused (a problem's path and detail, a note read), never a run's own view, which
|
|
27
33
|
* may show its user an account number. */
|
|
28
34
|
export declare function redactLearned(text: string, values: readonly string[], max?: number): string;
|
|
35
|
+
/** redactSecrets, and where it cut: the spans of `text` cut in place and the text so cut, or "whole" where redactSecrets
|
|
36
|
+
* answers "[redacted]". A reader that redacts a text in pieces (key-refusal.ts) reads the pieces as they came for a
|
|
37
|
+
* value split across them (valueLeft), each piece's cuts covering it. */
|
|
38
|
+
export declare function cutSecrets(text: string, values: readonly string[], max?: number): {
|
|
39
|
+
spans: Span[];
|
|
40
|
+
out: string;
|
|
41
|
+
} | "whole";
|
|
42
|
+
/** Whether `text` holds one of `values` in a form valueMatcher finds, a character of which no cut covers: what
|
|
43
|
+
* a reader that cut `text` there would still show of it. The cuts are `cuts` (merged spans of `text`, in order: where a
|
|
44
|
+
* reader that cut it in pieces cut each), or else those redactSecrets makes of `text` whole (its values' forms, hexes
|
|
45
|
+
* and folded identifiers, and the secret shapes, found as they stand). */
|
|
46
|
+
export declare function valueLeft(text: string, values: readonly string[], cuts?: readonly Span[]): boolean;
|
|
47
|
+
/** What the matcher looks for of `values` (derivedOf, cached by array): the scrubber's held rule (secret-rules.ts) cuts
|
|
48
|
+
* each form, hex and folded identifier in place with redact/match.ts cutSpans. */
|
|
49
|
+
export declare const heldNeedles: (values: readonly string[]) => Needles;
|
|
29
50
|
/** A value shorter than this matches too much text by chance to be refused. */
|
|
30
51
|
export declare const MIN_SECRET = 8;
|
|
31
52
|
/** An excerpt of a run's input or answer as learning keeps it: `text` cut of the secrets `shown` knows, whole, then
|
|
@@ -38,8 +59,7 @@ export declare function excerptShown(text: string, shown: {
|
|
|
38
59
|
}, max: number): string;
|
|
39
60
|
/** A matcher for `values` in a text: plain, split by whitespace, as JSON writes it, percent or form encoded, base64 or
|
|
40
61
|
* hex, and each hex identifier in a value folded: in any case, its separators dropped or moved (foldedOf). Values
|
|
41
|
-
* shorter than MIN_SECRET are left out. `fold: false`, the matcher without the folded needles
|
|
42
|
-
* whole-text check). */
|
|
62
|
+
* shorter than MIN_SECRET are left out. `fold: false`, the matcher without the folded needles. */
|
|
43
63
|
export declare function valueMatcher(values: readonly string[], { fold }?: {
|
|
44
64
|
fold?: boolean;
|
|
45
65
|
}): (text: string) => boolean;
|