@ricsam/r5d-api 0.0.73 → 0.0.75

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 CHANGED
@@ -50,7 +50,7 @@ Trusted server-side callers that authenticate through custom headers, such as a
50
50
  - `processes.list({ project?, branch?, session?, worker? })`
51
51
  - `processes.stop(runId)`
52
52
  - `projects.list()`
53
- - `projects.create({ name?, orgId? })`
53
+ - `projects.create({ repositoryId })`
54
54
  - `projects.describe(projectRef)`
55
55
  - `projects.update(projectRef, { name?, mode? })`
56
56
  - `projects.delete(projectRef)`
@@ -59,8 +59,6 @@ Trusted server-side callers that authenticate through custom headers, such as a
59
59
  - `projects.sessions.list(projectRef, { branch? })`
60
60
  - `projects.sessions.create(projectRef, { branchName, name? })`
61
61
  - `projects.sessions.start(projectRef, { worker, model, prompt, requestId, worktree?, newWorktree?, source? })`
62
- - `projects.worktrees.merge(projectRef, sourceWorktree, { worker?, conflictMode })`
63
- - `projects.worktrees.finishMerge(projectRef, conflictWorktree, { worker, summary? })`
64
62
  - `sessions.describe(sessionId)`
65
63
  - `sessions.update(sessionId, { name })`
66
64
  - `sessions.delete(sessionId)`
@@ -77,7 +75,7 @@ Trusted server-side callers that authenticate through custom headers, such as a
77
75
 
78
76
  `sessions.prompt(...)` returns `promptDisposition: "queued" | "started"`, so callers can distinguish delivery to an active generation from a newly started generation. Session commands never rebind a session to another worker implicitly.
79
77
 
80
- `projects.sessions.start(...)` selects either an existing `worktree`, or a `newWorktree` plus `source: { type: "worktree", branchName }`. Session events are exposed as an authenticated async iterable over the raw `/api/sessions/:sessionId/events` SSE stream.
78
+ `projects.sessions.start(...)` selects either an existing `worktree`, or a `newWorktree` plus `source: { type: "worktree", branchName }`. It returns a durable `provisioning` handle immediately; poll `sessions.status(...)` until the run is queued, running, failed, or stopped before attaching to events. Reusing the same `requestId` and request body is idempotent. Session events are exposed as an authenticated async iterable over the raw `/api/sessions/:sessionId/events` SSE stream.
81
79
 
82
80
  ## Errors
83
81
 
@@ -303,7 +303,37 @@ class R5dctlClient {
303
303
  containerName: input.containerName,
304
304
  window: input.window
305
305
  }
306
- })
306
+ }),
307
+ credentials: {
308
+ create: (name) => this.request({
309
+ method: "POST",
310
+ path: "/api/user/managed-vcluster/credentials",
311
+ body: { name }
312
+ }),
313
+ list: () => this.request({
314
+ method: "GET",
315
+ path: "/api/user/managed-vcluster/credentials"
316
+ }),
317
+ revoke: (credentialId) => this.request({
318
+ method: "DELETE",
319
+ path: `/api/user/managed-vcluster/credentials/${encodeURIComponent(credentialId)}`
320
+ })
321
+ },
322
+ trustedWorkflows: {
323
+ add: (input) => this.request({
324
+ method: "POST",
325
+ path: "/api/user/managed-vcluster/trusted-workflows",
326
+ body: input
327
+ }),
328
+ list: () => this.request({
329
+ method: "GET",
330
+ path: "/api/user/managed-vcluster/trusted-workflows"
331
+ }),
332
+ revoke: (workflowId) => this.request({
333
+ method: "DELETE",
334
+ path: `/api/user/managed-vcluster/trusted-workflows/${encodeURIComponent(workflowId)}`
335
+ })
336
+ }
307
337
  };
