Skip to content

armgit / Ix

Public Imported from GitHub
0

Understand any codebase instantly. System intelligence for codebases, built for humans and AI.

feat: add commitPatch client method and GraphPatch types

riley0227c27ef9023b5c
diff --git a/ix-cli/src/client/api.ts b/ix-cli/src/client/api.ts
index 2f8cdc92..336c2dc8 100644
--- a/ix-cli/src/client/api.ts
+++ b/ix-cli/src/client/api.ts
@@ -5,6 +5,8 @@ import type {
GraphNode,
HealthResponse,
PatchSummary,
+ GraphPatchPayload,
+ PatchCommitResult,
} from "./types.js";
export class IxClient {
@@ -141,6 +143,10 @@ export class IxClient {
return this.post(`/v1/provenance/${entityId}`, {});
}
+ async commitPatch(patch: GraphPatchPayload): Promise<PatchCommitResult> {
+ return this.post("/v1/patch", patch);
+ }
+
async stats(): Promise<any> {
return this.get("/v1/stats");
}
diff --git a/ix-cli/src/client/types.ts b/ix-cli/src/client/types.ts
index f2999e0d..5603dc34 100644
--- a/ix-cli/src/client/types.ts
+++ b/ix-cli/src/client/types.ts
@@ -150,3 +150,31 @@ export interface IngestResult {
export interface HealthResponse {
status: string;
}
+
+export interface PatchSource {
+ uri: string;
+ sourceHash?: string;
+ extractor: string;
+ sourceType: string;
+}
+
+export interface PatchOp {
+ type: string;
+ [key: string]: unknown;
+}
+
+export interface GraphPatchPayload {
+ patchId: string;
+ actor: string;
+ timestamp: string;
+ source: PatchSource;
+ baseRev: number;
+ ops: PatchOp[];
+ replaces: string[];
+ intent?: string;
+}
+
+export interface PatchCommitResult {
+ status: string;
+ rev: number;
+}