cclawd 2026.3.28 → 2026.3.29
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/.buildstamp +1 -1
- package/dist/build-info.json +3 -3
- package/dist/extensions/cclawd-guard/index.js +88 -25
- package/dist/extensions/discord/node_modules/.package-lock.json +10 -261
- package/dist/extensions/discord/node_modules/@types/node/README.md +1 -1
- package/dist/extensions/discord/node_modules/@types/node/assert/strict.d.ts +0 -46
- package/dist/extensions/discord/node_modules/@types/node/assert.d.ts +0 -5
- package/dist/extensions/discord/node_modules/@types/node/async_hooks.d.ts +18 -38
- package/dist/extensions/discord/node_modules/@types/node/buffer.buffer.d.ts +1 -1
- package/dist/extensions/discord/node_modules/@types/node/buffer.d.ts +0 -45
- package/dist/extensions/discord/node_modules/@types/node/child_process.d.ts +0 -67
- package/dist/extensions/discord/node_modules/@types/node/cluster.d.ts +0 -54
- package/dist/extensions/discord/node_modules/@types/node/console.d.ts +0 -58
- package/dist/extensions/discord/node_modules/@types/node/constants.d.ts +0 -6
- package/dist/extensions/discord/node_modules/@types/node/crypto.d.ts +0 -18
- package/dist/extensions/discord/node_modules/@types/node/dgram.d.ts +0 -27
- package/dist/extensions/discord/node_modules/@types/node/diagnostics_channel.d.ts +0 -24
- package/dist/extensions/discord/node_modules/@types/node/dns/promises.d.ts +0 -6
- package/dist/extensions/discord/node_modules/@types/node/dns.d.ts +0 -46
- package/dist/extensions/discord/node_modules/@types/node/domain.d.ts +0 -16
- package/dist/extensions/discord/node_modules/@types/node/events.d.ts +0 -36
- package/dist/extensions/discord/node_modules/@types/node/fs/promises.d.ts +0 -10
- package/dist/extensions/discord/node_modules/@types/node/fs.d.ts +0 -20
- package/dist/extensions/discord/node_modules/@types/node/http.d.ts +0 -41
- package/dist/extensions/discord/node_modules/@types/node/http2.d.ts +0 -10
- package/dist/extensions/discord/node_modules/@types/node/https.d.ts +0 -5
- package/dist/extensions/discord/node_modules/@types/node/inspector/promises.d.ts +0 -6
- package/dist/extensions/discord/node_modules/@types/node/inspector.d.ts +0 -5
- package/dist/extensions/discord/node_modules/@types/node/module.d.ts +0 -3
- package/dist/extensions/discord/node_modules/@types/node/net.d.ts +32 -14
- package/dist/extensions/discord/node_modules/@types/node/os.d.ts +0 -9
- package/dist/extensions/discord/node_modules/@types/node/package.json +3 -3
- package/dist/extensions/discord/node_modules/@types/node/path.d.ts +0 -9
- package/dist/extensions/discord/node_modules/@types/node/perf_hooks.d.ts +0 -31
- package/dist/extensions/discord/node_modules/@types/node/punycode.d.ts +0 -28
- package/dist/extensions/discord/node_modules/@types/node/querystring.d.ts +0 -13
- package/dist/extensions/discord/node_modules/@types/node/quic.d.ts +0 -13
- package/dist/extensions/discord/node_modules/@types/node/readline/promises.d.ts +0 -3
- package/dist/extensions/discord/node_modules/@types/node/readline.d.ts +0 -35
- package/dist/extensions/discord/node_modules/@types/node/repl.d.ts +0 -10
- package/dist/extensions/discord/node_modules/@types/node/sea.d.ts +0 -115
- package/dist/extensions/discord/node_modules/@types/node/sqlite.d.ts +0 -44
- package/dist/extensions/discord/node_modules/@types/node/stream/consumers.d.ts +81 -5
- package/dist/extensions/discord/node_modules/@types/node/stream.d.ts +0 -19
- package/dist/extensions/discord/node_modules/@types/node/string_decoder.d.ts +0 -40
- package/dist/extensions/discord/node_modules/@types/node/test/reporters.d.ts +0 -38
- package/dist/extensions/discord/node_modules/@types/node/test.d.ts +7 -80
- package/dist/extensions/discord/node_modules/@types/node/timers/promises.d.ts +0 -15
- package/dist/extensions/discord/node_modules/@types/node/timers.d.ts +0 -10
- package/dist/extensions/discord/node_modules/@types/node/tls.d.ts +6 -16
- package/dist/extensions/discord/node_modules/@types/node/trace_events.d.ts +0 -94
- package/dist/extensions/discord/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +1 -1
- package/dist/extensions/discord/node_modules/@types/node/tty.d.ts +0 -25
- package/dist/extensions/discord/node_modules/@types/node/url.d.ts +0 -9
- package/dist/extensions/discord/node_modules/@types/node/util.d.ts +0 -10
- package/dist/extensions/discord/node_modules/@types/node/v8.d.ts +0 -8
- package/dist/extensions/discord/node_modules/@types/node/vm.d.ts +0 -38
- package/dist/extensions/discord/node_modules/@types/node/wasi.d.ts +0 -71
- package/dist/extensions/discord/node_modules/@types/node/worker_threads.d.ts +15 -61
- package/dist/extensions/discord/node_modules/@types/node/zlib.d.ts +0 -93
- package/dist/extensions/discord/node_modules/discord-api-types/CHANGELOG.md +8 -0
- package/dist/extensions/discord/node_modules/discord-api-types/package.json +1 -1
- package/dist/extensions/discord/node_modules/discord-api-types/payloads/v10/message.d.ts +1 -1
- package/dist/extensions/discord/node_modules/discord-api-types/payloads/v9/message.d.ts +1 -1
- package/dist/extensions/discord/node_modules/discord-api-types/rest/v10/oauth2.d.ts +1 -1
- package/dist/extensions/discord/node_modules/discord-api-types/rest/v10/oauth2.d.ts.map +1 -1
- package/dist/extensions/discord/node_modules/discord-api-types/rest/v10/user.d.ts +1 -1
- package/dist/extensions/discord/node_modules/discord-api-types/rest/v10/user.d.ts.map +1 -1
- package/dist/extensions/discord/node_modules/discord-api-types/rest/v9/oauth2.d.ts +1 -1
- package/dist/extensions/discord/node_modules/discord-api-types/rest/v9/oauth2.d.ts.map +1 -1
- package/dist/extensions/discord/node_modules/discord-api-types/rest/v9/user.d.ts +1 -1
- package/dist/extensions/discord/node_modules/discord-api-types/rest/v9/user.d.ts.map +1 -1
- package/dist/extensions/discord/node_modules/undici-types/cache-interceptor.d.ts +6 -0
- package/dist/extensions/discord/node_modules/undici-types/client.d.ts +10 -0
- package/dist/extensions/discord/node_modules/undici-types/package.json +1 -1
- package/dist/extensions/feishu/node_modules/.package-lock.json +7 -7
- package/dist/extensions/feishu/node_modules/@types/node/README.md +1 -1
- package/dist/extensions/feishu/node_modules/@types/node/assert/strict.d.ts +0 -46
- package/dist/extensions/feishu/node_modules/@types/node/assert.d.ts +0 -5
- package/dist/extensions/feishu/node_modules/@types/node/async_hooks.d.ts +18 -38
- package/dist/extensions/feishu/node_modules/@types/node/buffer.buffer.d.ts +1 -1
- package/dist/extensions/feishu/node_modules/@types/node/buffer.d.ts +0 -45
- package/dist/extensions/feishu/node_modules/@types/node/child_process.d.ts +0 -67
- package/dist/extensions/feishu/node_modules/@types/node/cluster.d.ts +0 -54
- package/dist/extensions/feishu/node_modules/@types/node/console.d.ts +0 -58
- package/dist/extensions/feishu/node_modules/@types/node/constants.d.ts +0 -6
- package/dist/extensions/feishu/node_modules/@types/node/crypto.d.ts +0 -18
- package/dist/extensions/feishu/node_modules/@types/node/dgram.d.ts +0 -27
- package/dist/extensions/feishu/node_modules/@types/node/diagnostics_channel.d.ts +0 -24
- package/dist/extensions/feishu/node_modules/@types/node/dns/promises.d.ts +0 -6
- package/dist/extensions/feishu/node_modules/@types/node/dns.d.ts +0 -46
- package/dist/extensions/feishu/node_modules/@types/node/domain.d.ts +0 -16
- package/dist/extensions/feishu/node_modules/@types/node/events.d.ts +0 -36
- package/dist/extensions/feishu/node_modules/@types/node/fs/promises.d.ts +0 -10
- package/dist/extensions/feishu/node_modules/@types/node/fs.d.ts +0 -20
- package/dist/extensions/feishu/node_modules/@types/node/http.d.ts +0 -41
- package/dist/extensions/feishu/node_modules/@types/node/http2.d.ts +0 -10
- package/dist/extensions/feishu/node_modules/@types/node/https.d.ts +0 -5
- package/dist/extensions/feishu/node_modules/@types/node/inspector/promises.d.ts +0 -6
- package/dist/extensions/feishu/node_modules/@types/node/inspector.d.ts +0 -5
- package/dist/extensions/feishu/node_modules/@types/node/module.d.ts +0 -3
- package/dist/extensions/feishu/node_modules/@types/node/net.d.ts +32 -14
- package/dist/extensions/feishu/node_modules/@types/node/os.d.ts +0 -9
- package/dist/extensions/feishu/node_modules/@types/node/package.json +3 -3
- package/dist/extensions/feishu/node_modules/@types/node/path.d.ts +0 -9
- package/dist/extensions/feishu/node_modules/@types/node/perf_hooks.d.ts +0 -31
- package/dist/extensions/feishu/node_modules/@types/node/punycode.d.ts +0 -28
- package/dist/extensions/feishu/node_modules/@types/node/querystring.d.ts +0 -13
- package/dist/extensions/feishu/node_modules/@types/node/quic.d.ts +0 -13
- package/dist/extensions/feishu/node_modules/@types/node/readline/promises.d.ts +0 -3
- package/dist/extensions/feishu/node_modules/@types/node/readline.d.ts +0 -35
- package/dist/extensions/feishu/node_modules/@types/node/repl.d.ts +0 -10
- package/dist/extensions/feishu/node_modules/@types/node/sea.d.ts +0 -115
- package/dist/extensions/feishu/node_modules/@types/node/sqlite.d.ts +0 -44
- package/dist/extensions/feishu/node_modules/@types/node/stream/consumers.d.ts +81 -5
- package/dist/extensions/feishu/node_modules/@types/node/stream.d.ts +0 -19
- package/dist/extensions/feishu/node_modules/@types/node/string_decoder.d.ts +0 -40
- package/dist/extensions/feishu/node_modules/@types/node/test/reporters.d.ts +0 -38
- package/dist/extensions/feishu/node_modules/@types/node/test.d.ts +7 -80
- package/dist/extensions/feishu/node_modules/@types/node/timers/promises.d.ts +0 -15
- package/dist/extensions/feishu/node_modules/@types/node/timers.d.ts +0 -10
- package/dist/extensions/feishu/node_modules/@types/node/tls.d.ts +6 -16
- package/dist/extensions/feishu/node_modules/@types/node/trace_events.d.ts +0 -94
- package/dist/extensions/feishu/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +1 -1
- package/dist/extensions/feishu/node_modules/@types/node/tty.d.ts +0 -25
- package/dist/extensions/feishu/node_modules/@types/node/url.d.ts +0 -9
- package/dist/extensions/feishu/node_modules/@types/node/util.d.ts +0 -10
- package/dist/extensions/feishu/node_modules/@types/node/v8.d.ts +0 -8
- package/dist/extensions/feishu/node_modules/@types/node/vm.d.ts +0 -38
- package/dist/extensions/feishu/node_modules/@types/node/wasi.d.ts +0 -71
- package/dist/extensions/feishu/node_modules/@types/node/worker_threads.d.ts +15 -61
- package/dist/extensions/feishu/node_modules/@types/node/zlib.d.ts +0 -93
- package/dist/extensions/feishu/node_modules/undici-types/cache-interceptor.d.ts +6 -0
- package/dist/extensions/feishu/node_modules/undici-types/client.d.ts +10 -0
- package/dist/extensions/feishu/node_modules/undici-types/package.json +1 -1
- package/dist/extensions/slack/node_modules/.package-lock.json +7 -7
- package/dist/extensions/slack/node_modules/@types/node/README.md +1 -1
- package/dist/extensions/slack/node_modules/@types/node/assert/strict.d.ts +0 -46
- package/dist/extensions/slack/node_modules/@types/node/assert.d.ts +0 -5
- package/dist/extensions/slack/node_modules/@types/node/async_hooks.d.ts +18 -38
- package/dist/extensions/slack/node_modules/@types/node/buffer.buffer.d.ts +1 -1
- package/dist/extensions/slack/node_modules/@types/node/buffer.d.ts +0 -45
- package/dist/extensions/slack/node_modules/@types/node/child_process.d.ts +0 -67
- package/dist/extensions/slack/node_modules/@types/node/cluster.d.ts +0 -54
- package/dist/extensions/slack/node_modules/@types/node/console.d.ts +0 -58
- package/dist/extensions/slack/node_modules/@types/node/constants.d.ts +0 -6
- package/dist/extensions/slack/node_modules/@types/node/crypto.d.ts +0 -18
- package/dist/extensions/slack/node_modules/@types/node/dgram.d.ts +0 -27
- package/dist/extensions/slack/node_modules/@types/node/diagnostics_channel.d.ts +0 -24
- package/dist/extensions/slack/node_modules/@types/node/dns/promises.d.ts +0 -6
- package/dist/extensions/slack/node_modules/@types/node/dns.d.ts +0 -46
- package/dist/extensions/slack/node_modules/@types/node/domain.d.ts +0 -16
- package/dist/extensions/slack/node_modules/@types/node/events.d.ts +0 -36
- package/dist/extensions/slack/node_modules/@types/node/fs/promises.d.ts +0 -10
- package/dist/extensions/slack/node_modules/@types/node/fs.d.ts +0 -20
- package/dist/extensions/slack/node_modules/@types/node/http.d.ts +0 -41
- package/dist/extensions/slack/node_modules/@types/node/http2.d.ts +0 -10
- package/dist/extensions/slack/node_modules/@types/node/https.d.ts +0 -5
- package/dist/extensions/slack/node_modules/@types/node/inspector/promises.d.ts +0 -6
- package/dist/extensions/slack/node_modules/@types/node/inspector.d.ts +0 -5
- package/dist/extensions/slack/node_modules/@types/node/module.d.ts +0 -3
- package/dist/extensions/slack/node_modules/@types/node/net.d.ts +32 -14
- package/dist/extensions/slack/node_modules/@types/node/os.d.ts +0 -9
- package/dist/extensions/slack/node_modules/@types/node/package.json +3 -3
- package/dist/extensions/slack/node_modules/@types/node/path.d.ts +0 -9
- package/dist/extensions/slack/node_modules/@types/node/perf_hooks.d.ts +0 -31
- package/dist/extensions/slack/node_modules/@types/node/punycode.d.ts +0 -28
- package/dist/extensions/slack/node_modules/@types/node/querystring.d.ts +0 -13
- package/dist/extensions/slack/node_modules/@types/node/quic.d.ts +0 -13
- package/dist/extensions/slack/node_modules/@types/node/readline/promises.d.ts +0 -3
- package/dist/extensions/slack/node_modules/@types/node/readline.d.ts +0 -35
- package/dist/extensions/slack/node_modules/@types/node/repl.d.ts +0 -10
- package/dist/extensions/slack/node_modules/@types/node/sea.d.ts +0 -115
- package/dist/extensions/slack/node_modules/@types/node/sqlite.d.ts +0 -44
- package/dist/extensions/slack/node_modules/@types/node/stream/consumers.d.ts +81 -5
- package/dist/extensions/slack/node_modules/@types/node/stream.d.ts +0 -19
- package/dist/extensions/slack/node_modules/@types/node/string_decoder.d.ts +0 -40
- package/dist/extensions/slack/node_modules/@types/node/test/reporters.d.ts +0 -38
- package/dist/extensions/slack/node_modules/@types/node/test.d.ts +7 -80
- package/dist/extensions/slack/node_modules/@types/node/timers/promises.d.ts +0 -15
- package/dist/extensions/slack/node_modules/@types/node/timers.d.ts +0 -10
- package/dist/extensions/slack/node_modules/@types/node/tls.d.ts +6 -16
- package/dist/extensions/slack/node_modules/@types/node/trace_events.d.ts +0 -94
- package/dist/extensions/slack/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +1 -1
- package/dist/extensions/slack/node_modules/@types/node/tty.d.ts +0 -25
- package/dist/extensions/slack/node_modules/@types/node/url.d.ts +0 -9
- package/dist/extensions/slack/node_modules/@types/node/util.d.ts +0 -10
- package/dist/extensions/slack/node_modules/@types/node/v8.d.ts +0 -8
- package/dist/extensions/slack/node_modules/@types/node/vm.d.ts +0 -38
- package/dist/extensions/slack/node_modules/@types/node/wasi.d.ts +0 -71
- package/dist/extensions/slack/node_modules/@types/node/worker_threads.d.ts +15 -61
- package/dist/extensions/slack/node_modules/@types/node/zlib.d.ts +0 -93
- package/dist/extensions/slack/node_modules/undici-types/cache-interceptor.d.ts +6 -0
- package/dist/extensions/slack/node_modules/undici-types/client.d.ts +10 -0
- package/dist/extensions/slack/node_modules/undici-types/package.json +1 -1
- package/package.json +1 -1
package/dist/.buildstamp
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"builtAt":
|
|
1
|
+
{"builtAt":1776063192632,"head":"b298322a01618fb3aee8f17f6164093fdaf8180f"}
|
package/dist/build-info.json
CHANGED
|
@@ -1447,6 +1447,40 @@ async function getAccountStatus(apiKey, coreUrl) {
|
|
|
1447
1447
|
};
|
|
1448
1448
|
}
|
|
1449
1449
|
}
|
|
1450
|
+
/** Validate an API key against Core */
|
|
1451
|
+
async function validateApiKey(apiKey, coreUrl) {
|
|
1452
|
+
try {
|
|
1453
|
+
const res = await fetch(`${coreUrl}/api/v1/account`, { headers: { Authorization: `Bearer ${apiKey}` } });
|
|
1454
|
+
if (!res.ok) {
|
|
1455
|
+
if (res.status === 401) return {
|
|
1456
|
+
valid: false,
|
|
1457
|
+
error: "Invalid API key"
|
|
1458
|
+
};
|
|
1459
|
+
return {
|
|
1460
|
+
valid: false,
|
|
1461
|
+
error: `API error: ${res.status}`
|
|
1462
|
+
};
|
|
1463
|
+
}
|
|
1464
|
+
const data = await res.json();
|
|
1465
|
+
if (!data.success) return {
|
|
1466
|
+
valid: false,
|
|
1467
|
+
error: "API returned failure"
|
|
1468
|
+
};
|
|
1469
|
+
return {
|
|
1470
|
+
valid: true,
|
|
1471
|
+
agentId: data.agentId,
|
|
1472
|
+
email: data.email,
|
|
1473
|
+
plan: data.plan ?? "free",
|
|
1474
|
+
quotaUsed: data.quotaUsed ?? 0,
|
|
1475
|
+
quotaTotal: data.quotaTotal ?? 100
|
|
1476
|
+
};
|
|
1477
|
+
} catch (err) {
|
|
1478
|
+
return {
|
|
1479
|
+
valid: false,
|
|
1480
|
+
error: `Network error: ${err}`
|
|
1481
|
+
};
|
|
1482
|
+
}
|
|
1483
|
+
}
|
|
1450
1484
|
function createLogger(baseLogger) {
|
|
1451
1485
|
return {
|
|
1452
1486
|
info: (msg) => baseLogger.info(`${LOG_PREFIX} ${msg}`),
|
|
@@ -1549,44 +1583,73 @@ const openClawGuardPlugin = {
|
|
|
1549
1583
|
pluginVersion: PLUGIN_VERSION,
|
|
1550
1584
|
timeoutMs: Math.min(config.timeoutMs, 3e3)
|
|
1551
1585
|
}, log);
|
|
1552
|
-
if (!globalCoreCredentials)
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
verificationCode: ""
|
|
1586
|
+
if (!globalCoreCredentials) {
|
|
1587
|
+
const activateCredentials = (credentials) => {
|
|
1588
|
+
globalCoreCredentials = credentials;
|
|
1589
|
+
globalBehaviorDetector?.setCredentials(credentials);
|
|
1590
|
+
globalEventReporter?.setCredentials(credentials);
|
|
1558
1591
|
};
|
|
1559
|
-
|
|
1560
|
-
globalEventReporter?.setCredentials(globalCoreCredentials);
|
|
1561
|
-
log.info("Platform: using configured API key");
|
|
1562
|
-
startAutoScan();
|
|
1563
|
-
} else {
|
|
1564
|
-
debugLog(`loadCoreCredentials(${config.coreUrl}) called`);
|
|
1565
|
-
globalCoreCredentials = loadCoreCredentials(config.coreUrl);
|
|
1566
|
-
debugLog(`loadCoreCredentials result: ${globalCoreCredentials ? `apiKey=${globalCoreCredentials.apiKey?.slice(0, 10)}... agentId=${globalCoreCredentials.agentId} coreUrl=${globalCoreCredentials.coreUrl}` : "null"}`);
|
|
1567
|
-
if (globalCoreCredentials) {
|
|
1568
|
-
globalBehaviorDetector.setCredentials(globalCoreCredentials);
|
|
1569
|
-
globalEventReporter?.setCredentials(globalCoreCredentials);
|
|
1570
|
-
const mode = globalCoreCredentials.email ? "human managed" : "autonomous";
|
|
1571
|
-
log.info(`Platform: active (${mode} mode)`);
|
|
1572
|
-
startAutoScan();
|
|
1573
|
-
} else {
|
|
1592
|
+
const autoRegisterWithCore = () => {
|
|
1574
1593
|
log.info("Platform: auto-registering...");
|
|
1575
1594
|
debugLog(`registerWithCore(${config.agentName}, coreUrl=${config.coreUrl})`);
|
|
1576
1595
|
registerWithCore(config.agentName, "OpenClaw AI Agent secured by CClawd Guard", config.coreUrl).then((result) => {
|
|
1577
1596
|
debugLog(`registerWithCore SUCCESS: agentId=${result.credentials.agentId} apiKey=${result.credentials.apiKey?.slice(0, 10)}...`);
|
|
1578
|
-
|
|
1579
|
-
globalBehaviorDetector.setCredentials(result.credentials);
|
|
1580
|
-
globalEventReporter?.setCredentials(result.credentials);
|
|
1597
|
+
activateCredentials(result.credentials);
|
|
1581
1598
|
initPersonalDashboard(config.coreUrl);
|
|
1582
1599
|
initBusinessFeatures(config.coreUrl);
|
|
1583
1600
|
log.info(isEnterprise ? "Platform: registered (enterprise mode, unlimited quota)" : "Platform: registered (autonomous mode, 500/day quota)");
|
|
1584
1601
|
startAutoScan();
|
|
1585
1602
|
}).catch((err) => {
|
|
1586
1603
|
debugLog(`registerWithCore FAILED: ${err}`);
|
|
1587
|
-
log.warn(`Platform: auto-registration failed
|
|
1604
|
+
log.warn(`Platform: auto-registration failed - ${err}`);
|
|
1588
1605
|
log.info("Platform: local protections still active");
|
|
1589
1606
|
});
|
|
1607
|
+
};
|
|
1608
|
+
if (config.apiKey) {
|
|
1609
|
+
activateCredentials({
|
|
1610
|
+
apiKey: config.apiKey,
|
|
1611
|
+
agentId: "configured",
|
|
1612
|
+
claimUrl: "",
|
|
1613
|
+
verificationCode: ""
|
|
1614
|
+
});
|
|
1615
|
+
log.info("Platform: using configured API key");
|
|
1616
|
+
startAutoScan();
|
|
1617
|
+
} else {
|
|
1618
|
+
debugLog(`loadCoreCredentials(${config.coreUrl}) called`);
|
|
1619
|
+
const savedCredentials = loadCoreCredentials(config.coreUrl);
|
|
1620
|
+
debugLog(`loadCoreCredentials result: ${savedCredentials ? `apiKey=${savedCredentials.apiKey?.slice(0, 10)}... agentId=${savedCredentials.agentId} coreUrl=${savedCredentials.coreUrl}` : "null"}`);
|
|
1621
|
+
if (!savedCredentials) autoRegisterWithCore();
|
|
1622
|
+
else {
|
|
1623
|
+
log.info("Platform: validating saved credentials...");
|
|
1624
|
+
validateApiKey(savedCredentials.apiKey, config.coreUrl).then((validation) => {
|
|
1625
|
+
if (validation.valid) {
|
|
1626
|
+
if (validation.agentId && validation.agentId !== savedCredentials.agentId) {
|
|
1627
|
+
savedCredentials.agentId = validation.agentId;
|
|
1628
|
+
saveCoreCredentials(savedCredentials, config.coreUrl);
|
|
1629
|
+
}
|
|
1630
|
+
activateCredentials(savedCredentials);
|
|
1631
|
+
const mode = savedCredentials.email ? "human managed" : "autonomous";
|
|
1632
|
+
log.info(`Platform: active (${mode} mode)`);
|
|
1633
|
+
startAutoScan();
|
|
1634
|
+
return;
|
|
1635
|
+
}
|
|
1636
|
+
debugLog(`saved credentials invalid: ${validation.error ?? "unknown"}`);
|
|
1637
|
+
log.warn("Platform: saved credentials are invalid, re-registering with Core");
|
|
1638
|
+
deleteCoreCredentials();
|
|
1639
|
+
globalCoreCredentials = null;
|
|
1640
|
+
globalBehaviorDetector?.setCredentials(null);
|
|
1641
|
+
globalEventReporter?.setCredentials(null);
|
|
1642
|
+
autoRegisterWithCore();
|
|
1643
|
+
}).catch((err) => {
|
|
1644
|
+
debugLog(`validateApiKey FAILED: ${err}`);
|
|
1645
|
+
log.warn("Platform: failed to validate saved credentials, re-registering with Core");
|
|
1646
|
+
deleteCoreCredentials();
|
|
1647
|
+
globalCoreCredentials = null;
|
|
1648
|
+
globalBehaviorDetector?.setCredentials(null);
|
|
1649
|
+
globalEventReporter?.setCredentials(null);
|
|
1650
|
+
autoRegisterWithCore();
|
|
1651
|
+
});
|
|
1652
|
+
}
|
|
1590
1653
|
}
|
|
1591
1654
|
}
|
|
1592
1655
|
async function initPersonalDashboard(coreUrl) {
|
|
@@ -89,25 +89,6 @@
|
|
|
89
89
|
"hono": "^4"
|
|
90
90
|
}
|
|
91
91
|
},
|
|
92
|
-
"node_modules/@napi-rs/wasm-runtime": {
|
|
93
|
-
"version": "1.1.3",
|
|
94
|
-
"resolved": "https://registry.npmjs.org/@napi-rs/wasm-runtime/-/wasm-runtime-1.1.3.tgz",
|
|
95
|
-
"integrity": "sha512-xK9sGVbJWYb08+mTJt3/YV24WxvxpXcXtP6B172paPZ+Ts69Re9dAr7lKwJoeIx8OoeuimEiRZ7umkiUVClmmQ==",
|
|
96
|
-
"ideallyInert": true,
|
|
97
|
-
"license": "MIT",
|
|
98
|
-
"optional": true,
|
|
99
|
-
"dependencies": {
|
|
100
|
-
"@tybys/wasm-util": "^0.10.1"
|
|
101
|
-
},
|
|
102
|
-
"funding": {
|
|
103
|
-
"type": "github",
|
|
104
|
-
"url": "https://github.com/sponsors/Brooooooklyn"
|
|
105
|
-
},
|
|
106
|
-
"peerDependencies": {
|
|
107
|
-
"@emnapi/core": "^1.7.1",
|
|
108
|
-
"@emnapi/runtime": "^1.7.1"
|
|
109
|
-
}
|
|
110
|
-
},
|
|
111
92
|
"node_modules/@snazzah/davey": {
|
|
112
93
|
"version": "0.1.11",
|
|
113
94
|
"resolved": "https://registry.npmjs.org/@snazzah/davey/-/davey-0.1.11.tgz",
|
|
@@ -136,227 +117,6 @@
|
|
|
136
117
|
"@snazzah/davey-win32-x64-msvc": "0.1.11"
|
|
137
118
|
}
|
|
138
119
|
},
|
|
139
|
-
"node_modules/@snazzah/davey-android-arm-eabi": {
|
|
140
|
-
"version": "0.1.11",
|
|
141
|
-
"resolved": "https://registry.npmjs.org/@snazzah/davey-android-arm-eabi/-/davey-android-arm-eabi-0.1.11.tgz",
|
|
142
|
-
"integrity": "sha512-T1RYbNYKN6tLOcGIDKJd8OI6FBSEemwL7DOYdTMmhqfhhMr3YVN8WOhfoxGg63OcnpTN2e2c5tdY2bAx25RmQQ==",
|
|
143
|
-
"cpu": [
|
|
144
|
-
"arm"
|
|
145
|
-
],
|
|
146
|
-
"ideallyInert": true,
|
|
147
|
-
"license": "MIT",
|
|
148
|
-
"optional": true,
|
|
149
|
-
"os": [
|
|
150
|
-
"android"
|
|
151
|
-
],
|
|
152
|
-
"engines": {
|
|
153
|
-
"node": ">= 10"
|
|
154
|
-
}
|
|
155
|
-
},
|
|
156
|
-
"node_modules/@snazzah/davey-android-arm64": {
|
|
157
|
-
"version": "0.1.11",
|
|
158
|
-
"resolved": "https://registry.npmjs.org/@snazzah/davey-android-arm64/-/davey-android-arm64-0.1.11.tgz",
|
|
159
|
-
"integrity": "sha512-ksJn/x2VU8h6w9eku1HT96ugSRZ7lKVkKNKbFleaFN+U99DJaPM+gMu2YvnFU4V54HR06ZBnRihnVG6VLXQpDw==",
|
|
160
|
-
"cpu": [
|
|
161
|
-
"arm64"
|
|
162
|
-
],
|
|
163
|
-
"ideallyInert": true,
|
|
164
|
-
"license": "MIT",
|
|
165
|
-
"optional": true,
|
|
166
|
-
"os": [
|
|
167
|
-
"android"
|
|
168
|
-
],
|
|
169
|
-
"engines": {
|
|
170
|
-
"node": ">= 10"
|
|
171
|
-
}
|
|
172
|
-
},
|
|
173
|
-
"node_modules/@snazzah/davey-darwin-arm64": {
|
|
174
|
-
"version": "0.1.11",
|
|
175
|
-
"resolved": "https://registry.npmjs.org/@snazzah/davey-darwin-arm64/-/davey-darwin-arm64-0.1.11.tgz",
|
|
176
|
-
"integrity": "sha512-E1d7PbaaVMO3Lj9EiAPqOVbuV0xg5+PsHzHH097DDXiD1+zUDXvJaTnUWsnm5z50pJniHpi4GtaYmk+ieB/guA==",
|
|
177
|
-
"cpu": [
|
|
178
|
-
"arm64"
|
|
179
|
-
],
|
|
180
|
-
"ideallyInert": true,
|
|
181
|
-
"license": "MIT",
|
|
182
|
-
"optional": true,
|
|
183
|
-
"os": [
|
|
184
|
-
"darwin"
|
|
185
|
-
],
|
|
186
|
-
"engines": {
|
|
187
|
-
"node": ">= 10"
|
|
188
|
-
}
|
|
189
|
-
},
|
|
190
|
-
"node_modules/@snazzah/davey-darwin-x64": {
|
|
191
|
-
"version": "0.1.11",
|
|
192
|
-
"resolved": "https://registry.npmjs.org/@snazzah/davey-darwin-x64/-/davey-darwin-x64-0.1.11.tgz",
|
|
193
|
-
"integrity": "sha512-Tl4TI/LTmgJZepgbgVMYDi8RqlAkPtPg1OEBPl7a9Tn3AwR36Vs6lyIT1cs/lGy/ds/+B+mKI4rPObN1cyILTw==",
|
|
194
|
-
"cpu": [
|
|
195
|
-
"x64"
|
|
196
|
-
],
|
|
197
|
-
"ideallyInert": true,
|
|
198
|
-
"license": "MIT",
|
|
199
|
-
"optional": true,
|
|
200
|
-
"os": [
|
|
201
|
-
"darwin"
|
|
202
|
-
],
|
|
203
|
-
"engines": {
|
|
204
|
-
"node": ">= 10"
|
|
205
|
-
}
|
|
206
|
-
},
|
|
207
|
-
"node_modules/@snazzah/davey-freebsd-x64": {
|
|
208
|
-
"version": "0.1.11",
|
|
209
|
-
"resolved": "https://registry.npmjs.org/@snazzah/davey-freebsd-x64/-/davey-freebsd-x64-0.1.11.tgz",
|
|
210
|
-
"integrity": "sha512-T8Iw9FXkuI1T+YBAFzh9v/TXf9IOTOSqnd/BFpTRTrlW72PR2lhIidzSmg027VxO7r5pX47iFwiOkb9I/NU/EA==",
|
|
211
|
-
"cpu": [
|
|
212
|
-
"x64"
|
|
213
|
-
],
|
|
214
|
-
"ideallyInert": true,
|
|
215
|
-
"license": "MIT",
|
|
216
|
-
"optional": true,
|
|
217
|
-
"os": [
|
|
218
|
-
"freebsd"
|
|
219
|
-
],
|
|
220
|
-
"engines": {
|
|
221
|
-
"node": ">= 10"
|
|
222
|
-
}
|
|
223
|
-
},
|
|
224
|
-
"node_modules/@snazzah/davey-linux-arm-gnueabihf": {
|
|
225
|
-
"version": "0.1.11",
|
|
226
|
-
"resolved": "https://registry.npmjs.org/@snazzah/davey-linux-arm-gnueabihf/-/davey-linux-arm-gnueabihf-0.1.11.tgz",
|
|
227
|
-
"integrity": "sha512-1Txj+8pqA8uq/OGtaUaBFWAPnNMQzFgIywj0iA7EI4xZl+mab48/pv+YZ1pNb/suC6ynsW44oB9efiXSdcUAgA==",
|
|
228
|
-
"cpu": [
|
|
229
|
-
"arm"
|
|
230
|
-
],
|
|
231
|
-
"ideallyInert": true,
|
|
232
|
-
"license": "MIT",
|
|
233
|
-
"optional": true,
|
|
234
|
-
"os": [
|
|
235
|
-
"linux"
|
|
236
|
-
],
|
|
237
|
-
"engines": {
|
|
238
|
-
"node": ">= 10"
|
|
239
|
-
}
|
|
240
|
-
},
|
|
241
|
-
"node_modules/@snazzah/davey-linux-arm64-gnu": {
|
|
242
|
-
"version": "0.1.11",
|
|
243
|
-
"resolved": "https://registry.npmjs.org/@snazzah/davey-linux-arm64-gnu/-/davey-linux-arm64-gnu-0.1.11.tgz",
|
|
244
|
-
"integrity": "sha512-ERzF5nM/IYW1BcN3wLXpEwBCGLFf0kGJUVhaV6yfiInz0tkU8UmvrrgpaMaACfMjIhfWdq5CcX+aTkXo/saNcg==",
|
|
245
|
-
"cpu": [
|
|
246
|
-
"arm64"
|
|
247
|
-
],
|
|
248
|
-
"ideallyInert": true,
|
|
249
|
-
"license": "MIT",
|
|
250
|
-
"optional": true,
|
|
251
|
-
"os": [
|
|
252
|
-
"linux"
|
|
253
|
-
],
|
|
254
|
-
"engines": {
|
|
255
|
-
"node": ">= 10"
|
|
256
|
-
}
|
|
257
|
-
},
|
|
258
|
-
"node_modules/@snazzah/davey-linux-arm64-musl": {
|
|
259
|
-
"version": "0.1.11",
|
|
260
|
-
"resolved": "https://registry.npmjs.org/@snazzah/davey-linux-arm64-musl/-/davey-linux-arm64-musl-0.1.11.tgz",
|
|
261
|
-
"integrity": "sha512-e6pX6Hiabtz99q+H/YHNkm9JVlpqN8HGh0qPib8G2+UY4/SSH8WvqWipk3v581dMy2oyCHt7MOoY1aU1P1N/xA==",
|
|
262
|
-
"cpu": [
|
|
263
|
-
"arm64"
|
|
264
|
-
],
|
|
265
|
-
"ideallyInert": true,
|
|
266
|
-
"license": "MIT",
|
|
267
|
-
"optional": true,
|
|
268
|
-
"os": [
|
|
269
|
-
"linux"
|
|
270
|
-
],
|
|
271
|
-
"engines": {
|
|
272
|
-
"node": ">= 10"
|
|
273
|
-
}
|
|
274
|
-
},
|
|
275
|
-
"node_modules/@snazzah/davey-linux-x64-gnu": {
|
|
276
|
-
"version": "0.1.11",
|
|
277
|
-
"resolved": "https://registry.npmjs.org/@snazzah/davey-linux-x64-gnu/-/davey-linux-x64-gnu-0.1.11.tgz",
|
|
278
|
-
"integrity": "sha512-TW5bSoqChOJMbvsDb4wAATYrxmAXuNnse7wFNVSAJUaZKSeRfZbu3UAiPWSNn7GwLwSfU6hg322KZUn8IWCuvg==",
|
|
279
|
-
"cpu": [
|
|
280
|
-
"x64"
|
|
281
|
-
],
|
|
282
|
-
"ideallyInert": true,
|
|
283
|
-
"license": "MIT",
|
|
284
|
-
"optional": true,
|
|
285
|
-
"os": [
|
|
286
|
-
"linux"
|
|
287
|
-
],
|
|
288
|
-
"engines": {
|
|
289
|
-
"node": ">= 10"
|
|
290
|
-
}
|
|
291
|
-
},
|
|
292
|
-
"node_modules/@snazzah/davey-linux-x64-musl": {
|
|
293
|
-
"version": "0.1.11",
|
|
294
|
-
"resolved": "https://registry.npmjs.org/@snazzah/davey-linux-x64-musl/-/davey-linux-x64-musl-0.1.11.tgz",
|
|
295
|
-
"integrity": "sha512-5j6Pmc+Wzv5lSxVP6quA7teYRJXibkZqQyYGfTDnTsUOO5dPpcojpqlXlkhyvsA1OAQTj4uxbOCciN3cVWwzug==",
|
|
296
|
-
"cpu": [
|
|
297
|
-
"x64"
|
|
298
|
-
],
|
|
299
|
-
"ideallyInert": true,
|
|
300
|
-
"license": "MIT",
|
|
301
|
-
"optional": true,
|
|
302
|
-
"os": [
|
|
303
|
-
"linux"
|
|
304
|
-
],
|
|
305
|
-
"engines": {
|
|
306
|
-
"node": ">= 10"
|
|
307
|
-
}
|
|
308
|
-
},
|
|
309
|
-
"node_modules/@snazzah/davey-wasm32-wasi": {
|
|
310
|
-
"version": "0.1.11",
|
|
311
|
-
"resolved": "https://registry.npmjs.org/@snazzah/davey-wasm32-wasi/-/davey-wasm32-wasi-0.1.11.tgz",
|
|
312
|
-
"integrity": "sha512-rKOwZ/0J8lp+4VEyOdMDBRP9KR+PksZpa9V1Qn0veMzy4FqTVKthkxwGqewheFe0SFg9fdvt798l/PBFrfDeZw==",
|
|
313
|
-
"cpu": [
|
|
314
|
-
"wasm32"
|
|
315
|
-
],
|
|
316
|
-
"ideallyInert": true,
|
|
317
|
-
"license": "MIT",
|
|
318
|
-
"optional": true,
|
|
319
|
-
"dependencies": {
|
|
320
|
-
"@napi-rs/wasm-runtime": "^1.1.2"
|
|
321
|
-
},
|
|
322
|
-
"engines": {
|
|
323
|
-
"node": ">=14.0.0"
|
|
324
|
-
}
|
|
325
|
-
},
|
|
326
|
-
"node_modules/@snazzah/davey-win32-arm64-msvc": {
|
|
327
|
-
"version": "0.1.11",
|
|
328
|
-
"resolved": "https://registry.npmjs.org/@snazzah/davey-win32-arm64-msvc/-/davey-win32-arm64-msvc-0.1.11.tgz",
|
|
329
|
-
"integrity": "sha512-5fptJU4tX901m3mj0SHiBljMrPT4ZEsynbBhR7bK1yn9TY1jjyhN8EFi7QF5IWtUEni+0mia2BCMHZ5ZkmFZqQ==",
|
|
330
|
-
"cpu": [
|
|
331
|
-
"arm64"
|
|
332
|
-
],
|
|
333
|
-
"ideallyInert": true,
|
|
334
|
-
"license": "MIT",
|
|
335
|
-
"optional": true,
|
|
336
|
-
"os": [
|
|
337
|
-
"win32"
|
|
338
|
-
],
|
|
339
|
-
"engines": {
|
|
340
|
-
"node": ">= 10"
|
|
341
|
-
}
|
|
342
|
-
},
|
|
343
|
-
"node_modules/@snazzah/davey-win32-ia32-msvc": {
|
|
344
|
-
"version": "0.1.11",
|
|
345
|
-
"resolved": "https://registry.npmjs.org/@snazzah/davey-win32-ia32-msvc/-/davey-win32-ia32-msvc-0.1.11.tgz",
|
|
346
|
-
"integrity": "sha512-ualexn8SeLsiMHhWfzVrzRcjHgcBapg++FPaVgJJxoh2S/jCRiklXOu3luqIZdJdNKvhe2V9SwO/cImPeIIBKw==",
|
|
347
|
-
"cpu": [
|
|
348
|
-
"ia32"
|
|
349
|
-
],
|
|
350
|
-
"ideallyInert": true,
|
|
351
|
-
"license": "MIT",
|
|
352
|
-
"optional": true,
|
|
353
|
-
"os": [
|
|
354
|
-
"win32"
|
|
355
|
-
],
|
|
356
|
-
"engines": {
|
|
357
|
-
"node": ">= 10"
|
|
358
|
-
}
|
|
359
|
-
},
|
|
360
120
|
"node_modules/@snazzah/davey-win32-x64-msvc": {
|
|
361
121
|
"version": "0.1.11",
|
|
362
122
|
"resolved": "https://registry.npmjs.org/@snazzah/davey-win32-x64-msvc/-/davey-win32-x64-msvc-0.1.11.tgz",
|
|
@@ -373,17 +133,6 @@
|
|
|
373
133
|
"node": ">= 10"
|
|
374
134
|
}
|
|
375
135
|
},
|
|
376
|
-
"node_modules/@tybys/wasm-util": {
|
|
377
|
-
"version": "0.10.1",
|
|
378
|
-
"resolved": "https://registry.npmjs.org/@tybys/wasm-util/-/wasm-util-0.10.1.tgz",
|
|
379
|
-
"integrity": "sha512-9tTaPJLSiejZKx+Bmog4uSubteqTvFrVrURwkmHixBo0G4seD0zUxp98E1DzUBJxLQ3NPwXrGKDiVjwx/DpPsg==",
|
|
380
|
-
"ideallyInert": true,
|
|
381
|
-
"license": "MIT",
|
|
382
|
-
"optional": true,
|
|
383
|
-
"dependencies": {
|
|
384
|
-
"tslib": "^2.4.0"
|
|
385
|
-
}
|
|
386
|
-
},
|
|
387
136
|
"node_modules/@types/bun": {
|
|
388
137
|
"version": "1.3.9",
|
|
389
138
|
"resolved": "https://registry.npmjs.org/@types/bun/-/bun-1.3.9.tgz",
|
|
@@ -395,12 +144,12 @@
|
|
|
395
144
|
}
|
|
396
145
|
},
|
|
397
146
|
"node_modules/@types/node": {
|
|
398
|
-
"version": "25.
|
|
399
|
-
"resolved": "https://registry.npmjs.org/@types/node/-/node-25.
|
|
400
|
-
"integrity": "sha512
|
|
147
|
+
"version": "25.6.0",
|
|
148
|
+
"resolved": "https://registry.npmjs.org/@types/node/-/node-25.6.0.tgz",
|
|
149
|
+
"integrity": "sha512-+qIYRKdNYJwY3vRCZMdJbPLJAtGjQBudzZzdzwQYkEPQd+PJGixUL5QfvCLDaULoLv+RhT3LDkwEfKaAkgSmNQ==",
|
|
401
150
|
"license": "MIT",
|
|
402
151
|
"dependencies": {
|
|
403
|
-
"undici-types": "~7.
|
|
152
|
+
"undici-types": "~7.19.0"
|
|
404
153
|
}
|
|
405
154
|
},
|
|
406
155
|
"node_modules/@types/ws": {
|
|
@@ -449,9 +198,9 @@
|
|
|
449
198
|
}
|
|
450
199
|
},
|
|
451
200
|
"node_modules/discord-api-types": {
|
|
452
|
-
"version": "0.38.
|
|
453
|
-
"resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.38.
|
|
454
|
-
"integrity": "sha512-
|
|
201
|
+
"version": "0.38.45",
|
|
202
|
+
"resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.38.45.tgz",
|
|
203
|
+
"integrity": "sha512-DiI01i00FPv6n+hXcFkFxK8Y/rFRpKs6U6aP32N4T73nTbj37Eua3H/95TBpLktLWB6xnLXhYDGvyLq6zzYY2w==",
|
|
455
204
|
"license": "MIT",
|
|
456
205
|
"workspaces": [
|
|
457
206
|
"scripts/actions/documentation"
|
|
@@ -515,9 +264,9 @@
|
|
|
515
264
|
"license": "0BSD"
|
|
516
265
|
},
|
|
517
266
|
"node_modules/undici-types": {
|
|
518
|
-
"version": "7.
|
|
519
|
-
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.
|
|
520
|
-
"integrity": "sha512-
|
|
267
|
+
"version": "7.19.2",
|
|
268
|
+
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.19.2.tgz",
|
|
269
|
+
"integrity": "sha512-qYVnV5OEm2AW8cJMCpdV20CDyaN3g0AjDlOGf1OW4iaDEx8MwdtChUp4zu4H0VP3nDRF/8RKWH+IPp9uW0YGZg==",
|
|
521
270
|
"license": "MIT"
|
|
522
271
|
},
|
|
523
272
|
"node_modules/ws": {
|
|
@@ -8,7 +8,7 @@ This package contains type definitions for node (https://nodejs.org/).
|
|
|
8
8
|
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node.
|
|
9
9
|
|
|
10
10
|
### Additional Details
|
|
11
|
-
* Last updated: Fri,
|
|
11
|
+
* Last updated: Fri, 10 Apr 2026 03:39:58 GMT
|
|
12
12
|
* Dependencies: [undici-types](https://npmjs.com/package/undici-types)
|
|
13
13
|
|
|
14
14
|
# Credits
|
|
@@ -1,49 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* In strict assertion mode, non-strict methods behave like their corresponding
|
|
3
|
-
* strict methods. For example, `assert.deepEqual()` will behave like
|
|
4
|
-
* `assert.deepStrictEqual()`.
|
|
5
|
-
*
|
|
6
|
-
* In strict assertion mode, error messages for objects display a diff. In legacy
|
|
7
|
-
* assertion mode, error messages for objects display the objects, often truncated.
|
|
8
|
-
*
|
|
9
|
-
* To use strict assertion mode:
|
|
10
|
-
*
|
|
11
|
-
* ```js
|
|
12
|
-
* import { strict as assert } from 'node:assert';
|
|
13
|
-
* ```
|
|
14
|
-
*
|
|
15
|
-
* ```js
|
|
16
|
-
* import assert from 'node:assert/strict';
|
|
17
|
-
* ```
|
|
18
|
-
*
|
|
19
|
-
* Example error diff:
|
|
20
|
-
*
|
|
21
|
-
* ```js
|
|
22
|
-
* import { strict as assert } from 'node:assert';
|
|
23
|
-
*
|
|
24
|
-
* assert.deepEqual([[[1, 2, 3]], 4, 5], [[[1, 2, '3']], 4, 5]);
|
|
25
|
-
* // AssertionError: Expected inputs to be strictly deep-equal:
|
|
26
|
-
* // + actual - expected ... Lines skipped
|
|
27
|
-
* //
|
|
28
|
-
* // [
|
|
29
|
-
* // [
|
|
30
|
-
* // ...
|
|
31
|
-
* // 2,
|
|
32
|
-
* // + 3
|
|
33
|
-
* // - '3'
|
|
34
|
-
* // ],
|
|
35
|
-
* // ...
|
|
36
|
-
* // 5
|
|
37
|
-
* // ]
|
|
38
|
-
* ```
|
|
39
|
-
*
|
|
40
|
-
* To deactivate the colors, use the `NO_COLOR` or `NODE_DISABLE_COLORS`
|
|
41
|
-
* environment variables. This will also deactivate the colors in the REPL. For
|
|
42
|
-
* more on color support in terminal environments, read the tty
|
|
43
|
-
* [`getColorDepth()`](https://nodejs.org/docs/latest-v25.x/api/tty.html#writestreamgetcolordepthenv) documentation.
|
|
44
|
-
* @since v15.0.0
|
|
45
|
-
* @see [source](https://github.com/nodejs/node/blob/v25.x/lib/assert/strict.js)
|
|
46
|
-
*/
|
|
47
1
|
declare module "node:assert/strict" {
|
|
48
2
|
import {
|
|
49
3
|
Assert,
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The `node:assert` module provides a set of assertion functions for verifying
|
|
3
|
-
* invariants.
|
|
4
|
-
* @see [source](https://github.com/nodejs/node/blob/v25.x/lib/assert.js)
|
|
5
|
-
*/
|
|
6
1
|
declare module "node:assert" {
|
|
7
2
|
import strict = require("node:assert/strict");
|
|
8
3
|
/**
|
|
@@ -1,19 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* We strongly discourage the use of the `async_hooks` API.
|
|
3
|
-
* Other APIs that can cover most of its use cases include:
|
|
4
|
-
*
|
|
5
|
-
* * [`AsyncLocalStorage`](https://nodejs.org/docs/latest-v25.x/api/async_context.html#class-asynclocalstorage) tracks async context
|
|
6
|
-
* * [`process.getActiveResourcesInfo()`](https://nodejs.org/docs/latest-v25.x/api/process.html#processgetactiveresourcesinfo) tracks active resources
|
|
7
|
-
*
|
|
8
|
-
* The `node:async_hooks` module provides an API to track asynchronous resources.
|
|
9
|
-
* It can be accessed using:
|
|
10
|
-
*
|
|
11
|
-
* ```js
|
|
12
|
-
* import async_hooks from 'node:async_hooks';
|
|
13
|
-
* ```
|
|
14
|
-
* @experimental
|
|
15
|
-
* @see [source](https://github.com/nodejs/node/blob/v25.x/lib/async_hooks.js)
|
|
16
|
-
*/
|
|
17
1
|
declare module "node:async_hooks" {
|
|
18
2
|
/**
|
|
19
3
|
* ```js
|
|
@@ -123,37 +107,31 @@ declare module "node:async_hooks" {
|
|
|
123
107
|
function triggerAsyncId(): number;
|
|
124
108
|
interface HookCallbacks {
|
|
125
109
|
/**
|
|
126
|
-
*
|
|
127
|
-
* @param asyncId A unique ID for the async resource
|
|
128
|
-
* @param type The type of the async resource
|
|
129
|
-
* @param triggerAsyncId The unique ID of the async resource in whose execution context this async resource was created
|
|
130
|
-
* @param resource Reference to the resource representing the async operation, needs to be released during destroy
|
|
110
|
+
* The [`init` callback](https://nodejs.org/docs/latest-v25.x/api/async_hooks.html#initasyncid-type-triggerasyncid-resource).
|
|
131
111
|
*/
|
|
132
112
|
init?(asyncId: number, type: string, triggerAsyncId: number, resource: object): void;
|
|
133
113
|
/**
|
|
134
|
-
*
|
|
135
|
-
* The before callback is called just before said callback is executed.
|
|
136
|
-
* @param asyncId the unique identifier assigned to the resource about to execute the callback.
|
|
114
|
+
* The [`before` callback](https://nodejs.org/docs/latest-v25.x/api/async_hooks.html#beforeasyncid).
|
|
137
115
|
*/
|
|
138
116
|
before?(asyncId: number): void;
|
|
139
117
|
/**
|
|
140
|
-
*
|
|
141
|
-
*
|
|
142
|
-
* If an uncaught exception occurs during execution of the callback, then `after` will run after the `'uncaughtException'` event is emitted or a `domain`'s handler runs.
|
|
143
|
-
* @param asyncId the unique identifier assigned to the resource which has executed the callback.
|
|
118
|
+
* The [`after` callback](https://nodejs.org/docs/latest-v25.x/api/async_hooks.html#afterasyncid).
|
|
144
119
|
*/
|
|
145
120
|
after?(asyncId: number): void;
|
|
146
121
|
/**
|
|
147
|
-
*
|
|
148
|
-
* as the promise itself.
|
|
149
|
-
* @param asyncId the unique id for the promise that was resolve()d.
|
|
122
|
+
* The [`promiseResolve` callback](https://nodejs.org/docs/latest-v25.x/api/async_hooks.html#promiseresolveasyncid).
|
|
150
123
|
*/
|
|
151
124
|
promiseResolve?(asyncId: number): void;
|
|
152
125
|
/**
|
|
153
|
-
*
|
|
154
|
-
* @param asyncId a unique ID for the async resource
|
|
126
|
+
* The [`destroy` callback](https://nodejs.org/docs/latest-v25.x/api/async_hooks.html#destroyasyncid).
|
|
155
127
|
*/
|
|
156
128
|
destroy?(asyncId: number): void;
|
|
129
|
+
/**
|
|
130
|
+
* Whether the hook should track `Promise`s. Cannot be `false` if
|
|
131
|
+
* `promiseResolve` is set.
|
|
132
|
+
* @default true
|
|
133
|
+
*/
|
|
134
|
+
trackPromises?: boolean | undefined;
|
|
157
135
|
}
|
|
158
136
|
interface AsyncHook {
|
|
159
137
|
/**
|
|
@@ -174,7 +152,8 @@ declare module "node:async_hooks" {
|
|
|
174
152
|
*
|
|
175
153
|
* All callbacks are optional. For example, if only resource cleanup needs to
|
|
176
154
|
* be tracked, then only the `destroy` callback needs to be passed. The
|
|
177
|
-
* specifics of all functions that can be passed to `callbacks` is in the
|
|
155
|
+
* specifics of all functions that can be passed to `callbacks` is in the
|
|
156
|
+
* [Hook Callbacks](https://nodejs.org/docs/latest-v25.x/api/async_hooks.html#hook-callbacks) section.
|
|
178
157
|
*
|
|
179
158
|
* ```js
|
|
180
159
|
* import { createHook } from 'node:async_hooks';
|
|
@@ -202,12 +181,13 @@ declare module "node:async_hooks" {
|
|
|
202
181
|
* ```
|
|
203
182
|
*
|
|
204
183
|
* Because promises are asynchronous resources whose lifecycle is tracked
|
|
205
|
-
* via the async hooks mechanism, the `init()`, `before()`, `after()`, and
|
|
184
|
+
* via the async hooks mechanism, the `init()`, `before()`, `after()`, and
|
|
185
|
+
* `destroy()` callbacks _must not_ be async functions that return promises.
|
|
206
186
|
* @since v8.1.0
|
|
207
|
-
* @param
|
|
208
|
-
* @
|
|
187
|
+
* @param options The [Hook Callbacks](https://nodejs.org/docs/latest-v25.x/api/async_hooks.html#hook-callbacks) to register
|
|
188
|
+
* @returns Instance used for disabling and enabling hooks
|
|
209
189
|
*/
|
|
210
|
-
function createHook(
|
|
190
|
+
function createHook(options: HookCallbacks): AsyncHook;
|
|
211
191
|
interface AsyncResourceOptions {
|
|
212
192
|
/**
|
|
213
193
|
* The ID of the execution context that created this async event.
|
|
@@ -174,7 +174,7 @@ declare module "node:buffer" {
|
|
|
174
174
|
* If `totalLength` is not provided, it is calculated from the `Buffer` instances
|
|
175
175
|
* in `list` by adding their lengths.
|
|
176
176
|
*
|
|
177
|
-
* If `totalLength` is provided, it
|
|
177
|
+
* If `totalLength` is provided, it must be an unsigned integer. If the
|
|
178
178
|
* combined length of the `Buffer`s in `list` exceeds `totalLength`, the result is
|
|
179
179
|
* truncated to `totalLength`. If the combined length of the `Buffer`s in `list` is
|
|
180
180
|
* less than `totalLength`, the remaining space is filled with zeros.
|