308
338
  projects = {
309
339
  list: () => this.request({
@@ -367,22 +397,6 @@ class R5dctlClient {
367
397
  path: `/api/r5dctl/projects/${encodeURIComponent(projectRef)}/sessions/start`,
368
398
  body: input
369
399
  })
370
- },
371
- worktrees: {
372
- merge: (projectRef, sourceWorktree, input) => this.request({
373
- method: "POST",
374
- path: `/api/r5dctl/projects/${encodeURIComponent(projectRef)}/worktrees/${encodeURIComponent(sourceWorktree)}/merge`,
375
- body: input
376
- }),
377
- finishMerge: (projectRef, conflictWorktree, input) => this.request({
378
- method: "POST",
379
- path: `/api/r5dctl/projects/${encodeURIComponent(projectRef)}/worktrees/${encodeURIComponent(conflictWorktree)}/merge/finish`,
380
- body: input
381
- }),
382
- mergeAttempt: (projectRef, attemptId) => this.request({
383
- method: "GET",
384
- path: `/api/r5dctl/projects/${encodeURIComponent(projectRef)}/merge-attempts/${encodeURIComponent(attemptId)}`
385
- })
386
400
  }
387
401
  };
388
402
  sessions = {
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@ricsam/r5d-api",
3
- "version": "0.0.73",
3
+ "version": "0.0.75",
4
4
  "type": "commonjs"
5
5
  }
@@ -279,7 +279,37 @@ class R5dctlClient {
279
279
  containerName: input.containerName,
280
280
  window: input.window
281
281
  }
282
- })
282
+ }),
283
+ credentials: {
284
+ create: (name) => this.request({
285
+ method: "POST",
286
+ path: "/api/user/managed-vcluster/credentials",
287
+ body: { name }
288
+ }),
289
+ list: () => this.request({
290
+ method: "GET",
291
+ path: "/api/user/managed-vcluster/credentials"
292
+ }),
293
+ revoke: (credentialId) => this.request({
294
+ method: "DELETE",
295
+ path: `/api/user/managed-vcluster/credentials/${encodeURIComponent(credentialId)}`
296
+ })
297
+ },
298
+ trustedWorkflows: {
299
+ add: (input) => this.request({
300
+ method: "POST",
301
+ path: "/api/user/managed-vcluster/trusted-workflows",
302
+ body: input
303
+ }),
304
+ list: () => this.request({
305
+ method: "GET",
306
+ path: "/api/user/managed-vcluster/trusted-workflows"
307
+ }),
308
+ revoke: (workflowId) => this.request({
309
+ method: "DELETE",
310
+ path: `/api/user/managed-vcluster/trusted-workflows/${encodeURIComponent(workflowId)}`
311
+ })
312
+ }
283
313
  };
284
314
  projects = {
285
315
  list: () => this.request({
@@ -343,22 +373,6 @@ class R5dctlClient {
343
373
  path: `/api/r5dctl/projects/${encodeURIComponent(projectRef)}/sessions/start`,
344
374
  body: input
345
375
  })
346
- },
347
- worktrees: {
348
- merge: (projectRef, sourceWorktree, input) => this.request({
349
- method: "POST",
350
- path: `/api/r5dctl/projects/${encodeURIComponent(projectRef)}/worktrees/${encodeURIComponent(sourceWorktree)}/merge`,
351
- body: input
352
- }),
353
- finishMerge: (projectRef, conflictWorktree, input) => this.request({
354
- method: "POST",
355
- path: `/api/r5dctl/projects/${encodeURIComponent(projectRef)}/worktrees/${encodeURIComponent(conflictWorktree)}/merge/finish`,
356
- body: input
357
- }),
358
- mergeAttempt: (projectRef, attemptId) => this.request({
359
- method: "GET",
360
- path: `/api/r5dctl/projects/${encodeURIComponent(projectRef)}/merge-attempts/${encodeURIComponent(attemptId)}`
361
- })
362
376
  }
363
377
  };
364
378
  sessions = {
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@ricsam/r5d-api",
3
- "version": "0.0.73",
3
+ "version": "0.0.75",
4
4
  "type": "module"
5
5
  }
@@ -1,4 +1,4 @@
1
- export type ChatMode = "ask" | "plan" | "agent" | "large_diff_remediation" | "merge_conflict_resolution";
1
+ export type ChatMode = "ask" | "plan" | "agent" | "large_diff_remediation";
2
2
  export type R5dctlSessionMode = "ask" | "plan" | "agent";
3
3
  export type ModelTier = "low" | "medium" | "high" | "max";
