Skip to content

Commit 6290001

Browse files
committed
## Typescript SDK Changes:
* `glean.agents.createAgent()`: **Added**
1 parent 6758ae0 commit 6290001

31 files changed

Lines changed: 986 additions & 119 deletions

.speakeasy/gen.lock

Lines changed: 81 additions & 35 deletions
Large diffs are not rendered by default.

.speakeasy/gen.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ generation:
3535
generateNewTests: true
3636
skipResponseBodyAssertions: true
3737
typescript:
38-
version: 0.15.0
38+
version: 0.15.1
3939
acceptHeaderEnum: true
4040
additionalDependencies:
4141
dependencies: {}
@@ -84,6 +84,7 @@ typescript:
8484
enableReactQuery: true
8585
enumFormat: union
8686
envVarPrefix: GLEAN
87+
eventStreamClassName: EventStream
8788
exportZodModelNamespace: false
8889
fixEnumNameSanitization: false
8990
flatAdditionalProperties: false

.speakeasy/glean-merged-spec.yaml

Lines changed: 110 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ openapi: 3.0.0
22
info:
33
version: 0.9.0
44
title: Glean API
5-
x-source-commit-sha: 8041c7f73ed7b1a8bb52c21b4736355b3d3ac705
5+
x-source-commit-sha: 8458b85efeec4d5befaff7fc026de038dd4e0a37
66
description: |
77
# Introduction
88
In addition to the data sources that Glean has built-in support for, Glean also provides a REST API that enables customers to put arbitrary content in the search index. This is useful, for example, for doing permissions-aware search over content in internal tools that reside on-prem as well as for searching over applications that Glean does not currently support first class. In addition these APIs allow the customer to push organization data (people info, organization structure etc) into Glean.
@@ -22,7 +22,7 @@ info:
2222
These API clients provide type-safe, idiomatic interfaces for working with Glean IndexingAPIs in your language of choice.
2323
x-logo:
2424
url: https://app.glean.com/images/glean-text2.svg
25-
x-open-api-commit-sha: bcfb45a263878a9d08bcb4117a44e970b498dc10
25+
x-open-api-commit-sha: eda03784613fbf650c37fbb500f523881aef2ea0
2626
x-speakeasy-name: 'Glean API'
2727
servers:
2828
- url: https://{instance}-be.glean.com
@@ -910,6 +910,40 @@ paths:
910910
description: Internal server error.
911911
security:
912912
- APIToken: []
913+
/rest/api/v1/agents:
914+
post:
915+
tags:
916+
- Agents
917+
summary: Create an agent
918+
description: Create an agent.
919+
operationId: createAgent
920+
x-visibility: Preview
921+
parameters:
922+
- $ref: "#/components/parameters/locale"
923+
- $ref: "#/components/parameters/timezoneOffset"
924+
requestBody:
925+
required: true
926+
content:
927+
application/json:
928+
schema:
929+
$ref: "#/components/schemas/CreateWorkflowRequest"
930+
responses:
931+
"200":
932+
description: Success
933+
content:
934+
application/json:
935+
schema:
936+
$ref: "#/components/schemas/CreateWorkflowResponse"
937+
"400":
938+
description: Bad request
939+
"401":
940+
description: Not Authorized
941+
"403":
942+
description: Forbidden
943+
"500":
944+
description: Internal server error
945+
security:
946+
- APIToken: []
913947
/rest/api/v1/agents/{agent_id}:
914948
get:
915949
tags:
@@ -8990,6 +9024,80 @@ components:
89909024
items:
89919025
type: string
89929026
description: IDs of files to delete.
9027+
WorkflowDraftableProperties:
9028+
properties:
9029+
name:
9030+
type: string
9031+
description: The name of the workflow.
9032+
WorkflowMutableProperties:
9033+
type: object
9034+
allOf:
9035+
- $ref: "#/components/schemas/WorkflowDraftableProperties"
9036+
- type: object
9037+
CreateWorkflowRequest:
9038+
allOf:
9039+
- $ref: "#/components/schemas/WorkflowMutableProperties"
9040+
- type: object
9041+
properties:
9042+
transient:
9043+
type: boolean
9044+
description: Used to create a transient workflow.
9045+
parentWorkflowId:
9046+
type: string
9047+
description: id of the parent workflow for transient workflows
9048+
WorkflowMetadata:
9049+
allOf:
9050+
- type: object
9051+
properties:
9052+
author:
9053+
$ref: "#/components/schemas/Person"
9054+
createTimestamp:
9055+
type: integer
9056+
description: Server Unix timestamp of the creation time.
9057+
lastUpdateTimestamp:
9058+
type: integer
9059+
description: Server Unix timestamp of the last update time.
9060+
lastDraftSavedAt:
9061+
type: integer
9062+
description: Server Unix timestamp of the last time the draft was saved.
9063+
lastDraftSavedBy:
9064+
description: The person who last saved the draft.
9065+
$ref: "#/components/schemas/Person"
9066+
lastDraftGitAuthorId:
9067+
type: string
9068+
description: ID of the VCS user (e.g. GitHub username) who last saved the draft. Set only by the draft save path via the external Git integration API.
9069+
lastUpdatedBy:
9070+
$ref: "#/components/schemas/Person"
9071+
AttributionProperties: {}
9072+
Workflow:
9073+
allOf:
9074+
- $ref: "#/components/schemas/PermissionedObject"
9075+
- $ref: "#/components/schemas/WorkflowMutableProperties"
9076+
- $ref: "#/components/schemas/WorkflowMetadata"
9077+
- $ref: "#/components/schemas/AttributionProperties"
9078+
- type: object
9079+
properties:
9080+
id:
9081+
type: string
9082+
description: The ID of the workflow.
9083+
verified:
9084+
type: boolean
9085+
readOnly: true
9086+
description: When present, indicates this workflow is admin-verified. Set via the dedicated admin settings endpoint, not by regular edits.
9087+
showOrganizationAsAuthor:
9088+
type: boolean
9089+
readOnly: true
9090+
description: When true, displays organization name instead of author name in agent card. Set via the dedicated admin settings endpoint, not by regular edits.
9091+
WorkflowResult:
9092+
type: object
9093+
required:
9094+
- workflow
9095+
properties:
9096+
workflow:
9097+
$ref: "#/components/schemas/Workflow"
9098+
CreateWorkflowResponse:
9099+
allOf:
9100+
- $ref: "#/components/schemas/WorkflowResult"
89939101
Agent:
89949102
title: Agent
89959103
type: object
@@ -9042,16 +9150,6 @@ components:
90429150
message:
90439151
type: string
90449152
description: Client-facing error message describing what went wrong
9045-
WorkflowDraftableProperties:
9046-
properties:
9047-
name:
9048-
type: string
9049-
description: The name of the workflow.
9050-
WorkflowMutableProperties:
9051-
type: object
9052-
allOf:
9053-
- $ref: "#/components/schemas/WorkflowDraftableProperties"
9054-
- type: object
90559153
EditWorkflowRequest:
90569154
allOf:
90579155
- $ref: "#/components/schemas/WorkflowMutableProperties"
@@ -11310,7 +11408,6 @@ components:
1131011408
description: A list of removed user roles for the Workflow.
1131111409
items:
1131211410
$ref: "#/components/schemas/UserRoleSpecification"
11313-
AttributionProperties: {}
1131411411
PromptTemplate:
1131511412
allOf:
1131611413
- $ref: "#/components/schemas/PromptTemplateMutableProperties"
@@ -11386,55 +11483,6 @@ components:
1138611483
runCount:
1138711484
$ref: "#/components/schemas/CountInfo"
1138811485
description: This tracks how many times this prompt template was run. If user runs a prompt template after modifying the original one, it still counts as a run for the original template.
11389-
WorkflowMetadata:
11390-
allOf:
11391-
- type: object
11392-
properties:
11393-
author:
11394-
$ref: "#/components/schemas/Person"
11395-
createTimestamp:
11396-
type: integer
11397-
description: Server Unix timestamp of the creation time.
11398-
lastUpdateTimestamp:
11399-
type: integer
11400-
description: Server Unix timestamp of the last update time.
11401-
lastDraftSavedAt:
11402-
type: integer
11403-
description: Server Unix timestamp of the last time the draft was saved.
11404-
lastDraftSavedBy:
11405-
description: The person who last saved the draft.
11406-
$ref: "#/components/schemas/Person"
11407-
lastDraftGitAuthorId:
11408-
type: string
11409-
description: ID of the VCS user (e.g. GitHub username) who last saved the draft. Set only by the draft save path via the external Git integration API.
11410-
lastUpdatedBy:
11411-
$ref: "#/components/schemas/Person"
11412-
Workflow:
11413-
allOf:
11414-
- $ref: "#/components/schemas/PermissionedObject"
11415-
- $ref: "#/components/schemas/WorkflowMutableProperties"
11416-
- $ref: "#/components/schemas/WorkflowMetadata"
11417-
- $ref: "#/components/schemas/AttributionProperties"
11418-
- type: object
11419-
properties:
11420-
id:
11421-
type: string
11422-
description: The ID of the workflow.
11423-
verified:
11424-
type: boolean
11425-
readOnly: true
11426-
description: When present, indicates this workflow is admin-verified. Set via the dedicated admin settings endpoint, not by regular edits.
11427-
showOrganizationAsAuthor:
11428-
type: boolean
11429-
readOnly: true
11430-
description: When true, displays organization name instead of author name in agent card. Set via the dedicated admin settings endpoint, not by regular edits.
11431-
WorkflowResult:
11432-
type: object
11433-
required:
11434-
- workflow
11435-
properties:
11436-
workflow:
11437-
$ref: "#/components/schemas/Workflow"
1143811486
UserActivity:
1143911487
properties:
1144011488
actor:

