@ai-matrx/agents 0.43.17 → 0.43.19
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/CHANGELOG.md +13 -0
- package/dist/content-transfer/index.cjs +26 -10
- package/dist/content-transfer/index.cjs.map +1 -1
- package/dist/content-transfer/index.js +26 -10
- package/dist/content-transfer/index.js.map +1 -1
- package/dist/content-transfer/react/index.cjs +26 -10
- package/dist/content-transfer/react/index.cjs.map +1 -1
- package/dist/content-transfer/react/index.js +26 -10
- package/dist/content-transfer/react/index.js.map +1 -1
- package/dist/generated/api-types.cjs.map +1 -1
- package/dist/generated/api-types.d.cts +140 -0
- package/dist/generated/api-types.d.ts +140 -0
- package/dist/index.cjs +75 -74
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +75 -74
- package/dist/index.js.map +1 -1
- package/dist/{keys.generated-C-suriRk.d.cts → keys.generated-DX8nj5xZ.d.cts} +4 -4
- package/dist/{keys.generated-C-suriRk.d.ts → keys.generated-DX8nj5xZ.d.ts} +4 -4
- package/dist/mandates/index.cjs +2 -2
- package/dist/mandates/index.cjs.map +1 -1
- package/dist/mandates/index.d.cts +2 -2
- package/dist/mandates/index.d.ts +2 -2
- package/dist/mandates/index.js +2 -2
- package/dist/mandates/index.js.map +1 -1
- package/dist/matrx/index.cjs +75 -74
- package/dist/matrx/index.cjs.map +1 -1
- package/dist/matrx/index.d.cts +1 -1
- package/dist/matrx/index.d.ts +1 -1
- package/dist/matrx/index.js +75 -74
- package/dist/matrx/index.js.map +1 -1
- package/dist/portable/index.cjs +26 -10
- package/dist/portable/index.cjs.map +1 -1
- package/dist/portable/index.js +26 -10
- package/dist/portable/index.js.map +1 -1
- package/dist/portable/mcp.cjs +24 -10
- package/dist/portable/mcp.cjs.map +1 -1
- package/dist/portable/mcp.js +24 -10
- package/dist/portable/mcp.js.map +1 -1
- package/dist/react/index.cjs +60 -46
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.js +60 -46
- package/dist/react/index.js.map +1 -1
- package/generated/api-types.ts +140 -0
- package/mandates/snapshots/keys.0.43.18.json +653 -0
- package/mandates/snapshots/keys.0.43.19.json +653 -0
- package/package.json +4 -4
|
@@ -8573,6 +8573,26 @@ interface paths {
|
|
|
8573
8573
|
patch?: never;
|
|
8574
8574
|
trace?: never;
|
|
8575
8575
|
};
|
|
8576
|
+
"/google-integrations/calendar/event/source": {
|
|
8577
|
+
parameters: {
|
|
8578
|
+
query?: never;
|
|
8579
|
+
header?: never;
|
|
8580
|
+
path?: never;
|
|
8581
|
+
cookie?: never;
|
|
8582
|
+
};
|
|
8583
|
+
get?: never;
|
|
8584
|
+
put?: never;
|
|
8585
|
+
/**
|
|
8586
|
+
* Calendar Event Source
|
|
8587
|
+
* @description Resolve the current write target and eligibility without mutating Google.
|
|
8588
|
+
*/
|
|
8589
|
+
post: operations["calendar_event_source_google_integrations_calendar_event_source_post"];
|
|
8590
|
+
delete?: never;
|
|
8591
|
+
options?: never;
|
|
8592
|
+
head?: never;
|
|
8593
|
+
patch?: never;
|
|
8594
|
+
trace?: never;
|
|
8595
|
+
};
|
|
8576
8596
|
"/google-integrations/calendar/create/confirm/{intent_id}": {
|
|
8577
8597
|
parameters: {
|
|
8578
8598
|
query?: never;
|
|
@@ -57385,6 +57405,13 @@ interface components {
|
|
|
57385
57405
|
*/
|
|
57386
57406
|
jurisdiction_key?: string | null;
|
|
57387
57407
|
};
|
|
57408
|
+
/** CalendarActionEligibility */
|
|
57409
|
+
CalendarActionEligibility: {
|
|
57410
|
+
/** Available */
|
|
57411
|
+
available: boolean;
|
|
57412
|
+
/** Unavailable Reason */
|
|
57413
|
+
unavailable_reason?: string | null;
|
|
57414
|
+
};
|
|
57388
57415
|
/** CalendarAgendaEvent */
|
|
57389
57416
|
CalendarAgendaEvent: {
|
|
57390
57417
|
/** Event Id */
|
|
@@ -57802,6 +57829,84 @@ interface components {
|
|
|
57802
57829
|
*/
|
|
57803
57830
|
send_updates: "all" | "externalOnly" | "none";
|
|
57804
57831
|
};
|
|
57832
|
+
/**
|
|
57833
|
+
* CalendarEventSourceRequest
|
|
57834
|
+
* @description One selected event and the recurrence target the reviewer intends to change.
|
|
57835
|
+
*/
|
|
57836
|
+
CalendarEventSourceRequest: {
|
|
57837
|
+
/** Connection Id */
|
|
57838
|
+
connection_id: string;
|
|
57839
|
+
/** Calendar Id */
|
|
57840
|
+
calendar_id: string;
|
|
57841
|
+
/** Selected Event Id */
|
|
57842
|
+
selected_event_id: string;
|
|
57843
|
+
/**
|
|
57844
|
+
* Occurrence
|
|
57845
|
+
* @enum {string}
|
|
57846
|
+
*/
|
|
57847
|
+
occurrence: "instance" | "series" | "single";
|
|
57848
|
+
};
|
|
57849
|
+
/**
|
|
57850
|
+
* CalendarEventSourceResult
|
|
57851
|
+
* @description Privacy-bounded source facts used to construct an exact write preview.
|
|
57852
|
+
*/
|
|
57853
|
+
CalendarEventSourceResult: {
|
|
57854
|
+
/** Account Email */
|
|
57855
|
+
account_email: string;
|
|
57856
|
+
/** Calendar Id */
|
|
57857
|
+
calendar_id: string;
|
|
57858
|
+
/** Calendar Summary */
|
|
57859
|
+
calendar_summary: string;
|
|
57860
|
+
/**
|
|
57861
|
+
* Access Role
|
|
57862
|
+
* @enum {string}
|
|
57863
|
+
*/
|
|
57864
|
+
access_role: "freeBusyReader" | "owner" | "reader" | "writer" | "writerWithoutPrivateAccess";
|
|
57865
|
+
/** Selected Event Id */
|
|
57866
|
+
selected_event_id: string;
|
|
57867
|
+
/** Target Event Id */
|
|
57868
|
+
target_event_id?: string | null;
|
|
57869
|
+
/** Target Etag */
|
|
57870
|
+
target_etag?: string | null;
|
|
57871
|
+
/**
|
|
57872
|
+
* Occurrence
|
|
57873
|
+
* @enum {string}
|
|
57874
|
+
*/
|
|
57875
|
+
occurrence: "instance" | "series" | "single";
|
|
57876
|
+
/** Event Summary */
|
|
57877
|
+
event_summary?: string | null;
|
|
57878
|
+
/** Starts At */
|
|
57879
|
+
starts_at?: {
|
|
57880
|
+
[key: string]: components["schemas"]["JsonValue"];
|
|
57881
|
+
} | null;
|
|
57882
|
+
/** Ends At */
|
|
57883
|
+
ends_at?: {
|
|
57884
|
+
[key: string]: components["schemas"]["JsonValue"];
|
|
57885
|
+
} | null;
|
|
57886
|
+
/**
|
|
57887
|
+
* Recurrence
|
|
57888
|
+
* @default []
|
|
57889
|
+
*/
|
|
57890
|
+
recurrence?: string[];
|
|
57891
|
+
/** Original Start Time */
|
|
57892
|
+
original_start_time?: {
|
|
57893
|
+
[key: string]: components["schemas"]["JsonValue"];
|
|
57894
|
+
} | null;
|
|
57895
|
+
/** Organizer Email */
|
|
57896
|
+
organizer_email?: string | null;
|
|
57897
|
+
/** Organizer Self */
|
|
57898
|
+
organizer_self?: boolean | null;
|
|
57899
|
+
/** Self Response Status */
|
|
57900
|
+
self_response_status?: ("accepted" | "declined" | "needsAction" | "tentative") | null;
|
|
57901
|
+
/**
|
|
57902
|
+
* Redacted
|
|
57903
|
+
* @default false
|
|
57904
|
+
*/
|
|
57905
|
+
redacted?: boolean;
|
|
57906
|
+
move: components["schemas"]["CalendarActionEligibility"];
|
|
57907
|
+
cancel: components["schemas"]["CalendarActionEligibility"];
|
|
57908
|
+
rsvp: components["schemas"]["CalendarActionEligibility"];
|
|
57909
|
+
};
|
|
57805
57910
|
/** CalendarRefreshRequest */
|
|
57806
57911
|
CalendarRefreshRequest: {
|
|
57807
57912
|
/**
|
|
@@ -76191,6 +76296,8 @@ interface components {
|
|
|
76191
76296
|
typed_style?: string | null;
|
|
76192
76297
|
/** Strokes */
|
|
76193
76298
|
strokes?: unknown[] | null;
|
|
76299
|
+
/** Image Data Url */
|
|
76300
|
+
image_data_url?: string | null;
|
|
76194
76301
|
/** Observed */
|
|
76195
76302
|
observed?: {
|
|
76196
76303
|
[key: string]: string;
|
|
@@ -164268,6 +164375,39 @@ interface operations {
|
|
|
164268
164375
|
};
|
|
164269
164376
|
};
|
|
164270
164377
|
};
|
|
164378
|
+
calendar_event_source_google_integrations_calendar_event_source_post: {
|
|
164379
|
+
parameters: {
|
|
164380
|
+
query?: never;
|
|
164381
|
+
header?: never;
|
|
164382
|
+
path?: never;
|
|
164383
|
+
cookie?: never;
|
|
164384
|
+
};
|
|
164385
|
+
requestBody: {
|
|
164386
|
+
content: {
|
|
164387
|
+
"application/json": components["schemas"]["CalendarEventSourceRequest"];
|
|
164388
|
+
};
|
|
164389
|
+
};
|
|
164390
|
+
responses: {
|
|
164391
|
+
/** @description Successful Response */
|
|
164392
|
+
200: {
|
|
164393
|
+
headers: {
|
|
164394
|
+
[name: string]: unknown;
|
|
164395
|
+
};
|
|
164396
|
+
content: {
|
|
164397
|
+
"application/json": components["schemas"]["CalendarEventSourceResult"];
|
|
164398
|
+
};
|
|
164399
|
+
};
|
|
164400
|
+
/** @description Validation Error */
|
|
164401
|
+
422: {
|
|
164402
|
+
headers: {
|
|
164403
|
+
[name: string]: unknown;
|
|
164404
|
+
};
|
|
164405
|
+
content: {
|
|
164406
|
+
"application/json": components["schemas"]["HTTPValidationError"];
|
|
164407
|
+
};
|
|
164408
|
+
};
|
|
164409
|
+
};
|
|
164410
|
+
};
|
|
164271
164411
|
calendar_create_confirm_google_integrations_calendar_create_confirm__intent_id__post: {
|
|
164272
164412
|
parameters: {
|
|
164273
164413
|
query?: never;
|
|
@@ -8573,6 +8573,26 @@ interface paths {
|
|
|
8573
8573
|
patch?: never;
|
|
8574
8574
|
trace?: never;
|
|
8575
8575
|
};
|
|
8576
|
+
"/google-integrations/calendar/event/source": {
|
|
8577
|
+
parameters: {
|
|
8578
|
+
query?: never;
|
|
8579
|
+
header?: never;
|
|
8580
|
+
path?: never;
|
|
8581
|
+
cookie?: never;
|
|
8582
|
+
};
|
|
8583
|
+
get?: never;
|
|
8584
|
+
put?: never;
|
|
8585
|
+
/**
|
|
8586
|
+
* Calendar Event Source
|
|
8587
|
+
* @description Resolve the current write target and eligibility without mutating Google.
|
|
8588
|
+
*/
|
|
8589
|
+
post: operations["calendar_event_source_google_integrations_calendar_event_source_post"];
|
|
8590
|
+
delete?: never;
|
|
8591
|
+
options?: never;
|
|
8592
|
+
head?: never;
|
|
8593
|
+
patch?: never;
|
|
8594
|
+
trace?: never;
|
|
8595
|
+
};
|
|
8576
8596
|
"/google-integrations/calendar/create/confirm/{intent_id}": {
|
|
8577
8597
|
parameters: {
|
|
8578
8598
|
query?: never;
|
|
@@ -57385,6 +57405,13 @@ interface components {
|
|
|
57385
57405
|
*/
|
|
57386
57406
|
jurisdiction_key?: string | null;
|
|
57387
57407
|
};
|
|
57408
|
+
/** CalendarActionEligibility */
|
|
57409
|
+
CalendarActionEligibility: {
|
|
57410
|
+
/** Available */
|
|
57411
|
+
available: boolean;
|
|
57412
|
+
/** Unavailable Reason */
|
|
57413
|
+
unavailable_reason?: string | null;
|
|
57414
|
+
};
|
|
57388
57415
|
/** CalendarAgendaEvent */
|
|
57389
57416
|
CalendarAgendaEvent: {
|
|
57390
57417
|
/** Event Id */
|
|
@@ -57802,6 +57829,84 @@ interface components {
|
|
|
57802
57829
|
*/
|
|
57803
57830
|
send_updates: "all" | "externalOnly" | "none";
|
|
57804
57831
|
};
|
|
57832
|
+
/**
|
|
57833
|
+
* CalendarEventSourceRequest
|
|
57834
|
+
* @description One selected event and the recurrence target the reviewer intends to change.
|
|
57835
|
+
*/
|
|
57836
|
+
CalendarEventSourceRequest: {
|
|
57837
|
+
/** Connection Id */
|
|
57838
|
+
connection_id: string;
|
|
57839
|
+
/** Calendar Id */
|
|
57840
|
+
calendar_id: string;
|
|
57841
|
+
/** Selected Event Id */
|
|
57842
|
+
selected_event_id: string;
|
|
57843
|
+
/**
|
|
57844
|
+
* Occurrence
|
|
57845
|
+
* @enum {string}
|
|
57846
|
+
*/
|
|
57847
|
+
occurrence: "instance" | "series" | "single";
|
|
57848
|
+
};
|
|
57849
|
+
/**
|
|
57850
|
+
* CalendarEventSourceResult
|
|
57851
|
+
* @description Privacy-bounded source facts used to construct an exact write preview.
|
|
57852
|
+
*/
|
|
57853
|
+
CalendarEventSourceResult: {
|
|
57854
|
+
/** Account Email */
|
|
57855
|
+
account_email: string;
|
|
57856
|
+
/** Calendar Id */
|
|
57857
|
+
calendar_id: string;
|
|
57858
|
+
/** Calendar Summary */
|
|
57859
|
+
calendar_summary: string;
|
|
57860
|
+
/**
|
|
57861
|
+
* Access Role
|
|
57862
|
+
* @enum {string}
|
|
57863
|
+
*/
|
|
57864
|
+
access_role: "freeBusyReader" | "owner" | "reader" | "writer" | "writerWithoutPrivateAccess";
|
|
57865
|
+
/** Selected Event Id */
|
|
57866
|
+
selected_event_id: string;
|
|
57867
|
+
/** Target Event Id */
|
|
57868
|
+
target_event_id?: string | null;
|
|
57869
|
+
/** Target Etag */
|
|
57870
|
+
target_etag?: string | null;
|
|
57871
|
+
/**
|
|
57872
|
+
* Occurrence
|
|
57873
|
+
* @enum {string}
|
|
57874
|
+
*/
|
|
57875
|
+
occurrence: "instance" | "series" | "single";
|
|
57876
|
+
/** Event Summary */
|
|
57877
|
+
event_summary?: string | null;
|
|
57878
|
+
/** Starts At */
|
|
57879
|
+
starts_at?: {
|
|
57880
|
+
[key: string]: components["schemas"]["JsonValue"];
|
|
57881
|
+
} | null;
|
|
57882
|
+
/** Ends At */
|
|
57883
|
+
ends_at?: {
|
|
57884
|
+
[key: string]: components["schemas"]["JsonValue"];
|
|
57885
|
+
} | null;
|
|
57886
|
+
/**
|
|
57887
|
+
* Recurrence
|
|
57888
|
+
* @default []
|
|
57889
|
+
*/
|
|
57890
|
+
recurrence?: string[];
|
|
57891
|
+
/** Original Start Time */
|
|
57892
|
+
original_start_time?: {
|
|
57893
|
+
[key: string]: components["schemas"]["JsonValue"];
|
|
57894
|
+
} | null;
|
|
57895
|
+
/** Organizer Email */
|
|
57896
|
+
organizer_email?: string | null;
|
|
57897
|
+
/** Organizer Self */
|
|
57898
|
+
organizer_self?: boolean | null;
|
|
57899
|
+
/** Self Response Status */
|
|
57900
|
+
self_response_status?: ("accepted" | "declined" | "needsAction" | "tentative") | null;
|
|
57901
|
+
/**
|
|
57902
|
+
* Redacted
|
|
57903
|
+
* @default false
|
|
57904
|
+
*/
|
|
57905
|
+
redacted?: boolean;
|
|
57906
|
+
move: components["schemas"]["CalendarActionEligibility"];
|
|
57907
|
+
cancel: components["schemas"]["CalendarActionEligibility"];
|
|
57908
|
+
rsvp: components["schemas"]["CalendarActionEligibility"];
|
|
57909
|
+
};
|
|
57805
57910
|
/** CalendarRefreshRequest */
|
|
57806
57911
|
CalendarRefreshRequest: {
|
|
57807
57912
|
/**
|
|
@@ -76191,6 +76296,8 @@ interface components {
|
|
|
76191
76296
|
typed_style?: string | null;
|
|
76192
76297
|
/** Strokes */
|
|
76193
76298
|
strokes?: unknown[] | null;
|
|
76299
|
+
/** Image Data Url */
|
|
76300
|
+
image_data_url?: string | null;
|
|
76194
76301
|
/** Observed */
|
|
76195
76302
|
observed?: {
|
|
76196
76303
|
[key: string]: string;
|
|
@@ -164268,6 +164375,39 @@ interface operations {
|
|
|
164268
164375
|
};
|
|
164269
164376
|
};
|
|
164270
164377
|
};
|
|
164378
|
+
calendar_event_source_google_integrations_calendar_event_source_post: {
|
|
164379
|
+
parameters: {
|
|
164380
|
+
query?: never;
|
|
164381
|
+
header?: never;
|
|
164382
|
+
path?: never;
|
|
164383
|
+
cookie?: never;
|
|
164384
|
+
};
|
|
164385
|
+
requestBody: {
|
|
164386
|
+
content: {
|
|
164387
|
+
"application/json": components["schemas"]["CalendarEventSourceRequest"];
|
|
164388
|
+
};
|
|
164389
|
+
};
|
|
164390
|
+
responses: {
|
|
164391
|
+
/** @description Successful Response */
|
|
164392
|
+
200: {
|
|
164393
|
+
headers: {
|
|
164394
|
+
[name: string]: unknown;
|
|
164395
|
+
};
|
|
164396
|
+
content: {
|
|
164397
|
+
"application/json": components["schemas"]["CalendarEventSourceResult"];
|
|
164398
|
+
};
|
|
164399
|
+
};
|
|
164400
|
+
/** @description Validation Error */
|
|
164401
|
+
422: {
|
|
164402
|
+
headers: {
|
|
164403
|
+
[name: string]: unknown;
|
|
164404
|
+
};
|
|
164405
|
+
content: {
|
|
164406
|
+
"application/json": components["schemas"]["HTTPValidationError"];
|
|
164407
|
+
};
|
|
164408
|
+
};
|
|
164409
|
+
};
|
|
164410
|
+
};
|
|
164271
164411
|
calendar_create_confirm_google_integrations_calendar_create_confirm__intent_id__post: {
|
|
164272
164412
|
parameters: {
|
|
164273
164413
|
query?: never;
|
package/dist/index.cjs
CHANGED
|
@@ -950,80 +950,6 @@ function projectWorkflowNodeEvent(current, event) {
|
|
|
950
950
|
}
|
|
951
951
|
}
|
|
952
952
|
|
|
953
|
-
// matrx/transport.ts
|
|
954
|
-
var MatrxApiError = class extends Error {
|
|
955
|
-
name = "MatrxApiError";
|
|
956
|
-
/** HTTP status of the failed response. */
|
|
957
|
-
status;
|
|
958
|
-
/** Machine code from the server body (`code`, or `detail.code`), when present. */
|
|
959
|
-
code;
|
|
960
|
-
/** The parsed server error body, verbatim (undefined when unparsable). */
|
|
961
|
-
serverDetail;
|
|
962
|
-
/** The request path the failure came from (server-relative). */
|
|
963
|
-
path;
|
|
964
|
-
constructor(args) {
|
|
965
|
-
super(
|
|
966
|
-
args.message ?? extractMatrxErrorMessage(args.serverDetail) ?? `HTTP ${args.status}`
|
|
967
|
-
);
|
|
968
|
-
this.status = args.status;
|
|
969
|
-
this.path = args.path;
|
|
970
|
-
this.serverDetail = args.serverDetail;
|
|
971
|
-
this.code = extractMatrxErrorCode(args.serverDetail);
|
|
972
|
-
}
|
|
973
|
-
};
|
|
974
|
-
function isRecord3(value) {
|
|
975
|
-
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
976
|
-
}
|
|
977
|
-
function nonBlankString(value) {
|
|
978
|
-
return typeof value === "string" && value.trim() ? value : void 0;
|
|
979
|
-
}
|
|
980
|
-
function extractMatrxErrorMessage(serverDetail) {
|
|
981
|
-
if (!isRecord3(serverDetail)) return void 0;
|
|
982
|
-
const userMessage = nonBlankString(serverDetail.user_message);
|
|
983
|
-
if (userMessage) return userMessage;
|
|
984
|
-
const message = nonBlankString(serverDetail.message);
|
|
985
|
-
if (message) return message;
|
|
986
|
-
if (Array.isArray(serverDetail.details)) {
|
|
987
|
-
const messages = serverDetail.details.map((entry) => {
|
|
988
|
-
if (!isRecord3(entry)) return void 0;
|
|
989
|
-
const detailMessage = nonBlankString(entry.message);
|
|
990
|
-
if (!detailMessage) return void 0;
|
|
991
|
-
const field = nonBlankString(entry.field);
|
|
992
|
-
return field ? `${field}: ${detailMessage}` : detailMessage;
|
|
993
|
-
}).filter((m) => typeof m === "string");
|
|
994
|
-
if (messages.length > 0) return messages.join("; ");
|
|
995
|
-
}
|
|
996
|
-
const detail = serverDetail.detail;
|
|
997
|
-
if (isRecord3(detail)) {
|
|
998
|
-
const detailMessage = nonBlankString(detail.message) ?? nonBlankString(detail.user_message);
|
|
999
|
-
if (detailMessage) return detailMessage;
|
|
1000
|
-
}
|
|
1001
|
-
if (typeof detail === "string" && detail.trim()) return detail;
|
|
1002
|
-
if (Array.isArray(detail)) {
|
|
1003
|
-
const messages = detail.map(
|
|
1004
|
-
(entry) => isRecord3(entry) ? nonBlankString(entry.msg) : void 0
|
|
1005
|
-
).filter((m) => typeof m === "string");
|
|
1006
|
-
if (messages.length > 0) return messages.join("; ");
|
|
1007
|
-
}
|
|
1008
|
-
return void 0;
|
|
1009
|
-
}
|
|
1010
|
-
function extractMatrxErrorCode(serverDetail) {
|
|
1011
|
-
if (!isRecord3(serverDetail)) return null;
|
|
1012
|
-
const topLevel = nonBlankString(serverDetail.code);
|
|
1013
|
-
if (topLevel) return topLevel;
|
|
1014
|
-
const detail = serverDetail.detail;
|
|
1015
|
-
if (isRecord3(detail)) {
|
|
1016
|
-
const nested = nonBlankString(detail.code);
|
|
1017
|
-
if (nested) return nested;
|
|
1018
|
-
}
|
|
1019
|
-
return null;
|
|
1020
|
-
}
|
|
1021
|
-
|
|
1022
|
-
// matrx/client.ts
|
|
1023
|
-
var import_data = require("@ai-matrx/data");
|
|
1024
|
-
var import_data2 = require("@ai-matrx/data");
|
|
1025
|
-
var import_net2 = require("@ai-matrx/data/net");
|
|
1026
|
-
|
|
1027
953
|
// matrx/backend-errors.ts
|
|
1028
954
|
var BackendApiError = class extends Error {
|
|
1029
955
|
/** Machine-readable error code */
|
|
@@ -1329,6 +1255,81 @@ function statusToCode(status) {
|
|
|
1329
1255
|
}
|
|
1330
1256
|
}
|
|
1331
1257
|
|
|
1258
|
+
// matrx/transport.ts
|
|
1259
|
+
var MatrxApiError = class extends Error {
|
|
1260
|
+
name = "MatrxApiError";
|
|
1261
|
+
/** HTTP status of the failed response. */
|
|
1262
|
+
status;
|
|
1263
|
+
/** Machine code from the server body (`code`, or `detail.code`), when present. */
|
|
1264
|
+
code;
|
|
1265
|
+
/** The parsed server error body, verbatim (undefined when unparsable). */
|
|
1266
|
+
serverDetail;
|
|
1267
|
+
/** The request path the failure came from (server-relative). */
|
|
1268
|
+
path;
|
|
1269
|
+
constructor(args) {
|
|
1270
|
+
super(
|
|
1271
|
+
args.message ?? extractMatrxErrorMessage(args.serverDetail) ?? `HTTP ${args.status}`
|
|
1272
|
+
);
|
|
1273
|
+
this.status = args.status;
|
|
1274
|
+
this.path = args.path;
|
|
1275
|
+
this.serverDetail = args.serverDetail;
|
|
1276
|
+
this.code = extractMatrxErrorCode(args.serverDetail);
|
|
1277
|
+
}
|
|
1278
|
+
};
|
|
1279
|
+
function isRecord3(value) {
|
|
1280
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
1281
|
+
}
|
|
1282
|
+
function nonBlankString(value) {
|
|
1283
|
+
return typeof value === "string" && value.trim() ? value : void 0;
|
|
1284
|
+
}
|
|
1285
|
+
function extractMatrxErrorMessage(serverDetail) {
|
|
1286
|
+
if (!isRecord3(serverDetail)) return void 0;
|
|
1287
|
+
const candidates = [];
|
|
1288
|
+
const push = (value) => {
|
|
1289
|
+
if (value) candidates.push(value);
|
|
1290
|
+
};
|
|
1291
|
+
push(nonBlankString(serverDetail.user_message));
|
|
1292
|
+
push(nonBlankString(serverDetail.message));
|
|
1293
|
+
if (Array.isArray(serverDetail.details)) {
|
|
1294
|
+
const messages = serverDetail.details.map((entry) => {
|
|
1295
|
+
if (!isRecord3(entry)) return void 0;
|
|
1296
|
+
const detailMessage = nonBlankString(entry.message);
|
|
1297
|
+
if (!detailMessage) return void 0;
|
|
1298
|
+
const field = nonBlankString(entry.field);
|
|
1299
|
+
return field ? `${field}: ${detailMessage}` : detailMessage;
|
|
1300
|
+
}).filter((m) => typeof m === "string");
|
|
1301
|
+
if (messages.length > 0) push(messages.join("; "));
|
|
1302
|
+
}
|
|
1303
|
+
const detail = serverDetail.detail;
|
|
1304
|
+
if (isRecord3(detail)) {
|
|
1305
|
+
push(nonBlankString(detail.message) ?? nonBlankString(detail.user_message));
|
|
1306
|
+
}
|
|
1307
|
+
if (typeof detail === "string" && detail.trim()) push(detail);
|
|
1308
|
+
if (Array.isArray(detail)) {
|
|
1309
|
+
const messages = detail.map(
|
|
1310
|
+
(entry) => isRecord3(entry) ? nonBlankString(entry.msg) : void 0
|
|
1311
|
+
).filter((m) => typeof m === "string");
|
|
1312
|
+
if (messages.length > 0) push(messages.join("; "));
|
|
1313
|
+
}
|
|
1314
|
+
return candidates.find((c) => !isGenericUserMessage(c)) ?? candidates[0];
|
|
1315
|
+
}
|
|
1316
|
+
function extractMatrxErrorCode(serverDetail) {
|
|
1317
|
+
if (!isRecord3(serverDetail)) return null;
|
|
1318
|
+
const topLevel = nonBlankString(serverDetail.code);
|
|
1319
|
+
if (topLevel) return topLevel;
|
|
1320
|
+
const detail = serverDetail.detail;
|
|
1321
|
+
if (isRecord3(detail)) {
|
|
1322
|
+
const nested = nonBlankString(detail.code);
|
|
1323
|
+
if (nested) return nested;
|
|
1324
|
+
}
|
|
1325
|
+
return null;
|
|
1326
|
+
}
|
|
1327
|
+
|
|
1328
|
+
// matrx/client.ts
|
|
1329
|
+
var import_data = require("@ai-matrx/data");
|
|
1330
|
+
var import_data2 = require("@ai-matrx/data");
|
|
1331
|
+
var import_net2 = require("@ai-matrx/data/net");
|
|
1332
|
+
|
|
1332
1333
|
// matrx/org-context.ts
|
|
1333
1334
|
var import_uuid = require("@ai-matrx/kit/uuid");
|
|
1334
1335
|
var OrganizationContextError = class extends Error {
|