Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions app/lib/backend/schema/gen/memories_wire.g.dart
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ class GeneratedMemoryDB {
final String? headline;
final String id;
final DateTime? invalidAt;
final bool isBaseline;
final bool isLocked;
final bool kgExtracted;
final String? layer;
Expand Down Expand Up @@ -122,6 +123,7 @@ class GeneratedMemoryDB {
this.headline,
required this.id,
this.invalidAt,
this.isBaseline = false,
this.isLocked = false,
this.kgExtracted = false,
required this.layer,
Expand Down Expand Up @@ -164,6 +166,7 @@ class GeneratedMemoryDB {
headline: _readFieldValue<String>(_readField(json, const ["headline"]), "headline", _readString, requiredField: false, nullable: true),
id: _required(_readFieldValue<String>(_readField(json, const ["id"]), "id", _readString, requiredField: true, nullable: false), "id"),
invalidAt: _readFieldValue<DateTime>(_readField(json, const ["invalid_at"]), "invalid_at", _readDateTime, requiredField: false, nullable: true),
isBaseline: _required(_readFieldValue<bool>(_readField(json, const ["is_baseline"]), "is_baseline", _readBool, requiredField: false, nullable: false, defaultValue: false), "is_baseline"),
isLocked: _required(_readFieldValue<bool>(_readField(json, const ["is_locked"]), "is_locked", _readBool, requiredField: false, nullable: false, defaultValue: false), "is_locked"),
kgExtracted: _required(_readFieldValue<bool>(_readField(json, const ["kg_extracted"]), "kg_extracted", _readBool, requiredField: false, nullable: false, defaultValue: false), "kg_extracted"),
layer: _readFieldValue<String>(_readField(json, const ["layer"]), "layer", _readString, requiredField: true, nullable: true),
Expand Down Expand Up @@ -207,6 +210,7 @@ class GeneratedMemoryDB {
'headline': headline,
'id': id,
'invalid_at': invalidAt?.toUtc().toIso8601String(),
'is_baseline': isBaseline,
'is_locked': isLocked,
'kg_extracted': kgExtracted,
'layer': layer,
Expand Down
35 changes: 33 additions & 2 deletions desktop/macos/Desktop/Sources/Generated/OmiApi.generated.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// GENERATED CODE - DO NOT EDIT.

Check warning on line 1 in desktop/macos/Desktop/Sources/Generated/OmiApi.generated.swift

View workflow job for this annotation

GitHub Actions / Hygiene

Large changed file

desktop/macos/Desktop/Sources/Generated/OmiApi.generated.swift is 14392 lines; consider splitting files over 800 lines.

Check warning on line 1 in desktop/macos/Desktop/Sources/Generated/OmiApi.generated.swift

View workflow job for this annotation

GitHub Actions / PR Metadata Preflight

Large changed file

desktop/macos/Desktop/Sources/Generated/OmiApi.generated.swift is 14392 lines; consider splitting files over 800 lines.
// Generated by backend/scripts/generate_swift_openapi_types.py from docs/api-reference/app-client-openapi.json
// Swift wire DTOs for the desktop app's backend REST surface. Domain models
// (ServerConversation, ServerMemory, Goal, ActionItem) adapt from these types;
Expand Down Expand Up @@ -2688,6 +2688,7 @@
public let headline: String?
public let id: String
public let invalidAt: String?
public let isBaseline: Bool?
public let isLocked: Bool?
public let kgExtracted: Bool?
public let layer: String?
Expand Down Expand Up @@ -2728,6 +2729,7 @@
case headline
case id
case invalidAt = "invalid_at"
case isBaseline = "is_baseline"
case isLocked = "is_locked"
case kgExtracted = "kg_extracted"
case layer
Expand Down Expand Up @@ -2770,6 +2772,7 @@
headline = try c.decodeIfPresent(String.self, forKey: .headline)
id = try c.decode(String.self, forKey: .id)
invalidAt = try c.decodeIfPresent(String.self, forKey: .invalidAt)
isBaseline = try c.decodeIfPresent(Bool.self, forKey: .isBaseline)
isLocked = try c.decodeIfPresent(Bool.self, forKey: .isLocked)
kgExtracted = try c.decodeIfPresent(Bool.self, forKey: .kgExtracted)
layer = try c.decodeIfPresent(String.self, forKey: .layer)
Expand All @@ -2795,7 +2798,7 @@
visibility = try c.decodeIfPresent(String.self, forKey: .visibility)
}

public init(appId: String?, arguments: [String: OmiAnyCodable]?, captureConfidence: Double?, captureDeviceIds: [String]?, category: MemoryCategory?, content: String, conversationId: String?, createdAt: String, dataProtectionLevel: String?, durability: String?, edited: Bool?, evidence: [Evidence]?, headline: String?, id: String, invalidAt: String?, isLocked: Bool?, kgExtracted: Bool?, layer: String?, manuallyAdded: Bool?, memoryId: String?, memoryTier: MemoryLayer?, objectEntityIds: [String]?, predicate: String?, primaryCaptureDevice: String?, qualifiers: [String: OmiAnyCodable]?, reviewed: Bool?, scoring: String?, subjectAttribution: SubjectAttribution?, subjectEntityId: String?, supersededBy: String?, tags: [String]?, uid: String, uncertaintyReasons: [String]?, updatedAt: String, userReview: Bool?, validAt: String?, veracity: Double?, visibility: String?) {
public init(appId: String?, arguments: [String: OmiAnyCodable]?, captureConfidence: Double?, captureDeviceIds: [String]?, category: MemoryCategory?, content: String, conversationId: String?, createdAt: String, dataProtectionLevel: String?, durability: String?, edited: Bool?, evidence: [Evidence]?, headline: String?, id: String, invalidAt: String?, isBaseline: Bool?, isLocked: Bool?, kgExtracted: Bool?, layer: String?, manuallyAdded: Bool?, memoryId: String?, memoryTier: MemoryLayer?, objectEntityIds: [String]?, predicate: String?, primaryCaptureDevice: String?, qualifiers: [String: OmiAnyCodable]?, reviewed: Bool?, scoring: String?, subjectAttribution: SubjectAttribution?, subjectEntityId: String?, supersededBy: String?, tags: [String]?, uid: String, uncertaintyReasons: [String]?, updatedAt: String, userReview: Bool?, validAt: String?, veracity: Double?, visibility: String?) {
self.appId = appId
self.arguments = arguments
self.captureConfidence = captureConfidence
Expand All @@ -2811,6 +2814,7 @@
self.headline = headline
self.id = id
self.invalidAt = invalidAt
self.isBaseline = isBaseline
self.isLocked = isLocked
self.kgExtracted = kgExtracted
self.layer = layer
Expand Down Expand Up @@ -14167,6 +14171,33 @@
return try JSONDecoder().decode(OmiAnyCodable.self, from: data)
}

public static func updateMemoryBaselineV3MemoriesMemoryIdBaselinePatch(client: OmiApiClient, memoryId: String, value: Bool, authorization: String? = nil, xAppPlatform: String? = nil, xDeviceIdHash: String? = nil, xAppVersion: String? = nil) async throws -> OmiAnyCodable {
let _path = "/v3/memories/\(memoryId)/baseline"
guard var components = URLComponents(string: client.baseURL + _path) else {
throw OmiApiError.invalidURL
}
var queryItems: [URLQueryItem] = []
queryItems.append(URLQueryItem(name: "value", value: String(value)))
if !queryItems.isEmpty { components.queryItems = queryItems }
guard let url = components.url else { throw OmiApiError.invalidURL }
var req = URLRequest(url: url)
req.httpMethod = "PATCH"
for (name, value) in client.headers { req.setValue(value, forHTTPHeaderField: name) }
if let token = client.token {
req.setValue("Bearer " + token, forHTTPHeaderField: "Authorization")
}
if let authorization { req.setValue(String(authorization), forHTTPHeaderField: "authorization") }
if let xAppPlatform { req.setValue(String(xAppPlatform), forHTTPHeaderField: "X-App-Platform") }
if let xDeviceIdHash { req.setValue(String(xDeviceIdHash), forHTTPHeaderField: "X-Device-Id-Hash") }
if let xAppVersion { req.setValue(String(xAppVersion), forHTTPHeaderField: "X-App-Version") }
let (data, resp) = try await URLSession.shared.data(for: req)
guard let http = resp as? HTTPURLResponse else { throw OmiApiError.invalidURL }
guard (200..<300).contains(http.statusCode) else {
throw OmiApiError.httpError(status: http.statusCode, data: data)
}
return try JSONDecoder().decode(OmiAnyCodable.self, from: data)
}

public static func reviewMemoryV3MemoriesMemoryIdReviewPost(client: OmiApiClient, memoryId: String, value: Bool, authorization: String? = nil, xAppPlatform: String? = nil, xDeviceIdHash: String? = nil, xAppVersion: String? = nil) async throws -> OmiAnyCodable {
let _path = "/v3/memories/\(memoryId)/review"
guard var components = URLComponents(string: client.baseURL + _path) else {
Expand Down Expand Up @@ -14357,5 +14388,5 @@
return try JSONDecoder().decode(OmiAnyCodable.self, from: data)
}

// Total: 382 Swift client methods generated.
// Total: 385 Swift client methods generated.
}
36 changes: 35 additions & 1 deletion desktop/windows/src/renderer/src/lib/omiApi.generated.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// GENERATED CODE - DO NOT EDIT.

Check warning on line 1 in desktop/windows/src/renderer/src/lib/omiApi.generated.ts

View workflow job for this annotation

GitHub Actions / Hygiene

Large changed file

desktop/windows/src/renderer/src/lib/omiApi.generated.ts is 15691 lines; consider splitting files over 800 lines.

Check warning on line 1 in desktop/windows/src/renderer/src/lib/omiApi.generated.ts

View workflow job for this annotation

GitHub Actions / PR Metadata Preflight

Large changed file

desktop/windows/src/renderer/src/lib/omiApi.generated.ts is 15691 lines; consider splitting files over 800 lines.
/* eslint-disable prettier/prettier, @typescript-eslint/no-explicit-any */
// Generated by backend/scripts/generate_ts_openapi_types.py from docs/api-reference/app-client-openapi.json.

Expand Down Expand Up @@ -2196,6 +2196,7 @@
headline?: string | null;
id: string;
invalid_at?: string | null;
is_baseline?: boolean;
is_locked?: boolean;
kg_extracted?: boolean;
layer: string | null;
Expand Down Expand Up @@ -8024,6 +8025,17 @@
};
};
};
"/v3/memories/{memory_id}/baseline": {
patch: {
operationId: "update_memory_baseline_v3_memories__memory_id__baseline_patch";
responses: {
"200": MemoryMutationResponse;
"401": void;
"404": void;
"422": HTTPValidationError;
};
};
};
"/v3/memories/{memory_id}/review": {
post: {
operationId: "review_memory_v3_memories__memory_id__review_post";
Expand Down Expand Up @@ -15507,6 +15519,28 @@
return _res.status === 204 ? (undefined as any) : await _res.json();
}

export async function update_memory_baseline_v3_memories__memory_id__baseline_patch(path: { memory_id: string }, query: { value: boolean }, header: { authorization?: string, X_App_Platform?: string, X_Device_Id_Hash?: string, X_App_Version?: string }, init?: OmiApiClientInit): Promise<MemoryMutationResponse> {
const _base = init?.baseURL ?? "";
const _path = `/v3/memories/${path.memory_id}/baseline`;
const _params = query ? Object.entries(query)
.filter(([, v]) => v !== undefined && v !== null)
.map(([k, v]) => `${k}=${encodeURIComponent(String(v))}`).join('&') : '';
const _search = _params ? `?${_params}` : "";
const _res = await fetch(`${_base}${_path}${_search}`, {
method: "PATCH",
headers: {
...(init?.token ? { Authorization: `Bearer ${init.token}` } : {}),
...init?.headers,
...(header.authorization !== undefined ? { "authorization": String(header.authorization) } : {}),
...(header.X_App_Platform !== undefined ? { "X-App-Platform": String(header.X_App_Platform) } : {}),
...(header.X_Device_Id_Hash !== undefined ? { "X-Device-Id-Hash": String(header.X_Device_Id_Hash) } : {}),
...(header.X_App_Version !== undefined ? { "X-App-Version": String(header.X_App_Version) } : {}),
},
});
if (!_res.ok) throw new OmiApiError(_res.status, _res);
return _res.status === 204 ? (undefined as any) : await _res.json();
}

export async function review_memory_v3_memories__memory_id__review_post(path: { memory_id: string }, query: { value: boolean }, header: { authorization?: string, X_App_Platform?: string, X_Device_Id_Hash?: string, X_App_Version?: string }, init?: OmiApiClientInit): Promise<MemoryMutationResponse> {
const _base = init?.baseURL ?? "";
const _path = `/v3/memories/${path.memory_id}/review`;
Expand Down Expand Up @@ -15654,4 +15688,4 @@
return _res.status === 204 ? (undefined as any) : await _res.json();
}

// Total: 382 client methods generated.
// Total: 385 client methods generated.
104 changes: 104 additions & 0 deletions docs/api-reference/app-client-openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -13495,6 +13495,11 @@
],
"title": "Invalid At"
},
"is_baseline": {
"default": false,
"title": "Is Baseline",
"type": "boolean"
},
"is_locked": {
"default": false,
"title": "Is Locked",
Expand Down Expand Up @@ -55650,6 +55655,105 @@
]
}
},
"/v3/memories/{memory_id}/baseline": {
"patch": {
"description": "Toggle the baseline flag for a memory.\n\nBaseline memories are always injected first into the AI context window.\nNot supported for canonical-path users: MemoryItem has no is_baseline field,\nso writing to the legacy store would silently have no effect for canonical readers.\nCanonical users receive 503 explicitly rather than a silent wrong-store write.",
"operationId": "update_memory_baseline_v3_memories__memory_id__baseline_patch",
"parameters": [
{
"in": "path",
"name": "memory_id",
"required": true,
"schema": {
"title": "Memory Id",
"type": "string"
}
},
{
"in": "query",
"name": "value",
"required": true,
"schema": {
"title": "Value",
"type": "boolean"
}
},
{
"in": "header",
"name": "authorization",
"required": false,
"schema": {
"title": "Authorization",
"type": "string"
}
},
{
"in": "header",
"name": "X-App-Platform",
"required": false,
"schema": {
"title": "X-App-Platform",
"type": "string"
}
},
{
"in": "header",
"name": "X-Device-Id-Hash",
"required": false,
"schema": {
"title": "X-Device-Id-Hash",
"type": "string"
}
},
{
"in": "header",
"name": "X-App-Version",
"required": false,
"schema": {
"title": "X-App-Version",
"type": "string"
}
}
],
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/MemoryMutationResponse"
}
}
},
"description": "Successful Response"
},
"401": {
"$ref": "#/components/responses/Error401"
},
"404": {
"$ref": "#/components/responses/Error404"
},
"422": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
},
"description": "Validation Error"
}
},
"security": [
{
"firebaseBearer": []
}
],
"summary": "Update Memory Baseline",
"tags": [
"memories"
]
}
},
"/v3/memories/{memory_id}/review": {
"post": {
"operationId": "review_memory_v3_memories__memory_id__review_post",
Expand Down
5 changes: 5 additions & 0 deletions docs/api-reference/integration-public-openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -1086,6 +1086,11 @@
],
"title": "Invalid At"
},
"is_baseline": {
"default": false,
"title": "Is Baseline",
"type": "boolean"
},
"is_locked": {
"default": false,
"title": "Is Locked",
Expand Down
36 changes: 35 additions & 1 deletion web/admin/lib/services/omi-api/omiApi.generated.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// GENERATED CODE - DO NOT EDIT.

Check warning on line 1 in web/admin/lib/services/omi-api/omiApi.generated.ts

View workflow job for this annotation

GitHub Actions / Hygiene

Large changed file

web/admin/lib/services/omi-api/omiApi.generated.ts is 15691 lines; consider splitting files over 800 lines.

Check warning on line 1 in web/admin/lib/services/omi-api/omiApi.generated.ts

View workflow job for this annotation

GitHub Actions / PR Metadata Preflight

Large changed file

web/admin/lib/services/omi-api/omiApi.generated.ts is 15691 lines; consider splitting files over 800 lines.
/* eslint-disable prettier/prettier, @typescript-eslint/no-explicit-any */
// Generated by backend/scripts/generate_ts_openapi_types.py from docs/api-reference/app-client-openapi.json.

Expand Down Expand Up @@ -2196,6 +2196,7 @@
headline?: string | null;
id: string;
invalid_at?: string | null;
is_baseline?: boolean;
is_locked?: boolean;
kg_extracted?: boolean;
layer: string | null;
Expand Down Expand Up @@ -8024,6 +8025,17 @@
};
};
};
"/v3/memories/{memory_id}/baseline": {
patch: {
operationId: "update_memory_baseline_v3_memories__memory_id__baseline_patch";
responses: {
"200": MemoryMutationResponse;
"401": void;
"404": void;
"422": HTTPValidationError;
};
};
};
"/v3/memories/{memory_id}/review": {
post: {
operationId: "review_memory_v3_memories__memory_id__review_post";
Expand Down Expand Up @@ -15507,6 +15519,28 @@
return _res.status === 204 ? (undefined as any) : await _res.json();
}

export async function update_memory_baseline_v3_memories__memory_id__baseline_patch(path: { memory_id: string }, query: { value: boolean }, header: { authorization?: string, X_App_Platform?: string, X_Device_Id_Hash?: string, X_App_Version?: string }, init?: OmiApiClientInit): Promise<MemoryMutationResponse> {
const _base = init?.baseURL ?? "";
const _path = `/v3/memories/${path.memory_id}/baseline`;
const _params = query ? Object.entries(query)
.filter(([, v]) => v !== undefined && v !== null)
.map(([k, v]) => `${k}=${encodeURIComponent(String(v))}`).join('&') : '';
const _search = _params ? `?${_params}` : "";
const _res = await fetch(`${_base}${_path}${_search}`, {
method: "PATCH",
headers: {
...(init?.token ? { Authorization: `Bearer ${init.token}` } : {}),
...init?.headers,
...(header.authorization !== undefined ? { "authorization": String(header.authorization) } : {}),
...(header.X_App_Platform !== undefined ? { "X-App-Platform": String(header.X_App_Platform) } : {}),
...(header.X_Device_Id_Hash !== undefined ? { "X-Device-Id-Hash": String(header.X_Device_Id_Hash) } : {}),
...(header.X_App_Version !== undefined ? { "X-App-Version": String(header.X_App_Version) } : {}),
},
});
if (!_res.ok) throw new OmiApiError(_res.status, _res);
return _res.status === 204 ? (undefined as any) : await _res.json();
}

export async function review_memory_v3_memories__memory_id__review_post(path: { memory_id: string }, query: { value: boolean }, header: { authorization?: string, X_App_Platform?: string, X_Device_Id_Hash?: string, X_App_Version?: string }, init?: OmiApiClientInit): Promise<MemoryMutationResponse> {
const _base = init?.baseURL ?? "";
const _path = `/v3/memories/${path.memory_id}/review`;
Expand Down Expand Up @@ -15654,4 +15688,4 @@
return _res.status === 204 ? (undefined as any) : await _res.json();
}

// Total: 382 client methods generated.
// Total: 385 client methods generated.
Loading
Loading