@work-shape/catalyst-asset-schemas 0.8.0-rc.3 → 0.8.0-rc.4
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/index.d.ts +273 -1
- package/dist/index.js +150 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -501,6 +501,8 @@ declare const WORKFLOW_STEP_RUN_STATUSES: readonly ["queued", "running", "waitin
|
|
|
501
501
|
type WorkflowStepRunStatus = (typeof WORKFLOW_STEP_RUN_STATUSES)[number];
|
|
502
502
|
declare const WORKFLOW_ENDED_STATUSES: readonly ["done", "failed", "cancelled", "limit_reached"];
|
|
503
503
|
type WorkflowEndedStatus = (typeof WORKFLOW_ENDED_STATUSES)[number];
|
|
504
|
+
/** A released Managed File keeps its identity; original bytes live at the synced source. */
|
|
505
|
+
declare const MANAGED_FILE_STATUSES: readonly ["available", "released", "deleted"];
|
|
504
506
|
|
|
505
507
|
declare const localizedStringSchema: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
506
508
|
en: z.ZodOptional<z.ZodString>;
|
|
@@ -845,4 +847,274 @@ declare class YamlDataError extends Error {
|
|
|
845
847
|
/** `readYamlData` for a caller that reports a refused file as an error: it throws `YamlDataError`. */
|
|
846
848
|
declare function loadYamlData(text: string, file: string): unknown;
|
|
847
849
|
|
|
848
|
-
|
|
850
|
+
declare const knowledgeSyncInputSchema: z.ZodObject<{
|
|
851
|
+
source: z.ZodString;
|
|
852
|
+
mode: z.ZodOptional<z.ZodLiteral<"full">>;
|
|
853
|
+
}, z.core.$strict>;
|
|
854
|
+
type KnowledgeSyncInput = z.infer<typeof knowledgeSyncInputSchema>;
|
|
855
|
+
/** What a sync run ends with: the result of its Operation Run, and a Workflow step's output. */
|
|
856
|
+
declare const knowledgeSyncResultSchema: z.ZodObject<{
|
|
857
|
+
syncRunId: z.ZodString;
|
|
858
|
+
source: z.ZodString;
|
|
859
|
+
mode: z.ZodEnum<{
|
|
860
|
+
full: "full";
|
|
861
|
+
initial: "initial";
|
|
862
|
+
changes: "changes";
|
|
863
|
+
}>;
|
|
864
|
+
reason: z.ZodOptional<z.ZodEnum<{
|
|
865
|
+
cursor_expired: "cursor_expired";
|
|
866
|
+
}>>;
|
|
867
|
+
state: z.ZodEnum<{
|
|
868
|
+
failed: "failed";
|
|
869
|
+
running: "running";
|
|
870
|
+
done: "done";
|
|
871
|
+
}>;
|
|
872
|
+
counts: z.ZodObject<{
|
|
873
|
+
discovered: z.ZodNumber;
|
|
874
|
+
added: z.ZodNumber;
|
|
875
|
+
changed: z.ZodNumber;
|
|
876
|
+
moved: z.ZodNumber;
|
|
877
|
+
withdrawn: z.ZodNumber;
|
|
878
|
+
failed: z.ZodNumber;
|
|
879
|
+
skipped: z.ZodNumber;
|
|
880
|
+
}, z.core.$strict>;
|
|
881
|
+
bytesFetched: z.ZodNumber;
|
|
882
|
+
failureCode: z.ZodOptional<z.ZodEnum<{
|
|
883
|
+
knowledge_source_unreachable: "knowledge_source_unreachable";
|
|
884
|
+
knowledge_source_refused: "knowledge_source_refused";
|
|
885
|
+
knowledge_fetch_failed: "knowledge_fetch_failed";
|
|
886
|
+
knowledge_source_limit_reached: "knowledge_source_limit_reached";
|
|
887
|
+
}>>;
|
|
888
|
+
startedAt: z.ZodString;
|
|
889
|
+
endedAt: z.ZodOptional<z.ZodString>;
|
|
890
|
+
}, z.core.$strict>;
|
|
891
|
+
type KnowledgeSyncResult = z.infer<typeof knowledgeSyncResultSchema>;
|
|
892
|
+
/**
|
|
893
|
+
* What the page shows of an item: its own state up to `fetched`, then its document's.
|
|
894
|
+
* "Gefunden", "Geladen", "Durchsuchbar", "Fehlgeschlagen", "Entfernt".
|
|
895
|
+
*/
|
|
896
|
+
declare const KNOWLEDGE_SOURCE_ITEM_SHOWN_STATES: readonly ["discovered", "fetched", "indexed", "failed", "withdrawn"];
|
|
897
|
+
type KnowledgeSourceItemShownState = (typeof KNOWLEDGE_SOURCE_ITEM_SHOWN_STATES)[number];
|
|
898
|
+
declare const knowledgeSourcesOutputSchema: z.ZodObject<{
|
|
899
|
+
sources: z.ZodArray<z.ZodObject<{
|
|
900
|
+
id: z.ZodString;
|
|
901
|
+
connection: z.ZodString;
|
|
902
|
+
items: z.ZodObject<{
|
|
903
|
+
discovered: z.ZodNumber;
|
|
904
|
+
fetched: z.ZodNumber;
|
|
905
|
+
indexed: z.ZodNumber;
|
|
906
|
+
failed: z.ZodNumber;
|
|
907
|
+
withdrawn: z.ZodNumber;
|
|
908
|
+
}, z.core.$strict>;
|
|
909
|
+
failures: z.ZodArray<z.ZodObject<{
|
|
910
|
+
code: z.ZodUnion<readonly [z.ZodEnum<{
|
|
911
|
+
knowledge_file_format_unsupported: "knowledge_file_format_unsupported";
|
|
912
|
+
knowledge_file_over_limit: "knowledge_file_over_limit";
|
|
913
|
+
knowledge_source_unreachable: "knowledge_source_unreachable";
|
|
914
|
+
knowledge_source_refused: "knowledge_source_refused";
|
|
915
|
+
knowledge_fetch_failed: "knowledge_fetch_failed";
|
|
916
|
+
knowledge_source_limit_reached: "knowledge_source_limit_reached";
|
|
917
|
+
}>, z.ZodEnum<{
|
|
918
|
+
knowledge_file_format_unsupported: "knowledge_file_format_unsupported";
|
|
919
|
+
knowledge_file_over_limit: "knowledge_file_over_limit";
|
|
920
|
+
knowledge_file_unreadable: "knowledge_file_unreadable";
|
|
921
|
+
knowledge_file_missing: "knowledge_file_missing";
|
|
922
|
+
knowledge_extraction_failed: "knowledge_extraction_failed";
|
|
923
|
+
knowledge_file_format_unavailable: "knowledge_file_format_unavailable";
|
|
924
|
+
knowledge_text_unreadable: "knowledge_text_unreadable";
|
|
925
|
+
knowledge_text_empty: "knowledge_text_empty";
|
|
926
|
+
knowledge_index_failed: "knowledge_index_failed";
|
|
927
|
+
}>]>;
|
|
928
|
+
count: z.ZodNumber;
|
|
929
|
+
}, z.core.$strict>>;
|
|
930
|
+
running: z.ZodOptional<z.ZodObject<{
|
|
931
|
+
syncRunId: z.ZodString;
|
|
932
|
+
mode: z.ZodEnum<{
|
|
933
|
+
full: "full";
|
|
934
|
+
initial: "initial";
|
|
935
|
+
changes: "changes";
|
|
936
|
+
}>;
|
|
937
|
+
startedAt: z.ZodString;
|
|
938
|
+
itemsPerMinute: z.ZodOptional<z.ZodNumber>;
|
|
939
|
+
estimatedEndAt: z.ZodOptional<z.ZodString>;
|
|
940
|
+
}, z.core.$strict>>;
|
|
941
|
+
last: z.ZodOptional<z.ZodObject<{
|
|
942
|
+
syncRunId: z.ZodString;
|
|
943
|
+
source: z.ZodString;
|
|
944
|
+
mode: z.ZodEnum<{
|
|
945
|
+
full: "full";
|
|
946
|
+
initial: "initial";
|
|
947
|
+
changes: "changes";
|
|
948
|
+
}>;
|
|
949
|
+
reason: z.ZodOptional<z.ZodEnum<{
|
|
950
|
+
cursor_expired: "cursor_expired";
|
|
951
|
+
}>>;
|
|
952
|
+
state: z.ZodEnum<{
|
|
953
|
+
failed: "failed";
|
|
954
|
+
running: "running";
|
|
955
|
+
done: "done";
|
|
956
|
+
}>;
|
|
957
|
+
counts: z.ZodObject<{
|
|
958
|
+
discovered: z.ZodNumber;
|
|
959
|
+
added: z.ZodNumber;
|
|
960
|
+
changed: z.ZodNumber;
|
|
961
|
+
moved: z.ZodNumber;
|
|
962
|
+
withdrawn: z.ZodNumber;
|
|
963
|
+
failed: z.ZodNumber;
|
|
964
|
+
skipped: z.ZodNumber;
|
|
965
|
+
}, z.core.$strict>;
|
|
966
|
+
bytesFetched: z.ZodNumber;
|
|
967
|
+
failureCode: z.ZodOptional<z.ZodEnum<{
|
|
968
|
+
knowledge_source_unreachable: "knowledge_source_unreachable";
|
|
969
|
+
knowledge_source_refused: "knowledge_source_refused";
|
|
970
|
+
knowledge_fetch_failed: "knowledge_fetch_failed";
|
|
971
|
+
knowledge_source_limit_reached: "knowledge_source_limit_reached";
|
|
972
|
+
}>>;
|
|
973
|
+
startedAt: z.ZodString;
|
|
974
|
+
endedAt: z.ZodOptional<z.ZodString>;
|
|
975
|
+
}, z.core.$strict>>;
|
|
976
|
+
lastChangeAt: z.ZodOptional<z.ZodString>;
|
|
977
|
+
oldestOpenChangeAt: z.ZodOptional<z.ZodString>;
|
|
978
|
+
}, z.core.$strict>>;
|
|
979
|
+
}, z.core.$strict>;
|
|
980
|
+
type KnowledgeSourcesOutput = z.infer<typeof knowledgeSourcesOutputSchema>;
|
|
981
|
+
declare const knowledgeSourceItemsInputSchema: z.ZodObject<{
|
|
982
|
+
source: z.ZodString;
|
|
983
|
+
state: z.ZodOptional<z.ZodEnum<{
|
|
984
|
+
failed: "failed";
|
|
985
|
+
withdrawn: "withdrawn";
|
|
986
|
+
indexed: "indexed";
|
|
987
|
+
discovered: "discovered";
|
|
988
|
+
fetched: "fetched";
|
|
989
|
+
}>>;
|
|
990
|
+
failureCode: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
991
|
+
knowledge_file_format_unsupported: "knowledge_file_format_unsupported";
|
|
992
|
+
knowledge_file_over_limit: "knowledge_file_over_limit";
|
|
993
|
+
knowledge_source_unreachable: "knowledge_source_unreachable";
|
|
994
|
+
knowledge_source_refused: "knowledge_source_refused";
|
|
995
|
+
knowledge_fetch_failed: "knowledge_fetch_failed";
|
|
996
|
+
knowledge_source_limit_reached: "knowledge_source_limit_reached";
|
|
997
|
+
}>, z.ZodEnum<{
|
|
998
|
+
knowledge_file_format_unsupported: "knowledge_file_format_unsupported";
|
|
999
|
+
knowledge_file_over_limit: "knowledge_file_over_limit";
|
|
1000
|
+
knowledge_file_unreadable: "knowledge_file_unreadable";
|
|
1001
|
+
knowledge_file_missing: "knowledge_file_missing";
|
|
1002
|
+
knowledge_extraction_failed: "knowledge_extraction_failed";
|
|
1003
|
+
knowledge_file_format_unavailable: "knowledge_file_format_unavailable";
|
|
1004
|
+
knowledge_text_unreadable: "knowledge_text_unreadable";
|
|
1005
|
+
knowledge_text_empty: "knowledge_text_empty";
|
|
1006
|
+
knowledge_index_failed: "knowledge_index_failed";
|
|
1007
|
+
}>]>>;
|
|
1008
|
+
limit: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
1009
|
+
cursor: z.ZodOptional<z.ZodString>;
|
|
1010
|
+
}, z.core.$strict>;
|
|
1011
|
+
type KnowledgeSourceItemsInput = z.infer<typeof knowledgeSourceItemsInputSchema>;
|
|
1012
|
+
declare const knowledgeSourceItemsOutputSchema: z.ZodObject<{
|
|
1013
|
+
items: z.ZodArray<z.ZodObject<{
|
|
1014
|
+
id: z.ZodString;
|
|
1015
|
+
itemId: z.ZodString;
|
|
1016
|
+
name: z.ZodString;
|
|
1017
|
+
path: z.ZodString;
|
|
1018
|
+
state: z.ZodEnum<{
|
|
1019
|
+
failed: "failed";
|
|
1020
|
+
withdrawn: "withdrawn";
|
|
1021
|
+
indexed: "indexed";
|
|
1022
|
+
discovered: "discovered";
|
|
1023
|
+
fetched: "fetched";
|
|
1024
|
+
}>;
|
|
1025
|
+
failureCode: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
1026
|
+
knowledge_file_format_unsupported: "knowledge_file_format_unsupported";
|
|
1027
|
+
knowledge_file_over_limit: "knowledge_file_over_limit";
|
|
1028
|
+
knowledge_source_unreachable: "knowledge_source_unreachable";
|
|
1029
|
+
knowledge_source_refused: "knowledge_source_refused";
|
|
1030
|
+
knowledge_fetch_failed: "knowledge_fetch_failed";
|
|
1031
|
+
knowledge_source_limit_reached: "knowledge_source_limit_reached";
|
|
1032
|
+
}>, z.ZodEnum<{
|
|
1033
|
+
knowledge_file_format_unsupported: "knowledge_file_format_unsupported";
|
|
1034
|
+
knowledge_file_over_limit: "knowledge_file_over_limit";
|
|
1035
|
+
knowledge_file_unreadable: "knowledge_file_unreadable";
|
|
1036
|
+
knowledge_file_missing: "knowledge_file_missing";
|
|
1037
|
+
knowledge_extraction_failed: "knowledge_extraction_failed";
|
|
1038
|
+
knowledge_file_format_unavailable: "knowledge_file_format_unavailable";
|
|
1039
|
+
knowledge_text_unreadable: "knowledge_text_unreadable";
|
|
1040
|
+
knowledge_text_empty: "knowledge_text_empty";
|
|
1041
|
+
knowledge_index_failed: "knowledge_index_failed";
|
|
1042
|
+
}>]>>;
|
|
1043
|
+
documentId: z.ZodOptional<z.ZodString>;
|
|
1044
|
+
originLink: z.ZodOptional<z.ZodString>;
|
|
1045
|
+
changedAt: z.ZodString;
|
|
1046
|
+
}, z.core.$strict>>;
|
|
1047
|
+
nextCursor: z.ZodOptional<z.ZodString>;
|
|
1048
|
+
}, z.core.$strict>;
|
|
1049
|
+
type KnowledgeSourceItemsOutput = z.infer<typeof knowledgeSourceItemsOutputSchema>;
|
|
1050
|
+
/**
|
|
1051
|
+
* KB-5c's retry, widened: documents by id, or items of a source by id, by failure code or all
|
|
1052
|
+
* failed ones. A failed fetch is fetched again; a failed document of a synced source is
|
|
1053
|
+
* fetched and indexed again, because its original is not kept.
|
|
1054
|
+
*/
|
|
1055
|
+
declare const knowledgeRetryInputSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
1056
|
+
documentIds: z.ZodArray<z.ZodString>;
|
|
1057
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1058
|
+
source: z.ZodString;
|
|
1059
|
+
sourceItemIds: z.ZodArray<z.ZodString>;
|
|
1060
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1061
|
+
source: z.ZodString;
|
|
1062
|
+
failureCode: z.ZodUnion<readonly [z.ZodEnum<{
|
|
1063
|
+
knowledge_file_format_unsupported: "knowledge_file_format_unsupported";
|
|
1064
|
+
knowledge_file_over_limit: "knowledge_file_over_limit";
|
|
1065
|
+
knowledge_source_unreachable: "knowledge_source_unreachable";
|
|
1066
|
+
knowledge_source_refused: "knowledge_source_refused";
|
|
1067
|
+
knowledge_fetch_failed: "knowledge_fetch_failed";
|
|
1068
|
+
knowledge_source_limit_reached: "knowledge_source_limit_reached";
|
|
1069
|
+
}>, z.ZodEnum<{
|
|
1070
|
+
knowledge_file_format_unsupported: "knowledge_file_format_unsupported";
|
|
1071
|
+
knowledge_file_over_limit: "knowledge_file_over_limit";
|
|
1072
|
+
knowledge_file_unreadable: "knowledge_file_unreadable";
|
|
1073
|
+
knowledge_file_missing: "knowledge_file_missing";
|
|
1074
|
+
knowledge_extraction_failed: "knowledge_extraction_failed";
|
|
1075
|
+
knowledge_file_format_unavailable: "knowledge_file_format_unavailable";
|
|
1076
|
+
knowledge_text_unreadable: "knowledge_text_unreadable";
|
|
1077
|
+
knowledge_text_empty: "knowledge_text_empty";
|
|
1078
|
+
knowledge_index_failed: "knowledge_index_failed";
|
|
1079
|
+
}>]>;
|
|
1080
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1081
|
+
source: z.ZodString;
|
|
1082
|
+
all: z.ZodLiteral<true>;
|
|
1083
|
+
}, z.core.$strict>]>;
|
|
1084
|
+
type KnowledgeRetryInput = z.infer<typeof knowledgeRetryInputSchema>;
|
|
1085
|
+
declare const knowledgeRetryOutputSchema: z.ZodObject<{
|
|
1086
|
+
documents: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1087
|
+
id: z.ZodString;
|
|
1088
|
+
state: z.ZodEnum<{
|
|
1089
|
+
failed: "failed";
|
|
1090
|
+
pending: "pending";
|
|
1091
|
+
indexed: "indexed";
|
|
1092
|
+
}>;
|
|
1093
|
+
}, z.core.$strict>>>;
|
|
1094
|
+
queued: z.ZodNumber;
|
|
1095
|
+
}, z.core.$strict>;
|
|
1096
|
+
type KnowledgeRetryOutput = z.infer<typeof knowledgeRetryOutputSchema>;
|
|
1097
|
+
declare const knowledgeLocateInputSchema: z.ZodObject<{
|
|
1098
|
+
sourceItemId: z.ZodString;
|
|
1099
|
+
}, z.core.$strict>;
|
|
1100
|
+
type KnowledgeLocateInput = z.infer<typeof knowledgeLocateInputSchema>;
|
|
1101
|
+
/** An item's state and times, and no content, name or path. */
|
|
1102
|
+
declare const knowledgeLocateOutputSchema: z.ZodObject<{
|
|
1103
|
+
sourceItemId: z.ZodString;
|
|
1104
|
+
source: z.ZodString;
|
|
1105
|
+
itemId: z.ZodString;
|
|
1106
|
+
state: z.ZodEnum<{
|
|
1107
|
+
failed: "failed";
|
|
1108
|
+
withdrawn: "withdrawn";
|
|
1109
|
+
indexed: "indexed";
|
|
1110
|
+
discovered: "discovered";
|
|
1111
|
+
fetched: "fetched";
|
|
1112
|
+
}>;
|
|
1113
|
+
discoveredAt: z.ZodString;
|
|
1114
|
+
fetchedAt: z.ZodOptional<z.ZodString>;
|
|
1115
|
+
withdrawnAt: z.ZodOptional<z.ZodString>;
|
|
1116
|
+
purgedAt: z.ZodOptional<z.ZodString>;
|
|
1117
|
+
}, z.core.$strict>;
|
|
1118
|
+
type KnowledgeLocateOutput = z.infer<typeof knowledgeLocateOutputSchema>;
|
|
1119
|
+
|
|
1120
|
+
export { ACCESS_SOURCES, ACTIONS, ACTIVE_AGENT_RUN_STATUSES, ADMINISTERED_USER_STATUSES, AGENT_AVAILABILITY_MODES, AGENT_EDITABLE_FIELDS, AGENT_RUN_FAILURE_CATEGORIES, AGENT_RUN_STATUSES, AGENT_STARTERS_MAX, API_CREDENTIAL_SCOPES, APPROVAL_CHECK_FAILURE_OUTCOMES, APPROVAL_CHECK_STATUSES, APPROVAL_EXECUTIONS, APPROVAL_REQUEST_STATUSES, APP_ACTION_CALL_STATUSES, APP_ERROR_CODES, APP_ERROR_STATUS_CODES, APP_MODES, ARTIFACT_PREVIEW_IMAGE_FORMATS, ARTIFACT_PREVIEW_IMAGE_MIME_TYPES, ARTIFACT_PREVIEW_STATUSES, ASSET_LIFECYCLES, ASSET_NAME_REFUSAL_REASONS, ASSET_OWNER_KINDS, ASSET_REPO_BUNDLE_KINDS, ASSET_REPRESENTATIONS, ASSET_SYNC_CHANGE_TYPES, ATTACHMENT_CREATE_OUTCOMES, AUDIT_ACTOR_KINDS, AUDIT_EVENT_STATUSES, AUDIT_OUTCOMES, AUDIT_TIERS, AUTH_PRINCIPAL_KINDS, AUTH_SCOPE_WILDCARD, type AccessSource, type ActiveAgentRunStatus, type AdministeredUserStatus, type AgentAvailabilityMode, type AgentConfig, type AgentEditableField, type AgentInitialPromptConfig, type AgentRunFailureCategory, type AgentRunStatus, type ApiCredentialScope, type AppActionCallStatus, type AppErrorCode, type AppMode, type ApprovalCheckFailureOutcome, type ApprovalCheckStatus, type ApprovalExecution, type ApprovalRequestStatus, type ArtifactPreviewImageFormat, type ArtifactPreviewImageMimeType, type ArtifactPreviewStatus, type AssetLifecycle, type AssetNameRefusalReason, type AssetOwnerKind, type AssetRepoBundleKind, type AssetRepresentation, type AssetSyncChangeType, type AttachmentCreateOutcome, type AuditActorKind, type AuditEventStatus, type AuditOutcome, type AuditTier, type AuthPrincipalKind, CHAT_MESSAGE_ROLES, CHAT_SESSION_AUTH_SCOPES, COLLABORATION_WORKSPACE_KINDS, CONFIG_ASSET_CHANGE_OPERATIONS, CONFIG_ASSET_KINDS, CONNECTION_BINDING_STATES, CONNECTION_EXPOSURES, CONNECTION_HEALTH_STATES, CONNECTION_NAME_MAX_LENGTH, CONNECTION_NAME_PATTERN, CONNECTION_NETWORKS, CONNECTION_OAUTH_REGISTRATIONS, CONNECTION_OPERATION_POLICIES, CONNECTION_OPERATION_STATUSES, CONNECTION_ORIGINS, CONNECTION_PROVIDER_REVOCATIONS, CONNECTION_SECRET_STATES, CONNECTOR_TEST_STATUSES, CONVERSATION_ATTACHMENT_STATUSES, CONVERSATION_KINDS, CONVERSATION_VISIBILITIES, type ChatMessageRole, type ChatSessionAuthScope, type CollaborationWorkspaceKind, type ConfigAssetChangeOperation, type ConfigAssetKind, type ConnectionBindingState, type ConnectionExposure, type ConnectionHealth, type ConnectionNetwork, type ConnectionOAuthRegistration, type ConnectionOperationPolicy, type ConnectionOperationStatus, type ConnectionOrigin, type ConnectionProviderRevocation, type ConnectionSecretState, type ConnectorTestStatus, type ConversationAttachmentStatus, type ConversationKind, type ConversationVisibility, DATABASE_RELATION_TYPES, DATA_STORE_CONDITIONS, DATA_STORE_INSERT_CONFLICT_MODES, DATA_STORE_LOAD_CONFLICT_MODES, DATA_STORE_MIGRATION_OUTCOMES, DATA_STORE_SCALAR_TYPES, DATA_STORE_STATUSES, DECIDED_APPROVAL_REQUEST_STATUSES, DELETION_STATES, type DataStoreCondition, type DataStoreInsertConflictMode, type DataStoreLoadConflictMode, type DataStoreMigrationOutcome, type DataStoreScalarType, type DataStoreStatus, type DatabaseRelationType, type DecidedApprovalRequestStatus, type DeletionState, ENDED_AGENT_RUN_STATUSES, ENDED_APPROVAL_EXECUTIONS, type EndedAgentRunStatus, type EndedApprovalExecution, FAILED_JOB_STATUSES, FIRST_PARTY_AUTH_SCOPES, FOLLOW_UP_MODES, FOLLOW_UP_STATUSES, type FailedJobStatus, type FirstPartyAuthScope, GRANT_EFFECTS, GRANT_HOLDER_KINDS, GRANT_SCOPE_KINDS, GUARDRAIL_HIT_OUTCOMES, GUARDRAIL_NAME_MAX_LENGTH, GUARDRAIL_NAME_PATTERN, GUARDRAIL_OUTCOMES, type GrantEffect, type GrantHolderKind, type GrantScopeKind, type GuardrailHitOutcome, type GuardrailOutcome, IDEMPOTENCY_KEY_MAX_LENGTH, INFRASTRUCTURE_SECRET_STATES, INFRASTRUCTURE_WITHHELD_FIELDS, type InfrastructureSecretState, type InfrastructureWithheldField, JOB_STATUSES, type JobStatus, KNOWLEDGE_BASE_STATUSES, KNOWLEDGE_CHECK_STATUSES, KNOWLEDGE_DOCUMENT_FAILURE_CODES, KNOWLEDGE_DOCUMENT_STATES, KNOWLEDGE_DOCUMENT_WAIT_CODES, KNOWLEDGE_SEARCH_SIGNALS, KNOWLEDGE_SOURCE_FAILURE_CODES, KNOWLEDGE_SOURCE_ITEM_FAILURE_CODES, KNOWLEDGE_SOURCE_ITEM_SHOWN_STATES, KNOWLEDGE_SOURCE_ITEM_STATES, KNOWLEDGE_SYNC_COUNTS, KNOWLEDGE_SYNC_MODES, KNOWLEDGE_SYNC_RUN_STATES, type KnowledgeBaseStatus, type KnowledgeCheckStatus, type KnowledgeDocumentFailureCode, type KnowledgeDocumentState, type KnowledgeDocumentWaitCode, type KnowledgeLocateInput, type KnowledgeLocateOutput, type KnowledgeRetryInput, type KnowledgeRetryOutput, type KnowledgeSearchSignal, type KnowledgeSourceFailureCode, type KnowledgeSourceItemFailureCode, type KnowledgeSourceItemShownState, type KnowledgeSourceItemState, type KnowledgeSourceItemsInput, type KnowledgeSourceItemsOutput, type KnowledgeSourcesOutput, type KnowledgeSyncCount, type KnowledgeSyncInput, type KnowledgeSyncMode, type KnowledgeSyncResult, type KnowledgeSyncRunState, LISTED_DATA_STORE_STATUSES, LIVE_JOB_STATUSES, type ListedDataStoreStatus, type LiveJobStatus, type LocaleCode, type LocalizedStringConfig, MANAGED_FILE_STATUSES, MESSAGE_FINISH_STATUSES, MODEL_PROVIDER_AUTH_MODES, MODEL_USAGE_EVENT_STATUSES, MODEL_USAGE_SOURCES, MODEL_USAGE_TIERS, type MessageFinishStatus, type ModelProviderAuthMode, type ModelUsageEventStatus, type ModelUsageSource, type ModelUsageTier, NAMESPACE_PREFIX_MAX_LENGTH, NAMESPACE_PREFIX_MIN_LENGTH, NAMESPACE_PREFIX_PATTERN, NOTIFY_CHANNELS, type NotifyChannel, OPENAI_COMPATIBLE_APIS, OPERATIONS_AUDIENCES, OPERATION_CONFIRMATION_DECISIONS, OPERATION_DENIAL_REASONS, OPERATION_EFFECTS, OPERATION_ORIGIN_KINDS, OPERATION_RUN_DECISION_MODES, OPERATION_RUN_DECISION_REASONS, OPERATION_RUN_STATUSES, OPERATION_TARGETS, type OpenaiCompatibleApi, type OperationDenialReason, type OperationEffect, type OperationOriginKind, type OperationRunDecisionMode, type OperationRunDecisionReason, type OperationRunStatus, type OperationScope, type OperationTarget, type OperationsAudience, POLICY_VALUES, PRINCIPAL_HOLDER_KINDS, PROVIDER_CHECK_ERROR_CLASSES, PROVIDER_PORTS, PROVIDER_REGIONS, type PlatformAction, type PolicyValue, type PrincipalHolderKind, type ProviderCheckErrorClass, type ProviderPort, type ProviderRegion, READING_POLICY_VALUES, REASONING_EFFORTS, type ReadingPolicyValue, type ReasoningEffortConfig, SERVICE_PRINCIPAL_PERMISSIONS, SERVICE_PRINCIPAL_STATUSES, SKILL_CHANGE_TYPES, SKILL_FRONTMATTER_FIELDS, SKILL_FRONTMATTER_MAX_BYTES, SKILL_FRONTMATTER_MAX_DEPTH, SKILL_NAME_PATTERN, SKILL_NAME_RULE, SKILL_ORIGINS, SKILL_PORTABLE_DESCRIPTION_MAX_CHARS, SKILL_PORTABLE_NAME_MAX_CHARS, SKILL_RESOURCE_MEDIA_TYPES, SKILL_STARTERS_MAX, SKILL_STARTER_LINE_MAX_LENGTH, SKILL_SUMMARY_MAX_LENGTH, STRUCTURED_DATA_REVIEW_REASONS, SUPPORTED_IMAGE_MIME_TYPES, type ServicePrincipalPermission, type ServicePrincipalStatus, type SkillChangeType, type SkillConfig, type SkillFileEntry, type SkillFrontmatterRefusal, SkillMarkdownError, type SkillOrigin, type SkillResourceConfig, type SkillResourceMediaType, type SkillStarterConfig, type StructuredDataReviewReason, type SupportedImageMimeType, THEME_MODES, THEME_MODE_PREFERENCES, TOOL_CALL_STATES, TOOL_DECISION_MODES, TOOL_DECISION_OUTCOMES, TOOL_DISPLAY_MODES, TOOL_GROUPS, TOOL_INPUT_PARSE_ERROR_CODES, type ThemeMode, type ThemeModePreference, type ToolCallState, type ToolDisplayMode, type ToolGroup, type ToolInputParseErrorCode, USAGE_COST_STATUSES, USER_STATUSES, type UsageCostStatus, type UserStatus, WAITING_OPERATION_RUN_STATUSES, WEB_SOURCE_PROVIDERS, WORKFLOW_ENDED_STATUSES, WORKFLOW_NAME_PATTERN, WORKFLOW_NAME_RULE, WORKFLOW_RESERVED_STEP_TYPES, WORKFLOW_RUN_MODES, WORKFLOW_RUN_STATUSES, WORKFLOW_STEP_RUN_STATUSES, WORKFLOW_STEP_TYPES, WORKFLOW_TRIGGER_KINDS, WORKSPACE_ACCENT_COLORS, WORKSPACE_ACCESS_STATES, WORKSPACE_COMMAND_STATUSES, WORKSPACE_FILE_KINDS, WORKSPACE_MEMBERSHIP_ROLES, WORKSPACE_SECTIONS, WORKSPACE_VISIBILITIES, type WebSourceProvider, type WorkflowAssetConfig, type WorkflowEndedStatus, type WorkflowReservedStepType, type WorkflowRunMode, type WorkflowRunStatus, type WorkflowStepRunStatus, type WorkflowStepType, type WorkflowTriggerKind, type WorkspaceAccentColor, type WorkspaceAccessState, type WorkspaceCommandStatus, type WorkspaceFileKind, type WorkspaceMembershipRole, type WorkspaceSection, type WorkspaceVisibility, YAML_DATA_MAX_VALUES, YamlDataError, type YamlDataIssue, type YamlDataIssueCode, type YamlDataOptions, type YamlDataResult, agentConfigSchema, checkStorableTexts, deriveSkillTitle, formatSkillMarkdown, isStorableText, knowledgeLocateInputSchema, knowledgeLocateOutputSchema, knowledgeRetryInputSchema, knowledgeRetryOutputSchema, knowledgeSourceItemsInputSchema, knowledgeSourceItemsOutputSchema, knowledgeSourcesOutputSchema, knowledgeSyncInputSchema, knowledgeSyncResultSchema, loadYamlData, localeCodes, localizedStringSchema, parseSkillMarkdown, readYamlData, skillConfigSchema, skillFileEntrySchema, skillFileFrontmatterSchema, skillNameSchema, skillPortabilityIssues, skillResourceConfigSchema, skillResourceMediaTypeForPath, skillResourcePathSchema, skillStarterSchema, workflowConfigSchema, yamlValueIssue, yamlValueIssueSentence };
|
package/dist/index.js
CHANGED
|
@@ -647,6 +647,7 @@ var WORKFLOW_ENDED_STATUSES = [
|
|
|
647
647
|
"cancelled",
|
|
648
648
|
"limit_reached"
|
|
649
649
|
];
|
|
650
|
+
var MANAGED_FILE_STATUSES = ["available", "released", "deleted"];
|
|
650
651
|
|
|
651
652
|
// src/schemas.ts
|
|
652
653
|
import { z } from "zod";
|
|
@@ -1111,6 +1112,144 @@ function withoutExtension(filename) {
|
|
|
1111
1112
|
const dot = filename.lastIndexOf(".");
|
|
1112
1113
|
return dot > 0 ? filename.slice(0, dot) : filename;
|
|
1113
1114
|
}
|
|
1115
|
+
|
|
1116
|
+
// src/knowledge-sources.ts
|
|
1117
|
+
import { z as z2 } from "zod";
|
|
1118
|
+
var sourceIdSchema = z2.string().min(1).max(63);
|
|
1119
|
+
var countSchema = z2.number().int().min(0);
|
|
1120
|
+
var countsSchema = z2.strictObject({
|
|
1121
|
+
discovered: countSchema,
|
|
1122
|
+
added: countSchema,
|
|
1123
|
+
changed: countSchema,
|
|
1124
|
+
moved: countSchema,
|
|
1125
|
+
withdrawn: countSchema,
|
|
1126
|
+
failed: countSchema,
|
|
1127
|
+
skipped: countSchema
|
|
1128
|
+
});
|
|
1129
|
+
var knowledgeSyncInputSchema = z2.strictObject({
|
|
1130
|
+
/** The `id` of the source in the definition. */
|
|
1131
|
+
source: sourceIdSchema,
|
|
1132
|
+
/** `changes` unless `full`. The initial import is started by publish, not by this call. */
|
|
1133
|
+
mode: z2.literal("full", {
|
|
1134
|
+
// Keep SRC-0's accepted values frozen while explaining the deferred mode.
|
|
1135
|
+
error: (issue) => issue.input === "changes" ? "not_supported_yet: Change-feed sync is not supported yet; request mode full." : void 0
|
|
1136
|
+
}).optional()
|
|
1137
|
+
});
|
|
1138
|
+
var knowledgeSyncResultSchema = z2.strictObject({
|
|
1139
|
+
syncRunId: z2.string(),
|
|
1140
|
+
source: z2.string(),
|
|
1141
|
+
mode: z2.enum(KNOWLEDGE_SYNC_MODES),
|
|
1142
|
+
/** Why a run is of another mode than asked, such as a cursor the source refused. */
|
|
1143
|
+
reason: z2.enum(["cursor_expired"]).optional(),
|
|
1144
|
+
state: z2.enum(KNOWLEDGE_SYNC_RUN_STATES),
|
|
1145
|
+
counts: countsSchema,
|
|
1146
|
+
bytesFetched: z2.number().int().min(0),
|
|
1147
|
+
/** Why the whole sync failed, for a run in state `failed`. */
|
|
1148
|
+
failureCode: z2.enum(KNOWLEDGE_SOURCE_FAILURE_CODES).optional(),
|
|
1149
|
+
startedAt: z2.string(),
|
|
1150
|
+
endedAt: z2.string().optional()
|
|
1151
|
+
});
|
|
1152
|
+
var KNOWLEDGE_SOURCE_ITEM_SHOWN_STATES = [
|
|
1153
|
+
"discovered",
|
|
1154
|
+
"fetched",
|
|
1155
|
+
"indexed",
|
|
1156
|
+
"failed",
|
|
1157
|
+
"withdrawn"
|
|
1158
|
+
];
|
|
1159
|
+
var itemFailureCodeSchema = z2.union([
|
|
1160
|
+
z2.enum(KNOWLEDGE_SOURCE_ITEM_FAILURE_CODES),
|
|
1161
|
+
z2.enum(KNOWLEDGE_DOCUMENT_FAILURE_CODES)
|
|
1162
|
+
]);
|
|
1163
|
+
var knowledgeSourcesOutputSchema = z2.strictObject({
|
|
1164
|
+
sources: z2.array(
|
|
1165
|
+
z2.strictObject({
|
|
1166
|
+
id: z2.string(),
|
|
1167
|
+
/** The name of the Connection it reads through. */
|
|
1168
|
+
connection: z2.string(),
|
|
1169
|
+
/** Items by the state the page shows. */
|
|
1170
|
+
items: z2.strictObject({
|
|
1171
|
+
discovered: countSchema,
|
|
1172
|
+
fetched: countSchema,
|
|
1173
|
+
indexed: countSchema,
|
|
1174
|
+
failed: countSchema,
|
|
1175
|
+
withdrawn: countSchema
|
|
1176
|
+
}),
|
|
1177
|
+
/** Failed items per code. */
|
|
1178
|
+
failures: z2.array(z2.strictObject({ code: itemFailureCodeSchema, count: countSchema })),
|
|
1179
|
+
/** The sync that runs now, with its rate in items per minute and its estimated end. */
|
|
1180
|
+
running: z2.strictObject({
|
|
1181
|
+
syncRunId: z2.string(),
|
|
1182
|
+
mode: z2.enum(KNOWLEDGE_SYNC_MODES),
|
|
1183
|
+
startedAt: z2.string(),
|
|
1184
|
+
itemsPerMinute: z2.number().min(0).optional(),
|
|
1185
|
+
estimatedEndAt: z2.string().optional()
|
|
1186
|
+
}).optional(),
|
|
1187
|
+
/** The last sync that ended. */
|
|
1188
|
+
last: knowledgeSyncResultSchema.optional(),
|
|
1189
|
+
/** "Letzte Änderung verarbeitet". */
|
|
1190
|
+
lastChangeAt: z2.string().optional(),
|
|
1191
|
+
/** "Älteste offene Änderung". */
|
|
1192
|
+
oldestOpenChangeAt: z2.string().optional()
|
|
1193
|
+
})
|
|
1194
|
+
)
|
|
1195
|
+
});
|
|
1196
|
+
var knowledgeSourceItemsInputSchema = z2.strictObject({
|
|
1197
|
+
source: sourceIdSchema,
|
|
1198
|
+
state: z2.enum(KNOWLEDGE_SOURCE_ITEM_SHOWN_STATES).optional(),
|
|
1199
|
+
failureCode: itemFailureCodeSchema.optional(),
|
|
1200
|
+
/** Items per page: 50 by default, at most 200. */
|
|
1201
|
+
limit: z2.coerce.number().int().min(1).max(200).optional(),
|
|
1202
|
+
cursor: z2.string().min(1).max(1e3).optional()
|
|
1203
|
+
});
|
|
1204
|
+
var knowledgeSourceItemsOutputSchema = z2.strictObject({
|
|
1205
|
+
/** Newest change first. */
|
|
1206
|
+
items: z2.array(
|
|
1207
|
+
z2.strictObject({
|
|
1208
|
+
/** The row in `source_items`: what `retry` and `locate` name. */
|
|
1209
|
+
id: z2.string(),
|
|
1210
|
+
/** The id of the item at the source. */
|
|
1211
|
+
itemId: z2.string(),
|
|
1212
|
+
name: z2.string(),
|
|
1213
|
+
path: z2.string(),
|
|
1214
|
+
state: z2.enum(KNOWLEDGE_SOURCE_ITEM_SHOWN_STATES),
|
|
1215
|
+
failureCode: itemFailureCodeSchema.optional(),
|
|
1216
|
+
documentId: z2.string().optional(),
|
|
1217
|
+
originLink: z2.string().optional(),
|
|
1218
|
+
changedAt: z2.string()
|
|
1219
|
+
})
|
|
1220
|
+
),
|
|
1221
|
+
nextCursor: z2.string().optional()
|
|
1222
|
+
});
|
|
1223
|
+
var RETRY_MAX = 100;
|
|
1224
|
+
var knowledgeRetryInputSchema = z2.union([
|
|
1225
|
+
z2.strictObject({ documentIds: z2.array(z2.string().min(1).max(200)).min(1).max(RETRY_MAX) }),
|
|
1226
|
+
z2.strictObject({
|
|
1227
|
+
source: sourceIdSchema,
|
|
1228
|
+
sourceItemIds: z2.array(z2.string().min(1).max(200)).min(1).max(RETRY_MAX)
|
|
1229
|
+
}),
|
|
1230
|
+
z2.strictObject({ source: sourceIdSchema, failureCode: itemFailureCodeSchema }),
|
|
1231
|
+
z2.strictObject({ source: sourceIdSchema, all: z2.literal(true) })
|
|
1232
|
+
]);
|
|
1233
|
+
var knowledgeRetryOutputSchema = z2.strictObject({
|
|
1234
|
+
/** For a retry by document ids: each named document, with its state after the retry. */
|
|
1235
|
+
documents: z2.array(z2.strictObject({ id: z2.string(), state: z2.enum(KNOWLEDGE_DOCUMENT_STATES) })).optional(),
|
|
1236
|
+
/** How many contents or items were queued again. */
|
|
1237
|
+
queued: z2.number().int()
|
|
1238
|
+
});
|
|
1239
|
+
var knowledgeLocateInputSchema = z2.strictObject({
|
|
1240
|
+
/** The row in `source_items`. */
|
|
1241
|
+
sourceItemId: z2.string().min(1).max(200)
|
|
1242
|
+
});
|
|
1243
|
+
var knowledgeLocateOutputSchema = z2.strictObject({
|
|
1244
|
+
sourceItemId: z2.string(),
|
|
1245
|
+
source: z2.string(),
|
|
1246
|
+
itemId: z2.string(),
|
|
1247
|
+
state: z2.enum(KNOWLEDGE_SOURCE_ITEM_SHOWN_STATES),
|
|
1248
|
+
discoveredAt: z2.string(),
|
|
1249
|
+
fetchedAt: z2.string().optional(),
|
|
1250
|
+
withdrawnAt: z2.string().optional(),
|
|
1251
|
+
purgedAt: z2.string().optional()
|
|
1252
|
+
});
|
|
1114
1253
|
export {
|
|
1115
1254
|
ACCESS_SOURCES,
|
|
1116
1255
|
ACTIONS,
|
|
@@ -1201,12 +1340,14 @@ export {
|
|
|
1201
1340
|
KNOWLEDGE_SEARCH_SIGNALS,
|
|
1202
1341
|
KNOWLEDGE_SOURCE_FAILURE_CODES,
|
|
1203
1342
|
KNOWLEDGE_SOURCE_ITEM_FAILURE_CODES,
|
|
1343
|
+
KNOWLEDGE_SOURCE_ITEM_SHOWN_STATES,
|
|
1204
1344
|
KNOWLEDGE_SOURCE_ITEM_STATES,
|
|
1205
1345
|
KNOWLEDGE_SYNC_COUNTS,
|
|
1206
1346
|
KNOWLEDGE_SYNC_MODES,
|
|
1207
1347
|
KNOWLEDGE_SYNC_RUN_STATES,
|
|
1208
1348
|
LISTED_DATA_STORE_STATUSES,
|
|
1209
1349
|
LIVE_JOB_STATUSES,
|
|
1350
|
+
MANAGED_FILE_STATUSES,
|
|
1210
1351
|
MESSAGE_FINISH_STATUSES,
|
|
1211
1352
|
MODEL_PROVIDER_AUTH_MODES,
|
|
1212
1353
|
MODEL_USAGE_EVENT_STATUSES,
|
|
@@ -1286,6 +1427,15 @@ export {
|
|
|
1286
1427
|
deriveSkillTitle,
|
|
1287
1428
|
formatSkillMarkdown,
|
|
1288
1429
|
isStorableText,
|
|
1430
|
+
knowledgeLocateInputSchema,
|
|
1431
|
+
knowledgeLocateOutputSchema,
|
|
1432
|
+
knowledgeRetryInputSchema,
|
|
1433
|
+
knowledgeRetryOutputSchema,
|
|
1434
|
+
knowledgeSourceItemsInputSchema,
|
|
1435
|
+
knowledgeSourceItemsOutputSchema,
|
|
1436
|
+
knowledgeSourcesOutputSchema,
|
|
1437
|
+
knowledgeSyncInputSchema,
|
|
1438
|
+
knowledgeSyncResultSchema,
|
|
1289
1439
|
loadYamlData,
|
|
1290
1440
|
localeCodes,
|
|
1291
1441
|
localizedStringSchema,
|