@wirecat/attio-cli 0.9.0 → 0.11.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 +23 -0
- package/contracts/wirecat.json +1 -0
- package/dist/bin/attio.js +11 -11
- package/dist/bundle/attio.js +5 -166
- package/dist/bundle/{chunk-6E5QWCBK.js → chunk-OFEXB726.js} +2 -1
- package/dist/bundle/chunk-TQAECZFO.js +13 -0
- package/dist/bundle/{definitions-FODOIPM2.js → definitions-J73IBAHT.js} +1 -1
- package/dist/bundle/program-4R7RYWV3.js +6210 -0
- package/dist/bundle/{schemas-YGSTNU6F.js → schemas-G3HFAS45.js} +576 -29
- package/dist/commands/api.js +1 -2
- package/dist/commands/crm.js +12 -4
- package/dist/commands/schedule.js +1 -1
- package/dist/commands/session.js +1 -2
- package/dist/config.js +1 -2
- package/dist/context.js +1 -1
- package/dist/identity.js +1 -0
- package/dist/program.js +1 -2
- package/dist/version.js +1 -1
- package/package.json +3 -3
- package/dist/activities.d.ts +0 -4
- package/dist/activities.d.ts.map +0 -1
- package/dist/activities.js.map +0 -1
- package/dist/bin/attio.d.ts +0 -3
- package/dist/bin/attio.d.ts.map +0 -1
- package/dist/bin/attio.js.map +0 -1
- package/dist/bundle/agent-C3SZOGZS.js +0 -38
- package/dist/bundle/all-profiles-673VSTRG.js +0 -320
- package/dist/bundle/anthropic-V4RZS5XM.js +0 -91
- package/dist/bundle/app-server-CTEDPA5H.js +0 -249
- package/dist/bundle/bun-F4M4KCNA.js +0 -169
- package/dist/bundle/bun-sqlite-33JTNHCK.js +0 -76
- package/dist/bundle/chunk-2R2EX5I6.js +0 -54
- package/dist/bundle/chunk-5EH7S4RM.js +0 -362
- package/dist/bundle/chunk-5N2V6XO7.js +0 -119
- package/dist/bundle/chunk-5WY6RURV.js +0 -161
- package/dist/bundle/chunk-6V7ZUJI6.js +0 -4072
- package/dist/bundle/chunk-AOKAYQSJ.js +0 -2338
- package/dist/bundle/chunk-AQ5RIOUE.js +0 -633
- package/dist/bundle/chunk-B4DVW2BA.js +0 -185
- package/dist/bundle/chunk-C7JPYWYQ.js +0 -77
- package/dist/bundle/chunk-D72URWJE.js +0 -532
- package/dist/bundle/chunk-DBHZ7TQ7.js +0 -69828
- package/dist/bundle/chunk-DFDN6AUB.js +0 -21
- package/dist/bundle/chunk-DNCLQPOM.js +0 -7
- package/dist/bundle/chunk-DPV53EZC.js +0 -206
- package/dist/bundle/chunk-E2L4R6EI.js +0 -388
- package/dist/bundle/chunk-EDWRHVHD.js +0 -218
- package/dist/bundle/chunk-EH6ZEJGT.js +0 -932
- package/dist/bundle/chunk-EV6B3GHM.js +0 -323
- package/dist/bundle/chunk-FBWECICU.js +0 -259
- package/dist/bundle/chunk-FFER7KJI.js +0 -407
- package/dist/bundle/chunk-FTH6WGYO.js +0 -24
- package/dist/bundle/chunk-G3PK5BZB.js +0 -1222
- package/dist/bundle/chunk-G46PNDWL.js +0 -58
- package/dist/bundle/chunk-G6NY7LFB.js +0 -230
- package/dist/bundle/chunk-GLU36VKA.js +0 -52
- package/dist/bundle/chunk-GZ7WBU5Y.js +0 -18
- package/dist/bundle/chunk-HMYBAVIE.js +0 -86
- package/dist/bundle/chunk-HOJJPSLU.js +0 -288
- package/dist/bundle/chunk-HUAHLO6N.js +0 -29
- package/dist/bundle/chunk-ISQ23VKV.js +0 -123
- package/dist/bundle/chunk-J2LSOG3A.js +0 -12766
- package/dist/bundle/chunk-K5L77R7P.js +0 -66
- package/dist/bundle/chunk-KKRFVN4X.js +0 -1835
- package/dist/bundle/chunk-KLRCTMES.js +0 -100
- package/dist/bundle/chunk-KYRYD4CR.js +0 -38
- package/dist/bundle/chunk-L5QLKUQR.js +0 -794
- package/dist/bundle/chunk-MFSWMNSZ.js +0 -334
- package/dist/bundle/chunk-MYK2F5LD.js +0 -1251
- package/dist/bundle/chunk-NBNQLNVV.js +0 -388
- package/dist/bundle/chunk-O3DZDITT.js +0 -274
- package/dist/bundle/chunk-OEEWVKJX.js +0 -53
- package/dist/bundle/chunk-P5XYQZVW.js +0 -80
- package/dist/bundle/chunk-P6OJKJJS.js +0 -1197
- package/dist/bundle/chunk-P6S3ZRVW.js +0 -106
- package/dist/bundle/chunk-PL5P7UKW.js +0 -25216
- package/dist/bundle/chunk-QBJRK733.js +0 -1068
- package/dist/bundle/chunk-QBYE26ZC.js +0 -131
- package/dist/bundle/chunk-QPPOIWPY.js +0 -1246
- package/dist/bundle/chunk-R2CEA7MK.js +0 -743
- package/dist/bundle/chunk-S4UUN6LD.js +0 -1410
- package/dist/bundle/chunk-S6JG4YUH.js +0 -72
- package/dist/bundle/chunk-SKUY7JDA.js +0 -164
- package/dist/bundle/chunk-T35IOBPJ.js +0 -1341
- package/dist/bundle/chunk-T3W4V4A6.js +0 -63
- package/dist/bundle/chunk-TB3LN5G2.js +0 -50
- package/dist/bundle/chunk-TCT5D2X2.js +0 -6848
- package/dist/bundle/chunk-TES7MB6I.js +0 -82
- package/dist/bundle/chunk-TXDR6YSF.js +0 -23
- package/dist/bundle/chunk-TY7NDMFY.js +0 -46
- package/dist/bundle/chunk-U7UTYALA.js +0 -353
- package/dist/bundle/chunk-UOWHMOU3.js +0 -188
- package/dist/bundle/chunk-UXDUWGX6.js +0 -2791
- package/dist/bundle/chunk-V5I3QHDU.js +0 -558
- package/dist/bundle/chunk-VCDIKCFE.js +0 -1007
- package/dist/bundle/chunk-VJHUMB7U.js +0 -338
- package/dist/bundle/chunk-W4KLHM2K.js +0 -95
- package/dist/bundle/chunk-W5LKEOGN.js +0 -142
- package/dist/bundle/chunk-WLDZWHSF.js +0 -170
- package/dist/bundle/chunk-WQEEYEWO.js +0 -3752
- package/dist/bundle/chunk-WRF6TY63.js +0 -1521
- package/dist/bundle/chunk-WXYOELRI.js +0 -108
- package/dist/bundle/chunk-WZBPUOWM.js +0 -76
- package/dist/bundle/chunk-XGNZD52X.js +0 -592
- package/dist/bundle/chunk-XQUUANA2.js +0 -24600
- package/dist/bundle/chunk-Y5E2WNWB.js +0 -35
- package/dist/bundle/chunk-YQH4J6YZ.js +0 -358
- package/dist/bundle/chunk-Z7Y2I5YR.js +0 -44045
- package/dist/bundle/chunk-ZBCC7MBN.js +0 -9671
- package/dist/bundle/chunk-ZVVMGPBJ.js +0 -50
- package/dist/bundle/command-contract-ZL67KMYL.js +0 -37
- package/dist/bundle/command-server-entry-COR2VDRU.js +0 -166
- package/dist/bundle/decode-33SGRQM6.js +0 -297
- package/dist/bundle/dispatch-2FTOHA5D.js +0 -411
- package/dist/bundle/dist-EM7KLEG4.js +0 -7577
- package/dist/bundle/dist-PAKDDIBT.js +0 -191
- package/dist/bundle/echarts-QMAA7HH5.js +0 -42501
- package/dist/bundle/embed-W4ZBXPWD.js +0 -38
- package/dist/bundle/embedder-73CCZC52.js +0 -111
- package/dist/bundle/failure-OHIXWTR6.js +0 -25
- package/dist/bundle/first-run-MOSUMMVX.js +0 -28
- package/dist/bundle/first-screen-GUXBF3SL.js +0 -38
- package/dist/bundle/instructions-4H7UREH2.js +0 -11
- package/dist/bundle/mcp-5HFPWC3W.js +0 -167
- package/dist/bundle/meeting-combined-QMIZOBBJ.js +0 -24
- package/dist/bundle/meeting-model-2UYVGXD5.js +0 -25
- package/dist/bundle/meeting-semantic-LEJPUIN3.js +0 -22
- package/dist/bundle/node-KM3CUABH.js +0 -2340
- package/dist/bundle/node-P3PUHKYH.js +0 -176
- package/dist/bundle/node-TLZSIHIJ.js +0 -21
- package/dist/bundle/node-sqlite-UHPODTKB.js +0 -74
- package/dist/bundle/oauth-T3DWL7OV.js +0 -20
- package/dist/bundle/open-ODWX32PF.js +0 -23
- package/dist/bundle/openai-GSXXHKPX.js +0 -238
- package/dist/bundle/process-AFIXYXWL.js +0 -91
- package/dist/bundle/program-SXSUG335.js +0 -35250
- package/dist/bundle/prompt-GVTYTFK7.js +0 -17
- package/dist/bundle/recognize-XDSZEZP5.js +0 -26
- package/dist/bundle/remote-ZWZKMEY6.js +0 -31
- package/dist/bundle/rerank-OBZQ54NL.js +0 -52
- package/dist/bundle/serve-NY5MUTNW.js +0 -199
- package/dist/bundle/server-JK334V5Y.js +0 -212
- package/dist/bundle/server-VOPYQCUD.js +0 -79
- package/dist/bundle/sqlite-runtime-2NHF4S6G.js +0 -20
- package/dist/bundle/state-YGWZZWPM.js +0 -36
- package/dist/bundle/store-LRQUTFJR.js +0 -306
- package/dist/bundle/store-ND6KU4RI.js +0 -181
- package/dist/bundle/store-maintenance-command-GLYGQM2V.js +0 -66
- package/dist/bundle/surface-P53WLLXP.js +0 -65
- package/dist/commands/api.d.ts +0 -12
- package/dist/commands/api.d.ts.map +0 -1
- package/dist/commands/api.js.map +0 -1
- package/dist/commands/crm.d.ts +0 -7
- package/dist/commands/crm.d.ts.map +0 -1
- package/dist/commands/crm.js.map +0 -1
- package/dist/commands/schedule.d.ts +0 -3
- package/dist/commands/schedule.d.ts.map +0 -1
- package/dist/commands/schedule.js.map +0 -1
- package/dist/commands/session.d.ts +0 -8
- package/dist/commands/session.d.ts.map +0 -1
- package/dist/commands/session.js.map +0 -1
- package/dist/config.d.ts +0 -13
- package/dist/config.d.ts.map +0 -1
- package/dist/config.js.map +0 -1
- package/dist/context.d.ts +0 -37
- package/dist/context.d.ts.map +0 -1
- package/dist/context.js.map +0 -1
- package/dist/generated/definitions.d.ts +0 -3
- package/dist/generated/definitions.d.ts.map +0 -1
- package/dist/generated/definitions.js.map +0 -1
- package/dist/generated/manifest.d.ts +0 -6
- package/dist/generated/manifest.d.ts.map +0 -1
- package/dist/generated/manifest.js.map +0 -1
- package/dist/generated/schemas.d.ts +0 -383
- package/dist/generated/schemas.d.ts.map +0 -1
- package/dist/generated/schemas.js.map +0 -1
- package/dist/generated/types.d.ts +0 -10166
- package/dist/generated/types.d.ts.map +0 -1
- package/dist/generated/types.js.map +0 -1
- package/dist/generated/wirecat-config.d.ts +0 -15
- package/dist/generated/wirecat-config.d.ts.map +0 -1
- package/dist/generated/wirecat-config.js.map +0 -1
- package/dist/hooks.d.ts +0 -33
- package/dist/hooks.d.ts.map +0 -1
- package/dist/hooks.js.map +0 -1
- package/dist/identity.d.ts +0 -33
- package/dist/identity.d.ts.map +0 -1
- package/dist/identity.js.map +0 -1
- package/dist/index.d.ts +0 -3
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/links.d.ts +0 -10
- package/dist/links.d.ts.map +0 -1
- package/dist/links.js.map +0 -1
- package/dist/meetings.d.ts +0 -57
- package/dist/meetings.d.ts.map +0 -1
- package/dist/meetings.js.map +0 -1
- package/dist/program.d.ts +0 -6
- package/dist/program.d.ts.map +0 -1
- package/dist/program.js.map +0 -1
- package/dist/version.d.ts +0 -2
- package/dist/version.d.ts.map +0 -1
- package/dist/version.js.map +0 -1
- package/dist/wcat.d.ts +0 -3
- package/dist/wcat.d.ts.map +0 -1
- package/dist/wcat.js.map +0 -1
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import { createRequire as __bundleRequire } from "node:module";
|
|
2
|
-
const require = __bundleRequire(import.meta.url);
|
|
3
|
-
import {
|
|
4
|
-
__name
|
|
5
|
-
} from "./chunk-ZVVMGPBJ.js";
|
|
6
|
-
|
|
7
|
-
// node_modules/.pnpm/@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/errors.js
|
|
8
|
-
var errorCodes = [
|
|
9
|
-
"validation_error",
|
|
10
|
-
"configuration_error",
|
|
11
|
-
"authentication_error",
|
|
12
|
-
"permission_error",
|
|
13
|
-
"not_found",
|
|
14
|
-
"confirmation_required",
|
|
15
|
-
"rate_limited",
|
|
16
|
-
"timeout",
|
|
17
|
-
"network_error",
|
|
18
|
-
"provider_error",
|
|
19
|
-
"provider_unavailable",
|
|
20
|
-
"invalid_response",
|
|
21
|
-
"outcome_unknown",
|
|
22
|
-
"conflict",
|
|
23
|
-
"cancelled"
|
|
24
|
-
];
|
|
25
|
-
var BRAND = /* @__PURE__ */ Symbol.for("@wirecat/cli-base/CliError");
|
|
26
|
-
var CliError = class extends Error {
|
|
27
|
-
static {
|
|
28
|
-
__name(this, "CliError");
|
|
29
|
-
}
|
|
30
|
-
code;
|
|
31
|
-
details;
|
|
32
|
-
constructor(code, message, details = {}) {
|
|
33
|
-
super(message);
|
|
34
|
-
this.name = "CliError";
|
|
35
|
-
this.code = code;
|
|
36
|
-
this.details = details;
|
|
37
|
-
Object.defineProperty(this, BRAND, { value: true });
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
var isCliError = /* @__PURE__ */ __name((value) => typeof value === "object" && value !== null && value[BRAND] === true, "isCliError");
|
|
41
|
-
|
|
42
|
-
// node_modules/.pnpm/@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/sanitize.js
|
|
43
|
-
var CONTROL = (
|
|
44
|
-
// biome-ignore lint/suspicious/noControlCharactersInRegex: matching them is the whole point
|
|
45
|
-
/[\u0000-\u0008\u000B-\u001F\u007F-\u009F\u200B\u200E\u200F\u202A-\u202E\u2066-\u2069\uFEFF\u{E0000}-\u{E007F}]/gu
|
|
46
|
-
);
|
|
47
|
-
var SUBDIVISION_FLAG = /\u{1F3F4}[\u{E0061}-\u{E007A}]{2}[\u{E0030}-\u{E0039}\u{E0061}-\u{E007A}]{1,3}\u{E007F}/gu;
|
|
48
|
-
var LINE_BREAKS = /[\t\n\u2028\u2029]/g;
|
|
49
|
-
var escaped = /* @__PURE__ */ __name((c) => {
|
|
50
|
-
const code = c.codePointAt(0) ?? 0;
|
|
51
|
-
if (code > 65535)
|
|
52
|
-
return `\\u{${code.toString(16)}}`;
|
|
53
|
-
return code > 255 ? `\\u${code.toString(16).padStart(4, "0")}` : `\\x${code.toString(16).padStart(2, "0")}`;
|
|
54
|
-
}, "escaped");
|
|
55
|
-
var visibleControls = /* @__PURE__ */ __name((text) => {
|
|
56
|
-
let at = 0;
|
|
57
|
-
let result = "";
|
|
58
|
-
for (const flag of text.matchAll(SUBDIVISION_FLAG)) {
|
|
59
|
-
result += text.slice(at, flag.index).replace(CONTROL, escaped) + flag[0];
|
|
60
|
-
at = flag.index + flag[0].length;
|
|
61
|
-
}
|
|
62
|
-
return result + text.slice(at).replace(CONTROL, escaped);
|
|
63
|
-
}, "visibleControls");
|
|
64
|
-
var singleLine = /* @__PURE__ */ __name((text) => visibleControls(text).replace(LINE_BREAKS, escaped), "singleLine");
|
|
65
|
-
|
|
66
|
-
export {
|
|
67
|
-
errorCodes,
|
|
68
|
-
CliError,
|
|
69
|
-
isCliError,
|
|
70
|
-
visibleControls,
|
|
71
|
-
singleLine
|
|
72
|
-
};
|
|
@@ -1,164 +0,0 @@
|
|
|
1
|
-
import { createRequire as __bundleRequire } from "node:module";
|
|
2
|
-
const require = __bundleRequire(import.meta.url);
|
|
3
|
-
import {
|
|
4
|
-
CliError,
|
|
5
|
-
errorCodes
|
|
6
|
-
} from "./chunk-S6JG4YUH.js";
|
|
7
|
-
import {
|
|
8
|
-
__name
|
|
9
|
-
} from "./chunk-ZVVMGPBJ.js";
|
|
10
|
-
|
|
11
|
-
// node_modules/.pnpm/@wirecat+cli-core@2.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_a82f624c57005d53c3f072e45c3a3a86/node_modules/@wirecat/cli-core/dist/errors/failures.js
|
|
12
|
-
var isCliFailure = /* @__PURE__ */ __name((value) => value instanceof Error && value.name === "CliError" && errorCodes.includes(value.code), "isCliFailure");
|
|
13
|
-
var isCommanderFailure = /* @__PURE__ */ __name((value) => {
|
|
14
|
-
const { code, exitCode } = value ?? {};
|
|
15
|
-
return value instanceof Error && typeof code === "string" && code.startsWith("commander.") && typeof exitCode === "number";
|
|
16
|
-
}, "isCommanderFailure");
|
|
17
|
-
var USAGE_REASONS = {
|
|
18
|
-
"commander.unknownCommand": "usage.unknown-command",
|
|
19
|
-
"commander.unknownOption": "usage.unknown-option"
|
|
20
|
-
};
|
|
21
|
-
var usageReason = /* @__PURE__ */ __name((code) => USAGE_REASONS[code], "usageReason");
|
|
22
|
-
var failureKey = /* @__PURE__ */ __name((error) => isCliFailure(error) ? error.code : error instanceof Error ? error.name : "error", "failureKey");
|
|
23
|
-
var SQLITE_BUSY = 5;
|
|
24
|
-
var SQLITE_CORRUPT = 11;
|
|
25
|
-
var SQLITE_NOTADB = 26;
|
|
26
|
-
var DAMAGED_TEXT = /database disk image is malformed|file is not a database|fts5: corruption/i;
|
|
27
|
-
var sqliteCode = /* @__PURE__ */ __name((error) => {
|
|
28
|
-
const { errcode, errno, name } = error ?? {};
|
|
29
|
-
const code = typeof errcode === "number" ? errcode : name === "SQLiteError" && typeof errno === "number" ? errno : null;
|
|
30
|
-
return code === null ? void 0 : code & 255;
|
|
31
|
-
}, "sqliteCode");
|
|
32
|
-
var sqliteFailureIn = /* @__PURE__ */ __name((error, matches) => {
|
|
33
|
-
if (isCliFailure(error) || isCommanderFailure(error))
|
|
34
|
-
return void 0;
|
|
35
|
-
let at = error;
|
|
36
|
-
for (let depth = 0; depth < 5 && at instanceof Error; depth += 1) {
|
|
37
|
-
if (matches(at))
|
|
38
|
-
return at;
|
|
39
|
-
at = at.cause;
|
|
40
|
-
}
|
|
41
|
-
return void 0;
|
|
42
|
-
}, "sqliteFailureIn");
|
|
43
|
-
var damageIn = /* @__PURE__ */ __name((error) => sqliteFailureIn(error, (at) => {
|
|
44
|
-
const code = sqliteCode(at);
|
|
45
|
-
return code !== void 0 && [SQLITE_CORRUPT, SQLITE_NOTADB].includes(code) || DAMAGED_TEXT.test(at.message);
|
|
46
|
-
}), "damageIn");
|
|
47
|
-
var wrapping = /* @__PURE__ */ __name((error, original) => {
|
|
48
|
-
Object.defineProperty(error, "cause", { value: original, configurable: true, writable: true });
|
|
49
|
-
if (original instanceof Error && original.stack)
|
|
50
|
-
error.stack = original.stack;
|
|
51
|
-
return error;
|
|
52
|
-
}, "wrapping");
|
|
53
|
-
var storeDamaged = /* @__PURE__ */ __name((error, next) => damageIn(error) ? wrapping(new CliError("configuration_error", `the store file is damaged${next ? `; \`${next}\` says what is damaged and what to do` : ""}`, { reason: "store.damaged" }), error) : error, "storeDamaged");
|
|
54
|
-
var storeBusy = /* @__PURE__ */ __name((error) => sqliteFailureIn(error, (at) => sqliteCode(at) === SQLITE_BUSY) ? wrapping(new CliError("conflict", "another process held the store for longer than this command waits; run it again", {
|
|
55
|
-
reason: "store.busy"
|
|
56
|
-
}), error) : error, "storeBusy");
|
|
57
|
-
var damagedFile = /* @__PURE__ */ __name(async (files, work) => {
|
|
58
|
-
try {
|
|
59
|
-
return await work();
|
|
60
|
-
} catch (error) {
|
|
61
|
-
if (!damageIn(error))
|
|
62
|
-
throw error;
|
|
63
|
-
throw wrapping(new CliError("validation_error", `${files.join(" or ")} is damaged or not a database`, {
|
|
64
|
-
reason: "store.file-damaged"
|
|
65
|
-
}), error);
|
|
66
|
-
}
|
|
67
|
-
}, "damagedFile");
|
|
68
|
-
var isStoreDamage = /* @__PURE__ */ __name((error) => damageIn(error) !== void 0, "isStoreDamage");
|
|
69
|
-
|
|
70
|
-
// node_modules/.pnpm/@wirecat+cli-core@2.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_a82f624c57005d53c3f072e45c3a3a86/node_modules/@wirecat/cli-core/dist/runs/secrets.js
|
|
71
|
-
var SECRET_WORDS = /* @__PURE__ */ new Set([
|
|
72
|
-
"authorization",
|
|
73
|
-
"cookie",
|
|
74
|
-
"credential",
|
|
75
|
-
"credentials",
|
|
76
|
-
"passphrase",
|
|
77
|
-
"password",
|
|
78
|
-
"passwd",
|
|
79
|
-
"pwd",
|
|
80
|
-
"pass",
|
|
81
|
-
"passcode",
|
|
82
|
-
"pin",
|
|
83
|
-
"otp",
|
|
84
|
-
"2fa",
|
|
85
|
-
"secret",
|
|
86
|
-
"token",
|
|
87
|
-
"contrase\xF1a",
|
|
88
|
-
"contrasena",
|
|
89
|
-
"clave",
|
|
90
|
-
"\u043F\u0430\u0440\u043E\u043B\u044C",
|
|
91
|
-
"\u043F\u0438\u043D",
|
|
92
|
-
"\u043A\u043E\u0434",
|
|
93
|
-
...["api", "auth", "service", "account", "db", "database", "priv", "private", "client"].map((word) => `${word}key`),
|
|
94
|
-
...["db", "database", "key"].map((word) => `${word}pass`)
|
|
95
|
-
]);
|
|
96
|
-
var secretNamed = /* @__PURE__ */ __name((name) => {
|
|
97
|
-
const words = name.replace(/([a-z0-9])([A-Z])/g, "$1 $2").split(/[\s_.-]+/).map((word) => word.toLowerCase());
|
|
98
|
-
return words.some((word, at) => SECRET_WORDS.has(word) || SECRET_WORDS.has(word + (words[at + 1] ?? "")));
|
|
99
|
-
}, "secretNamed");
|
|
100
|
-
var START = "(?<![A-Za-z0-9_-])";
|
|
101
|
-
var END = "(?![A-Za-z0-9_-])";
|
|
102
|
-
var KNOWN_TOKENS = new RegExp(`${[
|
|
103
|
-
"gh[pousr]_[A-Za-z0-9]{36,}",
|
|
104
|
-
"github_pat_[A-Za-z0-9_]{22,}",
|
|
105
|
-
"sk-[A-Za-z0-9_-]{20,}",
|
|
106
|
-
"xox[abprs]-[A-Za-z0-9-]{10,}",
|
|
107
|
-
"(?:AKIA|ASIA)[A-Z0-9]{16}",
|
|
108
|
-
"AIza[A-Za-z0-9_-]{35}",
|
|
109
|
-
"(?:sk|rk)_(?:live|test)_[A-Za-z0-9]{10,}",
|
|
110
|
-
"npm_[A-Za-z0-9]{36}",
|
|
111
|
-
"eyJ[A-Za-z0-9_-]{5,}\\.eyJ[A-Za-z0-9_-]{5,}\\.[A-Za-z0-9_-]*"
|
|
112
|
-
].map((pattern) => `${START}${pattern}${END}`).join("|")}|(?<!\\d)\\d{8,10}:[A-Za-z0-9_-]{35}${END}`, "g");
|
|
113
|
-
var WEBHOOK_PATH = /(\/rest\/\d+\/)[^/\s?#"']+/g;
|
|
114
|
-
var PRIVATE_KEY = /-----BEGIN[A-Z ]* PRIVATE KEY-----[\s\S]*?(?:-----END[A-Z ]* PRIVATE KEY-----|$)/g;
|
|
115
|
-
var SCHEME = /(?<![A-Za-z])(Bearer|Basic)(\s+)(?![A-Z]?[a-z]+(?![A-Za-z0-9]))[A-Za-z0-9._~+/=-]{8,}/g;
|
|
116
|
-
var NAMED_PAIR = /(?<![\p{L}\p{N}])([\p{L}\p{N}_.-]*(?:token|pass|pwd|pin|otp|2fa|secret|credential|cookie|authorization|key|contrase|clave|пароль|пин|код)[\p{L}\p{N}_.-]*)(["']?\s*(?:=>|[:=])\s*["']?|\s+(?![\p{L}]+(?![\p{L}\p{N}])))((?:Bearer\s+|Basic\s+)?)([^\s"'&,;]+)/giu;
|
|
117
|
-
var looksRandom = /* @__PURE__ */ __name((run) => {
|
|
118
|
-
if (run.length < 20)
|
|
119
|
-
return false;
|
|
120
|
-
const classes = [/[a-z]/, /[A-Z]/, /\d/, /[^A-Za-z0-9]/].filter((kind) => kind.test(run)).length;
|
|
121
|
-
if (classes < 3)
|
|
122
|
-
return false;
|
|
123
|
-
let switches = 0;
|
|
124
|
-
for (let at = 1; at < run.length; at++) {
|
|
125
|
-
const [before, after] = [run[at - 1], run[at]];
|
|
126
|
-
if (/[a-z]/.test(before) && /[A-Z]/.test(after) || /[A-Z]/.test(before) && /[a-z]/.test(after))
|
|
127
|
-
switches += 1;
|
|
128
|
-
}
|
|
129
|
-
if (switches / run.length < 0.15)
|
|
130
|
-
return false;
|
|
131
|
-
const pieces = run.match(/[A-Z]?[a-z]+|[A-Z]+(?![a-z])|\d+/g) ?? [];
|
|
132
|
-
if (pieces.join("").length / Math.max(pieces.length, 1) >= 2.75)
|
|
133
|
-
return false;
|
|
134
|
-
return entropy(run) >= 3.5;
|
|
135
|
-
}, "looksRandom");
|
|
136
|
-
var entropy = /* @__PURE__ */ __name((text) => {
|
|
137
|
-
const counts = /* @__PURE__ */ new Map();
|
|
138
|
-
for (const char of text)
|
|
139
|
-
counts.set(char, (counts.get(char) ?? 0) + 1);
|
|
140
|
-
let bits = 0;
|
|
141
|
-
for (const count of counts.values())
|
|
142
|
-
bits -= count / text.length * Math.log2(count / text.length);
|
|
143
|
-
return bits;
|
|
144
|
-
}, "entropy");
|
|
145
|
-
var withoutSecrets = /* @__PURE__ */ __name((text, mark = "[redacted]") => text.replace(WEBHOOK_PATH, `$1${mark}`).replace(PRIVATE_KEY, mark).replace(KNOWN_TOKENS, mark).replace(SCHEME, `$1$2${mark}`).replace(NAMED_PAIR, (whole, name, separator, scheme) => secretNamed(name) ? `${name}${separator}${scheme}${mark}` : whole).replace(/[!-~]{20,}/g, (token) => (
|
|
146
|
-
// A URL or a path is somebody's address, not a key; a credential in one is caught by the rules above.
|
|
147
|
-
token.includes("://") || /^(?:\/|~\/|\.\.?\/)/.test(token) ? token : token.replace(RUN, (run) => looksRandom(run) ? mark : run.replace(HEX, (hex) => entropy(hex) >= 3 ? mark : hex))
|
|
148
|
-
)), "withoutSecrets");
|
|
149
|
-
var RUN = /(?<![A-Za-z0-9_+/-])[A-Za-z0-9_+/-]{20,}/g;
|
|
150
|
-
var HEX = /(?<![A-Za-z0-9])(?=[0-9]*[a-f])[0-9a-f]{20,}(?![A-Za-z0-9])/g;
|
|
151
|
-
|
|
152
|
-
export {
|
|
153
|
-
isCliFailure,
|
|
154
|
-
isCommanderFailure,
|
|
155
|
-
usageReason,
|
|
156
|
-
failureKey,
|
|
157
|
-
sqliteCode,
|
|
158
|
-
storeDamaged,
|
|
159
|
-
storeBusy,
|
|
160
|
-
damagedFile,
|
|
161
|
-
isStoreDamage,
|
|
162
|
-
secretNamed,
|
|
163
|
-
withoutSecrets
|
|
164
|
-
};
|