@openclawbrain/openclaw 0.3.5 → 0.4.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.
Files changed (60) hide show
  1. package/README.md +23 -175
  2. package/dist/extension/index.js +3 -2
  3. package/dist/extension/index.js.map +1 -1
  4. package/dist/extension/runtime-guard.js +1 -1
  5. package/dist/extension/runtime-guard.js.map +1 -1
  6. package/dist/src/attachment-truth.d.ts +32 -22
  7. package/dist/src/attachment-truth.js +338 -181
  8. package/dist/src/index.d.ts +75 -1712
  9. package/dist/src/index.js +7 -6875
  10. package/dist/src/runtime-core.js +574 -0
  11. package/extension/index.ts +3 -2
  12. package/extension/runtime-guard.ts +1 -1
  13. package/openclaw.plugin.json +11 -0
  14. package/package.json +24 -15
  15. package/dist/src/attachment-truth.js.map +0 -1
  16. package/dist/src/cli.d.ts +0 -170
  17. package/dist/src/cli.js +0 -5523
  18. package/dist/src/cli.js.map +0 -1
  19. package/dist/src/daemon.d.ts +0 -70
  20. package/dist/src/daemon.js +0 -955
  21. package/dist/src/daemon.js.map +0 -1
  22. package/dist/src/import-export.d.ts +0 -36
  23. package/dist/src/import-export.js +0 -171
  24. package/dist/src/import-export.js.map +0 -1
  25. package/dist/src/index.js.map +0 -1
  26. package/dist/src/learning-spine.d.ts +0 -50
  27. package/dist/src/learning-spine.js.map +0 -1
  28. package/dist/src/local-session-passive-learning.d.ts +0 -61
  29. package/dist/src/local-session-passive-learning.js +0 -454
  30. package/dist/src/local-session-passive-learning.js.map +0 -1
  31. package/dist/src/ollama-client.d.ts +0 -46
  32. package/dist/src/ollama-client.js +0 -231
  33. package/dist/src/ollama-client.js.map +0 -1
  34. package/dist/src/openclaw-home-layout.d.ts +0 -17
  35. package/dist/src/openclaw-home-layout.js +0 -182
  36. package/dist/src/openclaw-home-layout.js.map +0 -1
  37. package/dist/src/openclaw-hook-truth.d.ts +0 -25
  38. package/dist/src/openclaw-hook-truth.js +0 -154
  39. package/dist/src/openclaw-hook-truth.js.map +0 -1
  40. package/dist/src/provider-config.d.ts +0 -64
  41. package/dist/src/provider-config.js +0 -306
  42. package/dist/src/provider-config.js.map +0 -1
  43. package/dist/src/resolve-activation-root.d.ts +0 -27
  44. package/dist/src/resolve-activation-root.js +0 -185
  45. package/dist/src/resolve-activation-root.js.map +0 -1
  46. package/dist/src/semantic-metadata.d.ts +0 -5
  47. package/dist/src/semantic-metadata.js +0 -70
  48. package/dist/src/semantic-metadata.js.map +0 -1
  49. package/dist/src/session-store.d.ts +0 -168
  50. package/dist/src/session-store.js +0 -250
  51. package/dist/src/session-store.js.map +0 -1
  52. package/dist/src/session-tail.d.ts +0 -73
  53. package/dist/src/session-tail.js +0 -602
  54. package/dist/src/session-tail.js.map +0 -1
  55. package/dist/src/shadow-extension-proof.d.ts +0 -40
  56. package/dist/src/shadow-extension-proof.js +0 -218
  57. package/dist/src/shadow-extension-proof.js.map +0 -1
  58. package/dist/src/teacher-labeler.d.ts +0 -50
  59. package/dist/src/teacher-labeler.js +0 -424
  60. package/dist/src/teacher-labeler.js.map +0 -1
