-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathjules-openapi.yaml
More file actions
926 lines (895 loc) · 28.3 KB
/
jules-openapi.yaml
File metadata and controls
926 lines (895 loc) · 28.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
openapi: 3.0.0
info:
title: Jules API
version: v1alpha
description: |
The Jules API lets you programmatically access Jules's capabilities to automate and enhance your
software development lifecycle. You can use the API to create custom workflows, automate tasks
like bug fixing and code reviews, and embed Jules's intelligence directly into the tools you use
every day, such as Slack, Linear, and GitHub.
**Note**: The Jules API is in an alpha release, which means it is experimental. Be aware that we
may change specifications, API keys, and definitions as we work toward stabilization. In the
future, we plan to maintain at least one stable and one experimental version.
contact:
name: Google for Developers
url: https://developers.google.com/jules/api
servers:
- url: https://jules.googleapis.com/v1alpha
description: |
Google Jules API Alpha Endpoint
components:
securitySchemes:
ApiKeyAuth:
description: |
Your API key. Generated in the Settings page of the Jules web app.\nMust be included in the
`X-Goog-Api-Key` header.
**Important**: Keep your API keys secure. Don't share them or embed them in public code. For
your protection, any API keys found to be publicly exposed will be automatically disabled to
prevent abuse.
type: apiKey
in: header
name: X-Goog-Api-Key
schemas:
Session:
description: |
A continuous unit of work within a specific context, similar to a chat session. A session is
initiated with a prompt and a source.
type: object
required:
- prompt
- sourceContext
properties:
name:
description: |
Output only. Identifier. The full resource name (e.g., "sessions/{session}").
type: string
example: "sessions/31415926535897932384"
id:
description: |
Output only. The id of the session. This is the same as the "{session}" part of the
resource name (e.g., "sessions/{session}").
type: string
example: "31415926535897932384"
prompt:
description: |
Required. The prompt to start the session with.
type: string
example: "Create a boba app!"
sourceContext:
description: |
Required. The source to use in this session, with additional context.
allOf:
- $ref: "#/components/schemas/SourceContext"
title:
description: |
Optional. If not provided, the system will generate one.
type: string
example: "Boba App"
requirePlanApproval:
description: |
Optional. Input only. If true, plans the agent generates will require explicit plan
approval before the agent starts working. If not set, plans will be auto-approved.
type: boolean
automationMode:
description: |
Optional. Input only. The automation mode of the session. If not set, the default
automation mode will be used.
type: string
enum:
- AUTOMATION_MODE_UNSPECIFIED
- AUTO_CREATE_PR
createTime:
description: |
Output only. The time the session was created.
Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9
fractional digits. Offsets other than "Z" are also accepted. Examples:
"2014-10-02T15:01:23Z", "2014-10-02T15:01:23.045123456Z" or "2014-10-02T15:01:23+05:30".
type: string
format: date-time
updateTime:
description: |
Output only. The time the session was last updated.
Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9
fractional digits. Offsets other than "Z" are also accepted. Examples:
"2014-10-02T15:01:23Z", "2014-10-02T15:01:23.045123456Z" or "2014-10-02T15:01:23+05:30".
type: string
format: date-time
state:
description: |
Output only. The state of the session.
type: string
enum:
- STATE_UNSPECIFIED,
- QUEUED,
- PLANNING,
- AWAITING_PLAN_APPROVAL,
- AWAITING_USER_FEEDBACK,
- IN_PROGRESS,
- PAUSED,
- FAILED,
- COMPLETED,
url:
description: |
Output only. The URL of the session to view the session in the Jules web app.
type: string
outputs:
description: |
Output only. The outputs of the session, if any.
type: array
items:
$ref: "#/components/schemas/SessionOutput"
SourceContext:
description: |
Context for how to use a source in a session.
type: object
properties:
source:
description: |
Required. The name of the source this context is for. To get the list of sources,
use the ListSources API. Format: sources/{source}
type: string
example: "sources/github/bobalover/boba"
oneOf:
- type: object
description: |
Context to use a GitHubRepo in a session.
required:
- githubRepoContext
properties:
githubRepoContext:
$ref: "#/components/schemas/GithubRepoContext"
GithubRepoContext:
description: |
Context to use a GitHubRepo in a session.
type: object
required:
- startingBranch
properties:
startingBranch:
description: |
Required. The name of the branch to start the session from.
type: string
SessionOutput:
description: |
An output of a session.
type: object
oneOf:
- type: object
description: |
A pull request created by the session, if applicable.
required:
- pullRequest
properties:
pullRequest:
$ref: "#/components/schemas/PullRequest"
PullRequest:
description: |
A pull request.
type: object
properties:
url:
description: |
The URL of the pull request.
type: string
example: "https://github.com/bobalover/boba/pull/35"
title:
description: |
The title of the pull request.
type: string
example: "Create a boba app"
description:
description: |
The description of the pull request.
type: string
example: "This change adds the initial implementation of a boba app."
Activity:
description: |
A single unit of work within a Session. A Session contains multiple activities from both the
user and the agent, such as generating a plan, sending a message, or updating progress.
type: object
properties:
name:
description: |
Identifier. The full resource name (e.g.,
"sessions/{session}/activities/{activity}").
type: string
id:
description: |
Output only. The id of the activity. This is the same as the "{activity}" part of
the resource name (e.g., "sessions/{session}/activities/{activity}").
type: string
description:
description: |
Output only. A description of this activity.
type: string
createTime:
description: |
Output only. The time at which this activity was created.
Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or
9 fractional digits. Offsets other than "Z" are also accepted. Examples:
"2014-10-02T15:01:23Z", "2014-10-02T15:01:23.045123456Z" or
"2014-10-02T15:01:23+05:30".
type: string
format: date-time
originator:
description: |
The entity that this activity originated from (e.g. "user", "agent", "system").
type: string
artifacts:
description: |
Output only. The artifacts produced by this activity.
type: array
items:
$ref: "#/components/schemas/Artifact"
oneOf:
- type: object
description: |
The agent posted a message.
properties:
agentMessaged:
$ref: "#/components/schemas/AgentMessaged"
- type: object
description: |
The user posted a message.
properties:
userMessaged:
$ref: "#/components/schemas/UserMessaged"
- type: object
description: |
A plan was generated.
properties:
planGenerated:
$ref: "#/components/schemas/PlanGenerated"
- type: object
description: |
A plan was approved.
properties:
planApproved:
$ref: "#/components/schemas/PlanApproved"
- type: object
description: |
There was a progress update.
properties:
progressUpdated:
$ref: "#/components/schemas/ProgressUpdated"
- type: object
description: |
The session was completed.
properties:
sessionCompleted:
$ref: "#/components/schemas/SessionCompleted"
- type: object
description: |
The session failed.
properties:
sessionFailed:
$ref: "#/components/schemas/SessionFailed"
AgentMessaged:
description: |
The agent posted a message.
type: object
required:
- agentMessage
properties:
agentMessage:
description: |
The message the agent posted.
type: string
UserMessaged:
description: |
The user posted a message.
type: object
properties:
userMessage:
description: |
The message the user posted.
type: string
PlanGenerated:
description: |
A plan was generated.
type: object
properties:
plan:
description: |
The plan that was generated.
allOf:
- $ref: "#/components/schemas/Plan"
Plan:
description: |
A plan is a sequence of steps that the agent will take to complete the task.
type: object
properties:
id:
description: |
Output only. ID for this plan; unique within a session.
type: string
steps:
description: |
Output only. The steps in the plan.
type: array
items:
$ref: "#/components/schemas/PlanStep"
createTime:
description: |
Output only. Time when the plan was created.
Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9
fractional digits. Offsets other than "Z" are also accepted. Examples:
"2014-10-02T15:01:23Z", "2014-10-02T15:01:23.045123456Z" or "2014-10-02T15:01:23+05:30".
type: string
format: date-time
PlanStep:
description: |
A step in a plan.
type: object
properties:
id:
description: |
Output only. ID for this step; unique within a plan.
type: string
title:
description: |
Output only. The title of the step.
type: string
description:
description: |
Output only. The description of the step.
type: string
index:
description: |
Output only. 0-based index into the plan.steps.
type: integer
PlanApproved:
description: |
A plan was approved.
type: object
properties:
planId:
description: |
The ID of the plan that was approved.
type: string
ProgressUpdated:
description: |
There was a progress update.
type: object
properties:
title:
description: |
The title of the progress update.
type: string
description:
description: |
The description of the progress update.
type: string
SessionCompleted:
description: |
The session was completed.
This type has no fields.
type: object
SessionFailed:
description: |
The session failed.
type: object
properties:
reason:
description: |
The reason the session failed.
type: string
Artifact:
type: object
oneOf:
- type: object
description: |
A change set was produced (e.g. code changes).
properties:
changeSet:
$ref: "#/components/schemas/ChangeSet"
- type: object
description: |
A media file was produced (e.g. image, video).
properties:
media:
$ref: "#/components/schemas/Media"
- type: object
description: |
A bash output was produced.
properties:
bashOutput:
$ref: "#/components/schemas/BashOutput"
ChangeSet:
description: |
A set of changes to be applied to a source.
type: object
properties:
source:
description: |
The name of the source this change set applies to. Format: sources/{source}
type: string
oneOf:
- type: object
description: |
A patch in Git format.
properties:
gitPatch:
$ref: "#/components/schemas/GitPatch"
GitPatch:
description: |
A patch in Git format.
type: object
properties:
unidiffPatch:
description: |
The patch in unidiff format.
type: string
baseCommitId:
description: |
The base commit id of the patch. This is the id of the commit that the patch should be
applied to.
type: string
suggestedCommitMessage:
description: |
A suggested commit message for the patch, if one is generated.
type: string
Media:
description: |
A media output.
type: object
properties:
data:
description: |
The media data.
A base64-encoded string.
type: string
format: base64
mimeType:
description: |
The media mime type.
type: string
BashOutput:
description: |
A bash output.
type: object
properties:
command:
description: |
The bash command.
type: string
output:
description: |
The bash output. Includes both stdout and stderr.
type: string
exitCode:
description: |
The bash exit code.
type: string
Source:
description: |
An input source for the agent (e.g., a GitHub repository). Before using a source using the
API, you must first install the Jules GitHub app through the Jules web app.
type: object
properties:
name:
description: |
Identifier. The full resource name (e.g., "sources/{source}").
type: string
example: "sources/github/bobalover/boba"
id:
description: |
Output only. The id of the source. This is the same as the "{source}" part of the
resource name (e.g., "sources/{source}").
type: string
example: "github/bobalover/boba"
oneOf:
- type: object
description: |
A GitHub repo.
properties:
githubRepo:
$ref: "#/components/schemas/GitHubRepo"
GitHubRepo:
description: |
A GitHub repo.
type: object
properties:
owner:
type: string
repo:
type: string
isPrivate:
type: boolean
defaultBranch:
description: |
The default branch for this repo.
allOf:
- $ref: "#/components/schemas/GitHubBranch"
branches:
description: |
The list of active branches for this repo.
type: array
items:
$ref: "#/components/schemas/GitHubBranch"
GitHubBranch:
description: |
A GitHub branch.
type: object
properties:
displayName:
description: |
The name of the GitHub branch.
type: string
security:
- ApiKeyAuth: []
paths:
"/sessions/{session}:approvePlan":
post:
operationId: approvePlan
summary: Approves a plan in a session.
parameters:
- name: session
in: path
required: true
schema:
type: string
description: |
Required. The resource name of the session to approve the plan in. Format:
sessions/{session} It takes the form sessions/{session}.
requestBody:
description: |
The request body must be empty.
content: {}
responses:
"200":
description: |
If successful, the response body is empty.
content: {}
"400":
description: |
Invalid argument.
"403":
description: |
Permission denied.
"404":
description: |
Session not found.
/sessions:
post:
operationId: createSession
summary: Creates a new session.
requestBody:
description: |
The request body contains an instance of Session.
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/Session"
responses:
"200":
description: |
If successful, the response body contains a newly created instance of Session.
content:
application/json:
schema:
$ref: "#/components/schemas/Session"
"400":
description: |
Invalid argument.
"403":
description: |
Permission denied.
get:
operationId: listSessions
summary: Lists all sessions.
parameters:
- name: pageSize
in: query
schema:
description: |
Optional. The number of sessions to return. Must be between 1 and 100, inclusive. If
unset, defaults to 30. If set to greater than 100, it will be coerced to 100.
type: integer
- name: pageToken
in: query
schema:
description: |
Optional. A page token, received from a previous sessions.list call.
type: string
requestBody:
content: {}
responses:
"200":
description: |
Response message for sessions.list.
content:
application/json:
schema:
type: object
properties:
sessions:
description: |
The sessions from the specified request.
type: array
items:
$ref: "#/components/schemas/Session"
nextPageToken:
description: |
A token, which can be sent as pageToken to retrieve the next page. If this
field is omitted, there are no subsequent pages.
type: string
"400":
description: |
Invalid argument.
"403":
description: |
Permission denied.
/sessions/{name}:
get:
operationId: getSession
summary: Retrieves a specific session.
parameters:
- name: name
description: |
The resource name of the session to retrieve.
Format: sessions/{session}
in: path
required: true
schema:
type: string
pattern: "^sessions/[^/]+$"
example: "sessions/sess-12345-abcde"
responses:
"200":
description: |
If successful, the response body contains an instance of Session.
content:
application/json:
schema:
$ref: "#/components/schemas/Session"
"400":
description: |
Invalid argument.
"403":
description: |
Permission denied.
"404":
description: |
Session Not Found
"/sessions/{session}:sendMessage":
post:
operationId: sendMessage
summary: Sends a message from the user to a session.
parameters:
- name: session
description: |
Required. The resource name of the session to post the message to. Format:
sessions/{session} It takes the form sessions/{session}.
in: path
required: true
schema:
type: string
requestBody:
description: |
The request body contains data with the following structure:
required: true
content:
application/json:
schema:
type: object
required:
- prompt
properties:
prompt:
description: |
Required. The user prompt to send to the session
type: string
example: Create a boba app!
responses:
"200":
description: |
If successful, the response body is empty.
content: {}
"400":
description: |
Invalid argument.
"403":
description: |
Permission denied.
"404":
description: |
Session Not Found
/sessions/{session}/activities/{activity}:
get:
operationId: getActivity
summary: Gets a single activity.
parameters:
- name: session
description: |
Required. The resource name of the activity to retrieve. Format:
sessions/{session}/activities/{activity} It takes the form
sessions/{session}/activities/{activities}.
in: path
required: true
schema:
type: string
- name: activity
description: |
Required. The resource name of the activity to retrieve. Format:
sessions/{session}/activities/{activity} It takes the form
sessions/{session}/activities/{activities}.
in: path
required: true
schema:
type: string
requestBody:
description: |
The request body must be empty.
content: {}
responses:
"200":
description: |
If successful, the response body contains an instance of Activity.
content:
application/json:
schema:
$ref: "#/components/schemas/Activity"
"400":
description: |
Invalid argument.
"403":
description: |
Permission denied.
"404":
description: |
Session or activity not found
/sessions/{session}/activities:
get:
operationId: listActivities
summary: Lists activities for a session.
parameters:
- name: session
description: |
Required. The parent session, which owns this collection of activities. Format:
sessions/{session} It takes the form sessions/{session}.
in: path
required: true
schema:
type: string
- name: pageSize
description: |
Optional. The number of activities to return. Must be between 1 and 100, inclusive. If
unset, defaults to 50. If set to greater than 100, it will be coerced to 100.
in: query
required: false
schema:
type: integer
- name: pageToken
description: |
Optional. A page token, received from a previous activities.list call.
in: query
required: false
schema:
type: string
requestBody:
description: |
The request body must be empty.
content: {}
responses:
"200":
description: |
If successful, the response body contains data with the following structure:
content:
application/json:
schema:
type: object
properties:
activities:
description: |
The activities from the specified session
type: array
items:
$ref: "#/components/schemas/Activity"
nextPageToken:
description: |
A token, which can be sent as pageToken to retrieve the next page. If this
field is omitted, there are no subsequent pages.
type: string
"400":
description: |
Invalid argument.
"403":
description: |
Permission denied.
"404":
description: |
Session not found
/sources/{name}:
get:
operationId: getSource
summary: Gets a single source.
parameters:
- name: name
description: |
Required. The resource name of the source to retrieve. Format: sources/{source} It takes
the form sources/{+source}.
in: path
required: true
schema:
type: string
requestBody:
description: |
The request body must be empty.
content: {}
responses:
"200":
description: |
If successful, the response body contains an instance of Source.
content:
application/json:
schema:
$ref: "#/components/schemas/Source"
"400":
description: |
Invalid argument.
"403":
description: |
Permission denied.
"404":
description: |
Source not found
/sources:
get:
operationId: listSources
summary: Lists sources.
parameters:
- name: filter
description: |
Optional. The filter expression for listing sources, based on AIP-160. If not set, all
sources will be returned. Currently only supports filtering by name, which can be used
to filter by a single source or multiple sources separated by OR.
in: query
schema:
type: string
example: |
'name=sources/source1 OR name=sources/source2'
- name: pageSize
description: |
Optional. The number of sources to return. Must be between 1 and 100, inclusive. If
unset, defaults to 30. If set to greater than 100, it will be coerced to 100.
in: query
schema:
type: integer
- name: pageToken
description: |
Optional. A page token, received from a previous sources.list call.
in: query
schema:
type: string
requestBody:
description: |
The request body must be empty.
content: {}
responses:
"200":
description: |
If successful, the response body contains data with the following structure:
content:
application/json:
schema:
type: object
properties:
sources:
description: |
The sources from the specified request.
type: array
items:
$ref: "#/components/schemas/Source"
nextPageToken:
description: |
A token, which can be sent as pageToken to retrieve the next page. If this
field is omitted, there are no subsequent pages.
type: string
"400":
description: |
Invalid argument.
"403":
description: |
Permission denied.