Skip to content

Commit 379e062

Browse files
committed
yet another spec alteration
1 parent b8bf53b commit 379e062

File tree

10 files changed

+67
-61
lines changed

10 files changed

+67
-61
lines changed
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
interface ConcurrentSessionUsageInfo {
2-
message: 'Info';
3-
type: 'concurrent_session_usage';
2+
reason: string;
3+
message: string;
44
usage: number;
55
quota: number;
66
last_udpated?: string;
7+
type: 'concurrent_session_usage';
78
}
89
export type { ConcurrentSessionUsageInfo };
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
interface ConversationDurationLimitInfo {
2-
message: 'Info';
3-
type: 'conversation_duration_limit';
2+
reason: string;
3+
message: string;
44
conversation_duration_limit: number;
5+
type: 'conversation_duration_limit';
56
}
67
export type { ConversationDurationLimitInfo };

packages/flow-client/models/ConversationTermination.ts

Lines changed: 0 additions & 8 deletions
This file was deleted.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
interface ConversationTerminationWarning {
2+
reason: string;
3+
message: string;
4+
conversation_termination: number;
5+
type: 'conversation_termination';
6+
}
7+
export type { ConversationTerminationWarning };

packages/flow-client/models/FlowServerMessage.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ import type { ResponseCompleted } from './ResponseCompleted';
77
import type { ResponseInterrupted } from './ResponseInterrupted';
88
import type { ToolInvoke } from './ToolInvoke';
99
import type { ErrorType } from './ErrorType';
10-
import type { DefaultWarning } from './DefaultWarning';
11-
import type { ConversationTermination } from './ConversationTermination';
10+
import type { Warning } from './Warning';
11+
import type { ConversationTerminationWarning } from './ConversationTerminationWarning';
1212
import type { Info } from './Info';
1313
import type { StatusUpdateInfo } from './StatusUpdateInfo';
1414
import type { ConversationDurationLimitInfo } from './ConversationDurationLimitInfo';
@@ -25,8 +25,8 @@ type FlowServerMessage =
2525
| ResponseInterrupted
2626
| ToolInvoke
2727
| ErrorType
28-
| DefaultWarning
29-
| ConversationTermination
28+
| Warning
29+
| ConversationTerminationWarning
3030
| Info
3131
| StatusUpdateInfo
3232
| ConversationDurationLimitInfo
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
interface Info {
2-
message: 'Info';
3-
type: string;
42
reason: string;
3+
message: string;
4+
type: string;
55
}
66
export type { Info };
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import type { StatusUpdateInfoEvent } from './StatusUpdateInfoEvent';
22
interface StatusUpdateInfo {
3-
message: 'Info';
4-
type: 'status_update';
3+
reason: string;
4+
message: string;
55
event: StatusUpdateInfoEvent;
6+
type: 'status_update';
67
}
78
export type { StatusUpdateInfo };
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type { WarningTypeEnum } from './WarningTypeEnum';
2-
interface DefaultWarning {
3-
message: 'Warning';
4-
type: WarningTypeEnum;
2+
interface Warning {
53
reason: string;
4+
message: string;
5+
type: WarningTypeEnum;
66
}
7-
export type { DefaultWarning };
7+
export type { Warning };

packages/flow-client/models/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ export * from './ToolInvoke';
3737
export * from './ToolFunction';
3838
export * from './ErrorType';
3939
export * from './ErrorTypeEnum';
40-
export * from './DefaultWarning';
40+
export * from './Warning';
4141
export * from './WarningTypeEnum';
42-
export * from './ConversationTermination';
42+
export * from './ConversationTerminationWarning';
4343
export * from './Info';
4444
export * from './StatusUpdateInfo';
4545
export * from './StatusUpdateInfoEvent';

packages/flow-client/schema/flow.yml

Lines changed: 39 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ components:
169169
Warning:
170170
summary: Warning messages sent from the server to the client.
171171
payload:
172-
$ref: "#/components/schemas/Warning"
172+
$ref: "#/components/schemas/WarningMessage"
173173
Error:
174174
summary: Error messages sent from the server to the client.
175175
payload:
@@ -550,13 +550,6 @@ components:
550550
type: string
551551
description: The content of the tool result.
552552

553-
BaseInfo:
554-
properties:
555-
message:
556-
const: Info
557-
required:
558-
- message
559-
560553
InfoMessage:
561554
type: object
562555
oneOf:
@@ -565,6 +558,15 @@ components:
565558
- $ref: '#/components/schemas/ConversationDurationLimitInfo'
566559
- $ref: '#/components/schemas/ConcurrentSessionUsageInfo'
567560

561+
BaseInfo:
562+
properties:
563+
reason:
564+
type: string
565+
message:
566+
const: Info
567+
required:
568+
- reason
569+
- message
568570

569571
Info:
570572
allOf:
@@ -573,21 +575,18 @@ components:
573575
properties:
574576
type:
575577
type: string
576-
reason:
577-
type: string
578578
required:
579-
- reason
580579
- type
581580

582581
StatusUpdateInfo:
583582
allOf:
584583
- $ref: '#/components/schemas/BaseInfo'
585584
- type: object
586585
properties:
587-
type:
588-
const: status_update
589586
event:
590587
$ref: '#/components/schemas/StatusUpdateInfoEvent'
588+
type:
589+
const: status_update
591590
required:
592591
- event
593592
- type
@@ -608,10 +607,10 @@ components:
608607
- $ref: '#/components/schemas/BaseInfo'
609608
- type: object
610609
properties:
611-
type:
612-
const: conversation_duration_limit
613610
conversation_duration_limit:
614611
type: integer
612+
type:
613+
const: conversation_duration_limit
615614
required:
616615
- conversation_duration_limit
617616
- type
@@ -621,53 +620,58 @@ components:
621620
- $ref: '#/components/schemas/BaseInfo'
622621
- type: object
623622
properties:
624-
type:
625-
const: concurrent_session_usage
626623
usage:
627624
type: integer
628625
quota:
629626
type: integer
630627
last_udpated:
631628
type: string
632629
format: date-time
630+
type:
631+
const: concurrent_session_usage
633632
required:
634633
- usage
635634
- quota
636635
- last_updated
637636
- type
638637

639-
Warning:
638+
WarningMessage:
640639
oneOf:
641-
- $ref: "#/components/schemas/DefaultWarning"
642-
- $ref: "#/components/schemas/ConversationTermination"
643-
discrimator:
644-
propertyName: type
645-
mapping:
646-
conversation_termination: "#/components/schemas/ConversationTermination"
640+
- $ref: "#/components/schemas/Warning"
641+
- $ref: "#/components/schemas/ConversationTerminationWarning"
647642

648-
DefaultWarning:
649-
type: object
643+
BaseWarning:
650644
properties:
651-
message:
652-
const: Warning
653-
type:
654-
$ref: "#/components/schemas/WarningTypeEnum"
655645
reason:
656646
type: string
647+
message:
648+
const: Warning
657649
required:
658-
- message
659-
- type
660650
- reason
651+
- message
652+
653+
Warning:
654+
allOf:
655+
- $ref: "#/components/schemas/BaseWarning"
656+
- type: object
657+
properties:
658+
type:
659+
$ref: "#/components/schemas/WarningTypeEnum"
660+
required:
661+
- type
661662

662-
ConversationTermination:
663+
ConversationTerminationWarning:
663664
allOf:
664-
- $ref: "#/components/schemas/DefaultWarning"
665+
- $ref: "#/components/schemas/BaseWarning"
665666
- type: object
666667
properties:
667668
conversation_termination:
668669
type: integer
670+
type:
671+
const: conversation_termination
669672
required:
670-
- conversation_termination
673+
- conversation_termination
674+
- type
671675

672676
Error:
673677
type: object

0 commit comments

Comments
 (0)