4
4
  export type R5dctlWorktreeSource = {
@@ -14,9 +14,7 @@ export type R5dctlProject = {
14
14
  createdAt: string;
15
15
  updatedAt: string;
16
16
  };
17
- export type R5dctlProjectDescription = R5dctlProject & {
18
- orgId: string | null;
19
- };
17
+ export type R5dctlProjectDescription = R5dctlProject;
20
18
  export type R5dctlBranch = {
21
19
  branchName: string;
22
20
  sessionCount: number;
@@ -199,23 +197,6 @@ export type R5dctlConversationForkResponse = {
199
197
  copiedNodeCount: number;
200
198
  };
201
199
  export type R5dctlSessionRunStatus = "idle" | "provisioning" | "queued" | "running" | "completed" | "failed" | "stopped";
202
- export type R5dctlWorktreeMergeResponse = {
203
- status: "merged" | "up_to_date" | "conflicts" | "provisioning" | "conflict_worktree_created" | "resolving" | "failed" | "stale";
204
- attemptId?: string;
205
- sourceWorktree: string;
206
- targetWorktree: string;
207
- conflictWorktree?: string;
208
- commitHash?: string;
209
- resolverSessionId?: string;
210
- folderPath?: string;
211
- worker?: string;
212
- conflictedFiles?: string[];
213
- failureReason?: string;
214
- message?: string;
215
- worktreeReady?: boolean;
216
- resolverAgentRunning?: boolean;
217
- };
218
- export type R5dctlMergeConflictMode = "none" | "worktree" | "agent";
219
200
  export type R5dctlSessionRunResponse = {
220
201
  sessionId: string;
221
202
  branchName: string;
@@ -316,6 +297,26 @@ export type R5dctlApiKey = {
316
297
  createdAt: string;
317
298
  lastUsedAt: string | null;
318
299
  };
300
+ export type ManagedVClusterAccessCredential = {
301
+ id: string;
302
+ kind: "profile" | "github_actions";
303
+ name: string | null;
304
+ expiresAt: string | null;
305
+ lastUsedAt: string | null;
306
+ revokedAt: string | null;
307
+ createdAt: string;
308
+ };
309
+ export type ManagedVClusterTrustedWorkflow = {
310
+ id: string;
311
+ provider: "github";
312
+ repositoryId: string;
313
+ repository: string;
314
+ workflowPath: string;
315
+ role: "cluster_admin";
316
+ revokedAt: string | null;
317
+ createdAt: string;
318
+ updatedAt: string;
319
+ };
319
320
  export type R5dctlProcessRunStatus = "starting" | "running" | "exited" | "cancelled" | "failed";
320
321
  export type R5dctlProcessTarget = {
321
322
  type: "project";
@@ -337,24 +338,25 @@ export type R5dctlWorkspaceSyncResult = {
337
338
  toolCallId?: string;
338
339
  projectId?: string;
339
340
  branchName?: string;
340
- canonicalCheckoutOnly?: boolean;
341
341
  detail?: string;
342
342
  };
343
- outcome: "no_change" | "candidate_ready" | "published" | "updated" | "conflict_reset" | "large_diff_blocked" | "conflict_blocked" | "reset" | "failed";
343
+ outcome: "no_change" | "published" | "updated" | "conflict_reset" | "large_diff_blocked" | "conflict_blocked" | "reset" | "failed";
344
344
  startingHead: string | null;
345
- expectedHead?: string | null;
346
- candidateHead?: string;
347
- quarantineRef?: string;
345
+ localHead?: string;
348
346
  publishedHead?: string;
349
347
  rebaseCount: number;
350
348
  diffSizeBytes: number;
351
349
  gitStatus: string;
352
350
  affectedProjects: string[];
353
351
  affectedPaths: string[];
352
+ conflictPaths?: string[];
353
+ conflictSnapshotRefs?: {
354
+ local: string;
355
+ remote: string;
356
+ };
354
357
  discardedPaths: string[];
355
358
  localChangesDiscarded: boolean;
356
359
  dirtyGeneration?: number;
357
- sampledCanonicalCheckoutTreeHash?: string;
358
360
  telemetry?: {
359
361
  totalMs: number;
360
362
  queueMs: number;
@@ -368,36 +370,18 @@ export type R5dctlWorkspaceStatus = {
368
370
  latestSync: R5dctlWorkspaceSyncResult | null;
369
371
  workers: Array<{
370
372
  workerLabel: string;
371
- ready: boolean;
372
- manifestRevision: string | null;
373
+ configured: boolean;
373
374
  pendingCheckouts: Array<{
374
375
  projectId: string;
375
376
  branchName: string;
376
377
  }>;
377
378
  localHead: string | null;
378
- desiredCanonicalHead: string | null;
379
- dirtyGeneration: number;
380
- publishedGeneration: number;
381
- publicationState: "idle" | "scheduled" | "preparing" | "submitting" | "blocked";
382
- casRetries: number;
383
- lastNotifiedHead: string | null;
384
- lastNotifiedAt: string | null;
385
- fanoutLag: boolean;
386
- fanoutLagMs: number | null;
379
+ aheadOfOriginBranches: Array<{
380
+ projectId: string;
381
+ branchName: string;
382
+ ahead: number;
383
+ }>;
387
384
  }>;
388
- materialization: {
389
- desiredHead: string | null;
390
- materializedHead: string | null;
391
- state: "idle" | "pending" | "running" | "failed";
392
- retryCount: number;
393
- nextRetryAt: string | null;
394
- lastError: string | null;
395
- startedAt: string | null;
396
- completedAt: string | null;
397
- updatedAt: string;
398
- lag: boolean;
399
- lagMs: number;
400
- } | null;
401
385
  incident: {
402
386
  id: string;
403
387
  kind: "large_diff" | "sync_conflict";
@@ -628,11 +612,30 @@ export declare class R5dctlClient {
628
612
  containerName: string;
629
613
  window?: "24h" | "7d";
630
614
  }) => Promise<R5dctlK8sResourceHistory>;
615
+ credentials: {
616
+ create: (name: string) => Promise<ManagedVClusterAccessCredential & {
617
+ kubeconfig: string;
618
+ }>;
619
+ list: () => Promise<ManagedVClusterAccessCredential[]>;
620
+ revoke: (credentialId: string) => Promise<{
621
+ success: boolean;
622
+ }>;
623
+ };
624
+ trustedWorkflows: {
625
+ add: (input: {
626
+ repository: string;
627
+ workflowPath: string;
628
+ }) => Promise<ManagedVClusterTrustedWorkflow>;
629
+ list: () => Promise<ManagedVClusterTrustedWorkflow[]>;
630
+ revoke: (workflowId: string) => Promise<{
631
+ success: boolean;
632
+ }>;
633
+ };
631
634
  };
632
635
  readonly projects: {
633
636
  list: () => Promise<R5dctlProject[]>;
634
- describe: (projectRef: string) => Promise<R5dctlProjectDescription>;
635
- update: (projectRef: string, input: R5dctlProjectUpdateInput) => Promise<R5dctlProjectDescription>;
637
+ describe: (projectRef: string) => Promise<R5dctlProject>;
638
+ update: (projectRef: string, input: R5dctlProjectUpdateInput) => Promise<R5dctlProject>;
636
639
  delete: (projectRef: string) => Promise<{
637
640
  success: boolean;
638
641
  }>;
@@ -660,17 +663,6 @@ export declare class R5dctlClient {
660
663
  create: (projectRef: string, input: R5dctlSessionCreateInput) => Promise<R5dctlSessionDescription>;
661
664
  start: (projectRef: string, input: R5dctlSessionStartInput) => Promise<R5dctlSessionRunResponse>;
662
665
  };
663
- worktrees: {
664
- merge: (projectRef: string, sourceWorktree: string, input: {
665
- worker?: string;
666
- conflictMode: R5dctlMergeConflictMode;
667
- }) => Promise<R5dctlWorktreeMergeResponse>;
668
- finishMerge: (projectRef: string, conflictWorktree: string, input: {
669
- worker: string;
670
- summary?: string;
671
- }) => Promise<R5dctlWorktreeMergeResponse>;
672
- mergeAttempt: (projectRef: string, attemptId: string) => Promise<R5dctlWorktreeMergeResponse>;
673
- };
674
666
  };
675
667
  readonly sessions: {
676
668
  recent: (input?: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ricsam/r5d-api",
3
- "version": "0.0.73",
3
+ "version": "0.0.75",
4
4
  "type": "module",
5
5
  "main": "./dist/cjs/index.cjs",
6
6
  "module": "./dist/mjs/index.mjs",