.speakeasy/tests.arazzo.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164589,3 +164589,19 @@ workflows:
164589164589
type: simple
164590164590
x-speakeasy-test-group: Datasources
164591164591
x-speakeasy-test-rebuild: true
164592+
- workflowId: createAgent
164593+
steps:
164594+
- stepId: test
164595+
operationId: createAgent
164596+
requestBody:
164597+
contentType: application/json
164598+
payload: {}
164599+
successCriteria:
164600+
- condition: $statusCode == 200
164601+
- condition: $response.header.Content-Type == application/json
164602+
- context: $response.body
164603+
condition: |
164604+
{"workflow":{"author":{"name":"George Clooney","obfuscatedId":"abc123"},"lastDraftSavedBy":{"name":"George Clooney","obfuscatedId":"abc123"},"lastUpdatedBy":{"name":"George Clooney","obfuscatedId":"abc123"}}}
164605+
type: simple
164606+
x-speakeasy-test-group: Agents
164607+
x-speakeasy-test-rebuild: true

.speakeasy/workflow.lock

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
speakeasyVersion: 1.771.0
1+
speakeasyVersion: 1.774.0
22
sources:
33
Glean API:
44
sourceNamespace: glean-api-specs
5-
sourceRevisionDigest: sha256:847b1f126f78c86bb63c1c27b6053ba6a9afe8855aab3e82d1f7f71501a5e840
6-
sourceBlobDigest: sha256:b685acc261c79f1c7579b236eaff1ea63982eb1f4be4c318bd6c9a24998c6132
5+
sourceRevisionDigest: sha256:dd9eb91f0a42152889334650de4a7a12ab261520792a3aff77a32ee40d1a114a
6+
sourceBlobDigest: sha256:d2a18c0e49eef76ffc808b6211e8e59704c293516b048d0d9a83ccdf1acb6008
77
tags:
88
- latest
99
Glean Client API:
@@ -17,10 +17,10 @@ targets:
1717
glean:
1818
source: Glean API
1919
sourceNamespace: glean-api-specs
20-
sourceRevisionDigest: sha256:847b1f126f78c86bb63c1c27b6053ba6a9afe8855aab3e82d1f7f71501a5e840
21-
sourceBlobDigest: sha256:b685acc261c79f1c7579b236eaff1ea63982eb1f4be4c318bd6c9a24998c6132
20+
sourceRevisionDigest: sha256:dd9eb91f0a42152889334650de4a7a12ab261520792a3aff77a32ee40d1a114a
21+
sourceBlobDigest: sha256:d2a18c0e49eef76ffc808b6211e8e59704c293516b048d0d9a83ccdf1acb6008
2222
codeSamplesNamespace: glean-api-specs-typescript-code-samples
23-
codeSamplesRevisionDigest: sha256:b5791cfb1d37e9b90281cd3010643044add839fc460327b5789a1e216e4c5538
23+
codeSamplesRevisionDigest: sha256:02a92d9a9841dfb2b044ff55dda34078d6ca1a9b0dd6db833fb9c084b04dfa8b
2424
workflow:
2525
workflowVersion: 1.0.0
2626
speakeasyVersion: latest

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,7 @@ For more information on obtaining the appropriate token type, please contact you
282282

