coreblow 1.0.0-rc.6 → 1.0.0-rc.8
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/package.json
CHANGED
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
mergeAlsoAllowPolicy,
|
|
18
18
|
resolveToolProfilePolicy,
|
|
19
19
|
} from "../agents/tool-policy.js";
|
|
20
|
-
import { ToolInputError } from "../agents/tools/common.js";
|
|
20
|
+
import { ToolInputError, type AnyAgentTool } from "../agents/tools/common.js";
|
|
21
21
|
import { loadConfig } from "../config/config.js";
|
|
22
22
|
import { resolveMainSessionKey } from "../config/sessions.js";
|
|
23
23
|
import { logWarn } from "../logger.js";
|
|
@@ -272,9 +272,8 @@ export async function handleToolsInvokeHttpRequest(
|
|
|
272
272
|
});
|
|
273
273
|
|
|
274
274
|
const subagentFiltered = applyToolPolicyPipeline({
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
toolMeta: (tool) => getPluginToolMeta(tool as Record<string, unknown>),
|
|
275
|
+
tools: allTools as unknown as AnyAgentTool[],
|
|
276
|
+
toolMeta: (tool) => getPluginToolMeta(tool),
|
|
278
277
|
warn: logWarn,
|
|
279
278
|
steps: [
|
|
280
279
|
...buildDefaultToolPolicyPipelineSteps({
|
|
@@ -318,7 +317,7 @@ export async function handleToolsInvokeHttpRequest(
|
|
|
318
317
|
try {
|
|
319
318
|
const toolCallId = `http-${Date.now()}`;
|
|
320
319
|
const toolArgs = mergeActionIntoArgsIfSupported({
|
|
321
|
-
toolSchema: (tool as Record<string, unknown>).parameters,
|
|
320
|
+
toolSchema: (tool as unknown as Record<string, unknown>).parameters,
|
|
322
321
|
action,
|
|
323
322
|
args,
|
|
324
323
|
});
|
|
@@ -339,7 +338,7 @@ export async function handleToolsInvokeHttpRequest(
|
|
|
339
338
|
});
|
|
340
339
|
return true;
|
|
341
340
|
}
|
|
342
|
-
const result = await (tool as unknown as { execute?: (id: string, params: Record<string, unknown>) => Promise<unknown> }).execute?.(toolCallId, hookResult.params);
|
|
341
|
+
const result = await (tool as unknown as { execute?: (id: string, params: Record<string, unknown>) => Promise<unknown> }).execute?.(toolCallId, hookResult.params as Record<string, unknown>);
|
|
343
342
|
sendJson(res, 200, { ok: true, result });
|
|
344
343
|
} catch (err) {
|
|
345
344
|
const inputStatus = resolveToolInputErrorStatus(err);
|
|
@@ -8,6 +8,7 @@ import type { ChannelId } from "../channels/plugins/types.js";
|
|
|
8
8
|
import { inspectReadOnlyChannelAccount } from "../channels/read-only-account-inspect.js";
|
|
9
9
|
import { formatCliCommand } from "../cli/command-format.js";
|
|
10
10
|
import { resolveNativeCommandsEnabled, resolveNativeSkillsEnabled } from "../config/commands.js";
|
|
11
|
+
import type { NativeCommandsSetting } from "../config/types.messages.js";
|
|
11
12
|
import type { CoreBlowConfig } from "../config/config.js";
|
|
12
13
|
import { isDangerousNameMatchingEnabled } from "../config/dangerous-name-matching.js";
|
|
13
14
|
import { formatErrorMessage } from "../infra/errors.js";
|
|
@@ -881,8 +882,7 @@ export async function collectChannelSecurityFindings(params: {
|
|
|
881
882
|
|
|
882
883
|
if (!hasAnySenderAllowlist) {
|
|
883
884
|
const providerSetting = (telegramCfg.commands as { nativeSkills?: unknown } | undefined)
|
|
884
|
-
|
|
885
|
-
?.nativeSkills as unknown;
|
|
885
|
+
?.nativeSkills as NativeCommandsSetting | undefined;
|
|
886
886
|
const skillsEnabled = resolveNativeSkillsEnabled({
|
|
887
887
|
providerId: "telegram",
|
|
888
888
|
providerSetting,
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Stub for matrix-js-sdk — provides empty exports so that vitest
|
|
3
|
+
* contract tests can load the bundled channel entries without
|
|
4
|
+
* requiring the full matrix-js-sdk implementation.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
// ── Enums / Constants ────────────────────────────────────────────
|
|
8
|
+
export const EventType = {} as Record<string, string>;
|
|
9
|
+
export const RoomEvent = {} as Record<string, string>;
|
|
10
|
+
export const ClientEvent = {} as Record<string, string>;
|
|
11
|
+
export const MatrixEventEvent = {} as Record<string, string>;
|
|
12
|
+
export const RoomMemberEvent = {} as Record<string, string>;
|
|
13
|
+
export const RoomStateEvent = {} as Record<string, string>;
|
|
14
|
+
export const MsgType = {} as Record<string, string>;
|
|
15
|
+
export const Preset = {} as Record<string, string>;
|
|
16
|
+
export const Visibility = {} as Record<string, string>;
|
|
17
|
+
export const VerificationMethod = {} as Record<string, string>;
|
|
18
|
+
export const Category = {} as Record<string, string>;
|
|
19
|
+
export const CryptoEvent = {} as Record<string, string>;
|
|
20
|
+
|
|
21
|
+
// ── Classes ──────────────────────────────────────────────────────
|
|
22
|
+
export class MatrixClient {
|
|
23
|
+
[k: string]: unknown;
|
|
24
|
+
}
|
|
25
|
+
export class MatrixEvent {
|
|
26
|
+
[k: string]: unknown;
|
|
27
|
+
}
|
|
28
|
+
export class Room {
|
|
29
|
+
[k: string]: unknown;
|
|
30
|
+
}
|
|
31
|
+
export class RoomMember {
|
|
32
|
+
[k: string]: unknown;
|
|
33
|
+
}
|
|
34
|
+
export class MemoryStore {
|
|
35
|
+
[k: string]: unknown;
|
|
36
|
+
}
|
|
37
|
+
export class SyncAccumulator {
|
|
38
|
+
[k: string]: unknown;
|
|
39
|
+
constructor(..._args: unknown[]) {}
|
|
40
|
+
getJSON(): unknown { return {}; }
|
|
41
|
+
accumulate(_syncResponse: unknown): void {}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// ── Functions ────────────────────────────────────────────────────
|
|
45
|
+
export function createClient(..._args: unknown[]): MatrixClient {
|
|
46
|
+
return new MatrixClient();
|
|
47
|
+
}
|
|
48
|
+
export function decodeRecoveryKey(_key: string): Uint8Array {
|
|
49
|
+
return new Uint8Array();
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// ── Logger ───────────────────────────────────────────────────────
|
|
53
|
+
export const logger = {
|
|
54
|
+
info: (..._args: unknown[]) => {},
|
|
55
|
+
warn: (..._args: unknown[]) => {},
|
|
56
|
+
error: (..._args: unknown[]) => {},
|
|
57
|
+
debug: (..._args: unknown[]) => {},
|
|
58
|
+
trace: (..._args: unknown[]) => {},
|
|
59
|
+
setLevel: (_level: unknown) => {},
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
// ── Type stubs ───────────────────────────────────────────────────
|
|
63
|
+
export type ISyncData = unknown;
|
|
64
|
+
export type IRooms = unknown;
|
|
65
|
+
export type ISyncResponse = unknown;
|
|
66
|
+
export type IStoredClientOpts = unknown;
|
|
67
|
+
|
|
68
|
+
// ── Default export ───────────────────────────────────────────────
|
|
69
|
+
export default {};
|
package/src/utils/logger.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import { pino } from 'pino';
|
|
8
|
-
import type { Logger as PinoLogger } from 'pino';
|
|
8
|
+
import type { Logger as PinoLogger, TransportSingleOptions } from 'pino';
|
|
9
9
|
|
|
10
10
|
// ─── Configuration ────────────────────────────────────────────────
|
|
11
11
|
|
|
@@ -94,7 +94,7 @@ export const logger: PinoLogger = pino({
|
|
|
94
94
|
...(process.env.COREBLOW_INSTANCE_ID ? { instance: process.env.COREBLOW_INSTANCE_ID } : {}),
|
|
95
95
|
},
|
|
96
96
|
timestamp: () => `,"time":"${new Date().toISOString()}"`,
|
|
97
|
-
transport: transportConfig as
|
|
97
|
+
transport: transportConfig as unknown as TransportSingleOptions | undefined,
|
|
98
98
|
});
|
|
99
99
|
|
|
100
100
|
// ─── Module Logger Factory ────────────────────────────────────────
|