@company-semantics/contracts 0.108.0 → 0.110.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@company-semantics/contracts",
3
- "version": "0.108.0",
3
+ "version": "0.110.0",
4
4
  "private": false,
5
5
  "repository": {
6
6
  "type": "git",
@@ -82,6 +82,7 @@
82
82
  "release": "npx tsx scripts/release.ts",
83
83
  "prepublishOnly": "echo 'ERROR: Publishing is CI-only via tag push. Use pnpm release instead.' && exit 1",
84
84
  "test": "vitest run",
85
+ "generate:api": "pnpm generate:api-types",
85
86
  "generate:api-types": "openapi-typescript openapi/backend.yaml -o src/api/generated.ts",
86
87
  "generate:openapi-routes": "tsx scripts/generate-openapi-routes.ts",
87
88
  "generate:api-types:check": "openapi-typescript openapi/backend.yaml -o /tmp/cs-api-types-check.ts && diff -q src/api/generated.ts /tmp/cs-api-types-check.ts"
@@ -503,6 +503,70 @@ export interface paths {
503
503
  patch?: never;
504
504
  trace?: never;
505
505
  };
506
+ "/api/executions/{executionId}/undo": {
507
+ parameters: {
508
+ query?: never;
509
+ header?: never;
510
+ path?: never;
511
+ cookie?: never;
512
+ };
513
+ get?: never;
514
+ put?: never;
515
+ /**
516
+ * Undo a completed execution
517
+ * @description Undoes a completed execution within its undo window.
518
+ * The caller must be the same user who initiated the execution.
519
+ * Idempotent: if undo was already performed, returns the existing result.
520
+ */
521
+ post: operations["undoExecution"];
522
+ delete?: never;
523
+ options?: never;
524
+ head?: never;
525
+ patch?: never;
526
+ trace?: never;
527
+ };
528
+ "/api/executions/{executionId}/confirm": {
529
+ parameters: {
530
+ query?: never;
531
+ header?: never;
532
+ path?: never;
533
+ cookie?: never;
534
+ };
535
+ get?: never;
536
+ put?: never;
537
+ /**
538
+ * Confirm a pending execution
539
+ * @description Confirms a pending execution. Serialized via advisory lock.
540
+ * The caller must be the same user who initiated the execution.
541
+ */
542
+ post: operations["confirmExecution"];
543
+ delete?: never;
544
+ options?: never;
545
+ head?: never;
546
+ patch?: never;
547
+ trace?: never;
548
+ };
549
+ "/api/executions/{executionId}/reject": {
550
+ parameters: {
551
+ query?: never;
552
+ header?: never;
553
+ path?: never;
554
+ cookie?: never;
555
+ };
556
+ get?: never;
557
+ put?: never;
558
+ /**
559
+ * Reject a pending execution
560
+ * @description Rejects a pending execution. Serialized via advisory lock.
561
+ * The caller must be the same user who initiated the execution.
562
+ */
563
+ post: operations["rejectExecution"];
564
+ delete?: never;
565
+ options?: never;
566
+ head?: never;
567
+ patch?: never;
568
+ trace?: never;
569
+ };
506
570
  "/api/timeline": {
507
571
  parameters: {
508
572
  query?: never;
@@ -871,6 +935,26 @@ export interface paths {
871
935
  patch?: never;
872
936
  trace?: never;
873
937
  };
938
+ "/api/workspace/name": {
939
+ parameters: {
940
+ query?: never;
941
+ header?: never;
942
+ path?: never;
943
+ cookie?: never;
944
+ };
945
+ get?: never;
946
+ put?: never;
947
+ post?: never;
948
+ delete?: never;
949
+ options?: never;
950
+ head?: never;
951
+ /**
952
+ * Rename the workspace
953
+ * @description PATCH the workspace name. Requires org.manage_users capability (owner or admin).
954
+ */
955
+ patch: operations["renameWorkspace"];
956
+ trace?: never;
957
+ };
874
958
  "/api/workspace/members": {
875
959
  parameters: {
876
960
  query?: never;
@@ -2017,6 +2101,26 @@ export interface paths {
2017
2101
  patch?: never;
2018
2102
  trace?: never;
2019
2103
  };
2104
+ "/api/scope/check-batch": {
2105
+ parameters: {
2106
+ query?: never;
2107
+ header?: never;
2108
+ path?: never;
2109
+ cookie?: never;
2110
+ };
2111
+ get?: never;
2112
+ put?: never;
2113
+ /**
2114
+ * Batch check authorization scopes for current user
2115
+ * @description Checks whether the current user has access to each of the given scopes. Scope strings are implementation-defined and not part of the public API vocabulary. Accepts 1-20 scope strings per request.
2116
+ */
2117
+ post: operations["checkScopeBatch"];
2118
+ delete?: never;
2119
+ options?: never;
2120
+ head?: never;
2121
+ patch?: never;
2122
+ trace?: never;
2123
+ };
2020
2124
  }
2021
2125
  export type webhooks = Record<string, never>;
2022
2126
  export interface components {
@@ -2391,6 +2495,16 @@ export interface components {
2391
2495
  estimatedCostUsd: string;
2392
2496
  requestCount: number;
2393
2497
  };
2498
+ ScopeCheckBatchRequest: {
2499
+ scopes: string[];
2500
+ };
2501
+ ScopeCheckBatchResponse: {
2502
+ results: {
2503
+ [key: string]: {
2504
+ hasAccess: boolean;
2505
+ };
2506
+ };
2507
+ };
2394
2508
  ErrorResponse: {
2395
2509
  error: string;
2396
2510
  message: string;
@@ -2411,6 +2525,46 @@ export interface components {
2411
2525
  message: string;
2412
2526
  }[];
2413
2527
  };
2528
+ ExecutionLifecycleError: {
2529
+ /** @enum {string} */
2530
+ code: "EXECUTION_CONFLICT";
2531
+ executionId: string;
2532
+ currentState: string;
2533
+ } | {
2534
+ /** @enum {string} */
2535
+ code: "EXECUTION_EXPIRED";
2536
+ executionId: string;
2537
+ /** Format: date-time */
2538
+ expiredAt: string;
2539
+ } | {
2540
+ /** @enum {string} */
2541
+ code: "EXECUTION_FORBIDDEN";
2542
+ executionId: string;
2543
+ requiredRole: string;
2544
+ };
2545
+ UndoResultData: {
2546
+ /** @description Links back to original action */
2547
+ actionId: string;
2548
+ /** @description Original execution row ID */
2549
+ executionId: string;
2550
+ /** @description New undo audit row ID (append-only) */
2551
+ undoExecutionId: string;
2552
+ /** @enum {string} */
2553
+ status: "success" | "failed";
2554
+ error?: string;
2555
+ };
2556
+ ConfirmExecutionResponse: {
2557
+ /** @enum {string} */
2558
+ status: "executing" | "blocked_pending_approval" | "already_confirmed" | "awaiting_approval";
2559
+ code?: string;
2560
+ executionId?: string;
2561
+ /** @description ExecutionResultData when execution completes inline */
2562
+ result?: Record<string, never>;
2563
+ };
2564
+ RejectExecutionResponse: {
2565
+ /** @enum {string} */
2566
+ status: "cancelled";
2567
+ };
2414
2568
  ExecutionSummary: {
2415
2569
  /** Format: uuid */
2416
2570
  executionId: string;
@@ -2654,6 +2808,9 @@ export interface components {
2654
2808
  OrgType: "personal" | "shared";
2655
2809
  /** @enum {string} */
2656
2810
  WorkspaceRole: "owner" | "admin" | "member";
2811
+ RenameWorkspaceRequest: {
2812
+ name: string;
2813
+ };
2657
2814
  WorkspaceOverview: {
2658
2815
  /** Format: uuid */
2659
2816
  id: string;
@@ -3904,6 +4061,192 @@ export interface operations {
3904
4061
  };
3905
4062
  };
3906
4063
  };
4064
+ undoExecution: {
4065
+ parameters: {
4066
+ query?: never;
4067
+ header?: never;
4068
+ path: {
4069
+ /** @description Execution ID (UUID v4) */
4070
+ executionId: string;
4071
+ };
4072
+ cookie?: never;
4073
+ };
4074
+ requestBody?: never;
4075
+ responses: {
4076
+ /** @description Undo result */
4077
+ 200: {
4078
+ headers: {
4079
+ [name: string]: unknown;
4080
+ };
4081
+ content: {
4082
+ "application/json": components["schemas"]["UndoResultData"];
4083
+ };
4084
+ };
4085
+ /** @description Invalid execution ID format or execution not in undoable state */
4086
+ 400: {
4087
+ headers: {
4088
+ [name: string]: unknown;
4089
+ };
4090
+ content: {
4091
+ "application/json": components["schemas"]["ErrorResponse"];
4092
+ };
4093
+ };
4094
+ /** @description Insufficient permissions (not the initiating user) */
4095
+ 403: {
4096
+ headers: {
4097
+ [name: string]: unknown;
4098
+ };
4099
+ content: {
4100
+ "application/json": components["schemas"]["ExecutionLifecycleError"];
4101
+ };
4102
+ };
4103
+ /** @description Execution not found */
4104
+ 404: {
4105
+ headers: {
4106
+ [name: string]: unknown;
4107
+ };
4108
+ content: {
4109
+ "application/json": components["schemas"]["ErrorResponse"];
4110
+ };
4111
+ };
4112
+ /** @description Execution in wrong state (e.g. undo window expired) */
4113
+ 409: {
4114
+ headers: {
4115
+ [name: string]: unknown;
4116
+ };
4117
+ content: {
4118
+ "application/json": components["schemas"]["ExecutionLifecycleError"];
4119
+ };
4120
+ };
4121
+ };
4122
+ };
4123
+ confirmExecution: {
4124
+ parameters: {
4125
+ query?: never;
4126
+ header?: never;
4127
+ path: {
4128
+ /** @description Execution ID (UUID v4) */
4129
+ executionId: string;
4130
+ };
4131
+ cookie?: never;
4132
+ };
4133
+ requestBody?: never;
4134
+ responses: {
4135
+ /** @description Confirmation result */
4136
+ 200: {
4137
+ headers: {
4138
+ [name: string]: unknown;
4139
+ };
4140
+ content: {
4141
+ "application/json": components["schemas"]["ConfirmExecutionResponse"];
4142
+ };
4143
+ };
4144
+ /** @description Invalid execution ID format */
4145
+ 400: {
4146
+ headers: {
4147
+ [name: string]: unknown;
4148
+ };
4149
+ content: {
4150
+ "application/json": components["schemas"]["ErrorResponse"];
4151
+ };
4152
+ };
4153
+ /** @description Insufficient permissions (not the initiating user) */
4154
+ 403: {
4155
+ headers: {
4156
+ [name: string]: unknown;
4157
+ };
4158
+ content: {
4159
+ "application/json": components["schemas"]["ExecutionLifecycleError"];
4160
+ };
4161
+ };
4162
+ /** @description Execution not found */
4163
+ 404: {
4164
+ headers: {
4165
+ [name: string]: unknown;
4166
+ };
4167
+ content: {
4168
+ "application/json": components["schemas"]["ErrorResponse"];
4169
+ };
4170
+ };
4171
+ /** @description Execution not in pending_confirmation state */
4172
+ 409: {
4173
+ headers: {
4174
+ [name: string]: unknown;
4175
+ };
4176
+ content: {
4177
+ "application/json": components["schemas"]["ExecutionLifecycleError"];
4178
+ };
4179
+ };
4180
+ /** @description Confirmation has expired */
4181
+ 410: {
4182
+ headers: {
4183
+ [name: string]: unknown;
4184
+ };
4185
+ content: {
4186
+ "application/json": components["schemas"]["ExecutionLifecycleError"];
4187
+ };
4188
+ };
4189
+ };
4190
+ };
4191
+ rejectExecution: {
4192
+ parameters: {
4193
+ query?: never;
4194
+ header?: never;
4195
+ path: {
4196
+ /** @description Execution ID (UUID v4) */
4197
+ executionId: string;
4198
+ };
4199
+ cookie?: never;
4200
+ };
4201
+ requestBody?: never;
4202
+ responses: {
4203
+ /** @description Rejection result */
4204
+ 200: {
4205
+ headers: {
4206
+ [name: string]: unknown;
4207
+ };
4208
+ content: {
4209
+ "application/json": components["schemas"]["RejectExecutionResponse"];
4210
+ };
4211
+ };
4212
+ /** @description Invalid execution ID format */
4213
+ 400: {
4214
+ headers: {
4215
+ [name: string]: unknown;
4216
+ };
4217
+ content: {
4218
+ "application/json": components["schemas"]["ErrorResponse"];
4219
+ };
4220
+ };
4221
+ /** @description Insufficient permissions (not the initiating user) */
4222
+ 403: {
4223
+ headers: {
4224
+ [name: string]: unknown;
4225
+ };
4226
+ content: {
4227
+ "application/json": components["schemas"]["ExecutionLifecycleError"];
4228
+ };
4229
+ };
4230
+ /** @description Execution not found */
4231
+ 404: {
4232
+ headers: {
4233
+ [name: string]: unknown;
4234
+ };
4235
+ content: {
4236
+ "application/json": components["schemas"]["ErrorResponse"];
4237
+ };
4238
+ };
4239
+ /** @description Execution not in pending_confirmation state */
4240
+ 409: {
4241
+ headers: {
4242
+ [name: string]: unknown;
4243
+ };
4244
+ content: {
4245
+ "application/json": components["schemas"]["ExecutionLifecycleError"];
4246
+ };
4247
+ };
4248
+ };
4249
+ };
3907
4250
  getTimelineUI: {
3908
4251
  parameters: {
3909
4252
  query?: {
@@ -4695,6 +5038,57 @@ export interface operations {
4695
5038
  };
4696
5039
  };
4697
5040
  };
5041
+ renameWorkspace: {
5042
+ parameters: {
5043
+ query?: never;
5044
+ header?: never;
5045
+ path?: never;
5046
+ cookie?: never;
5047
+ };
5048
+ requestBody: {
5049
+ content: {
5050
+ "application/json": components["schemas"]["RenameWorkspaceRequest"];
5051
+ };
5052
+ };
5053
+ responses: {
5054
+ /** @description Updated workspace overview */
5055
+ 200: {
5056
+ headers: {
5057
+ [name: string]: unknown;
5058
+ };
5059
+ content: {
5060
+ "application/json": components["schemas"]["WorkspaceOverview"];
5061
+ };
5062
+ };
5063
+ /** @description Invalid name */
5064
+ 400: {
5065
+ headers: {
5066
+ [name: string]: unknown;
5067
+ };
5068
+ content: {
5069
+ "application/json": components["schemas"]["ErrorResponse"];
5070
+ };
5071
+ };
5072
+ /** @description Missing org.manage_users capability */
5073
+ 403: {
5074
+ headers: {
5075
+ [name: string]: unknown;
5076
+ };
5077
+ content: {
5078
+ "application/json": components["schemas"]["ErrorResponse"];
5079
+ };
5080
+ };
5081
+ /** @description Workspace not found */
5082
+ 404: {
5083
+ headers: {
5084
+ [name: string]: unknown;
5085
+ };
5086
+ content: {
5087
+ "application/json": components["schemas"]["ErrorResponse"];
5088
+ };
5089
+ };
5090
+ };
5091
+ };
4698
5092
  getWorkspaceMembers: {
4699
5093
  parameters: {
4700
5094
  query?: never;
@@ -5876,6 +6270,8 @@ export interface operations {
5876
6270
  query?: {
5877
6271
  /** @description Time period for usage aggregation */
5878
6272
  period?: "current_month" | "last_30_days" | "last_7_days";
6273
+ /** @description IANA timezone identifier for date bucketing */
6274
+ tz?: string;
5879
6275
  };
5880
6276
  header?: never;
5881
6277
  path: {
@@ -5908,7 +6304,12 @@ export interface operations {
5908
6304
  };
5909
6305
  listChats: {
5910
6306
  parameters: {
5911
- query?: never;
6307
+ query?: {
6308
+ search?: string;
6309
+ limit?: number;
6310
+ offset?: number;
6311
+ includePinned?: boolean;
6312
+ };
5912
6313
  header?: never;
5913
6314
  path?: never;
5914
6315
  cookie?: never;
@@ -7748,4 +8149,46 @@ export interface operations {
7748
8149
  };
7749
8150
  };
7750
8151
  };
8152
+ checkScopeBatch: {
8153
+ parameters: {
8154
+ query?: never;
8155
+ header?: never;
8156
+ path?: never;
8157
+ cookie?: never;
8158
+ };
8159
+ requestBody: {
8160
+ content: {
8161
+ "application/json": components["schemas"]["ScopeCheckBatchRequest"];
8162
+ };
8163
+ };
8164
+ responses: {
8165
+ /** @description Authorization results for each scope */
8166
+ 200: {
8167
+ headers: {
8168
+ [name: string]: unknown;
8169
+ };
8170
+ content: {
8171
+ "application/json": components["schemas"]["ScopeCheckBatchResponse"];
8172
+ };
8173
+ };
8174
+ /** @description Invalid input (empty array, >20 items, invalid scope format) */
8175
+ 400: {
8176
+ headers: {
8177
+ [name: string]: unknown;
8178
+ };
8179
+ content: {
8180
+ "application/json": components["schemas"]["ErrorResponse"];
8181
+ };
8182
+ };
8183
+ /** @description Not authenticated */
8184
+ 401: {
8185
+ headers: {
8186
+ [name: string]: unknown;
8187
+ };
8188
+ content: {
8189
+ "application/json": components["schemas"]["ErrorResponse"];
8190
+ };
8191
+ };
8192
+ };
8193
+ };
7751
8194
  }
@@ -23,9 +23,12 @@ export const openApiRoutes = {
23
23
  '/api/drive/files/recent': ['GET'],
24
24
  '/api/drive/files/{fileId}/content': ['GET'],
25
25
  '/api/executions': ['GET', 'POST'],
26
+ '/api/executions/{executionId}/confirm': ['POST'],
26
27
  '/api/executions/{executionId}/explanation': ['GET'],
28
+ '/api/executions/{executionId}/reject': ['POST'],
27
29
  '/api/executions/{executionId}/summary': ['GET'],
28
30
  '/api/executions/{executionId}/timeline': ['GET'],
31
+ '/api/executions/{executionId}/undo': ['POST'],
29
32
  '/api/goals/docs/{slug}': ['GET'],
30
33
  '/api/goals/docs/{slug}/content': ['PUT'],
31
34
  '/api/goals/docs/{slug}/sharing': ['GET'],
@@ -50,6 +53,7 @@ export const openApiRoutes = {
50
53
  '/api/orgs/{orgId}/ai-usage': ['GET'],
51
54
  '/api/orgs/{orgId}/billing': ['GET'],
52
55
  '/api/orgs/{orgId}/budget-config': ['GET', 'PUT'],
56
+ '/api/scope/check-batch': ['POST'],
53
57
  '/api/shared/{token}': ['GET'],
54
58
  '/api/shares/{shareId}': ['DELETE', 'PATCH'],
55
59
  '/api/teams': ['GET', 'POST'],
@@ -82,6 +86,7 @@ export const openApiRoutes = {
82
86
  '/api/workspace/members': ['GET'],
83
87
  '/api/workspace/members/{id}': ['DELETE'],
84
88
  '/api/workspace/members/{id}/role': ['PATCH'],
89
+ '/api/workspace/name': ['PATCH'],
85
90
  '/api/workspace/resolve-path': ['POST'],
86
91
  '/api/workspace/resync-slack-logo': ['POST'],
87
92
  '/auth/logout': ['POST'],