@ricsam/r5d-api 0.0.59 → 0.0.60

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
@@ -58,6 +58,8 @@ Trusted server-side callers that authenticate through custom headers, such as a
58
58
  - `projects.env.get/update/remove(projectId, ...)`
59
59
  - `projects.sessions.list(projectRef, { branch? })`
60
60
  - `projects.sessions.create(projectRef, { branchName, name? })`
61
+ - `projects.agents.start(projectRef, { source, agentType, prompt, worker, requestId })`
62
+ - `agents.status/sendPrompt/merge/stop/finishMerge(...)`
61
63
  - `sessions.describe(sessionId)`
62
64
  - `sessions.update(sessionId, { name })`
63
65
  - `sessions.delete(sessionId)`
@@ -69,6 +71,10 @@ Trusted server-side callers that authenticate through custom headers, such as a
69
71
  - `sessions.answerQuestions(sessionId, { answers })`
70
72
  - `sessions.answerEnvRequest(sessionId, { envs?, additionalContext? })`
71
73
 
74
+ `agents.sendPrompt(...)` returns `promptDisposition: "queued" | "started"`, so callers can distinguish delivery to an active generation from a newly started generation. Agent commands never rebind a session to another worker implicitly.
75
+
76
+ `projects.agents.start(...)` requires `source: { type: "worktree", branchName }`. The source is the named branch worktree, including its committed and uncommitted files.
77
+
72
78
  ## Errors
73
79
 
74
80
  Non-2xx responses throw `R5dctlApiError` with:
@@ -302,22 +302,7 @@ class R5dctlClient {
302
302
  path: `/api/r5dctl/projects/${encodeURIComponent(projectRef)}/agents`,
303
303
  body: input
304
304
  })
305
- },
306
- mergeChanges: (projectRef, input) => this.request({
307
- method: "POST",
308
- path: `/api/r5dctl/projects/${encodeURIComponent(projectRef)}/merge-changes`,
309
- body: input
310
- }),
311
- continueMerge: (projectRef, input) => this.request({
312
- method: "POST",
313
- path: `/api/r5dctl/projects/${encodeURIComponent(projectRef)}/continue-merge`,
314
- body: input
315
- }),
316
- abortMerge: (projectRef, input) => this.request({
317
- method: "POST",
318
- path: `/api/r5dctl/projects/${encodeURIComponent(projectRef)}/abort-merge`,
319
- body: input
320
- })
305
+ }
321
306
  };
322
307
  agents = {
323
308
  status: (sessionId) => this.request({
@@ -328,6 +313,20 @@ class R5dctlClient {
328
313
  method: "POST",
329
314
  path: `/api/r5dctl/agents/${encodeURIComponent(sessionId)}/prompt`,
330
315
  body: input
316
+ }),
317
+ merge: (sessionId, input) => this.request({
318
+ method: "POST",
319
+ path: `/api/r5dctl/agents/${encodeURIComponent(sessionId)}/merge`,
320
+ body: input
321
+ }),
322
+ stop: (sessionId) => this.request({
323
+ method: "POST",
324
+ path: `/api/r5dctl/agents/${encodeURIComponent(sessionId)}/stop`
325
+ }),
326
+ finishMerge: (sessionId, input) => this.request({
327
+ method: "POST",
328
+ path: `/api/r5dctl/agents/${encodeURIComponent(sessionId)}/finish-merge`,
329
+ body: input
331
330
  })
332
331
  };
333
332
  sessions = {
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@ricsam/r5d-api",
3
- "version": "0.0.59",
3
+ "version": "0.0.60",
4
4
  "type": "commonjs"
5
5
  }
@@ -278,22 +278,7 @@ class R5dctlClient {
278
278
  path: `/api/r5dctl/projects/${encodeURIComponent(projectRef)}/agents`,
279
279
  body: input
280
280
  })
