@meistrari/chat-nuxt 4.13.0-rc.9 → 4.13.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/dist/module.json +1 -1
- package/dist/runtime/files/components/chat-file-reference.vue +5 -2
- package/dist/runtime/files/file-reference.d.ts +7 -0
- package/dist/runtime/files/file-reference.js +8 -0
- package/dist/runtime/messages/components/chat-debug-widget-gallery.vue +13 -3
- package/dist/runtime/messages/tool-registry.js +7 -0
- package/dist/runtime/rendering/debug/widget-gallery.d.ts +2 -0
- package/dist/runtime/rendering/debug/widget-gallery.js +4 -0
- package/dist/runtime/types/schemas/chat/v3-mentions.d.ts +33 -0
- package/dist/runtime/types/schemas/chat/v3-mentions.js +96 -0
- package/dist/runtime/types/schemas/chat/v3.d.ts +494 -6
- package/dist/runtime/types/schemas/chat/v3.js +271 -13
- package/dist/runtime/types/schemas/integrations/agent-events.d.ts +246 -45
- package/dist/runtime/types/schemas/integrations/agent-events.js +101 -5
- package/package.json +2 -2
|
@@ -38,6 +38,12 @@ export declare const v5ErrorStatus: {
|
|
|
38
38
|
readonly invalid_event_limit: 400;
|
|
39
39
|
readonly invalid_artifact_limit: 400;
|
|
40
40
|
readonly invalid_user_event_batch: 400;
|
|
41
|
+
/** A named input the session's commit does not declare (agent-api #858). */
|
|
42
|
+
readonly input_not_declared: 400;
|
|
43
|
+
/** A `file` input given text, or a `text` input given a Vault reference. */
|
|
44
|
+
readonly input_type_mismatch: 400;
|
|
45
|
+
/** The session's first message left out a required input. */
|
|
46
|
+
readonly input_required: 400;
|
|
41
47
|
readonly insufficient_role: 403;
|
|
42
48
|
readonly agent_publication_forbidden: 403;
|
|
43
49
|
readonly session_not_found: 404;
|
|
@@ -65,6 +71,9 @@ export declare const v5ErrorStatus: {
|
|
|
65
71
|
readonly payload_not_offloaded: 413;
|
|
66
72
|
readonly agent_config_invalid: 422;
|
|
67
73
|
readonly model_not_on_provider: 422;
|
|
74
|
+
readonly model_not_found: 422;
|
|
75
|
+
readonly model_harness_mismatch: 422;
|
|
76
|
+
readonly invalid_effort: 422;
|
|
68
77
|
readonly internal_error: 500;
|
|
69
78
|
readonly session_vault_unavailable: 503;
|
|
70
79
|
readonly detached_delivery_unavailable: 503;
|
|
@@ -113,10 +122,49 @@ export declare const v5UserEventTypeSchema: z.ZodEnum<{
|
|
|
113
122
|
export declare const VAULT_REFERENCE_PREFIX = "vault://";
|
|
114
123
|
export declare function isVaultReference(payload: string): boolean;
|
|
115
124
|
export declare const v5VaultReferenceSchema: z.ZodString;
|
|
125
|
+
/** The efforts a message's `settings` take. The catalog also lists `none`, which a message cannot ask for. */
|
|
126
|
+
export declare const v5ReasoningEffortValues: readonly ["low", "medium", "high", "xhigh", "max"];
|
|
127
|
+
export declare const v5ReasoningEffortSchema: z.ZodEnum<{
|
|
128
|
+
low: "low";
|
|
129
|
+
medium: "medium";
|
|
130
|
+
high: "high";
|
|
131
|
+
xhigh: "xhigh";
|
|
132
|
+
max: "max";
|
|
133
|
+
}>;
|
|
134
|
+
export type V5ReasoningEffort = z.infer<typeof v5ReasoningEffortSchema>;
|
|
135
|
+
export declare const v5ModelIdSchema: z.ZodString;
|
|
136
|
+
/**
|
|
137
|
+
* The model and effort one message runs with, both or none. Without them, agent-api runs the
|
|
138
|
+
* message with the session's own (the agent's at its snapshot); it never keeps the last ones.
|
|
139
|
+
* agent-api checks the model against the session's harness and provider when it admits the message.
|
|
140
|
+
*/
|
|
141
|
+
export declare const v5MessageSettingsSchema: z.ZodObject<{
|
|
142
|
+
model: z.ZodString;
|
|
143
|
+
reasoningEffort: z.ZodEnum<{
|
|
144
|
+
low: "low";
|
|
145
|
+
medium: "medium";
|
|
146
|
+
high: "high";
|
|
147
|
+
xhigh: "xhigh";
|
|
148
|
+
max: "max";
|
|
149
|
+
}>;
|
|
150
|
+
}, z.core.$strict>;
|
|
151
|
+
export type V5MessageSettings = z.infer<typeof v5MessageSettingsSchema>;
|
|
152
|
+
/** The name of an agent input, as agent-api takes it; the agent reads its value in `input/<name>/`. */
|
|
153
|
+
export declare const v5InputNameSchema: z.ZodString;
|
|
116
154
|
/** A user event as the client sends it: a message, a steer, an input, a cancel or an answer. */
|
|
117
155
|
export declare const v5UserEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
118
156
|
type: z.ZodLiteral<"message-queue">;
|
|
119
157
|
payload: z.ZodString;
|
|
158
|
+
settings: z.ZodOptional<z.ZodObject<{
|
|
159
|
+
model: z.ZodString;
|
|
160
|
+
reasoningEffort: z.ZodEnum<{
|
|
161
|
+
low: "low";
|
|
162
|
+
medium: "medium";
|
|
163
|
+
high: "high";
|
|
164
|
+
xhigh: "xhigh";
|
|
165
|
+
max: "max";
|
|
166
|
+
}>;
|
|
167
|
+
}, z.core.$strict>>;
|
|
120
168
|
}, z.core.$strict>, z.ZodObject<{
|
|
121
169
|
type: z.ZodLiteral<"message-steer">;
|
|
122
170
|
turnId: z.ZodString;
|
|
@@ -132,12 +180,32 @@ export declare const v5UserEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
132
180
|
type: z.ZodLiteral<"tool-result">;
|
|
133
181
|
toolCallId: z.ZodString;
|
|
134
182
|
payload: z.ZodString;
|
|
183
|
+
settings: z.ZodOptional<z.ZodObject<{
|
|
184
|
+
model: z.ZodString;
|
|
185
|
+
reasoningEffort: z.ZodEnum<{
|
|
186
|
+
low: "low";
|
|
187
|
+
medium: "medium";
|
|
188
|
+
high: "high";
|
|
189
|
+
xhigh: "xhigh";
|
|
190
|
+
max: "max";
|
|
191
|
+
}>;
|
|
192
|
+
}, z.core.$strict>>;
|
|
135
193
|
}, z.core.$strict>], "type">;
|
|
136
194
|
export type V5UserEvent = z.infer<typeof v5UserEventSchema>;
|
|
137
195
|
export declare const v5EventsRequestSchema: z.ZodObject<{
|
|
138
196
|
events: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
139
197
|
type: z.ZodLiteral<"message-queue">;
|
|
140
198
|
payload: z.ZodString;
|
|
199
|
+
settings: z.ZodOptional<z.ZodObject<{
|
|
200
|
+
model: z.ZodString;
|
|
201
|
+
reasoningEffort: z.ZodEnum<{
|
|
202
|
+
low: "low";
|
|
203
|
+
medium: "medium";
|
|
204
|
+
high: "high";
|
|
205
|
+
xhigh: "xhigh";
|
|
206
|
+
max: "max";
|
|
207
|
+
}>;
|
|
208
|
+
}, z.core.$strict>>;
|
|
141
209
|
}, z.core.$strict>, z.ZodObject<{
|
|
142
210
|
type: z.ZodLiteral<"message-steer">;
|
|
143
211
|
turnId: z.ZodString;
|
|
@@ -153,6 +221,16 @@ export declare const v5EventsRequestSchema: z.ZodObject<{
|
|
|
153
221
|
type: z.ZodLiteral<"tool-result">;
|
|
154
222
|
toolCallId: z.ZodString;
|
|
155
223
|
payload: z.ZodString;
|
|
224
|
+
settings: z.ZodOptional<z.ZodObject<{
|
|
225
|
+
model: z.ZodString;
|
|
226
|
+
reasoningEffort: z.ZodEnum<{
|
|
227
|
+
low: "low";
|
|
228
|
+
medium: "medium";
|
|
229
|
+
high: "high";
|
|
230
|
+
xhigh: "xhigh";
|
|
231
|
+
max: "max";
|
|
232
|
+
}>;
|
|
233
|
+
}, z.core.$strict>>;
|
|
156
234
|
}, z.core.$strict>], "type">>;
|
|
157
235
|
}, z.core.$strict>;
|
|
158
236
|
export type V5EventsRequest = z.infer<typeof v5EventsRequestSchema>;
|
|
@@ -608,6 +686,8 @@ export declare const v5SessionSchema: z.ZodObject<{
|
|
|
608
686
|
effort: z.ZodOptional<z.ZodString>;
|
|
609
687
|
commitSha: z.ZodString;
|
|
610
688
|
repository: z.ZodString;
|
|
689
|
+
/** The inputs the pinned commit declares (`v5InputContractSchema`), `{}` when it declares none. */
|
|
690
|
+
inputs: z.ZodOptional<z.ZodUnknown>;
|
|
611
691
|
}, z.core.$loose>;
|
|
612
692
|
effectiveModelSettings: z.ZodNullable<z.ZodObject<{
|
|
613
693
|
model: z.ZodString;
|
|
@@ -616,51 +696,39 @@ export declare const v5SessionSchema: z.ZodObject<{
|
|
|
616
696
|
createdAt: z.ZodString;
|
|
617
697
|
}, z.core.$loose>;
|
|
618
698
|
export type V5Session = z.infer<typeof v5SessionSchema>;
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
}>;
|
|
653
|
-
model: z.ZodOptional<z.ZodString>;
|
|
654
|
-
provider: z.ZodOptional<z.ZodString>;
|
|
655
|
-
effort: z.ZodOptional<z.ZodString>;
|
|
656
|
-
commitSha: z.ZodString;
|
|
657
|
-
repository: z.ZodString;
|
|
658
|
-
}, z.core.$loose>;
|
|
659
|
-
effectiveModelSettings: z.ZodNullable<z.ZodObject<{
|
|
660
|
-
model: z.ZodString;
|
|
661
|
-
reasoningEffort: z.ZodNullable<z.ZodString>;
|
|
662
|
-
}, z.core.$loose>>;
|
|
663
|
-
createdAt: z.ZodString;
|
|
699
|
+
/**
|
|
700
|
+
* An input the agent declares in its `input-schema.json` (agent-api `declaredInputSchema`). It has
|
|
701
|
+
* no default value: the session is given it, by a named `input` event.
|
|
702
|
+
*/
|
|
703
|
+
export declare const v5DeclaredInputSchema: z.ZodObject<{
|
|
704
|
+
name: z.ZodString;
|
|
705
|
+
/** `text` or `file`; read as an open string so a new kind never breaks the chat. */
|
|
706
|
+
type: z.ZodString;
|
|
707
|
+
required: z.ZodBoolean;
|
|
708
|
+
description: z.ZodOptional<z.ZodString>;
|
|
709
|
+
}, z.core.$loose>;
|
|
710
|
+
export type V5DeclaredInput = z.infer<typeof v5DeclaredInputSchema>;
|
|
711
|
+
/** `GET /v5/agents/{agentId}/inputs`: the declarations at the branch or commit read. */
|
|
712
|
+
export declare const v5InputListSchema: z.ZodObject<{
|
|
713
|
+
branch: z.ZodString;
|
|
714
|
+
commitHash: z.ZodString;
|
|
715
|
+
inputs: z.ZodArray<z.ZodObject<{
|
|
716
|
+
name: z.ZodString;
|
|
717
|
+
/** `text` or `file`; read as an open string so a new kind never breaks the chat. */
|
|
718
|
+
type: z.ZodString;
|
|
719
|
+
required: z.ZodBoolean;
|
|
720
|
+
description: z.ZodOptional<z.ZodString>;
|
|
721
|
+
}, z.core.$loose>>;
|
|
722
|
+
}, z.core.$loose>;
|
|
723
|
+
export type V5InputList = z.infer<typeof v5InputListSchema>;
|
|
724
|
+
/** A session's `configuration.inputs` when its pinned commit declares inputs. */
|
|
725
|
+
export declare const v5InputContractSchema: z.ZodObject<{
|
|
726
|
+
inputs: z.ZodArray<z.ZodObject<{
|
|
727
|
+
name: z.ZodString;
|
|
728
|
+
/** `text` or `file`; read as an open string so a new kind never breaks the chat. */
|
|
729
|
+
type: z.ZodString;
|
|
730
|
+
required: z.ZodBoolean;
|
|
731
|
+
description: z.ZodOptional<z.ZodString>;
|
|
664
732
|
}, z.core.$loose>>;
|
|
665
733
|
}, z.core.$loose>;
|
|
666
734
|
/** Creation admits the session and its first queued messages and inputs in one idempotent request. */
|
|
@@ -676,6 +744,16 @@ export declare const v5SessionCreateSchema: z.ZodObject<{
|
|
|
676
744
|
events: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
677
745
|
type: z.ZodLiteral<"message-queue">;
|
|
678
746
|
payload: z.ZodString;
|
|
747
|
+
settings: z.ZodOptional<z.ZodObject<{
|
|
748
|
+
model: z.ZodString;
|
|
749
|
+
reasoningEffort: z.ZodEnum<{
|
|
750
|
+
low: "low";
|
|
751
|
+
medium: "medium";
|
|
752
|
+
high: "high";
|
|
753
|
+
xhigh: "xhigh";
|
|
754
|
+
max: "max";
|
|
755
|
+
}>;
|
|
756
|
+
}, z.core.$strict>>;
|
|
679
757
|
}, z.core.$strict>, z.ZodObject<{
|
|
680
758
|
type: z.ZodLiteral<"message-steer">;
|
|
681
759
|
turnId: z.ZodString;
|
|
@@ -691,6 +769,16 @@ export declare const v5SessionCreateSchema: z.ZodObject<{
|
|
|
691
769
|
type: z.ZodLiteral<"tool-result">;
|
|
692
770
|
toolCallId: z.ZodString;
|
|
693
771
|
payload: z.ZodString;
|
|
772
|
+
settings: z.ZodOptional<z.ZodObject<{
|
|
773
|
+
model: z.ZodString;
|
|
774
|
+
reasoningEffort: z.ZodEnum<{
|
|
775
|
+
low: "low";
|
|
776
|
+
medium: "medium";
|
|
777
|
+
high: "high";
|
|
778
|
+
xhigh: "xhigh";
|
|
779
|
+
max: "max";
|
|
780
|
+
}>;
|
|
781
|
+
}, z.core.$strict>>;
|
|
694
782
|
}, z.core.$strict>], "type">>>;
|
|
695
783
|
telaAgentId: z.ZodOptional<z.ZodString>;
|
|
696
784
|
projectId: z.ZodOptional<z.ZodString>;
|
|
@@ -823,6 +911,88 @@ export declare const v5AgentListSchema: z.ZodObject<{
|
|
|
823
911
|
updatedAt: z.ZodString;
|
|
824
912
|
}, z.core.$loose>>;
|
|
825
913
|
}, z.core.$loose>;
|
|
914
|
+
/** A branch of an agent's repository, as agent-api takes it in a query or a body. */
|
|
915
|
+
export declare const v5BranchNameSchema: z.ZodString;
|
|
916
|
+
export declare const v5CommitHashSchema: z.ZodString;
|
|
917
|
+
/** Where a read of the repository looks: a branch, a commit, or the default branch. */
|
|
918
|
+
export declare const v5RepositoryRefSchema: z.ZodObject<{
|
|
919
|
+
branch: z.ZodOptional<z.ZodString>;
|
|
920
|
+
commitHash: z.ZodOptional<z.ZodString>;
|
|
921
|
+
}, z.core.$strict>;
|
|
922
|
+
export type V5RepositoryRef = z.infer<typeof v5RepositoryRefSchema>;
|
|
923
|
+
/**
|
|
924
|
+
* A model of agent-api's catalog (`GET /v5/agents/models`). `reasoningEfforts` are the ones the
|
|
925
|
+
* model runs with, `none` included; an alias (`aliasOf`) names another entry.
|
|
926
|
+
*/
|
|
927
|
+
export declare const v5ModelSchema: z.ZodObject<{
|
|
928
|
+
id: z.ZodString;
|
|
929
|
+
name: z.ZodString;
|
|
930
|
+
vendor: z.ZodString;
|
|
931
|
+
harness: z.ZodEnum<{
|
|
932
|
+
claude: "claude";
|
|
933
|
+
lightweight: "lightweight";
|
|
934
|
+
codex: "codex";
|
|
935
|
+
}>;
|
|
936
|
+
harnesses: z.ZodArray<z.ZodEnum<{
|
|
937
|
+
claude: "claude";
|
|
938
|
+
lightweight: "lightweight";
|
|
939
|
+
codex: "codex";
|
|
940
|
+
}>>;
|
|
941
|
+
contextWindow: z.ZodNumber;
|
|
942
|
+
maxOutputTokens: z.ZodNullable<z.ZodNumber>;
|
|
943
|
+
inputModalities: z.ZodArray<z.ZodString>;
|
|
944
|
+
tier: z.ZodNumber;
|
|
945
|
+
reasoningEfforts: z.ZodArray<z.ZodString>;
|
|
946
|
+
defaultReasoningEffort: z.ZodNullable<z.ZodString>;
|
|
947
|
+
status: z.ZodEnum<{
|
|
948
|
+
available: "available";
|
|
949
|
+
deprecated: "deprecated";
|
|
950
|
+
}>;
|
|
951
|
+
aliasOf: z.ZodNullable<z.ZodString>;
|
|
952
|
+
isDefault: z.ZodBoolean;
|
|
953
|
+
}, z.core.$loose>;
|
|
954
|
+
export type V5Model = z.infer<typeof v5ModelSchema>;
|
|
955
|
+
export declare const v5ModelListSchema: z.ZodObject<{
|
|
956
|
+
models: z.ZodArray<z.ZodObject<{
|
|
957
|
+
id: z.ZodString;
|
|
958
|
+
name: z.ZodString;
|
|
959
|
+
vendor: z.ZodString;
|
|
960
|
+
harness: z.ZodEnum<{
|
|
961
|
+
claude: "claude";
|
|
962
|
+
lightweight: "lightweight";
|
|
963
|
+
codex: "codex";
|
|
964
|
+
}>;
|
|
965
|
+
harnesses: z.ZodArray<z.ZodEnum<{
|
|
966
|
+
claude: "claude";
|
|
967
|
+
lightweight: "lightweight";
|
|
968
|
+
codex: "codex";
|
|
969
|
+
}>>;
|
|
970
|
+
contextWindow: z.ZodNumber;
|
|
971
|
+
maxOutputTokens: z.ZodNullable<z.ZodNumber>;
|
|
972
|
+
inputModalities: z.ZodArray<z.ZodString>;
|
|
973
|
+
tier: z.ZodNumber;
|
|
974
|
+
reasoningEfforts: z.ZodArray<z.ZodString>;
|
|
975
|
+
defaultReasoningEffort: z.ZodNullable<z.ZodString>;
|
|
976
|
+
status: z.ZodEnum<{
|
|
977
|
+
available: "available";
|
|
978
|
+
deprecated: "deprecated";
|
|
979
|
+
}>;
|
|
980
|
+
aliasOf: z.ZodNullable<z.ZodString>;
|
|
981
|
+
isDefault: z.ZodBoolean;
|
|
982
|
+
}, z.core.$loose>>;
|
|
983
|
+
}, z.core.$loose>;
|
|
984
|
+
export declare const v5ModelQuerySchema: z.ZodObject<{
|
|
985
|
+
harness: z.ZodOptional<z.ZodEnum<{
|
|
986
|
+
claude: "claude";
|
|
987
|
+
lightweight: "lightweight";
|
|
988
|
+
codex: "codex";
|
|
989
|
+
}>>;
|
|
990
|
+
status: z.ZodOptional<z.ZodEnum<{
|
|
991
|
+
available: "available";
|
|
992
|
+
deprecated: "deprecated";
|
|
993
|
+
}>>;
|
|
994
|
+
}, z.core.$strict>;
|
|
995
|
+
export type V5ModelQuery = z.infer<typeof v5ModelQuerySchema>;
|
|
826
996
|
export declare const v5SnapshotPublishSchema: z.ZodObject<{
|
|
827
997
|
organizationName: z.ZodString;
|
|
828
998
|
repository: z.ZodString;
|
|
@@ -914,3 +1084,34 @@ export declare const v5ArtifactQuerySchema: z.ZodObject<{
|
|
|
914
1084
|
limit: z.ZodOptional<z.ZodNumber>;
|
|
915
1085
|
}, z.core.$strict>;
|
|
916
1086
|
export type V5ArtifactQuery = z.infer<typeof v5ArtifactQuerySchema>;
|
|
1087
|
+
/** A path of the agent's repository tree at one commit (`GET /v5/agents/{agentId}/repository`). */
|
|
1088
|
+
export declare const v5RepositoryTreeEntrySchema: z.ZodObject<{
|
|
1089
|
+
path: z.ZodString;
|
|
1090
|
+
/** `blob` or `tree`; read as an open string so a new kind never breaks the chat. */
|
|
1091
|
+
type: z.ZodString;
|
|
1092
|
+
sha: z.ZodString;
|
|
1093
|
+
size: z.ZodOptional<z.ZodNumber>;
|
|
1094
|
+
}, z.core.$loose>;
|
|
1095
|
+
export type V5RepositoryTreeEntry = z.infer<typeof v5RepositoryTreeEntrySchema>;
|
|
1096
|
+
export declare const v5RepositoryTreeSchema: z.ZodObject<{
|
|
1097
|
+
branch: z.ZodString;
|
|
1098
|
+
commitHash: z.ZodString;
|
|
1099
|
+
tree: z.ZodArray<z.ZodObject<{
|
|
1100
|
+
path: z.ZodString;
|
|
1101
|
+
/** `blob` or `tree`; read as an open string so a new kind never breaks the chat. */
|
|
1102
|
+
type: z.ZodString;
|
|
1103
|
+
sha: z.ZodString;
|
|
1104
|
+
size: z.ZodOptional<z.ZodNumber>;
|
|
1105
|
+
}, z.core.$loose>>;
|
|
1106
|
+
commitMessage: z.ZodNullable<z.ZodString>;
|
|
1107
|
+
}, z.core.$loose>;
|
|
1108
|
+
export type V5RepositoryTree = z.infer<typeof v5RepositoryTreeSchema>;
|
|
1109
|
+
/** One file of the agent's repository at a commit: text as it is, anything else in base64 (`encoding`). */
|
|
1110
|
+
export declare const v5RepositoryFileSchema: z.ZodObject<{
|
|
1111
|
+
branch: z.ZodString;
|
|
1112
|
+
commitHash: z.ZodString;
|
|
1113
|
+
filePath: z.ZodString;
|
|
1114
|
+
content: z.ZodString;
|
|
1115
|
+
encoding: z.ZodString;
|
|
1116
|
+
}, z.core.$loose>;
|
|
1117
|
+
export type V5RepositoryFile = z.infer<typeof v5RepositoryFileSchema>;
|
|
@@ -32,6 +32,12 @@ export const v5ErrorStatus = {
|
|
|
32
32
|
invalid_event_limit: 400,
|
|
33
33
|
invalid_artifact_limit: 400,
|
|
34
34
|
invalid_user_event_batch: 400,
|
|
35
|
+
/** A named input the session's commit does not declare (agent-api #858). */
|
|
36
|
+
input_not_declared: 400,
|
|
37
|
+
/** A `file` input given text, or a `text` input given a Vault reference. */
|
|
38
|
+
input_type_mismatch: 400,
|
|
39
|
+
/** The session's first message left out a required input. */
|
|
40
|
+
input_required: 400,
|
|
35
41
|
insufficient_role: 403,
|
|
36
42
|
agent_publication_forbidden: 403,
|
|
37
43
|
session_not_found: 404,
|
|
@@ -59,6 +65,9 @@ export const v5ErrorStatus = {
|
|
|
59
65
|
payload_not_offloaded: 413,
|
|
60
66
|
agent_config_invalid: 422,
|
|
61
67
|
model_not_on_provider: 422,
|
|
68
|
+
model_not_found: 422,
|
|
69
|
+
model_harness_mismatch: 422,
|
|
70
|
+
invalid_effort: 422,
|
|
62
71
|
internal_error: 500,
|
|
63
72
|
session_vault_unavailable: 503,
|
|
64
73
|
detached_delivery_unavailable: 503,
|
|
@@ -78,7 +87,18 @@ export function isVaultReference(payload) {
|
|
|
78
87
|
return payload.startsWith(VAULT_REFERENCE_PREFIX);
|
|
79
88
|
}
|
|
80
89
|
export const v5VaultReferenceSchema = z.string().max(2048).regex(/^vault:\/\/\S+$/u);
|
|
81
|
-
|
|
90
|
+
/** The efforts a message's `settings` take. The catalog also lists `none`, which a message cannot ask for. */
|
|
91
|
+
export const v5ReasoningEffortValues = ['low', 'medium', 'high', 'xhigh', 'max'];
|
|
92
|
+
export const v5ReasoningEffortSchema = z.enum(v5ReasoningEffortValues);
|
|
93
|
+
export const v5ModelIdSchema = z.string().min(1).max(256);
|
|
94
|
+
/**
|
|
95
|
+
* The model and effort one message runs with, both or none. Without them, agent-api runs the
|
|
96
|
+
* message with the session's own (the agent's at its snapshot); it never keeps the last ones.
|
|
97
|
+
* agent-api checks the model against the session's harness and provider when it admits the message.
|
|
98
|
+
*/
|
|
99
|
+
export const v5MessageSettingsSchema = z.object({ model: v5ModelIdSchema, reasoningEffort: v5ReasoningEffortSchema }).strict();
|
|
100
|
+
/** The name of an agent input, as agent-api takes it; the agent reads its value in `input/<name>/`. */
|
|
101
|
+
export const v5InputNameSchema = z.string().min(1).max(128).regex(/^[a-z_][\w-]*$/iu);
|
|
82
102
|
const payloadSchema = z.string().min(1);
|
|
83
103
|
function isAnswers(payload) {
|
|
84
104
|
try {
|
|
@@ -91,11 +111,12 @@ function isAnswers(payload) {
|
|
|
91
111
|
}
|
|
92
112
|
/** A user event as the client sends it: a message, a steer, an input, a cancel or an answer. */
|
|
93
113
|
export const v5UserEventSchema = z.discriminatedUnion('type', [
|
|
94
|
-
z.object({ type: z.literal('message-queue'), payload: payloadSchema }).strict(),
|
|
114
|
+
z.object({ type: z.literal('message-queue'), payload: payloadSchema, settings: v5MessageSettingsSchema.optional() }).strict(),
|
|
95
115
|
z.object({ type: z.literal('message-steer'), turnId: v5TurnIdSchema, payload: payloadSchema }).strict(),
|
|
96
|
-
z.object({ type: z.literal('input'), name:
|
|
116
|
+
z.object({ type: z.literal('input'), name: v5InputNameSchema.optional(), payload: payloadSchema.optional() }).strict(),
|
|
97
117
|
z.object({ type: z.literal('cancel'), turnId: v5TurnIdSchema }).strict(),
|
|
98
|
-
|
|
118
|
+
// An answer opens the next turn, so it takes settings too; a steer runs in the turn it joins.
|
|
119
|
+
z.object({ type: z.literal('tool-result'), toolCallId: z.string().min(1).max(v5Limits.turnIdChars), payload: payloadSchema, settings: v5MessageSettingsSchema.optional() }).strict(),
|
|
99
120
|
]).superRefine((input, ctx) => {
|
|
100
121
|
const payload = 'payload' in input ? input.payload : undefined;
|
|
101
122
|
if (input.type === 'input' && payload === undefined && input.name === undefined)
|
|
@@ -277,11 +298,31 @@ export const v5SessionSchema = z.looseObject({
|
|
|
277
298
|
effort: z.string().optional(),
|
|
278
299
|
commitSha: z.string(),
|
|
279
300
|
repository: z.string(),
|
|
301
|
+
/** The inputs the pinned commit declares (`v5InputContractSchema`), `{}` when it declares none. */
|
|
302
|
+
inputs: z.unknown().optional(),
|
|
280
303
|
}),
|
|
281
304
|
effectiveModelSettings: z.looseObject({ model: z.string(), reasoningEffort: z.string().nullable() }).nullable(),
|
|
282
305
|
createdAt: z.string(),
|
|
283
306
|
});
|
|
284
|
-
|
|
307
|
+
/**
|
|
308
|
+
* An input the agent declares in its `input-schema.json` (agent-api `declaredInputSchema`). It has
|
|
309
|
+
* no default value: the session is given it, by a named `input` event.
|
|
310
|
+
*/
|
|
311
|
+
export const v5DeclaredInputSchema = z.looseObject({
|
|
312
|
+
name: v5InputNameSchema,
|
|
313
|
+
/** `text` or `file`; read as an open string so a new kind never breaks the chat. */
|
|
314
|
+
type: z.string(),
|
|
315
|
+
required: z.boolean(),
|
|
316
|
+
description: z.string().optional(),
|
|
317
|
+
});
|
|
318
|
+
/** `GET /v5/agents/{agentId}/inputs`: the declarations at the branch or commit read. */
|
|
319
|
+
export const v5InputListSchema = z.looseObject({
|
|
320
|
+
branch: z.string(),
|
|
321
|
+
commitHash: z.string(),
|
|
322
|
+
inputs: z.array(v5DeclaredInputSchema),
|
|
323
|
+
});
|
|
324
|
+
/** A session's `configuration.inputs` when its pinned commit declares inputs. */
|
|
325
|
+
export const v5InputContractSchema = z.looseObject({ inputs: z.array(v5DeclaredInputSchema) });
|
|
285
326
|
/** Creation admits the session and its first queued messages and inputs in one idempotent request. */
|
|
286
327
|
export const v5SessionCreateSchema = z.object({
|
|
287
328
|
agentId: z.string().uuid(),
|
|
@@ -327,6 +368,39 @@ export const v5AgentSchema = z.looseObject({
|
|
|
327
368
|
});
|
|
328
369
|
export const v5AgentDetailSchema = v5AgentSchema.extend({ snapshots: z.array(v5AgentSnapshotSchema) });
|
|
329
370
|
export const v5AgentListSchema = z.looseObject({ agents: z.array(v5AgentSchema) });
|
|
371
|
+
/** A branch of an agent's repository, as agent-api takes it in a query or a body. */
|
|
372
|
+
export const v5BranchNameSchema = z.string().min(1).max(200).regex(/^(?!-)[\w./-]+$/u);
|
|
373
|
+
export const v5CommitHashSchema = z.string().min(1).max(64).regex(/^[\da-f]+$/iu);
|
|
374
|
+
/** Where a read of the repository looks: a branch, a commit, or the default branch. */
|
|
375
|
+
export const v5RepositoryRefSchema = z.object({
|
|
376
|
+
branch: v5BranchNameSchema.optional(),
|
|
377
|
+
commitHash: v5CommitHashSchema.optional(),
|
|
378
|
+
}).strict();
|
|
379
|
+
/**
|
|
380
|
+
* A model of agent-api's catalog (`GET /v5/agents/models`). `reasoningEfforts` are the ones the
|
|
381
|
+
* model runs with, `none` included; an alias (`aliasOf`) names another entry.
|
|
382
|
+
*/
|
|
383
|
+
export const v5ModelSchema = z.looseObject({
|
|
384
|
+
id: z.string().min(1),
|
|
385
|
+
name: z.string().min(1),
|
|
386
|
+
vendor: z.string().min(1),
|
|
387
|
+
harness: v5HarnessSchema,
|
|
388
|
+
harnesses: z.array(v5HarnessSchema),
|
|
389
|
+
contextWindow: z.number().int().positive(),
|
|
390
|
+
maxOutputTokens: z.number().int().positive().nullable(),
|
|
391
|
+
inputModalities: z.array(z.string()),
|
|
392
|
+
tier: z.number().int(),
|
|
393
|
+
reasoningEfforts: z.array(z.string()),
|
|
394
|
+
defaultReasoningEffort: z.string().nullable(),
|
|
395
|
+
status: z.enum(['available', 'deprecated']),
|
|
396
|
+
aliasOf: z.string().nullable(),
|
|
397
|
+
isDefault: z.boolean(),
|
|
398
|
+
});
|
|
399
|
+
export const v5ModelListSchema = z.looseObject({ models: z.array(v5ModelSchema) });
|
|
400
|
+
export const v5ModelQuerySchema = z.object({
|
|
401
|
+
harness: v5HarnessSchema.optional(),
|
|
402
|
+
status: z.enum(['available', 'deprecated']).optional(),
|
|
403
|
+
}).strict();
|
|
330
404
|
export const v5SnapshotPublishSchema = z.object({
|
|
331
405
|
organizationName: z.string().min(1).max(v5Limits.attributionChars),
|
|
332
406
|
repository: z.string().min(1).max(v5Limits.attributionChars),
|
|
@@ -362,3 +436,25 @@ export const v5ArtifactQuerySchema = z.object({
|
|
|
362
436
|
after: v5EventIdSchema.optional(),
|
|
363
437
|
limit: z.number().int().min(1).max(v5Limits.artifactPage.max).optional(),
|
|
364
438
|
}).strict();
|
|
439
|
+
/** A path of the agent's repository tree at one commit (`GET /v5/agents/{agentId}/repository`). */
|
|
440
|
+
export const v5RepositoryTreeEntrySchema = z.looseObject({
|
|
441
|
+
path: z.string().min(1),
|
|
442
|
+
/** `blob` or `tree`; read as an open string so a new kind never breaks the chat. */
|
|
443
|
+
type: z.string(),
|
|
444
|
+
sha: z.string(),
|
|
445
|
+
size: z.number().nonnegative().optional(),
|
|
446
|
+
});
|
|
447
|
+
export const v5RepositoryTreeSchema = z.looseObject({
|
|
448
|
+
branch: z.string(),
|
|
449
|
+
commitHash: z.string(),
|
|
450
|
+
tree: z.array(v5RepositoryTreeEntrySchema),
|
|
451
|
+
commitMessage: z.string().nullable(),
|
|
452
|
+
});
|
|
453
|
+
/** One file of the agent's repository at a commit: text as it is, anything else in base64 (`encoding`). */
|
|
454
|
+
export const v5RepositoryFileSchema = z.looseObject({
|
|
455
|
+
branch: z.string(),
|
|
456
|
+
commitHash: z.string(),
|
|
457
|
+
filePath: z.string(),
|
|
458
|
+
content: z.string(),
|
|
459
|
+
encoding: z.string(),
|
|
460
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@meistrari/chat-nuxt",
|
|
3
|
-
"version": "4.13.0
|
|
3
|
+
"version": "4.13.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"@iconify-json/ph": "^1.2.2",
|
|
53
53
|
"@iconify/vue": "^5.0.0",
|
|
54
54
|
"@meistrari/auth-nuxt": "3.31.0",
|
|
55
|
-
"@meistrari/chat-ui-lang": "0.8.
|
|
55
|
+
"@meistrari/chat-ui-lang": "0.8.1",
|
|
56
56
|
"@meistrari/logger": "^2.1.3",
|
|
57
57
|
"@meistrari/tela-build": "^1.79.0",
|
|
58
58
|
"@openuidev/lang-core": "1.0.0",
|