@company-semantics/contracts 13.4.0 → 13.5.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 +1 -1
- package/src/api/generated-spec-hash.ts +2 -2
- package/src/api/generated.ts +119 -49
- package/src/execution/events.ts +7 -12
- package/src/execution/index.ts +14 -1
- package/src/execution/sse.ts +33 -0
- package/src/execution/status.ts +22 -14
package/package.json
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// AUTO-GENERATED — do not edit. Run pnpm generate:spec-hash to regenerate.
|
|
2
|
-
export const SPEC_HASH = '
|
|
3
|
-
export const SPEC_HASH_FULL = '
|
|
2
|
+
export const SPEC_HASH = 'c6a71ea0cfa4' as const;
|
|
3
|
+
export const SPEC_HASH_FULL = 'c6a71ea0cfa4937f7069dbdbec771f42ab895123073e57995cdcff4805b0ee9b' as const;
|
package/src/api/generated.ts
CHANGED
|
@@ -2058,6 +2058,26 @@ export interface paths {
|
|
|
2058
2058
|
patch?: never;
|
|
2059
2059
|
trace?: never;
|
|
2060
2060
|
};
|
|
2061
|
+
"/api/ingestion/operations/{id}": {
|
|
2062
|
+
parameters: {
|
|
2063
|
+
query?: never;
|
|
2064
|
+
header?: never;
|
|
2065
|
+
path?: never;
|
|
2066
|
+
cookie?: never;
|
|
2067
|
+
};
|
|
2068
|
+
/**
|
|
2069
|
+
* Poll a generic ingestion operation by id (single shape for all consumers)
|
|
2070
|
+
* @description Returns the rolled-up status of an ingestion operation plus its consumerKind and dryRun flag. The validated candidate preview and a failure reason are surfaced when present. Org-scoped: an operation belonging to another org returns 404.
|
|
2071
|
+
*/
|
|
2072
|
+
get: operations["getIngestionOperation"];
|
|
2073
|
+
put?: never;
|
|
2074
|
+
post?: never;
|
|
2075
|
+
delete?: never;
|
|
2076
|
+
options?: never;
|
|
2077
|
+
head?: never;
|
|
2078
|
+
patch?: never;
|
|
2079
|
+
trace?: never;
|
|
2080
|
+
};
|
|
2061
2081
|
"/api/users/{userId}/avatar": {
|
|
2062
2082
|
parameters: {
|
|
2063
2083
|
query?: never;
|
|
@@ -2396,7 +2416,7 @@ export interface paths {
|
|
|
2396
2416
|
path?: never;
|
|
2397
2417
|
cookie?: never;
|
|
2398
2418
|
};
|
|
2399
|
-
/** Get a work item by id (
|
|
2419
|
+
/** Get a work item by id (binding gate; meta-tier admins see metadata only) */
|
|
2400
2420
|
get: operations["getWorkItemById"];
|
|
2401
2421
|
put?: never;
|
|
2402
2422
|
post?: never;
|
|
@@ -4465,6 +4485,31 @@ export interface components {
|
|
|
4465
4485
|
relationshipType: "solid" | "dotted";
|
|
4466
4486
|
}[];
|
|
4467
4487
|
};
|
|
4488
|
+
/** @description Polling snapshot of a generic ingestion operation. */
|
|
4489
|
+
IngestionOperationPollResponse: {
|
|
4490
|
+
/** Format: uuid */
|
|
4491
|
+
id: string;
|
|
4492
|
+
/** @enum {string} */
|
|
4493
|
+
status: "pending" | "normalizing" | "extracting" | "validating" | "validated" | "persisting" | "applying" | "applied" | "complete" | "failed";
|
|
4494
|
+
consumerKind: string;
|
|
4495
|
+
dryRun: boolean;
|
|
4496
|
+
/** @description A validated, not-yet-persisted extraction artifact (PRD-00756 F5). */
|
|
4497
|
+
candidate?: {
|
|
4498
|
+
data: unknown;
|
|
4499
|
+
model: string;
|
|
4500
|
+
fallbackUsed?: boolean;
|
|
4501
|
+
tokenUsage?: {
|
|
4502
|
+
input: number;
|
|
4503
|
+
output: number;
|
|
4504
|
+
};
|
|
4505
|
+
/** @enum {string} */
|
|
4506
|
+
confidence?: "low" | "medium" | "high";
|
|
4507
|
+
flags: string[];
|
|
4508
|
+
extractionMethod: string;
|
|
4509
|
+
extractionEmpty?: boolean;
|
|
4510
|
+
};
|
|
4511
|
+
error?: string;
|
|
4512
|
+
};
|
|
4468
4513
|
DriveFileListResponse: {
|
|
4469
4514
|
files: {
|
|
4470
4515
|
id: string;
|
|
@@ -4604,6 +4649,19 @@ export interface components {
|
|
|
4604
4649
|
/** @constant */
|
|
4605
4650
|
ok: true;
|
|
4606
4651
|
};
|
|
4652
|
+
WorkItemDetailResponse: {
|
|
4653
|
+
id: string;
|
|
4654
|
+
/** @enum {string} */
|
|
4655
|
+
kind: "meeting" | "comm" | "doc";
|
|
4656
|
+
title: string;
|
|
4657
|
+
content: string;
|
|
4658
|
+
contentRedacted?: boolean;
|
|
4659
|
+
metadata: {
|
|
4660
|
+
[key: string]: unknown;
|
|
4661
|
+
};
|
|
4662
|
+
createdAt: string;
|
|
4663
|
+
updatedAt: string;
|
|
4664
|
+
};
|
|
4607
4665
|
UpdateWorkItemResponse: {
|
|
4608
4666
|
updatedAt: string;
|
|
4609
4667
|
};
|
|
@@ -4726,58 +4784,32 @@ export interface components {
|
|
|
4726
4784
|
checksum: string;
|
|
4727
4785
|
cancelled?: boolean;
|
|
4728
4786
|
};
|
|
4729
|
-
/** @description Synchronous markdown/JSON
|
|
4787
|
+
/** @description Synchronous markdown/JSON export, or a queued PDF job id. */
|
|
4730
4788
|
ExportMeetingRecordingResponse: {
|
|
4731
|
-
/** @
|
|
4732
|
-
|
|
4789
|
+
/** @description ULID; unified trace key for the recording (INV-MTG-7). */
|
|
4790
|
+
recordingId: string;
|
|
4791
|
+
/**
|
|
4792
|
+
* @description Rendered export format for a finalized meeting transcript.
|
|
4793
|
+
* @enum {string}
|
|
4794
|
+
*/
|
|
4795
|
+
format: "markdown" | "text" | "vtt" | "srt" | "json";
|
|
4733
4796
|
content: string;
|
|
4734
|
-
|
|
4735
|
-
|
|
4736
|
-
format: "json";
|
|
4737
|
-
/** @description Finalized read projection for a recording (excludes drafts). */
|
|
4738
|
-
metadata: {
|
|
4797
|
+
contentRedacted?: boolean;
|
|
4798
|
+
segments: {
|
|
4739
4799
|
/** @description ULID; unified trace key for the recording (INV-MTG-7). */
|
|
4740
4800
|
recordingId: string;
|
|
4741
|
-
/** Format: uuid */
|
|
4742
|
-
ownerUserId: string;
|
|
4743
|
-
/** Format: uuid */
|
|
4744
|
-
orgId: string;
|
|
4745
|
-
title: string | null;
|
|
4746
4801
|
/**
|
|
4747
|
-
* @description
|
|
4802
|
+
* @description Capture stream identity. Mic = channel 0, system audio = channel 1.
|
|
4748
4803
|
* @enum {string}
|
|
4749
4804
|
*/
|
|
4750
|
-
|
|
4751
|
-
|
|
4752
|
-
|
|
4753
|
-
|
|
4754
|
-
|
|
4755
|
-
|
|
4756
|
-
/**
|
|
4757
|
-
|
|
4758
|
-
* @enum {string}
|
|
4759
|
-
*/
|
|
4760
|
-
status: "draft" | "recording" | "processing" | "finalized" | "failed" | "partial-transcript-network" | "cancelled";
|
|
4761
|
-
/**
|
|
4762
|
-
* @description Capture-runtime quality signal. `degraded` triggers a UI hint.
|
|
4763
|
-
* @enum {string}
|
|
4764
|
-
*/
|
|
4765
|
-
quality: "clean" | "degraded";
|
|
4766
|
-
/** Format: date-time */
|
|
4767
|
-
startedAt: string;
|
|
4768
|
-
endedAt: string | null;
|
|
4769
|
-
durationMs: number;
|
|
4770
|
-
participantUserIds: string[];
|
|
4771
|
-
transcriptAvailable: boolean;
|
|
4772
|
-
};
|
|
4773
|
-
segments: {
|
|
4774
|
-
startMs: number;
|
|
4775
|
-
endMs: number;
|
|
4776
|
-
/** @enum {string} */
|
|
4777
|
-
source: "mic" | "remote" | "unknown";
|
|
4778
|
-
speakerLabel: string | null;
|
|
4779
|
-
text: string;
|
|
4780
|
-
confidence: number | null;
|
|
4805
|
+
source: "mic" | "system";
|
|
4806
|
+
sequence: number;
|
|
4807
|
+
startedAtMs: number;
|
|
4808
|
+
endedAtMs: number | null;
|
|
4809
|
+
/** @constant */
|
|
4810
|
+
sampleRateHz: 16000;
|
|
4811
|
+
/** @constant */
|
|
4812
|
+
channels: 1;
|
|
4781
4813
|
}[];
|
|
4782
4814
|
} | {
|
|
4783
4815
|
/** @constant */
|
|
@@ -8374,6 +8406,35 @@ export interface operations {
|
|
|
8374
8406
|
};
|
|
8375
8407
|
};
|
|
8376
8408
|
};
|
|
8409
|
+
getIngestionOperation: {
|
|
8410
|
+
parameters: {
|
|
8411
|
+
query?: never;
|
|
8412
|
+
header?: never;
|
|
8413
|
+
path: {
|
|
8414
|
+
id: string;
|
|
8415
|
+
};
|
|
8416
|
+
cookie?: never;
|
|
8417
|
+
};
|
|
8418
|
+
requestBody?: never;
|
|
8419
|
+
responses: {
|
|
8420
|
+
/** @description Operation polling snapshot */
|
|
8421
|
+
200: {
|
|
8422
|
+
headers: {
|
|
8423
|
+
[name: string]: unknown;
|
|
8424
|
+
};
|
|
8425
|
+
content: {
|
|
8426
|
+
"application/json": components["schemas"]["IngestionOperationPollResponse"];
|
|
8427
|
+
};
|
|
8428
|
+
};
|
|
8429
|
+
/** @description Operation not found (or belongs to another org) */
|
|
8430
|
+
404: {
|
|
8431
|
+
headers: {
|
|
8432
|
+
[name: string]: unknown;
|
|
8433
|
+
};
|
|
8434
|
+
content?: never;
|
|
8435
|
+
};
|
|
8436
|
+
};
|
|
8437
|
+
};
|
|
8377
8438
|
uploadUserAvatar: {
|
|
8378
8439
|
parameters: {
|
|
8379
8440
|
query?: never;
|
|
@@ -8871,12 +8932,14 @@ export interface operations {
|
|
|
8871
8932
|
};
|
|
8872
8933
|
requestBody?: never;
|
|
8873
8934
|
responses: {
|
|
8874
|
-
/** @description Full work item including markdown content */
|
|
8935
|
+
/** @description Full work item including markdown content; content is redacted (contentRedacted:true) for a meta-tier viewer */
|
|
8875
8936
|
200: {
|
|
8876
8937
|
headers: {
|
|
8877
8938
|
[name: string]: unknown;
|
|
8878
8939
|
};
|
|
8879
|
-
content
|
|
8940
|
+
content: {
|
|
8941
|
+
"application/json": components["schemas"]["WorkItemDetailResponse"];
|
|
8942
|
+
};
|
|
8880
8943
|
};
|
|
8881
8944
|
/** @description Not found or not visible to this viewer */
|
|
8882
8945
|
404: {
|
|
@@ -9109,13 +9172,20 @@ export interface operations {
|
|
|
9109
9172
|
"application/json": components["schemas"]["ExportMeetingRecordingResponse"];
|
|
9110
9173
|
};
|
|
9111
9174
|
};
|
|
9112
|
-
/** @description Recording not found or not
|
|
9175
|
+
/** @description Recording not found, or the actor may not view it (no existence leak) */
|
|
9113
9176
|
404: {
|
|
9114
9177
|
headers: {
|
|
9115
9178
|
[name: string]: unknown;
|
|
9116
9179
|
};
|
|
9117
9180
|
content?: never;
|
|
9118
9181
|
};
|
|
9182
|
+
/** @description PDF export refused for a metadata-only (redacted) viewer */
|
|
9183
|
+
422: {
|
|
9184
|
+
headers: {
|
|
9185
|
+
[name: string]: unknown;
|
|
9186
|
+
};
|
|
9187
|
+
content?: never;
|
|
9188
|
+
};
|
|
9119
9189
|
};
|
|
9120
9190
|
};
|
|
9121
9191
|
downloadMeetingRecordingExport: {
|
package/src/execution/events.ts
CHANGED
|
@@ -7,19 +7,9 @@
|
|
|
7
7
|
* Forward-compatible: execution_completed, execution_failed, undo_completed, cancelled.
|
|
8
8
|
* These are defined here for type exhaustiveness but not yet emitted by backend.
|
|
9
9
|
*/
|
|
10
|
-
|
|
11
|
-
| "execution_created"
|
|
12
|
-
| "execution_started"
|
|
13
|
-
| "confirmation_approved"
|
|
14
|
-
| "confirmation_rejected"
|
|
15
|
-
| "confirmation_expired"
|
|
16
|
-
| "approval_requested"
|
|
17
|
-
| "execution_completed"
|
|
18
|
-
| "execution_failed"
|
|
19
|
-
| "undo_completed"
|
|
20
|
-
| "cancelled";
|
|
10
|
+
import { z } from "zod";
|
|
21
11
|
|
|
22
|
-
export const EXECUTION_EVENT_TYPES
|
|
12
|
+
export const EXECUTION_EVENT_TYPES = [
|
|
23
13
|
"execution_created",
|
|
24
14
|
"execution_started",
|
|
25
15
|
"confirmation_approved",
|
|
@@ -32,6 +22,11 @@ export const EXECUTION_EVENT_TYPES: readonly ExecutionEventType[] = [
|
|
|
32
22
|
"cancelled",
|
|
33
23
|
] as const;
|
|
34
24
|
|
|
25
|
+
export type ExecutionEventType = (typeof EXECUTION_EVENT_TYPES)[number];
|
|
26
|
+
|
|
27
|
+
/** Runtime-validatable form of {@link ExecutionEventType}, derived from the single source. */
|
|
28
|
+
export const ExecutionEventTypeSchema = z.enum(EXECUTION_EVENT_TYPES);
|
|
29
|
+
|
|
35
30
|
export function isExecutionEventType(
|
|
36
31
|
value: string,
|
|
37
32
|
): value is ExecutionEventType {
|
package/src/execution/index.ts
CHANGED
|
@@ -13,7 +13,18 @@
|
|
|
13
13
|
|
|
14
14
|
export type { ExecutionEventType } from "./events";
|
|
15
15
|
|
|
16
|
-
export {
|
|
16
|
+
export {
|
|
17
|
+
EXECUTION_EVENT_TYPES,
|
|
18
|
+
ExecutionEventTypeSchema,
|
|
19
|
+
isExecutionEventType,
|
|
20
|
+
} from "./events";
|
|
21
|
+
|
|
22
|
+
// =============================================================================
|
|
23
|
+
// SSE Stream Event (wire contract)
|
|
24
|
+
// =============================================================================
|
|
25
|
+
|
|
26
|
+
export { ExecutionSseEventSchema } from "./sse";
|
|
27
|
+
export type { ExecutionSseEvent } from "./sse";
|
|
17
28
|
|
|
18
29
|
// =============================================================================
|
|
19
30
|
// Event Metadata Schemas
|
|
@@ -67,6 +78,8 @@ export type { ExecutionKind } from "./kinds";
|
|
|
67
78
|
export type { ExecutionState } from "./status";
|
|
68
79
|
|
|
69
80
|
export {
|
|
81
|
+
EXECUTION_STATES,
|
|
82
|
+
ExecutionStateSchema,
|
|
70
83
|
VALID_TRANSITIONS,
|
|
71
84
|
TERMINAL_STATES,
|
|
72
85
|
EFFECTIVE_TERMINAL_STATES,
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Execution lifecycle SSE event — wire contract.
|
|
3
|
+
*
|
|
4
|
+
* The payload of one `text/event-stream` message emitted by
|
|
5
|
+
* `GET /api/executions/{executionId}/stream` (ADR-BE-269). Each SSE frame
|
|
6
|
+
* carries one execution_events row, PROJECTED to this least-exposure shape —
|
|
7
|
+
* the raw row's hash-chain fields (`event_hash`, `previous_hash`), `actor_id`,
|
|
8
|
+
* and free-form `metadata` are deliberately NOT on the wire. The stream never
|
|
9
|
+
* emits raw rows.
|
|
10
|
+
*
|
|
11
|
+
* `eventSequence` is the monotonic per-execution cursor (also the SSE `id:`
|
|
12
|
+
* field), so a client resumes after a disconnect via `Last-Event-ID`.
|
|
13
|
+
*
|
|
14
|
+
* @see ADR-CONT-029 for execution-contract design rationale.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import { z } from "zod";
|
|
18
|
+
import { ExecutionEventTypeSchema } from "./events";
|
|
19
|
+
import { ExecutionStateSchema } from "./status";
|
|
20
|
+
|
|
21
|
+
export const ExecutionSseEventSchema = z.object({
|
|
22
|
+
/** Monotonic per-execution sequence; doubles as the SSE `id:` for resume. */
|
|
23
|
+
eventSequence: z.number().int().nonnegative(),
|
|
24
|
+
eventType: ExecutionEventTypeSchema,
|
|
25
|
+
/** Execution lifecycle state AFTER this event. */
|
|
26
|
+
stateAfter: ExecutionStateSchema,
|
|
27
|
+
/** Coarse actor class that produced the event (e.g. `user`, `system`). */
|
|
28
|
+
actorType: z.string(),
|
|
29
|
+
/** DB insert time of the event, ISO-8601 with offset. */
|
|
30
|
+
createdAt: z.string().datetime({ offset: true }),
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
export type ExecutionSseEvent = z.infer<typeof ExecutionSseEventSchema>;
|
package/src/execution/status.ts
CHANGED
|
@@ -54,20 +54,28 @@
|
|
|
54
54
|
* - **INV-EXEC-5**: failed_retryable -> ready loop bounded by executor retry budget.
|
|
55
55
|
* Retry events must include retryAttempt in metadata.
|
|
56
56
|
*/
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
57
|
+
import { z } from "zod";
|
|
58
|
+
|
|
59
|
+
export const EXECUTION_STATES = [
|
|
60
|
+
"pending_confirmation",
|
|
61
|
+
"blocked_pending_approval",
|
|
62
|
+
"ready",
|
|
63
|
+
"executing",
|
|
64
|
+
"completed",
|
|
65
|
+
"completed_with_rollbacks",
|
|
66
|
+
"failed_retryable",
|
|
67
|
+
"failed_exhausted",
|
|
68
|
+
"failed_terminal",
|
|
69
|
+
"failed_with_partial_execution",
|
|
70
|
+
"cancelled",
|
|
71
|
+
"expired",
|
|
72
|
+
"undone",
|
|
73
|
+
] as const;
|
|
74
|
+
|
|
75
|
+
export type ExecutionState = (typeof EXECUTION_STATES)[number];
|
|
76
|
+
|
|
77
|
+
/** Runtime-validatable form of {@link ExecutionState}, derived from the single source. */
|
|
78
|
+
export const ExecutionStateSchema = z.enum(EXECUTION_STATES);
|
|
71
79
|
|
|
72
80
|
export const VALID_TRANSITIONS: Record<
|
|
73
81
|
ExecutionState,
|