@company-semantics/contracts 0.108.0 → 0.109.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.109.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;
@@ -2411,6 +2475,46 @@ export interface components {
2411
2475
  message: string;
2412
2476
  }[];
2413
2477
  };
2478
+ ExecutionLifecycleError: {
2479
+ /** @enum {string} */
2480
+ code: "EXECUTION_CONFLICT";
2481
+ executionId: string;
2482
+ currentState: string;
2483
+ } | {
2484
+ /** @enum {string} */
2485
+ code: "EXECUTION_EXPIRED";
2486
+ executionId: string;
2487
+ /** Format: date-time */
2488
+ expiredAt: string;
2489
+ } | {
2490
+ /** @enum {string} */
2491
+ code: "EXECUTION_FORBIDDEN";
2492
+ executionId: string;
2493
+ requiredRole: string;
2494
+ };
2495
+ UndoResultData: {
2496
+ /** @description Links back to original action */
2497
+ actionId: string;
2498
+ /** @description Original execution row ID */
2499
+ executionId: string;
2500
+ /** @description New undo audit row ID (append-only) */
2501
+ undoExecutionId: string;
2502
+ /** @enum {string} */
2503
+ status: "success" | "failed";
2504
+ error?: string;
2505
+ };
2506
+ ConfirmExecutionResponse: {
2507
+ /** @enum {string} */
2508
+ status: "executing" | "blocked_pending_approval" | "already_confirmed" | "awaiting_approval";
2509
+ code?: string;
2510
+ executionId?: string;
2511
+ /** @description ExecutionResultData when execution completes inline */
2512
+ result?: Record<string, never>;
2513
+ };
2514
+ RejectExecutionResponse: {
2515
+ /** @enum {string} */
2516
+ status: "cancelled";
2517
+ };
2414
2518
  ExecutionSummary: {
2415
2519
  /** Format: uuid */
2416
2520
  executionId: string;
@@ -3904,6 +4008,192 @@ export interface operations {
3904
4008
  };
3905
4009
  };
3906
4010
  };
