@kvell007/embed-labs-shared-schemas 0.1.0-alpha.100
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/README.md +7 -0
- package/dist/index.d.ts +321 -0
- package/dist/index.js +835 -0
- package/dist/index.js.map +1 -0
- package/package.json +20 -0
package/README.md
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# @embed-labs/shared-schemas
|
|
2
|
+
|
|
3
|
+
Shared runtime schemas for EmbedLabs local identity, telemetry, optimization
|
|
4
|
+
reports, maintainer tasks, and release-channel metadata.
|
|
5
|
+
|
|
6
|
+
This package is used by the local CLI and Cloud API implementation. Normal users
|
|
7
|
+
install it indirectly through the `embedlabs` CLI package.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,321 @@
|
|
|
1
|
+
export type AppMode = "server" | "local_release" | "local_dev" | "maintainer";
|
|
2
|
+
export type ReleaseChannel = "stable" | "beta" | "dev" | "internal";
|
|
3
|
+
export type TelemetryLevel = "debug" | "info" | "warn" | "error";
|
|
4
|
+
export type ConsentStatus = "granted" | "denied" | "unknown";
|
|
5
|
+
export type OptimizationReportCategory = "server_api_error" | "local_tool_error" | "agent_issue" | "user_suggestion" | "local_learning_suggestion" | "hardware_detection_issue" | "knowledge_gap" | "release_regression" | "security_issue" | "performance_issue";
|
|
6
|
+
export type OptimizationSeverity = "low" | "medium" | "high" | "critical";
|
|
7
|
+
export type OptimizationItemStatus = "new" | "triaged" | "accepted" | "in_progress" | "fixed" | "released" | "ignored" | "duplicate";
|
|
8
|
+
export type MaintainerTaskStatus = "queued" | "claimed" | "running" | "submitted" | "approved" | "rejected" | "released";
|
|
9
|
+
export type MaintainerTaskRunStatus = "succeeded" | "failed";
|
|
10
|
+
export type FixProposalStatus = "draft" | "submitted" | "approved" | "rejected";
|
|
11
|
+
export type ReleasePromotionStatus = "proposed" | "approved" | "publishing" | "published" | "rolled_back";
|
|
12
|
+
export type EmbedLabsPermission = "client:report" | "client:read_own_reports" | "admin:read_reports" | "admin:manage_backlog" | "admin:approve_fix" | "admin:approve_release" | "maintainer:pull_task" | "maintainer:update_task" | "maintainer:submit_fix_result" | "maintainer:read_context_bundle";
|
|
13
|
+
export interface RuntimeModeConfig {
|
|
14
|
+
app_mode: AppMode;
|
|
15
|
+
release_channel: ReleaseChannel;
|
|
16
|
+
enable_maintainer: boolean;
|
|
17
|
+
enable_local_code_repair: boolean;
|
|
18
|
+
enable_telemetry: boolean;
|
|
19
|
+
enable_report_upload: boolean;
|
|
20
|
+
permissions: EmbedLabsPermission[];
|
|
21
|
+
}
|
|
22
|
+
export interface ClientInstallation {
|
|
23
|
+
installation_id: string;
|
|
24
|
+
account_id?: string;
|
|
25
|
+
user_id?: string;
|
|
26
|
+
client_name: string;
|
|
27
|
+
client_version: string;
|
|
28
|
+
platform: string;
|
|
29
|
+
arch: string;
|
|
30
|
+
app_mode: AppMode;
|
|
31
|
+
release_channel: ReleaseChannel;
|
|
32
|
+
install_source?: string;
|
|
33
|
+
locale?: string;
|
|
34
|
+
timezone?: string;
|
|
35
|
+
telemetry_consent?: ConsentStatus;
|
|
36
|
+
report_upload_consent?: ConsentStatus;
|
|
37
|
+
installed_at?: string;
|
|
38
|
+
last_seen_at: string;
|
|
39
|
+
metadata?: Record<string, unknown>;
|
|
40
|
+
}
|
|
41
|
+
export interface DeviceProfile {
|
|
42
|
+
device_profile_id: string;
|
|
43
|
+
account_id?: string;
|
|
44
|
+
client_installation_id?: string;
|
|
45
|
+
local_device_id?: string;
|
|
46
|
+
client_device_id?: string;
|
|
47
|
+
board_id?: string;
|
|
48
|
+
variant_id?: string;
|
|
49
|
+
display_name?: string;
|
|
50
|
+
kind?: string;
|
|
51
|
+
transport?: string;
|
|
52
|
+
platform?: string;
|
|
53
|
+
arch?: string;
|
|
54
|
+
identity_confidence?: "hardware" | "locator_only" | "user_supplied" | "unknown";
|
|
55
|
+
identity_hash?: string;
|
|
56
|
+
locators?: Record<string, unknown>[];
|
|
57
|
+
capabilities?: string[];
|
|
58
|
+
firmware_version?: string;
|
|
59
|
+
observed_at: string;
|
|
60
|
+
metadata?: Record<string, unknown>;
|
|
61
|
+
}
|
|
62
|
+
export interface TelemetryEvent {
|
|
63
|
+
event_id: string;
|
|
64
|
+
account_id?: string;
|
|
65
|
+
user_id?: string;
|
|
66
|
+
client_device_id?: string;
|
|
67
|
+
local_device_id?: string;
|
|
68
|
+
client_installation_id?: string;
|
|
69
|
+
device_profile_id?: string;
|
|
70
|
+
event_type: string;
|
|
71
|
+
level: TelemetryLevel;
|
|
72
|
+
message?: string;
|
|
73
|
+
observed_at: string;
|
|
74
|
+
payload?: Record<string, unknown>;
|
|
75
|
+
redaction_version: string;
|
|
76
|
+
}
|
|
77
|
+
export interface OptimizationEvidence {
|
|
78
|
+
evidence_id: string;
|
|
79
|
+
kind: "log" | "error" | "request" | "response" | "screenshot" | "device_snapshot" | "knowledge_snippet" | "user_text" | "metadata";
|
|
80
|
+
label?: string;
|
|
81
|
+
redacted_text?: string;
|
|
82
|
+
payload?: Record<string, unknown>;
|
|
83
|
+
content_sha256?: string;
|
|
84
|
+
local_path_redacted?: string;
|
|
85
|
+
captured_at: string;
|
|
86
|
+
}
|
|
87
|
+
export interface OptimizationReport {
|
|
88
|
+
report_id: string;
|
|
89
|
+
account_id?: string;
|
|
90
|
+
user_id?: string;
|
|
91
|
+
client_device_id?: string;
|
|
92
|
+
local_device_id?: string;
|
|
93
|
+
client_installation?: ClientInstallation;
|
|
94
|
+
device_profile?: DeviceProfile;
|
|
95
|
+
category: OptimizationReportCategory;
|
|
96
|
+
severity: OptimizationSeverity;
|
|
97
|
+
source: "client" | "mcp" | "server" | "admin" | "maintainer";
|
|
98
|
+
title: string;
|
|
99
|
+
description: string;
|
|
100
|
+
expected_behavior?: string;
|
|
101
|
+
actual_behavior?: string;
|
|
102
|
+
steps_to_reproduce?: string[];
|
|
103
|
+
error_code?: string;
|
|
104
|
+
component?: string;
|
|
105
|
+
board_id?: string;
|
|
106
|
+
variant_id?: string;
|
|
107
|
+
release_channel: ReleaseChannel;
|
|
108
|
+
client_name?: string;
|
|
109
|
+
client_version?: string;
|
|
110
|
+
observed_at: string;
|
|
111
|
+
evidence: OptimizationEvidence[];
|
|
112
|
+
tags?: string[];
|
|
113
|
+
fingerprint: string;
|
|
114
|
+
redaction_version: string;
|
|
115
|
+
metadata?: Record<string, unknown>;
|
|
116
|
+
}
|
|
117
|
+
export interface UserSuggestionReport {
|
|
118
|
+
suggestion_id: string;
|
|
119
|
+
account_id?: string;
|
|
120
|
+
user_id?: string;
|
|
121
|
+
client_installation_id?: string;
|
|
122
|
+
title: string;
|
|
123
|
+
description: string;
|
|
124
|
+
category?: string;
|
|
125
|
+
board_id?: string;
|
|
126
|
+
priority_hint?: OptimizationSeverity;
|
|
127
|
+
created_at: string;
|
|
128
|
+
metadata?: Record<string, unknown>;
|
|
129
|
+
}
|
|
130
|
+
export interface LocalLearningSuggestion {
|
|
131
|
+
learning_id: string;
|
|
132
|
+
account_id?: string;
|
|
133
|
+
client_installation_id?: string;
|
|
134
|
+
board_id?: string;
|
|
135
|
+
topic: string;
|
|
136
|
+
current_answer?: string;
|
|
137
|
+
proposed_answer: string;
|
|
138
|
+
evidence?: OptimizationEvidence[];
|
|
139
|
+
confidence?: number;
|
|
140
|
+
created_at: string;
|
|
141
|
+
metadata?: Record<string, unknown>;
|
|
142
|
+
}
|
|
143
|
+
export interface OptimizationItem {
|
|
144
|
+
optimization_item_id: string;
|
|
145
|
+
fingerprint: string;
|
|
146
|
+
status: OptimizationItemStatus;
|
|
147
|
+
category: OptimizationReportCategory;
|
|
148
|
+
severity: OptimizationSeverity;
|
|
149
|
+
priority_score: number;
|
|
150
|
+
title: string;
|
|
151
|
+
summary: string;
|
|
152
|
+
affected_component?: string;
|
|
153
|
+
board_id?: string;
|
|
154
|
+
variant_id?: string;
|
|
155
|
+
report_count: number;
|
|
156
|
+
first_seen_at: string;
|
|
157
|
+
last_seen_at: string;
|
|
158
|
+
last_report_id?: string;
|
|
159
|
+
assigned_to?: string;
|
|
160
|
+
duplicate_of?: string;
|
|
161
|
+
tags?: string[];
|
|
162
|
+
metadata?: Record<string, unknown>;
|
|
163
|
+
}
|
|
164
|
+
export interface MaintainerTask {
|
|
165
|
+
maintainer_task_id: string;
|
|
166
|
+
optimization_item_id: string;
|
|
167
|
+
status: MaintainerTaskStatus;
|
|
168
|
+
title: string;
|
|
169
|
+
context_bundle_ref?: string;
|
|
170
|
+
branch_name?: string;
|
|
171
|
+
claimed_by?: string;
|
|
172
|
+
created_at: string;
|
|
173
|
+
updated_at: string;
|
|
174
|
+
metadata?: Record<string, unknown>;
|
|
175
|
+
}
|
|
176
|
+
export interface MaintainerTaskRun {
|
|
177
|
+
maintainer_task_run_id: string;
|
|
178
|
+
maintainer_task_id: string;
|
|
179
|
+
status: MaintainerTaskRunStatus;
|
|
180
|
+
summary: string;
|
|
181
|
+
changed_files: Array<string | Record<string, unknown>>;
|
|
182
|
+
test_results: Array<string | Record<string, unknown>>;
|
|
183
|
+
failure_report?: Record<string, unknown>;
|
|
184
|
+
created_by?: Record<string, unknown>;
|
|
185
|
+
created_at: string;
|
|
186
|
+
metadata?: Record<string, unknown>;
|
|
187
|
+
}
|
|
188
|
+
export interface FixProposal {
|
|
189
|
+
fix_proposal_id: string;
|
|
190
|
+
optimization_item_id: string;
|
|
191
|
+
maintainer_task_id?: string;
|
|
192
|
+
status: FixProposalStatus;
|
|
193
|
+
summary: string;
|
|
194
|
+
branch_name?: string;
|
|
195
|
+
diff_summary?: string;
|
|
196
|
+
tests_run?: string[];
|
|
197
|
+
created_at: string;
|
|
198
|
+
submitted_at?: string;
|
|
199
|
+
metadata?: Record<string, unknown>;
|
|
200
|
+
}
|
|
201
|
+
export interface FixExecutionResult {
|
|
202
|
+
fix_execution_result_id: string;
|
|
203
|
+
fix_proposal_id: string;
|
|
204
|
+
ok: boolean;
|
|
205
|
+
command?: string;
|
|
206
|
+
output_redacted?: string;
|
|
207
|
+
duration_ms?: number;
|
|
208
|
+
created_at: string;
|
|
209
|
+
metadata?: Record<string, unknown>;
|
|
210
|
+
}
|
|
211
|
+
export interface ReleasePromotion {
|
|
212
|
+
release_promotion_id: string;
|
|
213
|
+
fix_proposal_id?: string;
|
|
214
|
+
optimization_item_ids?: string[];
|
|
215
|
+
channel: ReleaseChannel;
|
|
216
|
+
status: ReleasePromotionStatus;
|
|
217
|
+
version?: string;
|
|
218
|
+
approved_by?: string;
|
|
219
|
+
created_at: string;
|
|
220
|
+
published_at?: string;
|
|
221
|
+
metadata?: Record<string, unknown>;
|
|
222
|
+
}
|
|
223
|
+
export interface ClientHandshakeRequest {
|
|
224
|
+
installation?: Partial<ClientInstallation>;
|
|
225
|
+
device_profile?: Partial<DeviceProfile>;
|
|
226
|
+
telemetry_consent?: ConsentStatus;
|
|
227
|
+
report_upload_consent?: ConsentStatus;
|
|
228
|
+
}
|
|
229
|
+
export interface ClientHandshakeResult {
|
|
230
|
+
installation: ClientInstallation;
|
|
231
|
+
device_profile?: DeviceProfile;
|
|
232
|
+
server_time: string;
|
|
233
|
+
client_config: RuntimeModeConfig;
|
|
234
|
+
feature_flags: Record<string, boolean | string>;
|
|
235
|
+
plugin_policy: {
|
|
236
|
+
local_mcp_required_for_hardware: boolean;
|
|
237
|
+
server_model_without_plugin_is_plain_model_api: boolean;
|
|
238
|
+
};
|
|
239
|
+
mode_boundary: string;
|
|
240
|
+
}
|
|
241
|
+
export interface ValidationError {
|
|
242
|
+
code: string;
|
|
243
|
+
message: string;
|
|
244
|
+
details?: unknown;
|
|
245
|
+
}
|
|
246
|
+
export type ValidationResult<T> = {
|
|
247
|
+
ok: true;
|
|
248
|
+
data: T;
|
|
249
|
+
} | {
|
|
250
|
+
ok: false;
|
|
251
|
+
error: ValidationError;
|
|
252
|
+
};
|
|
253
|
+
export interface OptimizationAggregationInput {
|
|
254
|
+
existing?: OptimizationItem;
|
|
255
|
+
report: OptimizationReport;
|
|
256
|
+
now?: string;
|
|
257
|
+
}
|
|
258
|
+
export declare function runtimeModeFromEnv(env: Record<string, string | undefined>, options?: {
|
|
259
|
+
defaultAppMode?: AppMode;
|
|
260
|
+
defaultReleaseChannel?: ReleaseChannel;
|
|
261
|
+
}): RuntimeModeConfig;
|
|
262
|
+
export declare function permissionsForAppMode(appMode: AppMode, flags?: {
|
|
263
|
+
enableMaintainer?: boolean;
|
|
264
|
+
enableLocalCodeRepair?: boolean;
|
|
265
|
+
enableReportUpload?: boolean;
|
|
266
|
+
}): EmbedLabsPermission[];
|
|
267
|
+
export declare function hasPermission(config: RuntimeModeConfig, permission: EmbedLabsPermission): boolean;
|
|
268
|
+
export declare function validateClientHandshake(input: unknown, context?: {
|
|
269
|
+
now?: string;
|
|
270
|
+
account_id?: string;
|
|
271
|
+
user_id?: string;
|
|
272
|
+
app_mode?: AppMode;
|
|
273
|
+
release_channel?: ReleaseChannel;
|
|
274
|
+
}): ValidationResult<ClientHandshakeRequest>;
|
|
275
|
+
export declare function buildClientHandshakeResult(input: ClientHandshakeRequest, config: RuntimeModeConfig, context?: {
|
|
276
|
+
now?: string;
|
|
277
|
+
account_id?: string;
|
|
278
|
+
user_id?: string;
|
|
279
|
+
client_device_id?: string;
|
|
280
|
+
}): ClientHandshakeResult;
|
|
281
|
+
export declare function validateOptimizationReport(input: unknown, context?: {
|
|
282
|
+
now?: string;
|
|
283
|
+
account_id?: string;
|
|
284
|
+
user_id?: string;
|
|
285
|
+
client_device_id?: string;
|
|
286
|
+
release_channel?: ReleaseChannel;
|
|
287
|
+
source?: OptimizationReport["source"];
|
|
288
|
+
}): ValidationResult<OptimizationReport>;
|
|
289
|
+
export declare function validateTelemetryEvent(input: unknown, context?: {
|
|
290
|
+
now?: string;
|
|
291
|
+
account_id?: string;
|
|
292
|
+
user_id?: string;
|
|
293
|
+
client_device_id?: string;
|
|
294
|
+
}): ValidationResult<TelemetryEvent>;
|
|
295
|
+
export declare function userSuggestionToOptimizationReport(input: unknown, context?: Parameters<typeof validateOptimizationReport>[1]): ValidationResult<OptimizationReport>;
|
|
296
|
+
export declare function deriveOptimizationFingerprint(report: Pick<OptimizationReport, "category" | "error_code" | "component" | "board_id" | "variant_id" | "title" | "description">): string;
|
|
297
|
+
export declare function scoreOptimizationPriority(input: {
|
|
298
|
+
severity: OptimizationSeverity;
|
|
299
|
+
report_count: number;
|
|
300
|
+
category?: OptimizationReportCategory;
|
|
301
|
+
release_channel?: ReleaseChannel;
|
|
302
|
+
last_seen_at?: string;
|
|
303
|
+
}): number;
|
|
304
|
+
export declare function aggregateOptimizationReport(input: OptimizationAggregationInput): OptimizationItem;
|
|
305
|
+
export declare function redactSensitiveText(text: string): string;
|
|
306
|
+
export declare function redactRecordDeep<T>(value: T): T;
|
|
307
|
+
export declare function normalizeClientInstallation(input: Partial<ClientInstallation> | undefined, context: {
|
|
308
|
+
now: string;
|
|
309
|
+
account_id?: string;
|
|
310
|
+
user_id?: string;
|
|
311
|
+
app_mode: AppMode;
|
|
312
|
+
release_channel: ReleaseChannel;
|
|
313
|
+
telemetry_consent?: ConsentStatus;
|
|
314
|
+
report_upload_consent?: ConsentStatus;
|
|
315
|
+
}): ClientInstallation;
|
|
316
|
+
export declare function normalizeDeviceProfile(input: Partial<DeviceProfile>, context: {
|
|
317
|
+
now: string;
|
|
318
|
+
account_id?: string;
|
|
319
|
+
client_installation_id?: string;
|
|
320
|
+
client_device_id?: string;
|
|
321
|
+
}): DeviceProfile;
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,835 @@
|
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
2
|
+
const redactionVersion = "embed-redaction-v1";
|
|
3
|
+
const maxEvidenceItems = 12;
|
|
4
|
+
export function runtimeModeFromEnv(env, options = {}) {
|
|
5
|
+
const appMode = parseAppMode(env.APP_MODE, options.defaultAppMode ?? "local_release");
|
|
6
|
+
const releaseChannel = parseReleaseChannel(env.RELEASE_CHANNEL, options.defaultReleaseChannel ?? "stable");
|
|
7
|
+
const enableMaintainer = booleanEnvValue(env.ENABLE_MAINTAINER, false);
|
|
8
|
+
const enableLocalCodeRepair = booleanEnvValue(env.ENABLE_LOCAL_CODE_REPAIR, false);
|
|
9
|
+
const enableTelemetry = booleanEnvValue(env.ENABLE_TELEMETRY, true);
|
|
10
|
+
const enableReportUpload = booleanEnvValue(env.ENABLE_REPORT_UPLOAD, true);
|
|
11
|
+
return {
|
|
12
|
+
app_mode: appMode,
|
|
13
|
+
release_channel: releaseChannel,
|
|
14
|
+
enable_maintainer: enableMaintainer,
|
|
15
|
+
enable_local_code_repair: enableLocalCodeRepair,
|
|
16
|
+
enable_telemetry: enableTelemetry,
|
|
17
|
+
enable_report_upload: enableReportUpload,
|
|
18
|
+
permissions: permissionsForAppMode(appMode, {
|
|
19
|
+
enableMaintainer,
|
|
20
|
+
enableLocalCodeRepair,
|
|
21
|
+
enableReportUpload
|
|
22
|
+
})
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
export function permissionsForAppMode(appMode, flags = {}) {
|
|
26
|
+
const permissions = new Set();
|
|
27
|
+
if (flags.enableReportUpload !== false) {
|
|
28
|
+
permissions.add("client:report");
|
|
29
|
+
permissions.add("client:read_own_reports");
|
|
30
|
+
}
|
|
31
|
+
if (appMode === "server") {
|
|
32
|
+
permissions.add("admin:read_reports");
|
|
33
|
+
permissions.add("admin:manage_backlog");
|
|
34
|
+
permissions.add("admin:approve_fix");
|
|
35
|
+
permissions.add("admin:approve_release");
|
|
36
|
+
}
|
|
37
|
+
if ((appMode === "server" || appMode === "maintainer") && flags.enableMaintainer === true) {
|
|
38
|
+
permissions.add("maintainer:pull_task");
|
|
39
|
+
permissions.add("maintainer:update_task");
|
|
40
|
+
permissions.add("maintainer:submit_fix_result");
|
|
41
|
+
permissions.add("maintainer:read_context_bundle");
|
|
42
|
+
}
|
|
43
|
+
return [...permissions];
|
|
44
|
+
}
|
|
45
|
+
export function hasPermission(config, permission) {
|
|
46
|
+
return config.permissions.includes(permission);
|
|
47
|
+
}
|
|
48
|
+
export function validateClientHandshake(input, context = {}) {
|
|
49
|
+
if (!isRecord(input)) {
|
|
50
|
+
return invalid("invalid_request", "Client handshake body must be a JSON object.");
|
|
51
|
+
}
|
|
52
|
+
const installation = input.installation === undefined
|
|
53
|
+
? undefined
|
|
54
|
+
: parsePartialClientInstallation(input.installation, context);
|
|
55
|
+
if (installation && !installation.ok) {
|
|
56
|
+
return installation;
|
|
57
|
+
}
|
|
58
|
+
const deviceProfile = input.device_profile === undefined
|
|
59
|
+
? undefined
|
|
60
|
+
: parsePartialDeviceProfile(input.device_profile, context);
|
|
61
|
+
if (deviceProfile && !deviceProfile.ok) {
|
|
62
|
+
return deviceProfile;
|
|
63
|
+
}
|
|
64
|
+
const telemetryConsent = optionalConsentStatus(input.telemetry_consent);
|
|
65
|
+
if (input.telemetry_consent !== undefined && !telemetryConsent) {
|
|
66
|
+
return invalid("invalid_request", "telemetry_consent must be granted, denied, or unknown.");
|
|
67
|
+
}
|
|
68
|
+
const reportUploadConsent = optionalConsentStatus(input.report_upload_consent);
|
|
69
|
+
if (input.report_upload_consent !== undefined && !reportUploadConsent) {
|
|
70
|
+
return invalid("invalid_request", "report_upload_consent must be granted, denied, or unknown.");
|
|
71
|
+
}
|
|
72
|
+
return valid({
|
|
73
|
+
installation: installation?.data,
|
|
74
|
+
device_profile: deviceProfile?.data,
|
|
75
|
+
telemetry_consent: telemetryConsent,
|
|
76
|
+
report_upload_consent: reportUploadConsent
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
export function buildClientHandshakeResult(input, config, context = {}) {
|
|
80
|
+
const now = context.now ?? new Date().toISOString();
|
|
81
|
+
const installation = normalizeClientInstallation(input.installation, {
|
|
82
|
+
now,
|
|
83
|
+
account_id: context.account_id,
|
|
84
|
+
user_id: context.user_id,
|
|
85
|
+
app_mode: config.app_mode,
|
|
86
|
+
release_channel: config.release_channel,
|
|
87
|
+
telemetry_consent: input.telemetry_consent,
|
|
88
|
+
report_upload_consent: input.report_upload_consent
|
|
89
|
+
});
|
|
90
|
+
const deviceProfile = input.device_profile
|
|
91
|
+
? normalizeDeviceProfile(input.device_profile, {
|
|
92
|
+
now,
|
|
93
|
+
account_id: context.account_id,
|
|
94
|
+
client_installation_id: installation.installation_id,
|
|
95
|
+
client_device_id: context.client_device_id
|
|
96
|
+
})
|
|
97
|
+
: undefined;
|
|
98
|
+
return {
|
|
99
|
+
installation,
|
|
100
|
+
device_profile: deviceProfile,
|
|
101
|
+
server_time: now,
|
|
102
|
+
client_config: config,
|
|
103
|
+
feature_flags: {
|
|
104
|
+
report_upload: config.enable_report_upload,
|
|
105
|
+
telemetry: config.enable_telemetry,
|
|
106
|
+
maintainer: config.enable_maintainer,
|
|
107
|
+
local_code_repair: config.enable_local_code_repair,
|
|
108
|
+
release_channel: config.release_channel
|
|
109
|
+
},
|
|
110
|
+
plugin_policy: {
|
|
111
|
+
local_mcp_required_for_hardware: true,
|
|
112
|
+
server_model_without_plugin_is_plain_model_api: true
|
|
113
|
+
},
|
|
114
|
+
mode_boundary: "server stores redacted reports, backlog, admin review, maintainer tasks, routing diagnostics, and release metadata; local release clients operate local hardware/toolchains and can only upload redacted reports."
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
export function validateOptimizationReport(input, context = {}) {
|
|
118
|
+
if (!isRecord(input)) {
|
|
119
|
+
return invalid("invalid_request", "Optimization report body must be a JSON object.");
|
|
120
|
+
}
|
|
121
|
+
if (input.account_id !== undefined || input.api_key_id !== undefined) {
|
|
122
|
+
return invalid("retired_platform_account_field", "Optimization reports must use local installation and device identifiers; account_id and api_key_id are removed.");
|
|
123
|
+
}
|
|
124
|
+
const category = parseOptimizationReportCategory(input.category);
|
|
125
|
+
if (!category) {
|
|
126
|
+
return invalid("invalid_request", "category is required and must be a supported optimization report category.");
|
|
127
|
+
}
|
|
128
|
+
const title = requiredString(input.title, 180);
|
|
129
|
+
if (!title) {
|
|
130
|
+
return invalid("invalid_request", "title is required and must be at most 180 characters.");
|
|
131
|
+
}
|
|
132
|
+
const description = requiredString(input.description, 6000);
|
|
133
|
+
if (!description) {
|
|
134
|
+
return invalid("invalid_request", "description is required and must be at most 6000 characters.");
|
|
135
|
+
}
|
|
136
|
+
const severity = parseOptimizationSeverity(input.severity) ?? "medium";
|
|
137
|
+
const now = context.now ?? new Date().toISOString();
|
|
138
|
+
const evidence = parseEvidenceList(input.evidence, now);
|
|
139
|
+
if (!evidence.ok) {
|
|
140
|
+
return evidence;
|
|
141
|
+
}
|
|
142
|
+
const installation = input.client_installation === undefined
|
|
143
|
+
? undefined
|
|
144
|
+
: parsePartialClientInstallation(input.client_installation, { now, account_id: context.account_id, user_id: context.user_id, release_channel: context.release_channel });
|
|
145
|
+
if (installation && !installation.ok) {
|
|
146
|
+
return installation;
|
|
147
|
+
}
|
|
148
|
+
const deviceProfile = input.device_profile === undefined
|
|
149
|
+
? undefined
|
|
150
|
+
: parsePartialDeviceProfile(input.device_profile, { now, account_id: context.account_id });
|
|
151
|
+
if (deviceProfile && !deviceProfile.ok) {
|
|
152
|
+
return deviceProfile;
|
|
153
|
+
}
|
|
154
|
+
const report = {
|
|
155
|
+
report_id: optionalSafeId(input.report_id, "report") ?? makeId("report"),
|
|
156
|
+
account_id: undefined,
|
|
157
|
+
user_id: optionalString(context.user_id ?? input.user_id, 120),
|
|
158
|
+
client_device_id: optionalString(context.client_device_id ?? input.client_device_id, 180),
|
|
159
|
+
local_device_id: optionalString(input.local_device_id, 180),
|
|
160
|
+
client_installation: installation?.data
|
|
161
|
+
? normalizeClientInstallation(installation.data, {
|
|
162
|
+
now,
|
|
163
|
+
account_id: undefined,
|
|
164
|
+
user_id: context.user_id,
|
|
165
|
+
app_mode: installation.data.app_mode ?? "local_release",
|
|
166
|
+
release_channel: installation.data.release_channel ?? context.release_channel ?? "stable"
|
|
167
|
+
})
|
|
168
|
+
: undefined,
|
|
169
|
+
device_profile: deviceProfile?.data
|
|
170
|
+
? normalizeDeviceProfile(deviceProfile.data, {
|
|
171
|
+
now,
|
|
172
|
+
account_id: undefined,
|
|
173
|
+
client_installation_id: installation?.data?.installation_id,
|
|
174
|
+
client_device_id: context.client_device_id
|
|
175
|
+
})
|
|
176
|
+
: undefined,
|
|
177
|
+
category,
|
|
178
|
+
severity,
|
|
179
|
+
source: parseReportSource(input.source) ?? context.source ?? "client",
|
|
180
|
+
title: redactSensitiveText(title),
|
|
181
|
+
description: redactSensitiveText(description),
|
|
182
|
+
expected_behavior: optionalRedactedString(input.expected_behavior, 4000),
|
|
183
|
+
actual_behavior: optionalRedactedString(input.actual_behavior, 4000),
|
|
184
|
+
steps_to_reproduce: parseStringArray(input.steps_to_reproduce, 12, 1000)?.map(redactSensitiveText),
|
|
185
|
+
error_code: optionalString(input.error_code, 120),
|
|
186
|
+
component: optionalString(input.component, 120),
|
|
187
|
+
board_id: optionalString(input.board_id, 120),
|
|
188
|
+
variant_id: optionalString(input.variant_id, 120),
|
|
189
|
+
release_channel: parseReleaseChannel(input.release_channel, context.release_channel ?? "stable"),
|
|
190
|
+
client_name: optionalString(input.client_name, 80),
|
|
191
|
+
client_version: optionalString(input.client_version, 80),
|
|
192
|
+
observed_at: optionalIsoDate(input.observed_at) ?? now,
|
|
193
|
+
evidence: evidence.data,
|
|
194
|
+
tags: parseStringArray(input.tags, 16, 64),
|
|
195
|
+
fingerprint: "",
|
|
196
|
+
redaction_version: redactionVersion,
|
|
197
|
+
metadata: optionalRedactedRecord(input.metadata)
|
|
198
|
+
};
|
|
199
|
+
report.fingerprint = optionalString(input.fingerprint, 96) ?? deriveOptimizationFingerprint(report);
|
|
200
|
+
return valid(report);
|
|
201
|
+
}
|
|
202
|
+
export function validateTelemetryEvent(input, context = {}) {
|
|
203
|
+
if (!isRecord(input)) {
|
|
204
|
+
return invalid("invalid_request", "Telemetry event body must be a JSON object.");
|
|
205
|
+
}
|
|
206
|
+
if (input.account_id !== undefined || input.api_key_id !== undefined) {
|
|
207
|
+
return invalid("retired_platform_account_field", "Telemetry events must use local installation and device identifiers; account_id and api_key_id are removed.");
|
|
208
|
+
}
|
|
209
|
+
const eventType = requiredString(input.event_type ?? input.type, 160);
|
|
210
|
+
if (!eventType) {
|
|
211
|
+
return invalid("invalid_request", "event_type is required and must be at most 160 characters.");
|
|
212
|
+
}
|
|
213
|
+
const level = parseTelemetryLevel(input.level) ?? "info";
|
|
214
|
+
return valid({
|
|
215
|
+
event_id: optionalSafeId(input.event_id, "telemetry") ?? makeId("telemetry"),
|
|
216
|
+
account_id: undefined,
|
|
217
|
+
user_id: optionalString(context.user_id ?? input.user_id, 120),
|
|
218
|
+
client_device_id: optionalString(context.client_device_id ?? input.client_device_id, 180),
|
|
219
|
+
local_device_id: optionalString(input.local_device_id, 180),
|
|
220
|
+
client_installation_id: optionalString(input.client_installation_id, 180),
|
|
221
|
+
device_profile_id: optionalString(input.device_profile_id, 180),
|
|
222
|
+
event_type: eventType,
|
|
223
|
+
level,
|
|
224
|
+
message: optionalRedactedString(input.message, 2000),
|
|
225
|
+
observed_at: optionalIsoDate(input.observed_at) ?? context.now ?? new Date().toISOString(),
|
|
226
|
+
payload: optionalRedactedRecord(input.payload),
|
|
227
|
+
redaction_version: redactionVersion
|
|
228
|
+
});
|
|
229
|
+
}
|
|
230
|
+
export function userSuggestionToOptimizationReport(input, context = {}) {
|
|
231
|
+
if (!isRecord(input)) {
|
|
232
|
+
return invalid("invalid_request", "User suggestion body must be a JSON object.");
|
|
233
|
+
}
|
|
234
|
+
return validateOptimizationReport({
|
|
235
|
+
...input,
|
|
236
|
+
category: "user_suggestion",
|
|
237
|
+
severity: input.priority_hint ?? input.severity ?? "low",
|
|
238
|
+
description: input.description ?? input.suggestion,
|
|
239
|
+
source: "client"
|
|
240
|
+
}, context);
|
|
241
|
+
}
|
|
242
|
+
export function deriveOptimizationFingerprint(report) {
|
|
243
|
+
const normalizedTitle = normalizeFingerprintText(report.title);
|
|
244
|
+
const normalizedDescription = normalizeFingerprintText(report.description).slice(0, 320);
|
|
245
|
+
return createHash("sha256").update([
|
|
246
|
+
report.category,
|
|
247
|
+
report.error_code ?? "",
|
|
248
|
+
report.component ?? "",
|
|
249
|
+
report.board_id ?? "",
|
|
250
|
+
report.variant_id ?? "",
|
|
251
|
+
normalizedTitle,
|
|
252
|
+
normalizedDescription
|
|
253
|
+
].join("|")).digest("hex");
|
|
254
|
+
}
|
|
255
|
+
export function scoreOptimizationPriority(input) {
|
|
256
|
+
const severityScore = {
|
|
257
|
+
low: 10,
|
|
258
|
+
medium: 30,
|
|
259
|
+
high: 65,
|
|
260
|
+
critical: 100
|
|
261
|
+
};
|
|
262
|
+
const categoryBonus = input.category === "security_issue" ? 30
|
|
263
|
+
: input.category === "release_regression" ? 25
|
|
264
|
+
: input.category === "server_api_error" ? 15
|
|
265
|
+
: input.category === "hardware_detection_issue" ? 12
|
|
266
|
+
: 0;
|
|
267
|
+
const channelBonus = input.release_channel === "stable" ? 10 : input.release_channel === "beta" ? 5 : 0;
|
|
268
|
+
const frequencyBonus = Math.min(40, Math.max(0, input.report_count - 1) * 5);
|
|
269
|
+
return Math.min(200, severityScore[input.severity] + categoryBonus + channelBonus + frequencyBonus);
|
|
270
|
+
}
|
|
271
|
+
export function aggregateOptimizationReport(input) {
|
|
272
|
+
const now = input.now ?? new Date().toISOString();
|
|
273
|
+
const report = input.report;
|
|
274
|
+
if (!input.existing) {
|
|
275
|
+
return {
|
|
276
|
+
optimization_item_id: makeId("opt_item"),
|
|
277
|
+
fingerprint: report.fingerprint,
|
|
278
|
+
status: "new",
|
|
279
|
+
category: report.category,
|
|
280
|
+
severity: report.severity,
|
|
281
|
+
priority_score: scoreOptimizationPriority({
|
|
282
|
+
severity: report.severity,
|
|
283
|
+
report_count: 1,
|
|
284
|
+
category: report.category,
|
|
285
|
+
release_channel: report.release_channel,
|
|
286
|
+
last_seen_at: report.observed_at
|
|
287
|
+
}),
|
|
288
|
+
title: report.title,
|
|
289
|
+
summary: report.description.slice(0, 1000),
|
|
290
|
+
affected_component: report.component,
|
|
291
|
+
board_id: report.board_id,
|
|
292
|
+
variant_id: report.variant_id,
|
|
293
|
+
report_count: 1,
|
|
294
|
+
first_seen_at: report.observed_at || now,
|
|
295
|
+
last_seen_at: report.observed_at || now,
|
|
296
|
+
last_report_id: report.report_id,
|
|
297
|
+
tags: report.tags,
|
|
298
|
+
metadata: {
|
|
299
|
+
last_source: report.source,
|
|
300
|
+
client_name: report.client_name,
|
|
301
|
+
client_version: report.client_version,
|
|
302
|
+
release_channel: report.release_channel,
|
|
303
|
+
last_release_channel: report.release_channel
|
|
304
|
+
}
|
|
305
|
+
};
|
|
306
|
+
}
|
|
307
|
+
const severity = higherSeverity(input.existing.severity, report.severity);
|
|
308
|
+
const reportCount = input.existing.report_count + 1;
|
|
309
|
+
return {
|
|
310
|
+
...input.existing,
|
|
311
|
+
category: input.existing.category,
|
|
312
|
+
severity,
|
|
313
|
+
priority_score: scoreOptimizationPriority({
|
|
314
|
+
severity,
|
|
315
|
+
report_count: reportCount,
|
|
316
|
+
category: input.existing.category,
|
|
317
|
+
release_channel: report.release_channel,
|
|
318
|
+
last_seen_at: report.observed_at
|
|
319
|
+
}),
|
|
320
|
+
report_count: reportCount,
|
|
321
|
+
last_seen_at: report.observed_at || now,
|
|
322
|
+
last_report_id: report.report_id,
|
|
323
|
+
tags: mergeTags(input.existing.tags, report.tags),
|
|
324
|
+
metadata: {
|
|
325
|
+
...(input.existing.metadata ?? {}),
|
|
326
|
+
last_source: report.source,
|
|
327
|
+
last_client_name: report.client_name,
|
|
328
|
+
last_client_version: report.client_version,
|
|
329
|
+
last_release_channel: report.release_channel
|
|
330
|
+
}
|
|
331
|
+
};
|
|
332
|
+
}
|
|
333
|
+
export function redactSensitiveText(text) {
|
|
334
|
+
let redacted = text;
|
|
335
|
+
redacted = redactBulkPrivateTextLabels(redacted);
|
|
336
|
+
redacted = redactLikelySourceText(redacted);
|
|
337
|
+
redacted = redacted.replace(/\bDO_NOT_(?:COPY|UPLOAD|SYNC|SHARE|EXFILTRATE)[A-Z0-9_-]*\b/g, "[redacted:private_marker]");
|
|
338
|
+
redacted = redacted.replace(/-----BEGIN [A-Z ]*PRIVATE KEY-----[\s\S]*?-----END [A-Z ]*PRIVATE KEY-----/g, "[redacted:ssh_private_key]");
|
|
339
|
+
redacted = redacted.replace(/\b(?:sk|pk|rk|re)[_-][A-Za-z0-9][A-Za-z0-9_-]{7,}\b/g, "[redacted:api_key]");
|
|
340
|
+
redacted = redacted.replace(/\bnpm_[A-Za-z0-9][A-Za-z0-9_-]{7,}\b/g, "[redacted:npm_token]");
|
|
341
|
+
redacted = redacted.replace(/\bBearer\s+[A-Za-z0-9._~+/-]{16,}=*/gi, "Bearer [redacted:bearer]");
|
|
342
|
+
redacted = redacted.replace(/\b[A-Z][A-Z0-9_]*(?:API[_-]?KEY|TOKEN|SECRET|PASSWORD|AUTHORIZATION)[A-Z0-9_]*\b\s*[:=]\s*(["']?)[^\s"',;]+/g, "[redacted:secret]");
|
|
343
|
+
redacted = redacted.replace(/\b[A-Z][A-Z0-9_]*(?:API[_-]?KEY|TOKEN|SECRET|PASSWORD|AUTHORIZATION)[A-Z0-9_]*\b/g, "[redacted:secret_name]");
|
|
344
|
+
redacted = redacted.replace(/((?:api[_-]?key|token|password|secret|authorization)\s*[:=]\s*)(["']?)[^\s"',;]+/gi, "$1$2[redacted:secret]");
|
|
345
|
+
redacted = redacted.replace(/((?:serial(?:[_-]?number)?|usb[_-]?serial)\s*[:=]\s*)(["']?)[^\s"',;]+/gi, "$1$2[redacted:serial]");
|
|
346
|
+
redacted = redacted.replace(/((?:IOPlatformUUID|MachineGuid|machine[_-]?id|hardware[_-]?id|raw[_-]?hardware[_-]?id|fingerprint[_-]?hash)\s*[:=]\s*)(["']?)[A-Fa-f0-9][A-Fa-f0-9:-]{15,}/g, "$1$2[redacted:hardware_id]");
|
|
347
|
+
redacted = redacted.replace(/\b[0-9A-Fa-f]{2}(?::[0-9A-Fa-f]{2}){5}\b/g, "[redacted:mac]");
|
|
348
|
+
redacted = redacted.replace(/\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}\b/gi, "[redacted:email]");
|
|
349
|
+
redacted = redactLocalNetworkUrls(redacted);
|
|
350
|
+
redacted = redacted.replace(/\bfe80::[0-9a-f:]+(?:%[A-Za-z0-9_.-]+)?\b/gi, "[redacted:ip]");
|
|
351
|
+
redacted = redacted.replace(/\/dev\/(?:cu|tty)\.[A-Za-z0-9_.-]+/g, "[redacted:serial_path]");
|
|
352
|
+
redacted = redacted.replace(/\bCOM\d+\b/gi, "[redacted:serial_port]");
|
|
353
|
+
redacted = redacted.replace(/\/Users\/[^/\s"'`]+/g, "/Users/[redacted:user]");
|
|
354
|
+
redacted = redacted.replace(/\/home\/[^/\s"'`]+/g, "/home/[redacted:user]");
|
|
355
|
+
redacted = redacted.replace(/C:\\Users\\[^\\\s"'`]+/gi, "C:\\Users\\[redacted:user]");
|
|
356
|
+
redacted = redacted.replace(/(^|[\s"'`=:(\[{,;])\/(?:Users|home)\/\[redacted:user\][^\s"'`<>),;\]}]*/g, "$1[local-path]");
|
|
357
|
+
redacted = redacted.replace(/(^|[\s"'`=:(\[{,;])\/(?:Users|Volumes|private|var\/folders|tmp|home|root|opt)\/[^\s"'`<>),;\]}]+/g, "$1[local-path]");
|
|
358
|
+
redacted = redacted.replace(/(^|[\s"'`=:(\[{,;])[A-Za-z]:\\Users\\\[redacted:user\](?:\\[^\s"'`<>),;\]}]+)*/gi, "$1[local-path]");
|
|
359
|
+
redacted = redacted.replace(/(^|[\s"'`=:(\[{,;])[A-Za-z]:\\[^\s"'`<>),;\]}]+/g, "$1[local-path]");
|
|
360
|
+
redacted = redacted.replace(/\b(?:\d{1,3}\.){3}\d{1,3}\b/g, "[redacted:ip]");
|
|
361
|
+
return redacted;
|
|
362
|
+
}
|
|
363
|
+
function redactLikelySourceText(text) {
|
|
364
|
+
let redacted = text;
|
|
365
|
+
redacted = redacted.replace(/```[^\n\r]*(?:\r?\n[\s\S]*?)?```/g, "```text\n[redacted:source_code]\n```");
|
|
366
|
+
redacted = redacted.replace(/(^|[\r\n])\s*#\s*(?:include|define|ifdef|ifndef|if|endif|pragma)\b[^\r\n]*/g, "$1[redacted:source_code]");
|
|
367
|
+
redacted = redacted.replace(/\b(?:static\s+|inline\s+|const\s+|volatile\s+|unsigned\s+|signed\s+)*(?:void|int|char|short|long|float|double|bool|size_t|ssize_t|uint(?:8|16|32|64)_t|int(?:8|16|32|64)_t)\s+[*\s]*[A-Za-z_][A-Za-z0-9_]*\s*\([^()\r\n;]{0,200}\)\s*\{[^{}]{0,1000}\}/g, "[redacted:source_code]");
|
|
368
|
+
redacted = redacted.replace(/\b(?:function\s+[A-Za-z_$][A-Za-z0-9_$]*\s*\([^)\r\n]{0,200}\)|(?:const|let|var)\s+[A-Za-z_$][A-Za-z0-9_$]*\s*=\s*(?:async\s*)?\([^)\r\n]{0,200}\)\s*=>)\s*\{[^{}]{0,1000}\}/g, "[redacted:source_code]");
|
|
369
|
+
return redacted;
|
|
370
|
+
}
|
|
371
|
+
function shouldRedactSourceContentField(lower, raw) {
|
|
372
|
+
if (lower.includes("source_code") || lower === "file_content") {
|
|
373
|
+
return true;
|
|
374
|
+
}
|
|
375
|
+
if (lower !== "code" || typeof raw !== "string") {
|
|
376
|
+
return false;
|
|
377
|
+
}
|
|
378
|
+
return looksLikeSourceCodeText(raw);
|
|
379
|
+
}
|
|
380
|
+
function looksLikeSourceCodeText(value) {
|
|
381
|
+
const text = value.trim();
|
|
382
|
+
if (text.length < 12) {
|
|
383
|
+
return false;
|
|
384
|
+
}
|
|
385
|
+
return /```/.test(text)
|
|
386
|
+
|| /^\s*#\s*(?:include|define|ifdef|ifndef|if|endif|pragma)\b/m.test(text)
|
|
387
|
+
|| /\bfunction\s+[A-Za-z_$][A-Za-z0-9_$]*\s*\(/.test(text)
|
|
388
|
+
|| /\b(?:const|let|var)\s+[A-Za-z_$][A-Za-z0-9_$]*\s*=/.test(text)
|
|
389
|
+
|| /\b(?:class|struct|enum)\s+[A-Za-z_][A-Za-z0-9_]*\b/.test(text)
|
|
390
|
+
|| /\b(?:void|int|char|short|long|float|double|bool|size_t|ssize_t|uint(?:8|16|32|64)_t|int(?:8|16|32|64)_t)\s+[*\s]*[A-Za-z_][A-Za-z0-9_]*\s*\([^()\r\n;]{0,200}\)\s*\{/.test(text)
|
|
391
|
+
|| (/[{};]/.test(text) && /\b(?:return|if|else|for|while|switch|case|import|export|require)\b/.test(text));
|
|
392
|
+
}
|
|
393
|
+
function redactBulkPrivateTextLabels(text) {
|
|
394
|
+
const labels = [
|
|
395
|
+
"raw_prompt",
|
|
396
|
+
"prompt",
|
|
397
|
+
"private_prompt",
|
|
398
|
+
"conversation",
|
|
399
|
+
"raw_conversation",
|
|
400
|
+
"conversation_history",
|
|
401
|
+
"chat_history",
|
|
402
|
+
"model_messages",
|
|
403
|
+
"messages",
|
|
404
|
+
"raw_model_response",
|
|
405
|
+
"raw_response",
|
|
406
|
+
"full_log",
|
|
407
|
+
"raw_log",
|
|
408
|
+
"console_log",
|
|
409
|
+
"serial_log",
|
|
410
|
+
"serial_output",
|
|
411
|
+
"uart_log",
|
|
412
|
+
"uart_output",
|
|
413
|
+
"terminal_log",
|
|
414
|
+
"terminal_output"
|
|
415
|
+
].join("|");
|
|
416
|
+
const boundary = "(^|[\\r\\n;,{])";
|
|
417
|
+
const key = `\\s*([\"']?(?:${labels})[\"']?)\\s*[:=]\\s*`;
|
|
418
|
+
const value = "([^\\r\\n}\\]]*)";
|
|
419
|
+
return text.replace(new RegExp(`${boundary}${key}${value}`, "gi"), (_match, prefix, label) => {
|
|
420
|
+
const separator = label.startsWith("\"") || label.startsWith("'") ? ": " : ": ";
|
|
421
|
+
return `${prefix}${label}${separator}[redacted:private_context]`;
|
|
422
|
+
});
|
|
423
|
+
}
|
|
424
|
+
function redactLocalNetworkUrls(text) {
|
|
425
|
+
return text.replace(/https?:\/\/(?:\[[^\]]+\]|[A-Za-z0-9.-]+)(?::\d+)?(?:\/[^\s"'<>),;\]}]*)?/g, (match) => {
|
|
426
|
+
try {
|
|
427
|
+
const url = new URL(match);
|
|
428
|
+
const host = url.hostname.toLowerCase().replace(/^\[|\]$/g, "");
|
|
429
|
+
if (isLocalNetworkHost(host)) {
|
|
430
|
+
return "[local-bridge-url]";
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
catch {
|
|
434
|
+
return match;
|
|
435
|
+
}
|
|
436
|
+
return match;
|
|
437
|
+
});
|
|
438
|
+
}
|
|
439
|
+
function isLocalNetworkHost(host) {
|
|
440
|
+
return host === "localhost"
|
|
441
|
+
|| host === "127.0.0.1"
|
|
442
|
+
|| host === "::1"
|
|
443
|
+
|| host.endsWith(".local")
|
|
444
|
+
|| host.startsWith("fe80:")
|
|
445
|
+
|| isPrivateIpv4Host(host);
|
|
446
|
+
}
|
|
447
|
+
function isPrivateIpv4Host(host) {
|
|
448
|
+
const parts = host.split(".").map((part) => Number(part));
|
|
449
|
+
if (parts.length !== 4 || parts.some((part) => !Number.isInteger(part) || part < 0 || part > 255)) {
|
|
450
|
+
return false;
|
|
451
|
+
}
|
|
452
|
+
return parts[0] === 10
|
|
453
|
+
|| (parts[0] === 172 && parts[1] >= 16 && parts[1] <= 31)
|
|
454
|
+
|| (parts[0] === 192 && parts[1] === 168)
|
|
455
|
+
|| (parts[0] === 169 && parts[1] === 254)
|
|
456
|
+
|| (parts[0] === 100 && parts[1] >= 64 && parts[1] <= 127);
|
|
457
|
+
}
|
|
458
|
+
export function redactRecordDeep(value) {
|
|
459
|
+
if (typeof value === "string") {
|
|
460
|
+
return redactSensitiveText(value);
|
|
461
|
+
}
|
|
462
|
+
if (Array.isArray(value)) {
|
|
463
|
+
return value.slice(0, 100).map((item) => redactRecordDeep(item));
|
|
464
|
+
}
|
|
465
|
+
if (!isRecord(value)) {
|
|
466
|
+
return value;
|
|
467
|
+
}
|
|
468
|
+
const output = {};
|
|
469
|
+
for (const [key, raw] of Object.entries(value)) {
|
|
470
|
+
const lower = key.toLowerCase();
|
|
471
|
+
if (shouldDropOrRedactField(lower)) {
|
|
472
|
+
output[key] = "[redacted]";
|
|
473
|
+
}
|
|
474
|
+
else if (shouldRedactBulkPrivateField(lower)) {
|
|
475
|
+
output[key] = "[redacted:private_context]";
|
|
476
|
+
}
|
|
477
|
+
else if (shouldRedactSourceContentField(lower, raw)) {
|
|
478
|
+
output[key] = "[redacted:source_code]";
|
|
479
|
+
}
|
|
480
|
+
else if (lower.includes("path")) {
|
|
481
|
+
output[key] = typeof raw === "string" ? redactSensitiveText(raw) : "[redacted:path]";
|
|
482
|
+
}
|
|
483
|
+
else {
|
|
484
|
+
output[key] = redactRecordDeep(raw);
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
return output;
|
|
488
|
+
}
|
|
489
|
+
export function normalizeClientInstallation(input, context) {
|
|
490
|
+
return {
|
|
491
|
+
installation_id: optionalSafeId(input?.installation_id, "install") ?? makeId("install"),
|
|
492
|
+
account_id: undefined,
|
|
493
|
+
user_id: context.user_id ?? input?.user_id,
|
|
494
|
+
client_name: input?.client_name || "embedlabs",
|
|
495
|
+
client_version: input?.client_version || "unknown",
|
|
496
|
+
platform: input?.platform || process.platform,
|
|
497
|
+
arch: input?.arch || process.arch,
|
|
498
|
+
app_mode: input?.app_mode ?? context.app_mode,
|
|
499
|
+
release_channel: input?.release_channel ?? context.release_channel,
|
|
500
|
+
install_source: input?.install_source,
|
|
501
|
+
locale: input?.locale,
|
|
502
|
+
timezone: input?.timezone,
|
|
503
|
+
telemetry_consent: context.telemetry_consent ?? input?.telemetry_consent ?? "unknown",
|
|
504
|
+
report_upload_consent: context.report_upload_consent ?? input?.report_upload_consent ?? "unknown",
|
|
505
|
+
installed_at: input?.installed_at,
|
|
506
|
+
last_seen_at: context.now,
|
|
507
|
+
metadata: optionalRedactedRecord(input?.metadata)
|
|
508
|
+
};
|
|
509
|
+
}
|
|
510
|
+
export function normalizeDeviceProfile(input, context) {
|
|
511
|
+
const identityPayload = JSON.stringify(redactRecordDeep({
|
|
512
|
+
board_id: input.board_id,
|
|
513
|
+
variant_id: input.variant_id,
|
|
514
|
+
local_device_id: input.local_device_id,
|
|
515
|
+
kind: input.kind,
|
|
516
|
+
locators: input.locators
|
|
517
|
+
}));
|
|
518
|
+
return {
|
|
519
|
+
device_profile_id: optionalSafeId(input.device_profile_id, "device_profile") ?? makeId("device_profile"),
|
|
520
|
+
account_id: undefined,
|
|
521
|
+
client_installation_id: context.client_installation_id ?? input.client_installation_id,
|
|
522
|
+
local_device_id: input.local_device_id,
|
|
523
|
+
client_device_id: context.client_device_id ?? input.client_device_id,
|
|
524
|
+
board_id: input.board_id,
|
|
525
|
+
variant_id: input.variant_id,
|
|
526
|
+
display_name: input.display_name,
|
|
527
|
+
kind: input.kind,
|
|
528
|
+
transport: input.transport,
|
|
529
|
+
platform: input.platform,
|
|
530
|
+
arch: input.arch,
|
|
531
|
+
identity_confidence: input.identity_confidence ?? "unknown",
|
|
532
|
+
identity_hash: input.identity_hash ?? createHash("sha256").update(identityPayload).digest("hex"),
|
|
533
|
+
locators: Array.isArray(input.locators) ? redactedRecordList(input.locators) : undefined,
|
|
534
|
+
capabilities: input.capabilities?.slice(0, 80),
|
|
535
|
+
firmware_version: input.firmware_version,
|
|
536
|
+
observed_at: input.observed_at ?? context.now,
|
|
537
|
+
metadata: optionalRedactedRecord(input.metadata)
|
|
538
|
+
};
|
|
539
|
+
}
|
|
540
|
+
function parsePartialClientInstallation(value, context) {
|
|
541
|
+
if (!isRecord(value)) {
|
|
542
|
+
return invalid("invalid_request", "client_installation must be a JSON object.");
|
|
543
|
+
}
|
|
544
|
+
if (value.account_id !== undefined) {
|
|
545
|
+
return invalid("retired_platform_account_field", "client_installation.account_id is removed. Use installation_id and client_device_id.");
|
|
546
|
+
}
|
|
547
|
+
const appMode = value.app_mode === undefined ? context.app_mode : parseAppMode(value.app_mode);
|
|
548
|
+
if (value.app_mode !== undefined && !appMode) {
|
|
549
|
+
return invalid("invalid_request", "client_installation.app_mode is invalid.");
|
|
550
|
+
}
|
|
551
|
+
const releaseChannel = value.release_channel === undefined ? context.release_channel : parseReleaseChannel(value.release_channel);
|
|
552
|
+
if (value.release_channel !== undefined && !releaseChannel) {
|
|
553
|
+
return invalid("invalid_request", "client_installation.release_channel is invalid.");
|
|
554
|
+
}
|
|
555
|
+
return valid({
|
|
556
|
+
installation_id: optionalSafeId(value.installation_id, "install"),
|
|
557
|
+
account_id: undefined,
|
|
558
|
+
user_id: optionalString(context.user_id ?? value.user_id, 120),
|
|
559
|
+
client_name: optionalString(value.client_name, 80),
|
|
560
|
+
client_version: optionalString(value.client_version, 80),
|
|
561
|
+
platform: optionalString(value.platform, 60),
|
|
562
|
+
arch: optionalString(value.arch, 60),
|
|
563
|
+
app_mode: appMode,
|
|
564
|
+
release_channel: releaseChannel,
|
|
565
|
+
install_source: optionalString(value.install_source, 80),
|
|
566
|
+
locale: optionalString(value.locale, 40),
|
|
567
|
+
timezone: optionalString(value.timezone, 80),
|
|
568
|
+
telemetry_consent: optionalConsentStatus(value.telemetry_consent),
|
|
569
|
+
report_upload_consent: optionalConsentStatus(value.report_upload_consent),
|
|
570
|
+
installed_at: optionalIsoDate(value.installed_at),
|
|
571
|
+
last_seen_at: optionalIsoDate(value.last_seen_at) ?? context.now,
|
|
572
|
+
metadata: optionalRedactedRecord(value.metadata)
|
|
573
|
+
});
|
|
574
|
+
}
|
|
575
|
+
function parsePartialDeviceProfile(value, context) {
|
|
576
|
+
if (!isRecord(value)) {
|
|
577
|
+
return invalid("invalid_request", "device_profile must be a JSON object.");
|
|
578
|
+
}
|
|
579
|
+
if (value.account_id !== undefined) {
|
|
580
|
+
return invalid("retired_platform_account_field", "device_profile.account_id is removed. Use client_installation_id, client_device_id, and local_device_id.");
|
|
581
|
+
}
|
|
582
|
+
return valid({
|
|
583
|
+
device_profile_id: optionalSafeId(value.device_profile_id, "device_profile"),
|
|
584
|
+
account_id: undefined,
|
|
585
|
+
client_installation_id: optionalString(value.client_installation_id, 180),
|
|
586
|
+
local_device_id: optionalString(value.local_device_id, 180),
|
|
587
|
+
client_device_id: optionalString(value.client_device_id, 180),
|
|
588
|
+
board_id: optionalString(value.board_id, 120),
|
|
589
|
+
variant_id: optionalString(value.variant_id, 120),
|
|
590
|
+
display_name: optionalString(value.display_name, 160),
|
|
591
|
+
kind: optionalString(value.kind, 80),
|
|
592
|
+
transport: optionalString(value.transport, 80),
|
|
593
|
+
platform: optionalString(value.platform, 60),
|
|
594
|
+
arch: optionalString(value.arch, 60),
|
|
595
|
+
identity_confidence: parseIdentityConfidence(value.identity_confidence),
|
|
596
|
+
identity_hash: optionalString(value.identity_hash, 160),
|
|
597
|
+
locators: Array.isArray(value.locators) ? redactedRecordList(value.locators.slice(0, 20)) : undefined,
|
|
598
|
+
capabilities: parseStringArray(value.capabilities, 80, 120),
|
|
599
|
+
firmware_version: optionalString(value.firmware_version, 80),
|
|
600
|
+
observed_at: optionalIsoDate(value.observed_at) ?? context.now,
|
|
601
|
+
metadata: optionalRedactedRecord(value.metadata)
|
|
602
|
+
});
|
|
603
|
+
}
|
|
604
|
+
function parseEvidenceList(value, now) {
|
|
605
|
+
if (value === undefined) {
|
|
606
|
+
return valid([]);
|
|
607
|
+
}
|
|
608
|
+
if (!Array.isArray(value)) {
|
|
609
|
+
return invalid("invalid_request", "evidence must be an array.");
|
|
610
|
+
}
|
|
611
|
+
const evidence = [];
|
|
612
|
+
for (const item of value.slice(0, maxEvidenceItems)) {
|
|
613
|
+
if (!isRecord(item)) {
|
|
614
|
+
return invalid("invalid_request", "Each evidence item must be a JSON object.");
|
|
615
|
+
}
|
|
616
|
+
const kind = parseEvidenceKind(item.kind);
|
|
617
|
+
if (!kind) {
|
|
618
|
+
return invalid("invalid_request", "evidence.kind is required and unsupported.");
|
|
619
|
+
}
|
|
620
|
+
const redactedText = optionalRedactedString(item.redacted_text ?? item.text ?? item.message, 8000);
|
|
621
|
+
evidence.push({
|
|
622
|
+
evidence_id: optionalSafeId(item.evidence_id, "evidence") ?? makeId("evidence"),
|
|
623
|
+
kind,
|
|
624
|
+
label: optionalString(item.label, 120),
|
|
625
|
+
redacted_text: redactedText,
|
|
626
|
+
payload: optionalRedactedRecord(item.payload),
|
|
627
|
+
content_sha256: optionalString(item.content_sha256, 96) ?? (redactedText ? createHash("sha256").update(redactedText).digest("hex") : undefined),
|
|
628
|
+
local_path_redacted: optionalRedactedString(item.local_path_redacted ?? item.path, 1000),
|
|
629
|
+
captured_at: optionalIsoDate(item.captured_at) ?? now
|
|
630
|
+
});
|
|
631
|
+
}
|
|
632
|
+
return valid(evidence);
|
|
633
|
+
}
|
|
634
|
+
function shouldDropOrRedactField(lowerKey) {
|
|
635
|
+
return lowerKey === "api_key"
|
|
636
|
+
|| lowerKey === "token"
|
|
637
|
+
|| lowerKey === "password"
|
|
638
|
+
|| lowerKey === "authorization"
|
|
639
|
+
|| lowerKey === "secret"
|
|
640
|
+
|| lowerKey === "hostname"
|
|
641
|
+
|| lowerKey === "email"
|
|
642
|
+
|| lowerKey === "ip"
|
|
643
|
+
|| lowerKey === "serial"
|
|
644
|
+
|| lowerKey === "serial_number"
|
|
645
|
+
|| lowerKey === "usb_serial"
|
|
646
|
+
|| lowerKey.endsWith("_serial")
|
|
647
|
+
|| lowerKey === "mac"
|
|
648
|
+
|| lowerKey === "mac_address"
|
|
649
|
+
|| lowerKey === "machine_id"
|
|
650
|
+
|| lowerKey === "machineguid"
|
|
651
|
+
|| lowerKey === "ioplatformuuid"
|
|
652
|
+
|| lowerKey === "hardware_id"
|
|
653
|
+
|| lowerKey === "raw_hardware_id"
|
|
654
|
+
|| lowerKey === "fingerprint_hash"
|
|
655
|
+
|| lowerKey === "public_key_sha256"
|
|
656
|
+
|| lowerKey === "hostname_hash"
|
|
657
|
+
|| lowerKey.endsWith("_key")
|
|
658
|
+
|| lowerKey.endsWith("_token")
|
|
659
|
+
|| lowerKey.endsWith("_secret")
|
|
660
|
+
|| lowerKey.endsWith("_password")
|
|
661
|
+
|| lowerKey.includes("private_key")
|
|
662
|
+
|| lowerKey.includes("dotenv")
|
|
663
|
+
|| lowerKey.includes(".env");
|
|
664
|
+
}
|
|
665
|
+
function shouldRedactBulkPrivateField(lowerKey) {
|
|
666
|
+
return lowerKey === "raw_prompt"
|
|
667
|
+
|| lowerKey === "prompt"
|
|
668
|
+
|| lowerKey === "private_prompt"
|
|
669
|
+
|| lowerKey === "conversation"
|
|
670
|
+
|| lowerKey === "raw_conversation"
|
|
671
|
+
|| lowerKey === "conversation_history"
|
|
672
|
+
|| lowerKey === "chat_history"
|
|
673
|
+
|| lowerKey === "model_messages"
|
|
674
|
+
|| lowerKey === "messages"
|
|
675
|
+
|| lowerKey === "raw_model_response"
|
|
676
|
+
|| lowerKey === "raw_response"
|
|
677
|
+
|| lowerKey === "full_log"
|
|
678
|
+
|| lowerKey === "raw_log"
|
|
679
|
+
|| lowerKey === "console_log"
|
|
680
|
+
|| lowerKey === "serial_log"
|
|
681
|
+
|| lowerKey === "serial_output"
|
|
682
|
+
|| lowerKey === "uart_log"
|
|
683
|
+
|| lowerKey === "uart_output"
|
|
684
|
+
|| lowerKey === "terminal_log"
|
|
685
|
+
|| lowerKey === "terminal_output"
|
|
686
|
+
|| lowerKey.endsWith("_raw_prompt")
|
|
687
|
+
|| lowerKey.endsWith("_conversation")
|
|
688
|
+
|| lowerKey.endsWith("_chat_history")
|
|
689
|
+
|| lowerKey.endsWith("_model_messages")
|
|
690
|
+
|| lowerKey.endsWith("_raw_log")
|
|
691
|
+
|| lowerKey.endsWith("_console_log")
|
|
692
|
+
|| lowerKey.endsWith("_serial_log")
|
|
693
|
+
|| lowerKey.endsWith("_serial_output")
|
|
694
|
+
|| lowerKey.endsWith("_uart_log")
|
|
695
|
+
|| lowerKey.endsWith("_uart_output")
|
|
696
|
+
|| lowerKey.endsWith("_terminal_log")
|
|
697
|
+
|| lowerKey.endsWith("_terminal_output");
|
|
698
|
+
}
|
|
699
|
+
function optionalRedactedRecord(value) {
|
|
700
|
+
return isRecord(value) ? redactRecordDeep(value) : undefined;
|
|
701
|
+
}
|
|
702
|
+
function redactedRecordList(value) {
|
|
703
|
+
const records = value.flatMap((item) => isRecord(item) ? [redactRecordDeep(item)] : []);
|
|
704
|
+
return records.length > 0 ? records : undefined;
|
|
705
|
+
}
|
|
706
|
+
function parseAppMode(value, fallback) {
|
|
707
|
+
return value === "server" || value === "local_release" || value === "local_dev" || value === "maintainer" ? value : fallback;
|
|
708
|
+
}
|
|
709
|
+
function parseReleaseChannel(value, fallback) {
|
|
710
|
+
return value === "stable" || value === "beta" || value === "dev" || value === "internal" ? value : fallback;
|
|
711
|
+
}
|
|
712
|
+
function parseOptimizationReportCategory(value) {
|
|
713
|
+
return value === "server_api_error"
|
|
714
|
+
|| value === "local_tool_error"
|
|
715
|
+
|| value === "agent_issue"
|
|
716
|
+
|| value === "user_suggestion"
|
|
717
|
+
|| value === "local_learning_suggestion"
|
|
718
|
+
|| value === "hardware_detection_issue"
|
|
719
|
+
|| value === "knowledge_gap"
|
|
720
|
+
|| value === "release_regression"
|
|
721
|
+
|| value === "security_issue"
|
|
722
|
+
|| value === "performance_issue"
|
|
723
|
+
? value
|
|
724
|
+
: undefined;
|
|
725
|
+
}
|
|
726
|
+
function parseOptimizationSeverity(value) {
|
|
727
|
+
return value === "low" || value === "medium" || value === "high" || value === "critical" ? value : undefined;
|
|
728
|
+
}
|
|
729
|
+
function parseTelemetryLevel(value) {
|
|
730
|
+
return value === "debug" || value === "info" || value === "warn" || value === "error" ? value : undefined;
|
|
731
|
+
}
|
|
732
|
+
function parseReportSource(value) {
|
|
733
|
+
return value === "client" || value === "mcp" || value === "server" || value === "admin" || value === "maintainer" ? value : undefined;
|
|
734
|
+
}
|
|
735
|
+
function parseIdentityConfidence(value) {
|
|
736
|
+
return value === "hardware" || value === "locator_only" || value === "user_supplied" || value === "unknown" ? value : undefined;
|
|
737
|
+
}
|
|
738
|
+
function parseEvidenceKind(value) {
|
|
739
|
+
return value === "log"
|
|
740
|
+
|| value === "error"
|
|
741
|
+
|| value === "request"
|
|
742
|
+
|| value === "response"
|
|
743
|
+
|| value === "screenshot"
|
|
744
|
+
|| value === "device_snapshot"
|
|
745
|
+
|| value === "knowledge_snippet"
|
|
746
|
+
|| value === "user_text"
|
|
747
|
+
|| value === "metadata"
|
|
748
|
+
? value
|
|
749
|
+
: undefined;
|
|
750
|
+
}
|
|
751
|
+
function higherSeverity(left, right) {
|
|
752
|
+
const order = ["low", "medium", "high", "critical"];
|
|
753
|
+
return order.indexOf(right) > order.indexOf(left) ? right : left;
|
|
754
|
+
}
|
|
755
|
+
function mergeTags(left, right) {
|
|
756
|
+
const values = [...(left ?? []), ...(right ?? [])].filter(Boolean);
|
|
757
|
+
const unique = [...new Set(values)].slice(0, 24);
|
|
758
|
+
return unique.length > 0 ? unique : undefined;
|
|
759
|
+
}
|
|
760
|
+
function normalizeFingerprintText(value) {
|
|
761
|
+
return redactSensitiveText(value).toLowerCase().replace(/[0-9a-f]{8,}/g, "<hex>").replace(/\d+/g, "<num>").replace(/\s+/g, " ").trim();
|
|
762
|
+
}
|
|
763
|
+
function parseStringArray(value, maxItems, maxLength) {
|
|
764
|
+
if (value === undefined) {
|
|
765
|
+
return undefined;
|
|
766
|
+
}
|
|
767
|
+
if (!Array.isArray(value)) {
|
|
768
|
+
return undefined;
|
|
769
|
+
}
|
|
770
|
+
const items = value
|
|
771
|
+
.flatMap((item) => typeof item === "string" && item.trim() ? [item.trim().slice(0, maxLength)] : [])
|
|
772
|
+
.slice(0, maxItems);
|
|
773
|
+
return items.length > 0 ? items : undefined;
|
|
774
|
+
}
|
|
775
|
+
function optionalConsentStatus(value) {
|
|
776
|
+
return value === "granted" || value === "denied" || value === "unknown" ? value : undefined;
|
|
777
|
+
}
|
|
778
|
+
function optionalRedactedString(value, maxLength) {
|
|
779
|
+
const parsed = optionalString(value, maxLength);
|
|
780
|
+
return parsed ? redactSensitiveText(parsed) : undefined;
|
|
781
|
+
}
|
|
782
|
+
function requiredString(value, maxLength) {
|
|
783
|
+
const parsed = optionalString(value, maxLength);
|
|
784
|
+
return parsed && parsed.length > 0 ? parsed : undefined;
|
|
785
|
+
}
|
|
786
|
+
function optionalString(value, maxLength) {
|
|
787
|
+
if (typeof value !== "string") {
|
|
788
|
+
return undefined;
|
|
789
|
+
}
|
|
790
|
+
const trimmed = value.trim();
|
|
791
|
+
return trimmed ? trimmed.slice(0, maxLength) : undefined;
|
|
792
|
+
}
|
|
793
|
+
function optionalSafeId(value, prefix) {
|
|
794
|
+
if (typeof value !== "string") {
|
|
795
|
+
return undefined;
|
|
796
|
+
}
|
|
797
|
+
const trimmed = value.trim();
|
|
798
|
+
if (!new RegExp(`^${prefix}_[A-Za-z0-9_.:-]{1,180}$`).test(trimmed)) {
|
|
799
|
+
return undefined;
|
|
800
|
+
}
|
|
801
|
+
return trimmed.slice(0, 200);
|
|
802
|
+
}
|
|
803
|
+
function optionalIsoDate(value) {
|
|
804
|
+
if (typeof value !== "string" || !value.trim()) {
|
|
805
|
+
return undefined;
|
|
806
|
+
}
|
|
807
|
+
const date = new Date(value);
|
|
808
|
+
return Number.isNaN(date.getTime()) ? undefined : date.toISOString();
|
|
809
|
+
}
|
|
810
|
+
function booleanEnvValue(value, fallback) {
|
|
811
|
+
const raw = value?.trim().toLowerCase();
|
|
812
|
+
if (!raw) {
|
|
813
|
+
return fallback;
|
|
814
|
+
}
|
|
815
|
+
if (["1", "true", "yes", "on"].includes(raw)) {
|
|
816
|
+
return true;
|
|
817
|
+
}
|
|
818
|
+
if (["0", "false", "no", "off"].includes(raw)) {
|
|
819
|
+
return false;
|
|
820
|
+
}
|
|
821
|
+
return fallback;
|
|
822
|
+
}
|
|
823
|
+
function makeId(prefix) {
|
|
824
|
+
return `${prefix}_${Date.now()}_${Math.random().toString(16).slice(2, 14)}`;
|
|
825
|
+
}
|
|
826
|
+
function valid(data) {
|
|
827
|
+
return { ok: true, data };
|
|
828
|
+
}
|
|
829
|
+
function invalid(code, message, details) {
|
|
830
|
+
return { ok: false, error: { code, message, details } };
|
|
831
|
+
}
|
|
832
|
+
function isRecord(value) {
|
|
833
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
834
|
+
}
|
|
835
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAgTzC,MAAM,gBAAgB,GAAG,oBAAoB,CAAC;AAC9C,MAAM,gBAAgB,GAAG,EAAE,CAAC;AAE5B,MAAM,UAAU,kBAAkB,CAChC,GAAuC,EACvC,UAAgF,EAAE;IAElF,MAAM,OAAO,GAAG,YAAY,CAAC,GAAG,CAAC,QAAQ,EAAE,OAAO,CAAC,cAAc,IAAI,eAAe,CAAC,CAAC;IACtF,MAAM,cAAc,GAAG,mBAAmB,CAAC,GAAG,CAAC,eAAe,EAAE,OAAO,CAAC,qBAAqB,IAAI,QAAQ,CAAC,CAAC;IAC3G,MAAM,gBAAgB,GAAG,eAAe,CAAC,GAAG,CAAC,iBAAiB,EAAE,KAAK,CAAC,CAAC;IACvE,MAAM,qBAAqB,GAAG,eAAe,CAAC,GAAG,CAAC,wBAAwB,EAAE,KAAK,CAAC,CAAC;IACnF,MAAM,eAAe,GAAG,eAAe,CAAC,GAAG,CAAC,gBAAgB,EAAE,IAAI,CAAC,CAAC;IACpE,MAAM,kBAAkB,GAAG,eAAe,CAAC,GAAG,CAAC,oBAAoB,EAAE,IAAI,CAAC,CAAC;IAC3E,OAAO;QACL,QAAQ,EAAE,OAAO;QACjB,eAAe,EAAE,cAAc;QAC/B,iBAAiB,EAAE,gBAAgB;QACnC,wBAAwB,EAAE,qBAAqB;QAC/C,gBAAgB,EAAE,eAAe;QACjC,oBAAoB,EAAE,kBAAkB;QACxC,WAAW,EAAE,qBAAqB,CAAC,OAAO,EAAE;YAC1C,gBAAgB;YAChB,qBAAqB;YACrB,kBAAkB;SACnB,CAAC;KACH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CAAC;IACD,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QAC7C,OAAO,IAAI,CAAC;IACd,CAAC;IACD,IAAI,CAAC,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QAC9C,OAAO,KAAK,CAAC;IACf,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED,SAAS,MAAM,CAAC,MAAc;IAC5B,OAAO,GAAG,MAAM,IAAI,IAAI,CAAC,GAAG,EAAE,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC;AAC9E,CAAC;AAED,SAAS,KAAK,CAAI,IAAO;IACvB,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;AAC5B,CAAC;AAED,SAAS,OAAO,CAAY,IAAY,EAAE,OAAe,EAAE,OAAiB;IAC1E,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,CAAC;AAC1D,CAAC;AAED,SAAS,QAAQ,CAAC,KAAc;IAC9B,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC9E,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@kvell007/embed-labs-shared-schemas",
|
|
3
|
+
"version": "0.1.0-alpha.100",
|
|
4
|
+
"description": "Shared runtime, telemetry, report, and optimization backlog schemas for EmbedLabs. Experimental npm publish.",
|
|
5
|
+
"private": false,
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "dist/index.js",
|
|
8
|
+
"types": "dist/index.d.ts",
|
|
9
|
+
"files": [
|
|
10
|
+
"dist",
|
|
11
|
+
"README.md"
|
|
12
|
+
],
|
|
13
|
+
"engines": {
|
|
14
|
+
"node": ">=20"
|
|
15
|
+
},
|
|
16
|
+
"publishConfig": {
|
|
17
|
+
"access": "public",
|
|
18
|
+
"registry": "https://registry.npmjs.org/"
|
|
19
|
+
}
|
|
20
|
+
}
|