@m8t-stack/cli 0.2.147 → 0.2.149
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/dist/cli.js +104 -6
- package/dist/cli.js.map +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -1464,7 +1464,7 @@ function installFoundryDnsShim() {
|
|
|
1464
1464
|
}
|
|
1465
1465
|
|
|
1466
1466
|
// src/lib/package-version.ts
|
|
1467
|
-
var CLI_VERSION = "0.2.
|
|
1467
|
+
var CLI_VERSION = "0.2.149";
|
|
1468
1468
|
|
|
1469
1469
|
// src/lib/render-error.ts
|
|
1470
1470
|
init_errors();
|
|
@@ -29045,8 +29045,102 @@ var KEYED_VALUE = `("[^"\\n]{8,}"|'[^'\\n]{8,}'|(?=[A-Za-z0-9+/=_.~%-]{0,64}[0-9
|
|
|
29045
29045
|
var KEYED_STRONG_SECRET_RE = new RegExp(`(?<![A-Za-z0-9])(shared[_-]?access[_-]?key|account[_-]?key|access[_-]?key|storage[_-]?key|api[_-]?key|apikey|x[_-]?api[_-]?key|client[_-]?secret|sas[_-]?token|access[_-]?token|refresh[_-]?token|auth[_-]?token|id[_-]?token|bot[_-]?token|private[_-]?key|password|passwd|pwd)(["']?\\s*[:=]\\s*)("[^"\\n]{8,}"|'[^'\\n]{8,}'|[A-Za-z0-9+/=_.~%-]{8,})`, "gi");
|
|
29046
29046
|
var KEYED_WEAK_SECRET_RE = new RegExp(`(?<![A-Za-z0-9])(authorization|secret|token|sig)(["']?\\s*[:=]\\s*)` + KEYED_VALUE, "gi");
|
|
29047
29047
|
var TELEGRAM_BOT_TOKEN_RE = /(?<!\d)\d{8,10}:AA[A-Za-z0-9_-]{32,34}(?![A-Za-z0-9_-])/g;
|
|
29048
|
-
var SPOKEN_SECRET_RE = /\b((?:password|passcode|passphrase|api[ _-]?key|access code|pin(?: code)?)\s+is[ \t:]+)(
|
|
29049
|
-
var
|
|
29048
|
+
var SPOKEN_SECRET_RE = /\b((?:password|passcode|passphrase|api[ _-]?key|access code|pin(?: code)?)\s+is[ \t:]+)(?!\[)("[^"\n]{4,64}"|'[^'\n]{4,64}'|\S{4,64})/gi;
|
|
29049
|
+
var SENTENCE_TAIL_RE = /[.,;:]+$/;
|
|
29050
|
+
var PROSE_TRIM_RE = /^[*_~`"']+|[*_~`"'.,;:!?]+$/g;
|
|
29051
|
+
var PASSWORD_STATE_WORDS = /* @__PURE__ */ new Set([
|
|
29052
|
+
"wrong",
|
|
29053
|
+
"incorrect",
|
|
29054
|
+
"invalid",
|
|
29055
|
+
"expired",
|
|
29056
|
+
"expiring",
|
|
29057
|
+
"required",
|
|
29058
|
+
"missing",
|
|
29059
|
+
"reset",
|
|
29060
|
+
"unchanged",
|
|
29061
|
+
"correct",
|
|
29062
|
+
"secure",
|
|
29063
|
+
"insecure",
|
|
29064
|
+
"weak",
|
|
29065
|
+
"strong",
|
|
29066
|
+
"blank",
|
|
29067
|
+
"empty",
|
|
29068
|
+
"gone",
|
|
29069
|
+
"lost",
|
|
29070
|
+
"forgotten",
|
|
29071
|
+
"compromised",
|
|
29072
|
+
"leaked",
|
|
29073
|
+
"breached",
|
|
29074
|
+
"outdated",
|
|
29075
|
+
"stale",
|
|
29076
|
+
"old",
|
|
29077
|
+
"new",
|
|
29078
|
+
"different",
|
|
29079
|
+
"same",
|
|
29080
|
+
"shared",
|
|
29081
|
+
"saved",
|
|
29082
|
+
"stored",
|
|
29083
|
+
"cached",
|
|
29084
|
+
"rotated",
|
|
29085
|
+
"rotating",
|
|
29086
|
+
"updated",
|
|
29087
|
+
"changed",
|
|
29088
|
+
"changing",
|
|
29089
|
+
"disabled",
|
|
29090
|
+
"enabled",
|
|
29091
|
+
"locked",
|
|
29092
|
+
"unlocked",
|
|
29093
|
+
"temporary",
|
|
29094
|
+
"permanent",
|
|
29095
|
+
"unrecoverable",
|
|
29096
|
+
"case-sensitive",
|
|
29097
|
+
"sensitive",
|
|
29098
|
+
"hashed",
|
|
29099
|
+
"encrypted",
|
|
29100
|
+
"written",
|
|
29101
|
+
"personal",
|
|
29102
|
+
"everywhere",
|
|
29103
|
+
"fine",
|
|
29104
|
+
"ok",
|
|
29105
|
+
"okay",
|
|
29106
|
+
"good",
|
|
29107
|
+
"bad",
|
|
29108
|
+
"ready",
|
|
29109
|
+
"set",
|
|
29110
|
+
"unset",
|
|
29111
|
+
"pending",
|
|
29112
|
+
"working",
|
|
29113
|
+
"broken",
|
|
29114
|
+
"failing",
|
|
29115
|
+
"failed",
|
|
29116
|
+
"accepted",
|
|
29117
|
+
"rejected",
|
|
29118
|
+
"not",
|
|
29119
|
+
"now",
|
|
29120
|
+
"still",
|
|
29121
|
+
"also",
|
|
29122
|
+
"only",
|
|
29123
|
+
"just",
|
|
29124
|
+
"being",
|
|
29125
|
+
"getting",
|
|
29126
|
+
"always",
|
|
29127
|
+
"never",
|
|
29128
|
+
"already",
|
|
29129
|
+
"again",
|
|
29130
|
+
"here",
|
|
29131
|
+
"there",
|
|
29132
|
+
"this",
|
|
29133
|
+
"that"
|
|
29134
|
+
]);
|
|
29135
|
+
function readsAsPasswordState(value) {
|
|
29136
|
+
if (/^["']/.test(value))
|
|
29137
|
+
return false;
|
|
29138
|
+
return PASSWORD_STATE_WORDS.has(value.replace(PROSE_TRIM_RE, "").toLowerCase());
|
|
29139
|
+
}
|
|
29140
|
+
function maskSpokenValue(lead, value) {
|
|
29141
|
+
const tail = SENTENCE_TAIL_RE.exec(value)?.[0] ?? "";
|
|
29142
|
+
return `${lead}${SECRET_PLACEHOLDER}${tail}`;
|
|
29143
|
+
}
|
|
29050
29144
|
var B64ISH_RE = /(?<![A-Za-z0-9+=_-])(?=[A-Za-z0-9+=_-]{0,64}[A-Z])(?=[A-Za-z0-9+=_-]{0,64}[a-z])(?=[A-Za-z0-9+=_-]{0,64}[0-9])[A-Za-z0-9+=_-]{40,}(?![A-Za-z0-9+=_-])/g;
|
|
29051
29145
|
var EMAIL_RE = new RegExp("[\\p{L}\\p{N}._%+-]+@[\\p{L}\\p{N}](?:[\\p{L}\\p{N}.-]*[\\p{L}\\p{N}])?\\.\\p{L}{2,}(?![\\p{L}\\p{N}-])", "gu");
|
|
29052
29146
|
var PHONE_INTL_RE = /(?<![\d/.-])\+\d{1,3}(?:[ .-]?\(\d{1,4}\))?(?:[ .-]?\d){6,12}(?!\d)/g;
|
|
@@ -29065,7 +29159,7 @@ function failClosedOnCutConstructs(text) {
|
|
|
29065
29159
|
return text;
|
|
29066
29160
|
}
|
|
29067
29161
|
function maskSecrets(text) {
|
|
29068
|
-
const masked = text.replace(PEM_BLOCK_RE, SECRET_PLACEHOLDER).replace(JWT_RE, SECRET_PLACEHOLDER).replace(HTTP_CREDENTIAL_RE, (_, scheme) => `${scheme} ${SECRET_PLACEHOLDER}`).replace(KNOWN_PREFIX_RE, SECRET_PLACEHOLDER).replace(TELEGRAM_BOT_TOKEN_RE, SECRET_PLACEHOLDER).replace(KEYED_STRONG_SECRET_RE, (_, key2, sep4) => `${key2}${sep4}${SECRET_PLACEHOLDER}`).replace(KEYED_WEAK_SECRET_RE, (_, key2, sep4) => `${key2}${sep4}${SECRET_PLACEHOLDER}`).replace(SPOKEN_SECRET_RE, (
|
|
29162
|
+
const masked = text.replace(PEM_BLOCK_RE, SECRET_PLACEHOLDER).replace(JWT_RE, SECRET_PLACEHOLDER).replace(HTTP_CREDENTIAL_RE, (_, scheme) => `${scheme} ${SECRET_PLACEHOLDER}`).replace(KNOWN_PREFIX_RE, SECRET_PLACEHOLDER).replace(TELEGRAM_BOT_TOKEN_RE, SECRET_PLACEHOLDER).replace(KEYED_STRONG_SECRET_RE, (_, key2, sep4) => `${key2}${sep4}${SECRET_PLACEHOLDER}`).replace(KEYED_WEAK_SECRET_RE, (_, key2, sep4) => `${key2}${sep4}${SECRET_PLACEHOLDER}`).replace(SPOKEN_SECRET_RE, (whole, lead, value) => readsAsPasswordState(value) ? whole : maskSpokenValue(lead, value)).replace(B64ISH_RE, SECRET_PLACEHOLDER);
|
|
29069
29163
|
return failClosedOnCutConstructs(masked);
|
|
29070
29164
|
}
|
|
29071
29165
|
function maskContact(text) {
|
|
@@ -29968,7 +30062,11 @@ async function runPipeline(args) {
|
|
|
29968
30062
|
(consumedRowsByPk[pk] ??= []).push(...grpRows);
|
|
29969
30063
|
const trustedOwner = g.source !== "a2a" && g.user.ref !== "unknown" && !g.user.ref.startsWith("svc:");
|
|
29970
30064
|
const dreamItems = trustedOwner ? teachingFilteredItems : teachingFilteredItems.map((i) => ({ ...i, text: maskContactStrict(i.text) }));
|
|
29971
|
-
const
|
|
30065
|
+
const dreamEnrichment = trustedOwner || !enrichment ? enrichment : {
|
|
30066
|
+
...enrichment,
|
|
30067
|
+
tools: enrichment.tools.map((t) => ({ ...t, queries: t.queries.map((q) => maskContactStrict(q)) }))
|
|
30068
|
+
};
|
|
30069
|
+
const conv = normalize(ng, dreamItems, dreamEnrichment);
|
|
29972
30070
|
conv.provenance = { pk, rows: provRows };
|
|
29973
30071
|
conversations.push(conv);
|
|
29974
30072
|
if (outcome === "consumed")
|
|
@@ -32343,7 +32441,7 @@ var ConversationsSweepCommand = class extends M8tCommand {
|
|
|
32343
32441
|
});
|
|
32344
32442
|
max = Option54.String("--max", "200", { description: "Maximum deletions per run" });
|
|
32345
32443
|
graceDays = Option54.String("--grace-days", "14", {
|
|
32346
|
-
description:
|
|
32444
|
+
description: `Days past the ${String(KEY_LIFETIME_DAYS)}-day key life before a conversation is eligible`
|
|
32347
32445
|
});
|
|
32348
32446
|
lookbackDays = Option54.String("--lookback-days", "180", {
|
|
32349
32447
|
description: "How far back to scan ledger activity for candidates"
|