terse-types 0.0.38 → 0.0.40

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/dist/types.js CHANGED
@@ -6,22 +6,27 @@ import { SlackChannelType, slackChannelTypeSchema } from "./SlackTypes.js";
6
6
  import { slackUserResponseSchema } from "./Tools.js";
7
7
  import { TriggerSchema, serializedEventSchema } from "./Triggers.js";
8
8
  export const roleSchema = z.enum(["admin", "user"]);
9
- export const userSchema = z.object({
9
+ export const userProfileSchema = z.object({
10
10
  id: z.string(),
11
- workosId: z.string(),
12
- organizationId: z.string(),
13
- organizationName: z.string(),
14
11
  email: z.string(),
15
12
  displayName: z.string(),
16
13
  firstName: z.string().nullable(),
17
14
  lastName: z.string().nullable(),
18
- displayPhotoUrl: z.string(),
15
+ displayPhotoUrl: z.string()
16
+ });
17
+ export const userSessionSchema = userProfileSchema.extend({
18
+ organizationId: z.string(),
19
+ organizationName: z.string(),
19
20
  roles: z.array(roleSchema)
20
21
  });
21
- export const userNoOrganizationSchema = userSchema.omit({
22
- organizationId: true,
23
- organizationName: true,
24
- roles: true
22
+ export const organizationSchema = z.object({
23
+ id: z.string(),
24
+ name: z.string()
25
+ });
26
+ export const membershipSchema = z.object({
27
+ organizationId: z.string(),
28
+ organizationName: z.string(),
29
+ roles: z.array(roleSchema)
25
30
  });
26
31
  export const commitAssociationSchema = z.object({
27
32
  sha: z.string(),
@@ -136,11 +141,7 @@ export const deviceTokenExchangeResponseSchema = z.object({
136
141
  user: deviceTokenExchangeUserSchema,
137
142
  organization: sdkOrganizationSummarySchema
138
143
  });
139
- export const identifyUserSchema = z.object({
140
- workosId: z.string(),
141
- email: z.string(),
142
- firstName: z.string().nullable(),
143
- lastName: z.string().nullable(),
144
+ export const identifyUserSchema = userProfileSchema.pick({ id: true, email: true, firstName: true, lastName: true }).extend({
144
145
  displayName: z.string().nullable()
145
146
  });
146
147
  export const identifyOrganizationSchema = z.object({
@@ -256,7 +257,6 @@ export const agentSchema = z.object({
256
257
  notificationSettings: agentNotificationSettingsSchema.nullable(),
257
258
  toolApprovals: z.array(z.string()).nullable(),
258
259
  updatedAt: z.string().nullable(),
259
- source: z.enum(["WEB_UI", "SDK"]).nullable(),
260
260
  metadata: jobMetadataSchema.nullable()
261
261
  });
262
262
  export const agentUpdateSchema = z.object({
@@ -269,16 +269,6 @@ export const agentUpdateSchema = z.object({
269
269
  notificationSettings: agentNotificationSettingsSchema.nullable().optional(),
270
270
  toolApprovals: z.array(z.string()).nullable().optional()
271
271
  });
272
- export const agentCreateSchema = agentSchema.omit({
273
- id: true,
274
- createdByUserId: true,
275
- source: true,
276
- updatedAt: true
277
- });
278
- export const agentDraftSchema = agentCreateSchema.extend({
279
- id: z.string().nullable(),
280
- createdByUserId: z.string()
281
- });
282
272
  export const paginationSchema = z.object({
283
273
  page: z.number(),
284
274
  limit: z.number(),
@@ -482,7 +472,7 @@ export const toolApprovalRequestedSchema = z.object({
482
472
  export const actionSchema = z.object({ type: z.literal("action"), action: runHistoryActionBaseSchema });
483
473
  export const errorSchema = z.object({ type: z.literal("error"), message: z.string() });
484
474
  export const doneSchema = z.object({ type: z.literal("done") });
485
- export const sdkDeployStageEnum = z.enum(["UPLOADING_SOURCE", "BUILDING_DEPENDENCY_IMAGE", "BUILDING_SOURCE_IMAGE", "CONFIGURING_AUTOMATIONS"]);
475
+ export const sdkDeployStageEnum = z.enum(["BUILDING_DEPENDENCY_IMAGE", "BUILDING_SOURCE_IMAGE", "CONFIGURING_AUTOMATIONS"]);
486
476
  export const deployStageSchema = z.object({ type: z.literal("deploy_stage"), stage: sdkDeployStageEnum });
487
477
  export const sdkAgentStreamEventSchema = z.discriminatedUnion("type", [
488
478
  runStartedSchema,
@@ -775,24 +765,6 @@ export const webhookJobTriggerResponseSchema = z.object({
775
765
  status: z.string().optional(),
776
766
  filtered: z.boolean().optional()
777
767
  });
778
- const fileSchema = z.object({
779
- id: z.string(),
780
- name: z.string(),
781
- get children() {
782
- return z.array(fileSchema).optional();
783
- }
784
- });
785
- export const agentFilesResponseSchema = z.object({
786
- id: z.string(),
787
- files: z.array(fileSchema)
788
- });
789
- /** Proxied SDK zip member: raw bytes as base64 plus path metadata (no separate GCS objects). */
790
- export const agentFileContentResponseSchema = z.object({
791
- path: z.string(),
792
- fileName: z.string(),
793
- contentBase64: z.string(),
794
- mimeType: z.string().optional()
795
- });
796
768
  export const projectDeployStatusSchema = z.enum(["IN_PROGRESS", "SUCCEEDED", "FAILED", "ROLLED_BACK"]);
797
769
  export const projectDeployUserSchema = z.object({
798
770
  id: z.string(),
@@ -818,12 +790,6 @@ export const projectDeploysResponseSchema = z.object({
818
790
  projectId: z.string(),
819
791
  deploys: z.array(projectDeploySchema)
820
792
  });
821
- export const projectSourceFilesResponseSchema = z.object({
822
- projectId: z.string(),
823
- deployId: z.string().nullable(),
824
- deployedAt: z.string().nullable(),
825
- files: z.array(fileSchema)
826
- });
827
793
  export const sdkListenQuerySchema = z.object({
828
794
  jobName: z.string().min(1),
829
795
  projectId: z.string().min(1)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "terse-types",
3
- "version": "0.0.38",
3
+ "version": "0.0.40",
4
4
  "type": "module",
5
5
  "description": "Shared Terse TypeScript types, enums, constants, and helpers.",
6
6
  "main": "./dist/index.js",
@@ -28,6 +28,15 @@
28
28
  "access": "public"
29
29
  },
30
30
  "license": "SEE LICENSE IN LICENSE.md",
31
+ "repository": {
32
+ "type": "git",
33
+ "url": "git+https://github.com/TerseAI/Terse.git",
34
+ "directory": "terse-types"
35
+ },
36
+ "homepage": "https://docs.useterse.ai",
37
+ "bugs": {
38
+ "url": "https://github.com/TerseAI/Terse/issues"
39
+ },
31
40
  "devDependencies": {
32
41
  "tsc-esm-fix": "^3.1.2",
33
42
  "tsx": "^4.21.0",