4011
+ undoExecution: {
4012
+ parameters: {
4013
+ query?: never;
4014
+ header?: never;
4015
+ path: {
4016
+ /** @description Execution ID (UUID v4) */
4017
+ executionId: string;
4018
+ };
4019
+ cookie?: never;
4020
+ };
4021
+ requestBody?: never;
4022
+ responses: {
4023
+ /** @description Undo result */
4024
+ 200: {
4025
+ headers: {
4026
+ [name: string]: unknown;
4027
+ };
4028
+ content: {
4029
+ "application/json": components["schemas"]["UndoResultData"];
4030
+ };
4031
+ };
4032
+ /** @description Invalid execution ID format or execution not in undoable state */
4033
+ 400: {
4034
+ headers: {
4035
+ [name: string]: unknown;
4036
+ };
4037
+ content: {
4038
+ "application/json": components["schemas"]["ErrorResponse"];
4039
+ };
4040
+ };
4041
+ /** @description Insufficient permissions (not the initiating user) */
4042
+ 403: {
4043
+ headers: {
4044
+ [name: string]: unknown;
4045
+ };
4046
+ content: {
4047
+ "application/json": components["schemas"]["ExecutionLifecycleError"];
4048
+ };
4049
+ };
4050
+ /** @description Execution not found */
4051
+ 404: {
4052
+ headers: {
4053
+ [name: string]: unknown;
4054
+ };
4055
+ content: {
4056
+ "application/json": components["schemas"]["ErrorResponse"];
4057
+ };
4058
+ };
4059
+ /** @description Execution in wrong state (e.g. undo window expired) */
4060
+ 409: {
4061
+ headers: {
4062
+ [name: string]: unknown;
4063
+ };
4064
+ content: {
4065
+ "application/json": components["schemas"]["ExecutionLifecycleError"];
4066
+ };
4067
+ };
4068
+ };
4069
+ };
4070
+ confirmExecution: {
4071
+ parameters: {
4072
+ query?: never;
4073
+ header?: never;
4074
+ path: {
4075
+ /** @description Execution ID (UUID v4) */
4076
+ executionId: string;
4077
+ };
4078
+ cookie?: never;
4079
+ };
4080
+ requestBody?: never;
4081
+ responses: {
4082
+ /** @description Confirmation result */
4083
+ 200: {
4084
+ headers: {
4085
+ [name: string]: unknown;
4086
+ };
4087
+ content: {
4088
+ "application/json": components["schemas"]["ConfirmExecutionResponse"];
4089
+ };
4090
+ };
4091
+ /** @description Invalid execution ID format */
4092
+ 400: {
4093
+ headers: {
4094
+ [name: string]: unknown;
4095
+ };
4096
+ content: {
4097
+ "application/json": components["schemas"]["ErrorResponse"];
4098
+ };
4099
+ };
4100
+ /** @description Insufficient permissions (not the initiating user) */
4101
+ 403: {
4102
+ headers: {
4103
+ [name: string]: unknown;
4104
+ };
4105
+ content: {
4106
+ "application/json": components["schemas"]["ExecutionLifecycleError"];
4107
+ };
4108
+ };
4109
+ /** @description Execution not found */
4110
+ 404: {
4111
+ headers: {
4112
+ [name: string]: unknown;
4113
+ };
4114
+ content: {
4115
+ "application/json": components["schemas"]["ErrorResponse"];
4116
+ };
4117
+ };
4118
+ /** @description Execution not in pending_confirmation state */
4119
+ 409: {
4120
+ headers: {
4121
+ [name: string]: unknown;
4122
+ };
4123
+ content: {
4124
+ "application/json": components["schemas"]["ExecutionLifecycleError"];
4125
+ };
4126
+ };
4127
+ /** @description Confirmation has expired */
4128
+ 410: {
4129
+ headers: {
4130
+ [name: string]: unknown;
4131
+ };
4132
+ content: {
4133
+ "application/json": components["schemas"]["ExecutionLifecycleError"];
4134
+ };
4135
+ };
4136
+ };
4137
+ };
4138
+ rejectExecution: {
4139
+ parameters: {
4140
+ query?: never;
4141
+ header?: never;
4142
+ path: {
4143
+ /** @description Execution ID (UUID v4) */
4144
+ executionId: string;
4145
+ };
4146
+ cookie?: never;
4147
+ };
4148
+ requestBody?: never;
4149
+ responses: {
4150
+ /** @description Rejection result */
4151
+ 200: {
4152
+ headers: {
4153
+ [name: string]: unknown;
4154
+ };
4155
+ content: {
4156
+ "application/json": components["schemas"]["RejectExecutionResponse"];
4157
+ };
4158
+ };
4159
+ /** @description Invalid execution ID format */
4160
+ 400: {
4161
+ headers: {
4162
+ [name: string]: unknown;
4163
+ };
4164
+ content: {
4165
+ "application/json": components["schemas"]["ErrorResponse"];
4166
+ };
4167
+ };
4168
+ /** @description Insufficient permissions (not the initiating user) */
4169
+ 403: {
4170
+ headers: {
4171
+ [name: string]: unknown;
4172
+ };
4173
+ content: {
4174
+ "application/json": components["schemas"]["ExecutionLifecycleError"];
4175
+ };
4176
+ };
4177
+ /** @description Execution not found */
4178
+ 404: {
4179
+ headers: {
4180
+ [name: string]: unknown;
4181
+ };
4182
+ content: {
4183
+ "application/json": components["schemas"]["ErrorResponse"];
4184
+ };
4185
+ };
4186
+ /** @description Execution not in pending_confirmation state */
4187
+ 409: {
4188
+ headers: {
4189
+ [name: string]: unknown;
4190
+ };
4191
+ content: {
4192
+ "application/json": components["schemas"]["ExecutionLifecycleError"];
4193
+ };
4194
+ };
4195
+ };
4196
+ };
3907
4197
  getTimelineUI: {
3908
4198
  parameters: {
3909
4199
  query?: {
@@ -5908,7 +6198,12 @@ export interface operations {
5908
6198
  };
5909
6199
  listChats: {
5910
6200
  parameters: {
5911
- query?: never;
6201
+ query?: {
6202
+ search?: string;
6203
+ limit?: number;
6204
+ offset?: number;
6205
+ includePinned?: boolean;
6206
+ };
5912
6207
  header?: never;
5913
6208
  path?: never;
5914
6209
  cookie?: never;
@@ -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'],