283283
### [Agents](docs/sdks/agents/README.md)
284284

285+
* [createAgent](docs/sdks/agents/README.md#createagent) - Create an agent
285286
* [editAgent](docs/sdks/agents/README.md#editagent) - Edit an agent
286287

287288
### [Authentication](docs/sdks/authentication/README.md)
@@ -537,6 +538,7 @@ To read more about standalone functions, check [FUNCTIONS.md](./FUNCTIONS.md).
537538

538539
<summary>Available standalone functions</summary>
539540

541+
- [`agentsCreateAgent`](docs/sdks/agents/README.md#createagent) - Create an agent
540542
- [`agentsEditAgent`](docs/sdks/agents/README.md#editagent) - Edit an agent
541543
- [`authenticationCheckdatasourceauth`](docs/sdks/authentication/README.md#checkdatasourceauth) - Check datasource authorization
542544
- [`chatGetChatFile`](docs/sdks/chat/README.md#getchatfile) - Download a chat file
@@ -697,6 +699,7 @@ To learn about this feature and how to get started, check
697699

698700
<summary>Available React hooks</summary>
699701

702+
- [`useAgentsCreateAgentMutation`](docs/sdks/agents/README.md#createagent) - Create an agent
700703
- [`useAgentsEditAgentMutation`](docs/sdks/agents/README.md#editagent) - Edit an agent
701704
- [`useAuthenticationCheckdatasourceauthMutation`](docs/sdks/authentication/README.md#checkdatasourceauth) - Check datasource authorization
702705
- [`useChatGetChatFile`](docs/sdks/chat/README.md#getchatfile) - Download a chat file

RELEASES.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -768,4 +768,14 @@ Based on:
768768
### Generated
769769
- [typescript v0.15.0] .
770770
### Releases
771-
- [NPM v0.15.0] https://www.npmjs.com/package/@gleanwork/api-client/v/0.15.0 - .
771+
- [NPM v0.15.0] https://www.npmjs.com/package/@gleanwork/api-client/v/0.15.0 - .
772+
773+
## 2026-06-10 02:58:53
774+
### Changes
775+
Based on:
776+
- OpenAPI Doc
777+
- Speakeasy CLI 1.774.0 (2.899.0) https://github.com/speakeasy-api/speakeasy
778+
### Generated
779+
- [typescript v0.15.1] .
780+
### Releases
781+
- [NPM v0.15.1] https://www.npmjs.com/package/@gleanwork/api-client/v/0.15.1 - .
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# CreateWorkflowRequest
2+
3+
## Example Usage
4+
5+
```typescript
6+
import { CreateWorkflowRequest } from "@gleanwork/api-client/models/components";
7+
8+
let value: CreateWorkflowRequest = {};
9+
```
10+
11+
## Fields
12+
13+
| Field | Type | Required | Description |
14+
| ------------------------------------------------- | ------------------------------------------------- | ------------------------------------------------- | ------------------------------------------------- |
15+
| `name` | *string* | :heavy_minus_sign: | The name of the workflow. |
16+
| `transient` | *boolean* | :heavy_minus_sign: | Used to create a transient workflow. |
17+
| `parentWorkflowId` | *string* | :heavy_minus_sign: | id of the parent workflow for transient workflows |
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# CreateAgentRequest
2+
3+
## Example Usage
4+
5+
```typescript
6+
import { CreateAgentRequest } from "@gleanwork/api-client/models/operations";
7+
8+
let value: CreateAgentRequest = {
9+
createWorkflowRequest: {},
10+
};
11+
```
12+
13+
## Fields
14+
15+
| Field | Type | Required | Description |
16+
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
17+
| `locale` | *string* | :heavy_minus_sign: | The client's preferred locale in rfc5646 format (e.g. `en`, `ja`, `pt-BR`). If omitted, the `Accept-Language` will be used. If not present or not supported, defaults to the closest match or `en`. |
18+
| `timezoneOffset` | *number* | :heavy_minus_sign: | The offset of the client's timezone in minutes from UTC. e.g. PDT is -420 because it's 7 hours behind UTC. |
19+
| `createWorkflowRequest` | [components.CreateWorkflowRequest](../../models/components/createworkflowrequest.md) | :heavy_check_mark: | N/A |

0 commit comments

Comments
 (0)