@@ -1,46 +0,0 @@
1
- export declare const DEFAULT_OLLAMA_BASE_URL = "http://127.0.0.1:11434/api";
2
- export declare const DEFAULT_OLLAMA_TIMEOUT_MS = 30000;
3
- export interface OllamaChatMessage {
4
- role: string;
5
- content: string;
6
- }
7
- export interface OllamaClientOptions {
8
- baseURL?: string;
9
- timeoutMs?: number;
10
- fetch?: OllamaFetch;
11
- }
12
- export interface OllamaRequestOptions {
13
- timeoutMs?: number;
14
- }
15
- export interface OllamaFetchRequestInit {
16
- method?: string;
17
- headers?: Record<string, string>;
18
- body?: string;
19
- signal?: AbortSignal;
20
- }
21
- export interface OllamaFetchResponse {
22
- ok: boolean;
23
- status: number;
24
- statusText: string;
25
- text(): Promise<string>;
26
- }
27
- export type OllamaFetch = (input: string, init?: OllamaFetchRequestInit) => Promise<OllamaFetchResponse>;
28
- export declare class OllamaClientError extends Error {
29
- readonly endpoint: string;
30
- readonly status: number | null;
31
- readonly cause: unknown;
32
- constructor(message: string, options: {
33
- endpoint: string;
34
- status?: number | null;
35
- cause?: unknown;
36
- });
37
- }
38
- export declare class OllamaClient {
39
- #private;
40
- readonly baseURL: string;
41
- readonly timeoutMs: number;
42
- constructor(options?: OllamaClientOptions);
43
- chat(model: string, messages: readonly OllamaChatMessage[], options?: OllamaRequestOptions): Promise<string>;
44
- embed(model: string, input: string, options?: OllamaRequestOptions): Promise<number[]>;
45
- }
46
- export declare function createOllamaClient(options?: OllamaClientOptions): OllamaClient;
@@ -1,231 +0,0 @@
1
- const DEFAULT_BASE_URL = "http://127.0.0.1:11434/api";
2
- const DEFAULT_TIMEOUT_MS = 30_000;
3
- export const DEFAULT_OLLAMA_BASE_URL = DEFAULT_BASE_URL;
4
- export const DEFAULT_OLLAMA_TIMEOUT_MS = DEFAULT_TIMEOUT_MS;
5
- export class OllamaClientError extends Error {
6
- endpoint;
7
- status;
8
- cause;
9
- constructor(message, options) {
10
- super(message);
11
- this.name = "OllamaClientError";
12
- this.endpoint = options.endpoint;
13
- this.status = options.status ?? null;
14
- this.cause = options.cause;
15
- }
16
- }
17
- export class OllamaClient {
18
- baseURL;
19
- timeoutMs;
20
- #fetch;
21
- constructor(options = {}) {
22
- this.baseURL = normalizeBaseURL(options.baseURL ?? DEFAULT_BASE_URL);
23
- this.timeoutMs = normalizeTimeoutMs(options.timeoutMs ?? DEFAULT_TIMEOUT_MS, "timeoutMs", "initialization");
24
- this.#fetch = resolveFetch(options.fetch);
25
- }
26
- async chat(model, messages, options = {}) {
27
- const normalizedModel = requireNonEmptyString(model, "model", "chat");
28
- const normalizedMessages = normalizeMessages(messages);
29
- const response = await this.#post("chat", {
30
- model: normalizedModel,
31
- messages: normalizedMessages,
32
- stream: false
33
- }, options);
34
- return readChatText(response);
35
- }
36
- async embed(model, input, options = {}) {
37
- const normalizedModel = requireNonEmptyString(model, "model", "embed");
38
- const normalizedInput = requireNonEmptyString(input, "input", "embed");
39
- const response = await this.#post("embed", {
40
- model: normalizedModel,
41
- input: normalizedInput
42
- }, options);
43
- return readEmbeddingVector(response);
44
- }
45
- async #post(endpoint, body, options) {
46
- const timeoutMs = normalizeTimeoutMs(options.timeoutMs ?? this.timeoutMs, "timeoutMs", endpoint);
47
- const url = `${this.baseURL}/${endpoint}`;
48
- const controller = new AbortController();
49
- const timeout = setTimeout(() => {
50
- controller.abort();
51
- }, timeoutMs);
52
- let response;
53
- try {
54
- response = await this.#fetch(url, {
55
- method: "POST",
56
- headers: {
57
- accept: "application/json",
58
- "content-type": "application/json"
59
- },
60
- body: JSON.stringify(body),
61
- signal: controller.signal
62
- });
63
- }
64
- catch (error) {
65
- if (controller.signal.aborted) {
66
- throw new OllamaClientError(`Ollama request to ${url} timed out after ${timeoutMs}ms.`, { endpoint: endpoint, cause: error });
67
- }
68
- throw new OllamaClientError(`Ollama request to ${url} failed: ${describeUnknownError(error)}.`, { endpoint: endpoint, cause: error });
69
- }
70
- finally {
71
- clearTimeout(timeout);
72
- }
73
- const text = await readResponseText(response, endpoint);
74
- if (!response.ok) {
75
- throw new OllamaClientError(formatHttpErrorMessage(url, response.status, response.statusText, text), { endpoint: endpoint, status: response.status });
76
- }
77
- if (text.trim().length === 0) {
78
- throw new OllamaClientError(`Ollama response from ${url} was empty.`, { endpoint: endpoint, status: response.status });
79
- }
80
- try {
81
- return JSON.parse(text);
82
- }
83
- catch (error) {
84
- throw new OllamaClientError(`Ollama response from ${url} was not valid JSON.`, { endpoint: endpoint, status: response.status, cause: error });
85
- }
86
- }
87
- }
88
- export function createOllamaClient(options = {}) {
89
- return new OllamaClient(options);
90
- }
91
- function resolveFetch(fetchFn) {
92
- if (typeof fetchFn === "function") {
93
- return fetchFn;
94
- }
95
- const globalFetch = globalThis.fetch;
96
- if (typeof globalFetch === "function") {
97
- return globalFetch;
98
- }
99
- throw new OllamaClientError("Ollama client requires a fetch implementation.", {
100
- endpoint: "initialization"
101
- });
102
- }
103
- function normalizeBaseURL(baseURL) {
104
- const normalized = requireNonEmptyString(baseURL, "baseURL", "initialization").replace(/\/+$/, "");
105
- let parsed;
106
- try {
107
- parsed = new URL(normalized);
108
- }
109
- catch (error) {
110
- throw new OllamaClientError(`Invalid Ollama baseURL: ${describeUnknownError(error)}.`, { endpoint: "initialization", cause: error });
111
- }
112
- if (parsed.pathname === "" || parsed.pathname === "/") {
113
- parsed.pathname = "/api";
114
- }
115
- parsed.pathname = parsed.pathname.replace(/\/+$/, "") || "/api";
116
- return parsed.toString().replace(/\/+$/, "");
117
- }
118
- function normalizeMessages(messages) {
119
- if (!Array.isArray(messages) || messages.length === 0) {
120
- throw new OllamaClientError("messages must contain at least one chat message.", {
121
- endpoint: "chat"
122
- });
123
- }
124
- return messages.map((message, index) => {
125
- if (!isRecord(message)) {
126
- throw new OllamaClientError(`messages[${index}] must be an object with role and content strings.`, {
127
- endpoint: "chat"
128
- });
129
- }
130
- return {
131
- role: requireNonEmptyString(message.role, `messages[${index}].role`, "chat"),
132
- content: requireString(message.content, `messages[${index}].content`, "chat")
133
- };
134
- });
135
- }
136
- function normalizeTimeoutMs(timeoutMs, fieldName, endpoint) {
137
- if (!Number.isInteger(timeoutMs) || timeoutMs <= 0) {
138
- throw new OllamaClientError(`${fieldName} must be a positive integer number of milliseconds.`, {
139
- endpoint
140
- });
141
- }
142
- return timeoutMs;
143
- }
144
- function readChatText(value) {
145
- if (!isRecord(value) || !isRecord(value.message) || typeof value.message.content !== "string") {
146
- throw new OllamaClientError("Ollama chat response did not include message.content.", {
147
- endpoint: "chat"
148
- });
149
- }
150
- return value.message.content;
151
- }
152
- function readEmbeddingVector(value) {
153
- if (!isRecord(value) || !Array.isArray(value.embeddings) || value.embeddings.length === 0) {
154
- throw new OllamaClientError("Ollama embed response did not include embeddings[0].", {
155
- endpoint: "embed"
156
- });
157
- }
158
- const [firstEmbedding] = value.embeddings;
159
- if (!Array.isArray(firstEmbedding) || firstEmbedding.some((item) => typeof item !== "number" || !Number.isFinite(item))) {
160
- throw new OllamaClientError("Ollama embed response embeddings[0] was not a numeric vector.", {
161
- endpoint: "embed"
162
- });
163
- }
164
- return [...firstEmbedding];
165
- }
166
- async function readResponseText(response, endpoint) {
167
- try {
168
- return await response.text();
169
- }
170
- catch (error) {
171
- throw new OllamaClientError("Failed to read Ollama response body.", {
172
- endpoint,
173
- status: response.status,
174
- cause: error
175
- });
176
- }
177
- }
178
- function formatHttpErrorMessage(url, status, statusText, text) {
179
- const details = summarizeErrorBody(text);
180
- const suffix = details === null ? "." : `: ${details}`;
181
- const normalizedStatusText = statusText.trim().length === 0 ? "" : ` ${statusText}`;
182
- return `Ollama request to ${url} failed with HTTP ${status}${normalizedStatusText}${suffix}`;
183
- }
184
- function summarizeErrorBody(text) {
185
- const normalized = text.trim();
186
- if (normalized.length === 0) {
187
- return null;
188
- }
189
- try {
190
- const parsed = JSON.parse(normalized);
191
- if (isRecord(parsed)) {
192
- if (typeof parsed.error === "string" && parsed.error.trim().length > 0) {
193
- return parsed.error.trim();
194
- }
195
- if (typeof parsed.message === "string" && parsed.message.trim().length > 0) {
196
- return parsed.message.trim();
197
- }
198
- }
199
- }
200
- catch {
201
- // Preserve plain-text bodies when the upstream error is not JSON.
202
- }
203
- return normalized.replace(/\s+/g, " ").slice(0, 240);
204
- }
205
- function requireNonEmptyString(value, fieldName, endpoint) {
206
- const normalized = requireString(value, fieldName, endpoint).trim();
207
- if (normalized.length === 0) {
208
- throw new OllamaClientError(`${fieldName} must be a non-empty string.`, {
209
- endpoint
210
- });
211
- }
212
- return normalized;
213
- }
214
- function requireString(value, fieldName, endpoint) {
215
- if (typeof value !== "string") {
216
- throw new OllamaClientError(`${fieldName} must be a string.`, {
217
- endpoint
218
- });
219
- }
220
- return value;
221
- }
222
- function describeUnknownError(error) {
223
- if (error instanceof Error && error.message.trim().length > 0) {
224
- return error.message;
225
- }
226
- return String(error);
227
- }
228
- function isRecord(value) {
229
- return typeof value === "object" && value !== null;
230
- }
231
- //# sourceMappingURL=ollama-client.js.map
@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AAM,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AAED,SAAS,QAAQ,CAAC,KAAc;IAC9B,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,CAAC;AACrD,CAAC"}
@@ -1,17 +0,0 @@
1
- export type OpenClawHomeLayout = "per_profile_home" | "shared_home_profiles_in_config" | "single_openclaw_home" | "custom_openclaw_home";
2
- export type OpenClawHomeProfileSource = "openclaw_json_profile" | "openclaw_json_single_profile_key" | "directory_name" | "none";
3
- export interface OpenClawHomeInspection {
4
- openclawHome: string;
5
- openclawJsonPath: string;
6
- layout: OpenClawHomeLayout;
7
- profileId: string | null;
8
- profileSource: OpenClawHomeProfileSource;
9
- configuredProfileIds: string[];
10
- configReadable: boolean;
11
- configError: string | null;
12
- }
13
- export declare function inspectOpenClawHome(openclawHome: string): OpenClawHomeInspection;
14
- export declare function discoverOpenClawHomes(homeDir?: string): OpenClawHomeInspection[];
15
- export declare function formatOpenClawHomeLayout(layout: OpenClawHomeLayout): string;
16
- export declare function formatOpenClawHomeProfileSource(source: OpenClawHomeProfileSource): string;
17
- export declare function describeOpenClawHomeInspection(inspection: OpenClawHomeInspection): string;
@@ -1,182 +0,0 @@
1
- import { existsSync, readdirSync, readFileSync } from "node:fs";
2
- import { homedir } from "node:os";
3
- import path from "node:path";
4
- function normalizeOptionalString(value) {
5
- if (typeof value !== "string") {
6
- return null;
7
- }
8
- const trimmed = value.trim();
9
- return trimmed.length > 0 ? trimmed : null;
10
- }
11
- function readRecord(value) {
12
- if (value === null || typeof value !== "object" || Array.isArray(value)) {
13
- return null;
14
- }
15
- return value;
16
- }
17
- function listConfiguredProfileIds(config) {
18
- const profiles = readRecord(config?.profiles);
19
- if (profiles === null) {
20
- return [];
21
- }
22
- return Object.keys(profiles)
23
- .map((profileId) => profileId.trim())
24
- .filter((profileId) => profileId.length > 0)
25
- .sort((left, right) => left.localeCompare(right));
26
- }
27
- function deriveDirectoryProfileId(openclawHome) {
28
- const basename = path.basename(openclawHome);
29
- if (!basename.startsWith(".openclaw-")) {
30
- return null;
31
- }
32
- const derived = basename.slice(".openclaw-".length).trim();
33
- return derived.length > 0 ? derived : null;
34
- }
35
- function detectLayout(input) {
36
- const basename = path.basename(input.openclawHome);
37
- if (basename.startsWith(".openclaw-")) {
38
- return "per_profile_home";
39
- }
40
- if (basename === ".openclaw" && input.configuredProfileIds.length > 0) {
41
- return "shared_home_profiles_in_config";
42
- }
43
- if (basename === ".openclaw") {
44
- return "single_openclaw_home";
45
- }
46
- if (input.configuredProfileIds.length > 0) {
47
- return "shared_home_profiles_in_config";
48
- }
49
- return "custom_openclaw_home";
50
- }
51
- function detectProfileId(input) {
52
- const directProfile = normalizeOptionalString(input.config?.profile);
53
- if (directProfile !== null) {
54
- return {
55
- profileId: directProfile,
56
- profileSource: "openclaw_json_profile"
57
- };
58
- }
59
- if (input.configuredProfileIds.length === 1) {
60
- return {
61
- profileId: input.configuredProfileIds[0],
62
- profileSource: "openclaw_json_single_profile_key"
63
- };
64
- }
65
- const directoryProfile = deriveDirectoryProfileId(input.openclawHome);
66
- if (directoryProfile !== null) {
67
- return {
68
- profileId: directoryProfile,
69
- profileSource: "directory_name"
70
- };
71
- }
72
- return {
73
- profileId: null,
74
- profileSource: "none"
75
- };
76
- }
77
- export function inspectOpenClawHome(openclawHome) {
78
- const resolvedHome = path.resolve(openclawHome);
79
- const openclawJsonPath = path.join(resolvedHome, "openclaw.json");
80
- let config = null;
81
- let configReadable = false;
82
- let configError = null;
83
- if (existsSync(openclawJsonPath)) {
84
- try {
85
- config = readRecord(JSON.parse(readFileSync(openclawJsonPath, "utf8")));
86
- configReadable = config !== null;
87
- if (config === null) {
88
- configError = "openclaw.json does not contain a top-level object";
89
- }
90
- }
91
- catch (error) {
92
- configError = error instanceof Error ? error.message : String(error);
93
- }
94
- }
95
- else {
96
- configError = "openclaw.json is missing";
97
- }
98
- const configuredProfileIds = listConfiguredProfileIds(config);
99
- const layout = detectLayout({
100
- openclawHome: resolvedHome,
101
- configuredProfileIds
102
- });
103
- const profileResolution = detectProfileId({
104
- openclawHome: resolvedHome,
105
- config,
106
- configuredProfileIds
107
- });
108
- return {
109
- openclawHome: resolvedHome,
110
- openclawJsonPath,
111
- layout,
112
- profileId: profileResolution.profileId,
113
- profileSource: profileResolution.profileSource,
114
- configuredProfileIds,
115
- configReadable,
116
- configError
117
- };
118
- }
119
- function isDiscoverableOpenClawHome(entry) {
120
- if (!entry.isDirectory()) {
121
- return false;
122
- }
123
- return entry.name === ".openclaw" || entry.name.startsWith(".openclaw-");
124
- }
125
- export function discoverOpenClawHomes(homeDir = process.env.HOME ?? process.env.USERPROFILE ?? homedir()) {
126
- const resolvedHomeDir = path.resolve(homeDir);
127
- let entries;
128
- try {
129
- entries = readdirSync(resolvedHomeDir, { withFileTypes: true });
130
- }
131
- catch {
132
- return [];
133
- }
134
- return entries
135
- .filter(isDiscoverableOpenClawHome)
136
- .map((entry) => path.join(resolvedHomeDir, entry.name))
137
- .filter((candidate) => existsSync(path.join(candidate, "openclaw.json")))
138
- .map((candidate) => inspectOpenClawHome(candidate))
139
- .sort((left, right) => left.openclawHome.localeCompare(right.openclawHome));
140
- }
141
- export function formatOpenClawHomeLayout(layout) {
142
- switch (layout) {
143
- case "per_profile_home":
144
- return "per-profile home";
145
- case "shared_home_profiles_in_config":
146
- return "single ~/.openclaw home with profiles in openclaw.json";
147
- case "single_openclaw_home":
148
- return "single ~/.openclaw home";
149
- case "custom_openclaw_home":
150
- return "custom OpenClaw home";
151
- default:
152
- return layout;
153
- }
154
- }
155
- export function formatOpenClawHomeProfileSource(source) {
156
- switch (source) {
157
- case "openclaw_json_profile":
158
- return "openclaw.json.profile";
159
- case "openclaw_json_single_profile_key":
160
- return "the only openclaw.json profiles entry";
161
- case "directory_name":
162
- return "the OpenClaw home directory name";
163
- case "none":
164
- return "none";
165
- default:
166
- return source;
167
- }
168
- }
169
- export function describeOpenClawHomeInspection(inspection) {
170
- const layout = formatOpenClawHomeLayout(inspection.layout);
171
- const configuredProfiles = inspection.configuredProfileIds.length === 0
172
- ? "none"
173
- : inspection.configuredProfileIds.join(", ");
174
- if (inspection.profileId !== null) {
175
- return `${layout}; target profile=${inspection.profileId} via ${formatOpenClawHomeProfileSource(inspection.profileSource)}; configured profiles=${configuredProfiles}`;
176
- }
177
- if (inspection.layout === "shared_home_profiles_in_config" || inspection.layout === "single_openclaw_home") {
178
- return `${layout}; target profile stays host-selected current_profile; configured profiles=${configuredProfiles}`;
179
- }
180
- return `${layout}; target profile unresolved; configured profiles=${configuredProfiles}`;
181
- }
182
- //# sourceMappingURL=openclaw-home-layout.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"openclaw-home-layout.js","sourceRoot":"","sources":["../../src/openclaw-home-layout.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,YAAY,EAAe,MAAM,SAAS,CAAC;AAC7E,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,SAAS,uBAAuB,CAAC,KAAc;IAC7C,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;IAC7B,OAAO,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC;AAC7C,CAAC;AAED,SAAS,UAAU,CAAC,KAAc;IAChC,IAAI,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QACxE,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,KAAgC,CAAC;AAC1C,CAAC;AAED,SAAS,wBAAwB,CAAC,MAAsC;IACtE,MAAM,QAAQ,GAAG,UAAU,CAAC,MAAM,EAAE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AM,EAAE,CAAC;QACf,KAAK,uBAAuB;YAC1B,OAAO,uBAAuB,CAAC;QACjC,KAAK,kCAAkC;YACrC,OAAO,uCAAuC,CAAC;QACjD,KAAK,gBAAgB;YACnB,OAAO,kCAAkC,CAAC;QAC5C,KAAK,MAAM;YACT,OAAO,MAAM,CAAC;QAChB;YACE,OAAO,MAAM,CAAC;IAClB,CAAC;AACH,CAAC;AAED,MAAM,UAAU,8BAA8B,CAAC,UAAkC;IAC/E,MAAM,MAAM,GAAG,wBAAwB,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;IAC3D,MAAM,kBAAkB,GACtB,UAAU,CAAC,oBAAoB,CAAC,MAAM,KAAK,CAAC;QAC1C,CAAC,CAAC,MAAM;QACR,CAAC,CAAC,UAAU,CAAC,oBAAoB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAEjD,IAAI,UAAU,CAAC,SAAS,KAAK,IAAI,EAAE,CAAC;QAClC,OAAO,GAAG,MAAM,oBAAoB,UAAU,CAAC,SAAS,QAAQ,+BAA+B,CAAC,UAAU,CAAC,aAAa,CAAC,yBAAyB,kBAAkB,EAAE,CAAC;IACzK,CAAC;IAED,IAAI,UAAU,CAAC,MAAM,KAAK,gCAAgC,IAAI,UAAU,CAAC,MAAM,KAAK,sBAAsB,EAAE,CAAC;QAC3G,OAAO,GAAG,MAAM,6EAA6E,kBAAkB,EAAE,CAAC;IACpH,CAAC;IAED,OAAO,GAAG,MAAM,oDAAoD,kBAAkB,EAAE,CAAC;AAC3F,CAAC"}
@@ -1,25 +0,0 @@
1
- export type OpenClawBrainHookInstallState = "installed" | "not_installed" | "blocked_by_allowlist" | "unverified";
2
- export type OpenClawBrainHookLoadability = "loadable" | "blocked" | "not_installed" | "unverified";
3
- export type OpenClawBrainHookLoadProof = "status_probe_ready" | "not_ready";
4
- export type OpenClawBrainPluginAllowlistState = "unrestricted" | "allowed" | "blocked" | "invalid" | "unverified";
5
- export interface OpenClawBrainHookInspection {
6
- scope: "exact_openclaw_home" | "activation_root_only";
7
- openclawHome: string | null;
8
- hookPath: string | null;
9
- runtimeGuardPath: string | null;
10
- manifestPath: string | null;
11
- installState: OpenClawBrainHookInstallState;
12
- loadability: OpenClawBrainHookLoadability;
13
- pluginAllowlistState: OpenClawBrainPluginAllowlistState;
14
- desynced: boolean;
15
- detail: string;
16
- }
17
- export interface OpenClawBrainHookLoadSummary extends OpenClawBrainHookInspection {
18
- loadProof: OpenClawBrainHookLoadProof;
19
- }
20
- export declare function inspectOpenClawBrainPluginAllowlist(openclawHome: string): {
21
- state: Exclude<OpenClawBrainPluginAllowlistState, "unverified">;
22
- detail: string;
23
- };
24
- export declare function inspectOpenClawBrainHookStatus(openclawHome: string | null | undefined): OpenClawBrainHookInspection;
25
- export declare function summarizeOpenClawBrainHookLoad(inspection: OpenClawBrainHookInspection, statusProbeReady: boolean): OpenClawBrainHookLoadSummary;