@kya-os/checkpoint-shared 1.1.0 → 1.2.1
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 +31 -0
- package/dist/beacon-types/index.d.mts +427 -0
- package/dist/beacon-types/index.d.ts +427 -0
- package/dist/beacon-types/index.js +204 -0
- package/dist/beacon-types/index.mjs +191 -0
- package/dist/deploy/index.d.mts +380 -0
- package/dist/deploy/index.d.ts +380 -0
- package/dist/deploy/index.js +221 -0
- package/dist/deploy/index.mjs +207 -0
- package/dist/gateway/index.d.mts +575 -0
- package/dist/gateway/index.d.ts +575 -0
- package/dist/gateway/index.js +98 -0
- package/dist/gateway/index.mjs +88 -0
- package/dist/index.d.mts +1471 -106
- package/dist/index.d.ts +1471 -106
- package/dist/index.js +1869 -1029
- package/dist/index.mjs +1826 -1028
- package/dist/mcpi/agentshield-api/index.d.mts +47 -0
- package/dist/mcpi/agentshield-api/index.d.ts +47 -0
- package/dist/mcpi/agentshield-api/index.js +2 -0
- package/dist/mcpi/agentshield-api/index.mjs +1 -0
- package/dist/mcpi/approval-grant/index.d.mts +79 -0
- package/dist/mcpi/approval-grant/index.d.ts +79 -0
- package/dist/mcpi/approval-grant/index.js +157 -0
- package/dist/mcpi/approval-grant/index.mjs +150 -0
- package/dist/mcpi/dashboard-config/index.d.mts +14075 -0
- package/dist/mcpi/dashboard-config/index.d.ts +14075 -0
- package/dist/mcpi/dashboard-config/index.js +517 -0
- package/dist/mcpi/dashboard-config/index.mjs +492 -0
- package/dist/test-fixtures/index.d.mts +17 -8
- package/dist/test-fixtures/index.d.ts +17 -8
- package/dist/test-fixtures/index.js +73 -7
- package/dist/test-fixtures/index.mjs +73 -8
- package/dist/tool-protection/index.d.mts +1120 -0
- package/dist/tool-protection/index.d.ts +1120 -0
- package/dist/tool-protection/index.js +370 -0
- package/dist/tool-protection/index.mjs +338 -0
- package/package.json +40 -3
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
// src/beacon-types/index.ts
|
|
2
|
+
function isRecord(input) {
|
|
3
|
+
return typeof input === "object" && input !== null && !Array.isArray(input);
|
|
4
|
+
}
|
|
5
|
+
function toRecord(input) {
|
|
6
|
+
return isRecord(input) ? input : {};
|
|
7
|
+
}
|
|
8
|
+
function numberOr(value, fallback) {
|
|
9
|
+
return typeof value === "number" && Number.isFinite(value) && value !== 0 ? value : fallback;
|
|
10
|
+
}
|
|
11
|
+
function stringOr(value, fallback) {
|
|
12
|
+
return typeof value === "string" ? value : fallback;
|
|
13
|
+
}
|
|
14
|
+
function isBeaconTags(value) {
|
|
15
|
+
return isRecord(value) && Object.values(value).every(
|
|
16
|
+
(entry) => typeof entry === "string" || typeof entry === "number" || typeof entry === "boolean"
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
function isLogLevel(value) {
|
|
20
|
+
return value === "error" || value === "warn" || value === "info" || value === "debug";
|
|
21
|
+
}
|
|
22
|
+
function isBeaconWorkerMessageType(value) {
|
|
23
|
+
return value === "init" || value === "collect" || value === "flush" || value === "config" || value === "status" || value === "error";
|
|
24
|
+
}
|
|
25
|
+
function parseRetryStrategy(input) {
|
|
26
|
+
const strategy = toRecord(input);
|
|
27
|
+
return {
|
|
28
|
+
maxAttempts: numberOr(strategy.maxAttempts, 3),
|
|
29
|
+
baseDelay: numberOr(strategy.baseDelay, 1e3),
|
|
30
|
+
maxDelay: numberOr(strategy.maxDelay, 3e4),
|
|
31
|
+
factor: numberOr(strategy.factor, 2),
|
|
32
|
+
jitter: strategy.jitter !== false
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
function parseCircuitBreakerConfig(input) {
|
|
36
|
+
const config = toRecord(input);
|
|
37
|
+
return {
|
|
38
|
+
threshold: numberOr(config.threshold, 5),
|
|
39
|
+
timeout: numberOr(config.timeout, 6e4),
|
|
40
|
+
resetTimeout: numberOr(config.resetTimeout, 3e4)
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
function parseOfflineQueueEntry(input) {
|
|
44
|
+
if (!isRecord(input)) {
|
|
45
|
+
throw new Error("Invalid offline queue entry");
|
|
46
|
+
}
|
|
47
|
+
const entry = input;
|
|
48
|
+
return {
|
|
49
|
+
id: stringOr(entry.id, `${Date.now()}_${Math.random().toString(36).substr(2, 9)}`),
|
|
50
|
+
events: Array.isArray(entry.events) ? entry.events : [],
|
|
51
|
+
timestamp: numberOr(entry.timestamp, Date.now()),
|
|
52
|
+
expiresAt: numberOr(entry.expiresAt, Date.now() + 864e5),
|
|
53
|
+
// 24 hours
|
|
54
|
+
retryCount: numberOr(entry.retryCount, 0),
|
|
55
|
+
size: numberOr(entry.size, 0)
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
function parseBeaconWorkerMessage(input) {
|
|
59
|
+
if (!isRecord(input)) {
|
|
60
|
+
throw new Error("Invalid beacon worker message");
|
|
61
|
+
}
|
|
62
|
+
const msg = input;
|
|
63
|
+
const messageId = stringOr(msg.messageId) ?? stringOr(msg.id) ?? crypto.randomUUID();
|
|
64
|
+
return {
|
|
65
|
+
type: isBeaconWorkerMessageType(msg.type) ? msg.type : "init",
|
|
66
|
+
data: msg.data,
|
|
67
|
+
payload: msg.payload,
|
|
68
|
+
messageId,
|
|
69
|
+
timestamp: numberOr(msg.timestamp, Date.now()),
|
|
70
|
+
id: stringOr(msg.id, messageId)
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
function isMessagePriority(value) {
|
|
74
|
+
return value === "low" || value === "normal" || value === "high" || value === "critical";
|
|
75
|
+
}
|
|
76
|
+
function isWorkerMessageType(value) {
|
|
77
|
+
return value === "request" || value === "response" || value === "error" || value === "heartbeat" || value === "status";
|
|
78
|
+
}
|
|
79
|
+
function isWorkerErrorType(value) {
|
|
80
|
+
return value === "initialization" || value === "runtime" || value === "communication" || value === "timeout" || value === "memory" || value === "network" || value === "permission" || value === "validation" || value === "processing" || value === "unknown";
|
|
81
|
+
}
|
|
82
|
+
function parseWorkerMessage(input) {
|
|
83
|
+
const msg = input && typeof input === "object" ? input : null;
|
|
84
|
+
if (!msg) {
|
|
85
|
+
throw new Error("Invalid worker message");
|
|
86
|
+
}
|
|
87
|
+
return {
|
|
88
|
+
id: msg.id || crypto.randomUUID(),
|
|
89
|
+
type: isWorkerMessageType(msg.type) ? msg.type : "request",
|
|
90
|
+
action: msg.action,
|
|
91
|
+
payload: msg.payload,
|
|
92
|
+
timestamp: msg.timestamp || Date.now(),
|
|
93
|
+
compressed: msg.compressed,
|
|
94
|
+
priority: isMessagePriority(msg.priority) ? msg.priority : "normal",
|
|
95
|
+
correlationId: msg.correlationId
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
function parseWorkerError(input) {
|
|
99
|
+
const error = input && typeof input === "object" ? input : {};
|
|
100
|
+
return {
|
|
101
|
+
type: isWorkerErrorType(error.type) ? error.type : "unknown",
|
|
102
|
+
code: typeof error.code === "string" ? error.code : void 0,
|
|
103
|
+
message: typeof error.message === "string" ? error.message : "Worker error",
|
|
104
|
+
stack: typeof error.stack === "string" ? error.stack : void 0,
|
|
105
|
+
timestamp: typeof error.timestamp === "number" ? error.timestamp : Date.now(),
|
|
106
|
+
recoverable: error.recoverable !== false,
|
|
107
|
+
retryAfter: typeof error.retryAfter === "number" ? error.retryAfter : void 0,
|
|
108
|
+
context: error.context
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
function parseWorkerPoolConfig(input) {
|
|
112
|
+
const config = input && typeof input === "object" ? input : {};
|
|
113
|
+
return {
|
|
114
|
+
maxWorkers: config.maxWorkers ?? 4,
|
|
115
|
+
minWorkers: config.minWorkers ?? 1,
|
|
116
|
+
workerIdleTimeout: config.workerIdleTimeout ?? 3e4,
|
|
117
|
+
taskQueueSize: config.taskQueueSize ?? 100,
|
|
118
|
+
resourceLimits: config.resourceLimits ?? {},
|
|
119
|
+
autoScale: config.autoScale ?? true,
|
|
120
|
+
scaleUpThreshold: config.scaleUpThreshold ?? 75,
|
|
121
|
+
scaleDownThreshold: config.scaleDownThreshold ?? 25
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
function parseResourceUsage(input) {
|
|
125
|
+
const usage = input && typeof input === "object" ? input : {};
|
|
126
|
+
return {
|
|
127
|
+
memory: usage.memory ?? { used: 0, limit: 0, percentage: 0 },
|
|
128
|
+
cpu: usage.cpu ?? { usage: 0, limit: 100 },
|
|
129
|
+
tasks: usage.tasks ?? { pending: 0, active: 0, completed: 0, failed: 0 },
|
|
130
|
+
activeWorkers: usage.activeWorkers ?? 0
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
var ResourceUsageSchema = {
|
|
134
|
+
parse: parseResourceUsage
|
|
135
|
+
};
|
|
136
|
+
var WorkerPoolConfigSchema = {
|
|
137
|
+
parse: parseWorkerPoolConfig
|
|
138
|
+
};
|
|
139
|
+
function parseWorkerCapabilities(input) {
|
|
140
|
+
const cap = toRecord(input);
|
|
141
|
+
const csp = toRecord(cap.csp);
|
|
142
|
+
const performance = toRecord(cap.performance);
|
|
143
|
+
return {
|
|
144
|
+
workerAPI: cap.workerAPI !== false,
|
|
145
|
+
sharedArrayBuffer: cap.sharedArrayBuffer === true,
|
|
146
|
+
transferableObjects: cap.transferableObjects === true,
|
|
147
|
+
offscreenCanvas: cap.offscreenCanvas === true,
|
|
148
|
+
webAssembly: cap.webAssembly === true,
|
|
149
|
+
atomics: cap.atomics === true,
|
|
150
|
+
bigInt: cap.bigInt === true,
|
|
151
|
+
csp: {
|
|
152
|
+
workerSrc: csp.workerSrc === true,
|
|
153
|
+
scriptSrc: csp.scriptSrc === true,
|
|
154
|
+
blobUrls: csp.blobUrls === true,
|
|
155
|
+
inlineWorkers: csp.inlineWorkers === true
|
|
156
|
+
},
|
|
157
|
+
performance: {
|
|
158
|
+
memory: performance.memory === true,
|
|
159
|
+
measureUserAgentSpecificMemory: performance.measureUserAgentSpecificMemory === true
|
|
160
|
+
}
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
function parseBeaconConfig(input) {
|
|
164
|
+
const config = toRecord(input);
|
|
165
|
+
if (typeof config.projectId !== "string" || config.projectId.length === 0) {
|
|
166
|
+
throw new Error("Project ID is required");
|
|
167
|
+
}
|
|
168
|
+
return {
|
|
169
|
+
projectId: config.projectId,
|
|
170
|
+
environment: stringOr(config.environment),
|
|
171
|
+
tags: isBeaconTags(config.tags) ? config.tags : void 0,
|
|
172
|
+
enabled: config.enabled !== false,
|
|
173
|
+
debug: config.debug === true,
|
|
174
|
+
logLevel: isLogLevel(config.logLevel) ? config.logLevel : "error",
|
|
175
|
+
respectDoNotTrack: config.respectDoNotTrack !== false,
|
|
176
|
+
anonymizeIp: config.anonymizeIp === true,
|
|
177
|
+
sessionTimeout: numberOr(config.sessionTimeout, 18e5),
|
|
178
|
+
// 30 minutes
|
|
179
|
+
sessionCookieName: stringOr(config.sessionCookieName, "_as_beacon_session"),
|
|
180
|
+
batchSize: numberOr(config.batchSize, 10),
|
|
181
|
+
flushInterval: numberOr(config.flushInterval, 5e3),
|
|
182
|
+
maxQueueSize: numberOr(config.maxQueueSize, 100),
|
|
183
|
+
retryAttempts: numberOr(config.retryAttempts, 3),
|
|
184
|
+
retryDelay: numberOr(config.retryDelay, 2e3),
|
|
185
|
+
useWorker: config.useWorker !== false,
|
|
186
|
+
workerUrl: stringOr(config.workerUrl),
|
|
187
|
+
workerConfig: isRecord(config.workerConfig) ? config.workerConfig : void 0
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
export { ResourceUsageSchema, WorkerPoolConfigSchema, parseBeaconConfig, parseBeaconWorkerMessage, parseCircuitBreakerConfig, parseOfflineQueueEntry, parseResourceUsage, parseRetryStrategy, parseWorkerCapabilities, parseWorkerError, parseWorkerMessage, parseWorkerPoolConfig };
|
|
@@ -0,0 +1,380 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
declare const DidStringSchema: z.ZodString;
|
|
4
|
+
declare const FlyRegionSchema: z.ZodEnum<["ams", "arn", "atl", "bog", "bos", "cdg", "den", "dfw", "ewr", "eze", "fra", "gdl", "gig", "gru", "hkg", "iad", "jnb", "lax", "lhr", "mad", "mia", "nrt", "ord", "otp", "phx", "qro", "scl", "sea", "sin", "sjc", "syd", "waw", "yul", "yyz"]>;
|
|
5
|
+
type FlyRegion = z.infer<typeof FlyRegionSchema>;
|
|
6
|
+
declare const HostingModeSchema: z.ZodEnum<["byok", "managed"]>;
|
|
7
|
+
type HostingMode = z.infer<typeof HostingModeSchema>;
|
|
8
|
+
declare const ManagedDeployStepStatusSchema: z.ZodEnum<["pending", "in_progress", "completed", "failed", "skipped"]>;
|
|
9
|
+
type ManagedDeployStepStatus = z.infer<typeof ManagedDeployStepStatusSchema>;
|
|
10
|
+
declare const HeartbeatRequestSchema: z.ZodObject<{
|
|
11
|
+
agentDid: z.ZodString;
|
|
12
|
+
status: z.ZodEnum<["starting", "running", "error", "stopping"]>;
|
|
13
|
+
computeVersion: z.ZodString;
|
|
14
|
+
openclawVersion: z.ZodOptional<z.ZodString>;
|
|
15
|
+
machineId: z.ZodOptional<z.ZodString>;
|
|
16
|
+
uptimeSeconds: z.ZodOptional<z.ZodNumber>;
|
|
17
|
+
memoryMb: z.ZodOptional<z.ZodNumber>;
|
|
18
|
+
}, "strip", z.ZodTypeAny, {
|
|
19
|
+
status: "starting" | "running" | "error" | "stopping";
|
|
20
|
+
agentDid: string;
|
|
21
|
+
computeVersion: string;
|
|
22
|
+
openclawVersion?: string | undefined;
|
|
23
|
+
machineId?: string | undefined;
|
|
24
|
+
uptimeSeconds?: number | undefined;
|
|
25
|
+
memoryMb?: number | undefined;
|
|
26
|
+
}, {
|
|
27
|
+
status: "starting" | "running" | "error" | "stopping";
|
|
28
|
+
agentDid: string;
|
|
29
|
+
computeVersion: string;
|
|
30
|
+
openclawVersion?: string | undefined;
|
|
31
|
+
machineId?: string | undefined;
|
|
32
|
+
uptimeSeconds?: number | undefined;
|
|
33
|
+
memoryMb?: number | undefined;
|
|
34
|
+
}>;
|
|
35
|
+
type HeartbeatRequest = z.infer<typeof HeartbeatRequestSchema>;
|
|
36
|
+
declare const StopCommandSchema: z.ZodObject<{
|
|
37
|
+
type: z.ZodLiteral<"stop">;
|
|
38
|
+
}, "strict", z.ZodTypeAny, {
|
|
39
|
+
type: "stop";
|
|
40
|
+
}, {
|
|
41
|
+
type: "stop";
|
|
42
|
+
}>;
|
|
43
|
+
declare const RestartCommandSchema: z.ZodObject<{
|
|
44
|
+
type: z.ZodLiteral<"restart">;
|
|
45
|
+
}, "strict", z.ZodTypeAny, {
|
|
46
|
+
type: "restart";
|
|
47
|
+
}, {
|
|
48
|
+
type: "restart";
|
|
49
|
+
}>;
|
|
50
|
+
declare const UpdateConfigCommandSchema: z.ZodObject<{
|
|
51
|
+
type: z.ZodLiteral<"update_config">;
|
|
52
|
+
}, "strict", z.ZodTypeAny, {
|
|
53
|
+
type: "update_config";
|
|
54
|
+
}, {
|
|
55
|
+
type: "update_config";
|
|
56
|
+
}>;
|
|
57
|
+
declare const UpdateVersionCommandSchema: z.ZodObject<{
|
|
58
|
+
type: z.ZodLiteral<"update_version">;
|
|
59
|
+
payload: z.ZodObject<{
|
|
60
|
+
version: z.ZodString;
|
|
61
|
+
}, "strip", z.ZodTypeAny, {
|
|
62
|
+
version: string;
|
|
63
|
+
}, {
|
|
64
|
+
version: string;
|
|
65
|
+
}>;
|
|
66
|
+
}, "strict", z.ZodTypeAny, {
|
|
67
|
+
type: "update_version";
|
|
68
|
+
payload: {
|
|
69
|
+
version: string;
|
|
70
|
+
};
|
|
71
|
+
}, {
|
|
72
|
+
type: "update_version";
|
|
73
|
+
payload: {
|
|
74
|
+
version: string;
|
|
75
|
+
};
|
|
76
|
+
}>;
|
|
77
|
+
declare const ComputeCommandSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
78
|
+
type: z.ZodLiteral<"stop">;
|
|
79
|
+
}, "strict", z.ZodTypeAny, {
|
|
80
|
+
type: "stop";
|
|
81
|
+
}, {
|
|
82
|
+
type: "stop";
|
|
83
|
+
}>, z.ZodObject<{
|
|
84
|
+
type: z.ZodLiteral<"restart">;
|
|
85
|
+
}, "strict", z.ZodTypeAny, {
|
|
86
|
+
type: "restart";
|
|
87
|
+
}, {
|
|
88
|
+
type: "restart";
|
|
89
|
+
}>, z.ZodObject<{
|
|
90
|
+
type: z.ZodLiteral<"update_config">;
|
|
91
|
+
}, "strict", z.ZodTypeAny, {
|
|
92
|
+
type: "update_config";
|
|
93
|
+
}, {
|
|
94
|
+
type: "update_config";
|
|
95
|
+
}>, z.ZodObject<{
|
|
96
|
+
type: z.ZodLiteral<"update_version">;
|
|
97
|
+
payload: z.ZodObject<{
|
|
98
|
+
version: z.ZodString;
|
|
99
|
+
}, "strip", z.ZodTypeAny, {
|
|
100
|
+
version: string;
|
|
101
|
+
}, {
|
|
102
|
+
version: string;
|
|
103
|
+
}>;
|
|
104
|
+
}, "strict", z.ZodTypeAny, {
|
|
105
|
+
type: "update_version";
|
|
106
|
+
payload: {
|
|
107
|
+
version: string;
|
|
108
|
+
};
|
|
109
|
+
}, {
|
|
110
|
+
type: "update_version";
|
|
111
|
+
payload: {
|
|
112
|
+
version: string;
|
|
113
|
+
};
|
|
114
|
+
}>]>;
|
|
115
|
+
type ComputeCommand = z.infer<typeof ComputeCommandSchema>;
|
|
116
|
+
declare const HeartbeatResponseSchema: z.ZodObject<{
|
|
117
|
+
ack: z.ZodLiteral<true>;
|
|
118
|
+
commands: z.ZodDefault<z.ZodArray<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
119
|
+
type: z.ZodLiteral<"stop">;
|
|
120
|
+
}, "strict", z.ZodTypeAny, {
|
|
121
|
+
type: "stop";
|
|
122
|
+
}, {
|
|
123
|
+
type: "stop";
|
|
124
|
+
}>, z.ZodObject<{
|
|
125
|
+
type: z.ZodLiteral<"restart">;
|
|
126
|
+
}, "strict", z.ZodTypeAny, {
|
|
127
|
+
type: "restart";
|
|
128
|
+
}, {
|
|
129
|
+
type: "restart";
|
|
130
|
+
}>, z.ZodObject<{
|
|
131
|
+
type: z.ZodLiteral<"update_config">;
|
|
132
|
+
}, "strict", z.ZodTypeAny, {
|
|
133
|
+
type: "update_config";
|
|
134
|
+
}, {
|
|
135
|
+
type: "update_config";
|
|
136
|
+
}>, z.ZodObject<{
|
|
137
|
+
type: z.ZodLiteral<"update_version">;
|
|
138
|
+
payload: z.ZodObject<{
|
|
139
|
+
version: z.ZodString;
|
|
140
|
+
}, "strip", z.ZodTypeAny, {
|
|
141
|
+
version: string;
|
|
142
|
+
}, {
|
|
143
|
+
version: string;
|
|
144
|
+
}>;
|
|
145
|
+
}, "strict", z.ZodTypeAny, {
|
|
146
|
+
type: "update_version";
|
|
147
|
+
payload: {
|
|
148
|
+
version: string;
|
|
149
|
+
};
|
|
150
|
+
}, {
|
|
151
|
+
type: "update_version";
|
|
152
|
+
payload: {
|
|
153
|
+
version: string;
|
|
154
|
+
};
|
|
155
|
+
}>]>, "many">>;
|
|
156
|
+
configUpdatedAt: z.ZodOptional<z.ZodString>;
|
|
157
|
+
}, "strip", z.ZodTypeAny, {
|
|
158
|
+
ack: true;
|
|
159
|
+
commands: ({
|
|
160
|
+
type: "stop";
|
|
161
|
+
} | {
|
|
162
|
+
type: "restart";
|
|
163
|
+
} | {
|
|
164
|
+
type: "update_config";
|
|
165
|
+
} | {
|
|
166
|
+
type: "update_version";
|
|
167
|
+
payload: {
|
|
168
|
+
version: string;
|
|
169
|
+
};
|
|
170
|
+
})[];
|
|
171
|
+
configUpdatedAt?: string | undefined;
|
|
172
|
+
}, {
|
|
173
|
+
ack: true;
|
|
174
|
+
commands?: ({
|
|
175
|
+
type: "stop";
|
|
176
|
+
} | {
|
|
177
|
+
type: "restart";
|
|
178
|
+
} | {
|
|
179
|
+
type: "update_config";
|
|
180
|
+
} | {
|
|
181
|
+
type: "update_version";
|
|
182
|
+
payload: {
|
|
183
|
+
version: string;
|
|
184
|
+
};
|
|
185
|
+
})[] | undefined;
|
|
186
|
+
configUpdatedAt?: string | undefined;
|
|
187
|
+
}>;
|
|
188
|
+
type HeartbeatResponse = z.infer<typeof HeartbeatResponseSchema>;
|
|
189
|
+
declare const ConfigBundleSchema: z.ZodObject<{
|
|
190
|
+
version: z.ZodNumber;
|
|
191
|
+
killed: z.ZodBoolean;
|
|
192
|
+
openclawVersion: z.ZodString;
|
|
193
|
+
soulFile: z.ZodNullable<z.ZodString>;
|
|
194
|
+
gatewayToken: z.ZodString;
|
|
195
|
+
channels: z.ZodObject<{
|
|
196
|
+
telegram: z.ZodOptional<z.ZodObject<{
|
|
197
|
+
enabled: z.ZodBoolean;
|
|
198
|
+
token: z.ZodOptional<z.ZodString>;
|
|
199
|
+
}, "strip", z.ZodTypeAny, {
|
|
200
|
+
enabled: boolean;
|
|
201
|
+
token?: string | undefined;
|
|
202
|
+
}, {
|
|
203
|
+
enabled: boolean;
|
|
204
|
+
token?: string | undefined;
|
|
205
|
+
}>>;
|
|
206
|
+
discord: z.ZodOptional<z.ZodObject<{
|
|
207
|
+
enabled: z.ZodBoolean;
|
|
208
|
+
token: z.ZodOptional<z.ZodString>;
|
|
209
|
+
}, "strip", z.ZodTypeAny, {
|
|
210
|
+
enabled: boolean;
|
|
211
|
+
token?: string | undefined;
|
|
212
|
+
}, {
|
|
213
|
+
enabled: boolean;
|
|
214
|
+
token?: string | undefined;
|
|
215
|
+
}>>;
|
|
216
|
+
slack: z.ZodOptional<z.ZodObject<{
|
|
217
|
+
enabled: z.ZodBoolean;
|
|
218
|
+
token: z.ZodOptional<z.ZodString>;
|
|
219
|
+
appToken: z.ZodOptional<z.ZodString>;
|
|
220
|
+
}, "strip", z.ZodTypeAny, {
|
|
221
|
+
enabled: boolean;
|
|
222
|
+
token?: string | undefined;
|
|
223
|
+
appToken?: string | undefined;
|
|
224
|
+
}, {
|
|
225
|
+
enabled: boolean;
|
|
226
|
+
token?: string | undefined;
|
|
227
|
+
appToken?: string | undefined;
|
|
228
|
+
}>>;
|
|
229
|
+
whatsapp: z.ZodOptional<z.ZodObject<{
|
|
230
|
+
enabled: z.ZodBoolean;
|
|
231
|
+
}, "strict", z.ZodTypeAny, {
|
|
232
|
+
enabled: boolean;
|
|
233
|
+
}, {
|
|
234
|
+
enabled: boolean;
|
|
235
|
+
}>>;
|
|
236
|
+
}, "strip", z.ZodTypeAny, {
|
|
237
|
+
telegram?: {
|
|
238
|
+
enabled: boolean;
|
|
239
|
+
token?: string | undefined;
|
|
240
|
+
} | undefined;
|
|
241
|
+
discord?: {
|
|
242
|
+
enabled: boolean;
|
|
243
|
+
token?: string | undefined;
|
|
244
|
+
} | undefined;
|
|
245
|
+
slack?: {
|
|
246
|
+
enabled: boolean;
|
|
247
|
+
token?: string | undefined;
|
|
248
|
+
appToken?: string | undefined;
|
|
249
|
+
} | undefined;
|
|
250
|
+
whatsapp?: {
|
|
251
|
+
enabled: boolean;
|
|
252
|
+
} | undefined;
|
|
253
|
+
}, {
|
|
254
|
+
telegram?: {
|
|
255
|
+
enabled: boolean;
|
|
256
|
+
token?: string | undefined;
|
|
257
|
+
} | undefined;
|
|
258
|
+
discord?: {
|
|
259
|
+
enabled: boolean;
|
|
260
|
+
token?: string | undefined;
|
|
261
|
+
} | undefined;
|
|
262
|
+
slack?: {
|
|
263
|
+
enabled: boolean;
|
|
264
|
+
token?: string | undefined;
|
|
265
|
+
appToken?: string | undefined;
|
|
266
|
+
} | undefined;
|
|
267
|
+
whatsapp?: {
|
|
268
|
+
enabled: boolean;
|
|
269
|
+
} | undefined;
|
|
270
|
+
}>;
|
|
271
|
+
aiProvider: z.ZodObject<{
|
|
272
|
+
type: z.ZodEnum<["anthropic", "openai"]>;
|
|
273
|
+
apiKey: z.ZodString;
|
|
274
|
+
baseUrl: z.ZodOptional<z.ZodString>;
|
|
275
|
+
}, "strip", z.ZodTypeAny, {
|
|
276
|
+
type: "anthropic" | "openai";
|
|
277
|
+
apiKey: string;
|
|
278
|
+
baseUrl?: string | undefined;
|
|
279
|
+
}, {
|
|
280
|
+
type: "anthropic" | "openai";
|
|
281
|
+
apiKey: string;
|
|
282
|
+
baseUrl?: string | undefined;
|
|
283
|
+
}>;
|
|
284
|
+
heartbeatEvery: z.ZodOptional<z.ZodString>;
|
|
285
|
+
modelOverride: z.ZodOptional<z.ZodString>;
|
|
286
|
+
updatedAt: z.ZodString;
|
|
287
|
+
}, "strip", z.ZodTypeAny, {
|
|
288
|
+
openclawVersion: string;
|
|
289
|
+
version: number;
|
|
290
|
+
killed: boolean;
|
|
291
|
+
soulFile: string | null;
|
|
292
|
+
gatewayToken: string;
|
|
293
|
+
channels: {
|
|
294
|
+
telegram?: {
|
|
295
|
+
enabled: boolean;
|
|
296
|
+
token?: string | undefined;
|
|
297
|
+
} | undefined;
|
|
298
|
+
discord?: {
|
|
299
|
+
enabled: boolean;
|
|
300
|
+
token?: string | undefined;
|
|
301
|
+
} | undefined;
|
|
302
|
+
slack?: {
|
|
303
|
+
enabled: boolean;
|
|
304
|
+
token?: string | undefined;
|
|
305
|
+
appToken?: string | undefined;
|
|
306
|
+
} | undefined;
|
|
307
|
+
whatsapp?: {
|
|
308
|
+
enabled: boolean;
|
|
309
|
+
} | undefined;
|
|
310
|
+
};
|
|
311
|
+
aiProvider: {
|
|
312
|
+
type: "anthropic" | "openai";
|
|
313
|
+
apiKey: string;
|
|
314
|
+
baseUrl?: string | undefined;
|
|
315
|
+
};
|
|
316
|
+
updatedAt: string;
|
|
317
|
+
heartbeatEvery?: string | undefined;
|
|
318
|
+
modelOverride?: string | undefined;
|
|
319
|
+
}, {
|
|
320
|
+
openclawVersion: string;
|
|
321
|
+
version: number;
|
|
322
|
+
killed: boolean;
|
|
323
|
+
soulFile: string | null;
|
|
324
|
+
gatewayToken: string;
|
|
325
|
+
channels: {
|
|
326
|
+
telegram?: {
|
|
327
|
+
enabled: boolean;
|
|
328
|
+
token?: string | undefined;
|
|
329
|
+
} | undefined;
|
|
330
|
+
discord?: {
|
|
331
|
+
enabled: boolean;
|
|
332
|
+
token?: string | undefined;
|
|
333
|
+
} | undefined;
|
|
334
|
+
slack?: {
|
|
335
|
+
enabled: boolean;
|
|
336
|
+
token?: string | undefined;
|
|
337
|
+
appToken?: string | undefined;
|
|
338
|
+
} | undefined;
|
|
339
|
+
whatsapp?: {
|
|
340
|
+
enabled: boolean;
|
|
341
|
+
} | undefined;
|
|
342
|
+
};
|
|
343
|
+
aiProvider: {
|
|
344
|
+
type: "anthropic" | "openai";
|
|
345
|
+
apiKey: string;
|
|
346
|
+
baseUrl?: string | undefined;
|
|
347
|
+
};
|
|
348
|
+
updatedAt: string;
|
|
349
|
+
heartbeatEvery?: string | undefined;
|
|
350
|
+
modelOverride?: string | undefined;
|
|
351
|
+
}>;
|
|
352
|
+
type ConfigBundle = z.infer<typeof ConfigBundleSchema>;
|
|
353
|
+
declare const ControlStatusSchema: z.ZodObject<{
|
|
354
|
+
healthy: z.ZodBoolean;
|
|
355
|
+
uptimeSeconds: z.ZodNumber;
|
|
356
|
+
openclawVersion: z.ZodString;
|
|
357
|
+
computeVersion: z.ZodString;
|
|
358
|
+
activeConnections: z.ZodNumber;
|
|
359
|
+
memoryMb: z.ZodNumber;
|
|
360
|
+
cpuPercent: z.ZodNumber;
|
|
361
|
+
}, "strip", z.ZodTypeAny, {
|
|
362
|
+
computeVersion: string;
|
|
363
|
+
openclawVersion: string;
|
|
364
|
+
uptimeSeconds: number;
|
|
365
|
+
memoryMb: number;
|
|
366
|
+
healthy: boolean;
|
|
367
|
+
activeConnections: number;
|
|
368
|
+
cpuPercent: number;
|
|
369
|
+
}, {
|
|
370
|
+
computeVersion: string;
|
|
371
|
+
openclawVersion: string;
|
|
372
|
+
uptimeSeconds: number;
|
|
373
|
+
memoryMb: number;
|
|
374
|
+
healthy: boolean;
|
|
375
|
+
activeConnections: number;
|
|
376
|
+
cpuPercent: number;
|
|
377
|
+
}>;
|
|
378
|
+
type ControlStatus = z.infer<typeof ControlStatusSchema>;
|
|
379
|
+
|
|
380
|
+
export { type ComputeCommand, ComputeCommandSchema, type ConfigBundle, ConfigBundleSchema, type ControlStatus, ControlStatusSchema, DidStringSchema, type FlyRegion, FlyRegionSchema, type HeartbeatRequest, HeartbeatRequestSchema, type HeartbeatResponse, HeartbeatResponseSchema, type HostingMode, HostingModeSchema, type ManagedDeployStepStatus, ManagedDeployStepStatusSchema, RestartCommandSchema, StopCommandSchema, UpdateConfigCommandSchema, UpdateVersionCommandSchema };
|