281
- },
282
- mergeChanges: (projectRef, input) => this.request({
283
- method: "POST",
284
- path: `/api/r5dctl/projects/${encodeURIComponent(projectRef)}/merge-changes`,
285
- body: input
286
- }),
287
- continueMerge: (projectRef, input) => this.request({
288
- method: "POST",
289
- path: `/api/r5dctl/projects/${encodeURIComponent(projectRef)}/continue-merge`,
290
- body: input
291
- }),
292
- abortMerge: (projectRef, input) => this.request({
293
- method: "POST",
294
- path: `/api/r5dctl/projects/${encodeURIComponent(projectRef)}/abort-merge`,
295
- body: input
296
- })
281
+ }
297
282
  };
298
283
  agents = {
299
284
  status: (sessionId) => this.request({
@@ -304,6 +289,20 @@ class R5dctlClient {
304
289
  method: "POST",
305
290
  path: `/api/r5dctl/agents/${encodeURIComponent(sessionId)}/prompt`,
306
291
  body: input
292
+ }),
293
+ merge: (sessionId, input) => this.request({
294
+ method: "POST",
295
+ path: `/api/r5dctl/agents/${encodeURIComponent(sessionId)}/merge`,
296
+ body: input
297
+ }),
298
+ stop: (sessionId) => this.request({
299
+ method: "POST",
300
+ path: `/api/r5dctl/agents/${encodeURIComponent(sessionId)}/stop`
301
+ }),
302
+ finishMerge: (sessionId, input) => this.request({
303
+ method: "POST",
304
+ path: `/api/r5dctl/agents/${encodeURIComponent(sessionId)}/finish-merge`,
305
+ body: input
307
306
  })
308
307
  };
309
308
  sessions = {
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@ricsam/r5d-api",
3
- "version": "0.0.59",
3
+ "version": "0.0.60",
4
4
  "type": "module"
5
5
  }
@@ -1,6 +1,10 @@
1
1
  export type ChatMode = "ask" | "plan" | "build" | "agent" | "explore" | "test" | "research" | "security_review" | "large_diff_remediation" | "merge_conflict_resolution";
2
2
  export type ModelTier = "low" | "medium" | "high" | "max";
3
3
  export type R5dctlAgentType = "research" | "debug" | "test";
4
+ export type R5dctlAgentSource = {
5
+ type: "worktree";
6
+ branchName: string;
7
+ };
4
8
  export type R5dctlProject = {
5
9
  id: string;
6
10
  namespace: string;
@@ -94,53 +98,50 @@ export type R5dctlConversationWorkResponse = {
94
98
  detail: R5dctlConversationWorkDetail;
95
99
  workText: string;
96
100
  };
97
- export type R5dctlAgentStartResponse = {
98
- sessionId: string;
99
- branchName: string;
100
- baseBranch: string;
101
- baseCommit: string;
102
- status: "running";
101
+ export type R5dctlAgentRunStatus = "provisioning" | "queued" | "running" | "completed" | "failed" | "stopped";
102
+ export type R5dctlAgentMergeStatus = {
103
+ status: "merged" | "up_to_date" | "conflicts" | "resolving" | "failed" | "stale";
104
+ attemptId?: string;
105
+ sourceBranch: string;
106
+ targetBranch: string;
107
+ commitHash?: string;
108
+ resolverSessionId?: string;
109
+ resolverBranch?: string;
110
+ folderPath?: string;
111
+ worker?: string;
112
+ conflictedFiles?: string[];
113
+ failureReason?: string;
114
+ message?: string;
103
115
  };
104
116
  export type R5dctlAgentStatusResponse = {
105
117
  sessionId: string;
106
118
  branchName: string;
107
- baseBranch: string | null;
108
- baseCommit: string | null;
109
- status: "running" | "completed" | "failed";
110
- startedAt: string;
119
+ source: R5dctlAgentSource;
120
+ baselineCommit: string | null;
121
+ workspaceHead: string | null;
122
+ worker: string;
123
+ status: R5dctlAgentRunStatus;
124
+ runStatus: R5dctlAgentRunStatus;
125
+ kind: R5dctlAgentType;
126
+ createdAt: string;
111
127
  updatedAt: string;
128
+ queuedAt?: string;
129
+ startedAt?: string;
112
130
  completedAt?: string;
113
131
  failedAt?: string;
132
+ stoppedAt?: string;
114
133
  error?: string;
115
- headCommit: string;
134
+ headCommit: string | null;
135
+ headCommitError?: string;
116
136
  summary: string;
117
137
  diffSummary: string;
138
+ sessionPath: string;
139
+ sessionUrl?: string;
140
+ merge?: R5dctlAgentMergeStatus;
118
141
  };
119
- export type R5dctlMergeResult = {
120
- type: "merge_branch";
121
- status: "merged";
122
- sourceBranch: string;
123
- targetBranch: string;
124
- commitHash: string;
125
- message: string;
126
- } | {
127
- type: "merge_branch";
128
- status: "conflicts";
129
- sourceBranch: string;
130
- targetBranch: string;
131
- conflictedFiles: string[];
132
- message: string;
133
- };
134
- export type R5dctlContinueMergeResult = {
135
- type: "continue_merge";
136
- status: "committed";
137
- commitHash: string;
138
- message: string;
139
- };
140
- export type R5dctlAbortMergeResult = {
141
- type: "abort_merge";
142
- status: "aborted";
143
- message: string;
142
+ export type R5dctlAgentStartResponse = R5dctlAgentStatusResponse;
143
+ export type R5dctlAgentPromptResponse = R5dctlAgentStatusResponse & {
144
+ promptDisposition: "queued" | "started";
144
145
  };
145
146
  export type DeviceAuthorizationStartResponse = {
146
147
  requestId: string;
@@ -256,7 +257,7 @@ export type R5dctlWorkspaceStatus = {
256
257
  desiredCanonicalHead: string | null;
257
258
  dirtyGeneration: number;
258
259
  publishedGeneration: number;
259
- checkpointState: "idle" | "scheduled" | "preparing" | "submitting" | "blocked";
260
+ publicationState: "idle" | "scheduled" | "preparing" | "submitting" | "blocked";
260
261
  casRetries: number;
261
262
  lastNotifiedHead: string | null;
262
263
  lastNotifiedAt: string | null;
@@ -537,26 +538,27 @@ export declare class R5dctlClient {
537
538
  };
538
539
  agents: {
539
540
  start: (projectRef: string, input: {
540
- sourceBranch: string;
541
+ source: R5dctlAgentSource;
541
542
  agentType: R5dctlAgentType;
542
543
  prompt: string;
543
- }) => Promise<R5dctlAgentStartResponse>;
544
+ worker: string;
545
+ requestId: string;
546
+ }) => Promise<R5dctlAgentStatusResponse>;
544
547
  };
545
- mergeChanges: (projectRef: string, input: {
546
- targetBranch: string;
547
- sourceBranch: string;
548
- }) => Promise<R5dctlMergeResult>;
549
- continueMerge: (projectRef: string, input: {
550
- targetBranch: string;
551
- }) => Promise<R5dctlContinueMergeResult>;
552
- abortMerge: (projectRef: string, input: {
553
- targetBranch: string;
554
- }) => Promise<R5dctlAbortMergeResult>;
555
548
  };
556
549
  readonly agents: {
557
550
  status: (sessionId: string) => Promise<R5dctlAgentStatusResponse>;
558
551
  sendPrompt: (sessionId: string, input: {
559
552
  prompt: string;
553
+ worker: string;
554
+ }) => Promise<R5dctlAgentPromptResponse>;
555
+ merge: (sessionId: string, input: {
556
+ worker: string;
557
+ }) => Promise<R5dctlAgentStatusResponse>;
558
+ stop: (sessionId: string) => Promise<R5dctlAgentStatusResponse>;
559
+ finishMerge: (sessionId: string, input: {
560
+ worker: string;
561
+ summary: string;
560
562
  }) => Promise<R5dctlAgentStatusResponse>;
561
563
  };
562
564
  readonly sessions: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ricsam/r5d-api",
3
- "version": "0.0.59",
3
+ "version": "0.0.60",
4
4
  "type": "module",
5
5
  "main": "./dist/cjs/index.cjs",
6
6
  "module": "./dist/mjs/index.mjs",