@opengeni/contracts 2.7.0 → 2.9.2
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/agent-authored-durable-text.d.ts +3 -0
- package/dist/atlassian.js +2 -1
- package/dist/chunk-4IVHBXRI.js +221 -0
- package/dist/chunk-4IVHBXRI.js.map +1 -0
- package/dist/{chunk-ILB4IYNN.js → chunk-AWNGBY5I.js} +210 -246
- package/dist/chunk-AWNGBY5I.js.map +1 -0
- package/dist/company-profile.d.ts +275 -1
- package/dist/connection-authority.js +2 -1
- package/dist/connection-authority.js.map +1 -1
- package/dist/google-drive.js +2 -1
- package/dist/google-drive.js.map +1 -1
- package/dist/index.d.ts +176 -3
- package/dist/index.js +43 -5
- package/dist/managed-auth-session-sets.d.ts +19 -0
- package/dist/managed-auth-session-sets.js +12 -1
- package/dist/managed-auth-session-sets.js.map +1 -1
- package/dist/organization-membership-lifecycle.d.ts +3 -0
- package/dist/permissions.d.ts +1 -0
- package/dist/personal-github.js +2 -1
- package/dist/personal-github.js.map +1 -1
- package/dist/session-titles.d.ts +9 -0
- package/dist/session-titles.js +17 -0
- package/dist/session-titles.js.map +1 -0
- package/package.json +5 -1
- package/src/agent-authored-durable-text.ts +13 -6
- package/src/company-profile.ts +46 -1
- package/src/index.ts +374 -179
- package/src/managed-auth-session-sets.ts +18 -0
- package/src/permissions.ts +1 -0
- package/src/session-titles.ts +12 -5
- package/dist/chunk-ILB4IYNN.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -6,9 +6,11 @@ import {
|
|
|
6
6
|
AGENT_AUTHORED_DURABLE_TEXT_STYLE,
|
|
7
7
|
AGENT_AUTHORED_INSTRUCTION_POLICY_CONTENT_MAX_CHARS,
|
|
8
8
|
AGENT_AUTHORED_INSTRUCTION_POLICY_CONTENT_TOO_LONG_MESSAGE,
|
|
9
|
+
AGENT_AUTHORED_INSTRUCTION_POLICY_STYLE,
|
|
9
10
|
AGENT_AUTHORED_PREFERENCE_CONTENT_MAX_CHARS,
|
|
10
11
|
AGENT_AUTHORED_PREFERENCE_CONTENT_TOO_LONG_MESSAGE,
|
|
11
12
|
AGENT_AUTHORED_REMEMBER_CONTENT_TOO_LONG_MESSAGE,
|
|
13
|
+
AGENT_AUTHORED_SKILL_STYLE,
|
|
12
14
|
API_INTEGRATION_OAUTH_CREDENTIAL_ROLE,
|
|
13
15
|
ATLASSIAN_CREDENTIAL_LABEL,
|
|
14
16
|
ATLASSIAN_CREDENTIAL_ROLE,
|
|
@@ -19,8 +21,6 @@ import {
|
|
|
19
21
|
ATTEMPT_TOOL_CATALOG_MAX_ENTRIES,
|
|
20
22
|
ATTEMPT_TOOL_CATALOG_MAX_PATH_SEGMENTS,
|
|
21
23
|
ATTEMPT_TOOL_CATALOG_VERSION,
|
|
22
|
-
AUTOMATIC_SESSION_TITLE_FALLBACK,
|
|
23
|
-
AUTOMATIC_SESSION_TITLE_MAX_GRAPHEMES,
|
|
24
24
|
AUTOMATION_EVENT_PAYLOAD_MAX_BYTES,
|
|
25
25
|
AUTOMATION_MAX_MATCHED_TRIGGERS,
|
|
26
26
|
AUTOMATION_SESSION_TEMPLATE_MAX_BYTES,
|
|
@@ -297,11 +297,15 @@ import {
|
|
|
297
297
|
CompanyProfileActivationEvent,
|
|
298
298
|
CompanyProfileActivationType,
|
|
299
299
|
CompanyProfileAgentAttempt,
|
|
300
|
+
CompanyProfileAgentAutomaticActivationReceipt,
|
|
300
301
|
CompanyProfileAgentConfirmRequest,
|
|
301
302
|
CompanyProfileAgentConfirmationReceipt,
|
|
302
303
|
CompanyProfileAgentHumanInputPrompt,
|
|
304
|
+
CompanyProfileAgentPolicy,
|
|
305
|
+
CompanyProfileAgentPolicyMode,
|
|
303
306
|
CompanyProfileAgentProposalReceipt,
|
|
304
307
|
CompanyProfileAgentProposalRequest,
|
|
308
|
+
CompanyProfileAgentReviewRequiredReceipt,
|
|
305
309
|
CompanyProfileConflictResponse,
|
|
306
310
|
CompanyProfileContent,
|
|
307
311
|
CompanyProfileDiffRequest,
|
|
@@ -378,6 +382,7 @@ import {
|
|
|
378
382
|
CreateKnowledgeDropRequest,
|
|
379
383
|
CreateKnowledgeMemoryRequest,
|
|
380
384
|
CreateNetworkRouteRequest,
|
|
385
|
+
CreateOrganizationApiKeyRequest,
|
|
381
386
|
CreateOrganizationInvitationRequest,
|
|
382
387
|
CreateOrganizationRequest,
|
|
383
388
|
CreateOrganizationResponse,
|
|
@@ -465,6 +470,8 @@ import {
|
|
|
465
470
|
EnrollmentCredentialsResponse,
|
|
466
471
|
EnrollmentOs,
|
|
467
472
|
EnrollmentSummary,
|
|
473
|
+
EnsureWorkspaceRequest,
|
|
474
|
+
EnsureWorkspaceResponse,
|
|
468
475
|
EntitlementDecision,
|
|
469
476
|
EntitlementValue,
|
|
470
477
|
Entitlements,
|
|
@@ -756,6 +763,7 @@ import {
|
|
|
756
763
|
ListSlackUserLinkAccessRequestsResponse,
|
|
757
764
|
ListUserResourceAuthoritiesQuery,
|
|
758
765
|
ListUserResourceAuthoritiesResponse,
|
|
766
|
+
ListWorkspaceMemberCandidatesResponse,
|
|
759
767
|
ListWorkspaceMembersResponse,
|
|
760
768
|
MAX_NESTED_AGENT_DEPTH,
|
|
761
769
|
MAX_RESOLVED_VARIABLE_SET_ATTACHMENTS,
|
|
@@ -1042,6 +1050,7 @@ import {
|
|
|
1042
1050
|
RunDocumentDefaultCollectionBackfillRequest,
|
|
1043
1051
|
SANDBOX_FILE_ARTIFACT_MAX_BYTES,
|
|
1044
1052
|
SANDBOX_PROVIDER_INSTANCE_ID_FIELDS_BY_BACKEND,
|
|
1053
|
+
SCHEDULED_OCCURRENCE_TASK_LABEL,
|
|
1045
1054
|
SCHEDULED_TASK_ACCEPTED_EXECUTION_MAX_BYTES,
|
|
1046
1055
|
SCHEDULED_TASK_AGENT_CONFIG_MAX_BYTES,
|
|
1047
1056
|
SCHEDULED_TASK_METADATA_MAX_BYTES,
|
|
@@ -1080,7 +1089,6 @@ import {
|
|
|
1080
1089
|
SESSION_MCP_SERVERS_MAX,
|
|
1081
1090
|
SESSION_OPERATION_KEY_MAX_CHARS,
|
|
1082
1091
|
SESSION_SYSTEM_UPDATE_WAKE_CLASS,
|
|
1083
|
-
SESSION_TITLE_MAX_CHARACTERS,
|
|
1084
1092
|
SITE_AUTH_MAINTENANCE_CONNECTION_CONTEXT_KEY,
|
|
1085
1093
|
SITE_AUTH_MAINTENANCE_OPERATION_CONTEXT_KEY,
|
|
1086
1094
|
SLACK_TASK_POLICY_ID_MAX_CHARS,
|
|
@@ -1348,6 +1356,7 @@ import {
|
|
|
1348
1356
|
UpdateAutomationTriggerRequest,
|
|
1349
1357
|
UpdateBrowserIdentityRequest,
|
|
1350
1358
|
UpdateChannelRequest,
|
|
1359
|
+
UpdateCompanyProfileAgentPolicyRequest,
|
|
1351
1360
|
UpdateCompanyProfileRequest,
|
|
1352
1361
|
UpdateConnectionRequest,
|
|
1353
1362
|
UpdateKnowledgeMemoryRequest,
|
|
@@ -1403,6 +1412,8 @@ import {
|
|
|
1403
1412
|
UserResourceGrantStatus,
|
|
1404
1413
|
UserResourceKind,
|
|
1405
1414
|
UserResourceLifecycleGrantMode,
|
|
1415
|
+
VARIABLE_SET_RESERVED_EXACT_NAMES,
|
|
1416
|
+
VARIABLE_SET_RESERVED_PREFIXES,
|
|
1406
1417
|
VIRTUAL_WORKSPACE_ROOT,
|
|
1407
1418
|
VOICE_INPUT_ACCEPTED_MIME_TYPES,
|
|
1408
1419
|
VOICE_INPUT_MAX_DURATION_SECONDS,
|
|
@@ -1560,6 +1571,7 @@ import {
|
|
|
1560
1571
|
WorkspaceLearningSourceOverrides,
|
|
1561
1572
|
WorkspaceLearningSourceRef,
|
|
1562
1573
|
WorkspaceMember,
|
|
1574
|
+
WorkspaceMemberCandidate,
|
|
1563
1575
|
WorkspaceMemberRole,
|
|
1564
1576
|
WorkspaceMemoryPromptMode,
|
|
1565
1577
|
WorkspaceMemorySearchMode,
|
|
@@ -1647,7 +1659,6 @@ import {
|
|
|
1647
1659
|
mergeToolRefs,
|
|
1648
1660
|
metadataWithTurnExecutionPolicyV1,
|
|
1649
1661
|
networkRoutePlacementCompatibilityIssue,
|
|
1650
|
-
normalizeAutomaticSessionTitle,
|
|
1651
1662
|
normalizeCompanyProfileStableKey,
|
|
1652
1663
|
normalizePreferenceRegistryStableKey,
|
|
1653
1664
|
normalizeRepositorySubpath,
|
|
@@ -1709,6 +1720,7 @@ import {
|
|
|
1709
1720
|
toolResultSpillFilename,
|
|
1710
1721
|
toolResultSpillSandboxPath,
|
|
1711
1722
|
turnExecutionPolicyAuditMetadata,
|
|
1723
|
+
variableSetVariableNameReservation,
|
|
1712
1724
|
verifyDelegatedAccessToken,
|
|
1713
1725
|
verifyEnrollToken,
|
|
1714
1726
|
verifyEnrollmentBearer,
|
|
@@ -1720,7 +1732,7 @@ import {
|
|
|
1720
1732
|
workspaceLearningPolicyRouterContext,
|
|
1721
1733
|
workspaceLearningSourceKey,
|
|
1722
1734
|
workspaceSlackReactionChannelAllowed
|
|
1723
|
-
} from "./chunk-
|
|
1735
|
+
} from "./chunk-AWNGBY5I.js";
|
|
1724
1736
|
import {
|
|
1725
1737
|
ConnectorDocumentDestination,
|
|
1726
1738
|
ConnectorDocumentDestinationAuthority,
|
|
@@ -1747,6 +1759,14 @@ import {
|
|
|
1747
1759
|
hasOpenGeniSlackBotSearchScopes,
|
|
1748
1760
|
hasOpenGeniSlackReactionScope
|
|
1749
1761
|
} from "./chunk-MRWYRAS5.js";
|
|
1762
|
+
import {
|
|
1763
|
+
AUTOMATIC_SESSION_TITLE_FALLBACK,
|
|
1764
|
+
AUTOMATIC_SESSION_TITLE_MAX_GRAPHEMES,
|
|
1765
|
+
SESSION_TITLE_MAX_CHARACTERS,
|
|
1766
|
+
boundAutomaticSessionTitle,
|
|
1767
|
+
containsSensitiveAutomaticSessionTitleValue,
|
|
1768
|
+
normalizeAutomaticSessionTitle
|
|
1769
|
+
} from "./chunk-4IVHBXRI.js";
|
|
1750
1770
|
import {
|
|
1751
1771
|
WORKSPACE_XAI_PROVIDER_ACCOUNT_AUTHORITY_SNAPSHOT_V1,
|
|
1752
1772
|
XaiProviderAccountAuthoritySnapshotV1
|
|
@@ -2012,9 +2032,11 @@ export {
|
|
|
2012
2032
|
AGENT_AUTHORED_DURABLE_TEXT_STYLE,
|
|
2013
2033
|
AGENT_AUTHORED_INSTRUCTION_POLICY_CONTENT_MAX_CHARS,
|
|
2014
2034
|
AGENT_AUTHORED_INSTRUCTION_POLICY_CONTENT_TOO_LONG_MESSAGE,
|
|
2035
|
+
AGENT_AUTHORED_INSTRUCTION_POLICY_STYLE,
|
|
2015
2036
|
AGENT_AUTHORED_PREFERENCE_CONTENT_MAX_CHARS,
|
|
2016
2037
|
AGENT_AUTHORED_PREFERENCE_CONTENT_TOO_LONG_MESSAGE,
|
|
2017
2038
|
AGENT_AUTHORED_REMEMBER_CONTENT_TOO_LONG_MESSAGE,
|
|
2039
|
+
AGENT_AUTHORED_SKILL_STYLE,
|
|
2018
2040
|
API_INTEGRATION_OAUTH_CREDENTIAL_ROLE,
|
|
2019
2041
|
ATLASSIAN_CREDENTIAL_LABEL,
|
|
2020
2042
|
ATLASSIAN_CREDENTIAL_ROLE,
|
|
@@ -2330,11 +2352,15 @@ export {
|
|
|
2330
2352
|
CompanyProfileActivationEvent,
|
|
2331
2353
|
CompanyProfileActivationType,
|
|
2332
2354
|
CompanyProfileAgentAttempt,
|
|
2355
|
+
CompanyProfileAgentAutomaticActivationReceipt,
|
|
2333
2356
|
CompanyProfileAgentConfirmRequest,
|
|
2334
2357
|
CompanyProfileAgentConfirmationReceipt,
|
|
2335
2358
|
CompanyProfileAgentHumanInputPrompt,
|
|
2359
|
+
CompanyProfileAgentPolicy,
|
|
2360
|
+
CompanyProfileAgentPolicyMode,
|
|
2336
2361
|
CompanyProfileAgentProposalReceipt,
|
|
2337
2362
|
CompanyProfileAgentProposalRequest,
|
|
2363
|
+
CompanyProfileAgentReviewRequiredReceipt,
|
|
2338
2364
|
CompanyProfileConflictResponse,
|
|
2339
2365
|
CompanyProfileContent,
|
|
2340
2366
|
CompanyProfileDiffRequest,
|
|
@@ -2425,6 +2451,7 @@ export {
|
|
|
2425
2451
|
CreateKnowledgeDropRequest,
|
|
2426
2452
|
CreateKnowledgeMemoryRequest,
|
|
2427
2453
|
CreateNetworkRouteRequest,
|
|
2454
|
+
CreateOrganizationApiKeyRequest,
|
|
2428
2455
|
CreateOrganizationInvitationRequest,
|
|
2429
2456
|
CreateOrganizationRequest,
|
|
2430
2457
|
CreateOrganizationResponse,
|
|
@@ -2545,6 +2572,8 @@ export {
|
|
|
2545
2572
|
EnrollmentCredentialsResponse,
|
|
2546
2573
|
EnrollmentOs,
|
|
2547
2574
|
EnrollmentSummary,
|
|
2575
|
+
EnsureWorkspaceRequest,
|
|
2576
|
+
EnsureWorkspaceResponse,
|
|
2548
2577
|
EntitlementDecision,
|
|
2549
2578
|
EntitlementValue,
|
|
2550
2579
|
Entitlements,
|
|
@@ -2844,6 +2873,7 @@ export {
|
|
|
2844
2873
|
ListSlackUserLinkAccessRequestsResponse,
|
|
2845
2874
|
ListUserResourceAuthoritiesQuery,
|
|
2846
2875
|
ListUserResourceAuthoritiesResponse,
|
|
2876
|
+
ListWorkspaceMemberCandidatesResponse,
|
|
2847
2877
|
ListWorkspaceMembersResponse,
|
|
2848
2878
|
MAX_COMMITTED_TRANSACTION_BYTES,
|
|
2849
2879
|
MAX_COMMITTED_TRANSACTION_CAUSAL_REPLICAS,
|
|
@@ -3188,6 +3218,7 @@ export {
|
|
|
3188
3218
|
RunDocumentDefaultCollectionBackfillRequest,
|
|
3189
3219
|
SANDBOX_FILE_ARTIFACT_MAX_BYTES,
|
|
3190
3220
|
SANDBOX_PROVIDER_INSTANCE_ID_FIELDS_BY_BACKEND,
|
|
3221
|
+
SCHEDULED_OCCURRENCE_TASK_LABEL,
|
|
3191
3222
|
SCHEDULED_TASK_ACCEPTED_EXECUTION_MAX_BYTES,
|
|
3192
3223
|
SCHEDULED_TASK_AGENT_CONFIG_MAX_BYTES,
|
|
3193
3224
|
SCHEDULED_TASK_METADATA_MAX_BYTES,
|
|
@@ -3513,6 +3544,7 @@ export {
|
|
|
3513
3544
|
UpdateAutomationTriggerRequest,
|
|
3514
3545
|
UpdateBrowserIdentityRequest,
|
|
3515
3546
|
UpdateChannelRequest,
|
|
3547
|
+
UpdateCompanyProfileAgentPolicyRequest,
|
|
3516
3548
|
UpdateCompanyProfileRequest,
|
|
3517
3549
|
UpdateConnectionRequest,
|
|
3518
3550
|
UpdateKnowledgeMemoryRequest,
|
|
@@ -3569,6 +3601,8 @@ export {
|
|
|
3569
3601
|
UserResourceGrantStatus,
|
|
3570
3602
|
UserResourceKind,
|
|
3571
3603
|
UserResourceLifecycleGrantMode,
|
|
3604
|
+
VARIABLE_SET_RESERVED_EXACT_NAMES,
|
|
3605
|
+
VARIABLE_SET_RESERVED_PREFIXES,
|
|
3572
3606
|
VIDEO_GENERATION_SCHEMA_VERSION,
|
|
3573
3607
|
VIRTUAL_WORKSPACE_ROOT,
|
|
3574
3608
|
VOICE_INPUT_ACCEPTED_MIME_TYPES,
|
|
@@ -3745,6 +3779,7 @@ export {
|
|
|
3745
3779
|
WorkspaceLearningSourceOverrides,
|
|
3746
3780
|
WorkspaceLearningSourceRef,
|
|
3747
3781
|
WorkspaceMember,
|
|
3782
|
+
WorkspaceMemberCandidate,
|
|
3748
3783
|
WorkspaceMemberRole,
|
|
3749
3784
|
WorkspaceMemoryPromptMode,
|
|
3750
3785
|
WorkspaceMemorySearchMode,
|
|
@@ -3811,6 +3846,7 @@ export {
|
|
|
3811
3846
|
atlassianScopesAllowRead,
|
|
3812
3847
|
backendForNativeSnapshotProvider,
|
|
3813
3848
|
bindConnectorDocumentDestination,
|
|
3849
|
+
boundAutomaticSessionTitle,
|
|
3814
3850
|
boundSessionEvent,
|
|
3815
3851
|
boundSessionEventPayload,
|
|
3816
3852
|
boundWorkspaceControlEvent,
|
|
@@ -3827,6 +3863,7 @@ export {
|
|
|
3827
3863
|
comparePersonalSlackCanonicalConnections,
|
|
3828
3864
|
connectorDestinationDocumentAuthority,
|
|
3829
3865
|
connectorDocumentDestinationCollectionId,
|
|
3866
|
+
containsSensitiveAutomaticSessionTitleValue,
|
|
3830
3867
|
createCodexFleetReplayRecordV1,
|
|
3831
3868
|
currentEditableArtifactCompatibility,
|
|
3832
3869
|
decodeCommittedTransactionSummary,
|
|
@@ -3963,6 +4000,7 @@ export {
|
|
|
3963
4000
|
toolResultSpillSandboxPath,
|
|
3964
4001
|
turnExecutionPolicyAuditMetadata,
|
|
3965
4002
|
validateRetainedOutputEvidence,
|
|
4003
|
+
variableSetVariableNameReservation,
|
|
3966
4004
|
verifyDelegatedAccessToken,
|
|
3967
4005
|
verifyEnrollToken,
|
|
3968
4006
|
verifyEnrollmentBearer,
|
|
@@ -99,6 +99,25 @@ export declare const ManagedAuthLoginTransaction: z.ZodObject<{
|
|
|
99
99
|
returnIntentId: z.ZodNullable<z.ZodString>;
|
|
100
100
|
}, z.core.$strip>;
|
|
101
101
|
export type ManagedAuthLoginTransaction = z.infer<typeof ManagedAuthLoginTransaction>;
|
|
102
|
+
export declare const ManagedAuthSocialProvider: z.ZodEnum<{
|
|
103
|
+
github: "github";
|
|
104
|
+
google: "google";
|
|
105
|
+
}>;
|
|
106
|
+
export type ManagedAuthSocialProvider = z.infer<typeof ManagedAuthSocialProvider>;
|
|
107
|
+
export declare const StartManagedAuthSocialTransactionRequest: z.ZodObject<{
|
|
108
|
+
operationId: z.ZodString;
|
|
109
|
+
expectedGeneration: z.ZodString;
|
|
110
|
+
transactionId: z.ZodString;
|
|
111
|
+
provider: z.ZodEnum<{
|
|
112
|
+
github: "github";
|
|
113
|
+
google: "google";
|
|
114
|
+
}>;
|
|
115
|
+
}, z.core.$strip>;
|
|
116
|
+
export type StartManagedAuthSocialTransactionRequest = z.infer<typeof StartManagedAuthSocialTransactionRequest>;
|
|
117
|
+
export declare const StartManagedAuthSocialTransactionResponse: z.ZodObject<{
|
|
118
|
+
url: z.ZodString;
|
|
119
|
+
}, z.core.$strip>;
|
|
120
|
+
export type StartManagedAuthSocialTransactionResponse = z.infer<typeof StartManagedAuthSocialTransactionResponse>;
|
|
102
121
|
export declare const CompleteManagedAuthEmailPasswordTransactionRequest: z.ZodObject<{
|
|
103
122
|
operationId: z.ZodString;
|
|
104
123
|
expectedGeneration: z.ZodString;
|
|
@@ -82,6 +82,14 @@ var ManagedAuthLoginTransaction = z.object({
|
|
|
82
82
|
expiresAt: z.string().datetime(),
|
|
83
83
|
returnIntentId: z.string().uuid().nullable()
|
|
84
84
|
});
|
|
85
|
+
var ManagedAuthSocialProvider = z.enum(["google", "github"]);
|
|
86
|
+
var StartManagedAuthSocialTransactionRequest = ManagedAuthOperationIdentity.extend({
|
|
87
|
+
transactionId: z.string().uuid(),
|
|
88
|
+
provider: ManagedAuthSocialProvider
|
|
89
|
+
});
|
|
90
|
+
var StartManagedAuthSocialTransactionResponse = z.object({
|
|
91
|
+
url: z.string().url().max(4096)
|
|
92
|
+
});
|
|
85
93
|
var CompleteManagedAuthEmailPasswordTransactionRequest = ManagedAuthOperationIdentity.extend({
|
|
86
94
|
transactionId: z.string().uuid(),
|
|
87
95
|
email: z.string().email().max(320),
|
|
@@ -159,8 +167,11 @@ export {
|
|
|
159
167
|
ManagedAuthSessionSetMode,
|
|
160
168
|
ManagedAuthSessionSetProjection,
|
|
161
169
|
ManagedAuthSessionSetState,
|
|
170
|
+
ManagedAuthSocialProvider,
|
|
162
171
|
ManagedAuthVerifiedClaim,
|
|
163
172
|
ResolveManagedAuthDeepLinkRequest,
|
|
164
|
-
SelectManagedAuthLoginSlotRequest
|
|
173
|
+
SelectManagedAuthLoginSlotRequest,
|
|
174
|
+
StartManagedAuthSocialTransactionRequest,
|
|
175
|
+
StartManagedAuthSocialTransactionResponse
|
|
165
176
|
};
|
|
166
177
|
//# sourceMappingURL=managed-auth-session-sets.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/managed-auth-session-sets.ts"],"sourcesContent":["import { z } from \"zod\";\n\nexport const MANAGED_AUTH_SESSION_SET_MAX_SLOTS = 8 as const;\nexport const MANAGED_AUTH_TRANSACTION_TTL_SECONDS = 600 as const;\nexport const MANAGED_AUTH_RETURN_INTENT_MAX_BYTES = 2_048 as const;\nexport const MANAGED_AUTH_SESSION_SET_API_CONTRACT_HEADER = \"x-opengeni-api-contract\" as const;\nexport const MANAGED_AUTH_SESSION_SET_API_CONTRACT_REVISION =\n \"2026-08-personal-only-organization-setup-v1\" as const;\n\nexport const ManagedAuthSessionSetMode = z.enum([\"legacy\", \"dual\", \"broker\"]);\nexport type ManagedAuthSessionSetMode = z.infer<typeof ManagedAuthSessionSetMode>;\n\nexport const ManagedAuthLoginSlotState = z.enum([\"active\", \"reauth_required\"]);\nexport type ManagedAuthLoginSlotState = z.infer<typeof ManagedAuthLoginSlotState>;\n\nexport const ManagedAuthVerifiedClaim = z.object({\n kind: z.literal(\"email\"),\n value: z.string().email().max(320),\n});\nexport type ManagedAuthVerifiedClaim = z.infer<typeof ManagedAuthVerifiedClaim>;\n\n/** Secret-free, browser-safe summary. Provider session ids and tokens never enter this shape. */\nexport const ManagedAuthLoginSlot = z.object({\n id: z.string().uuid(),\n displayName: z.string().min(1).max(256),\n verifiedClaim: ManagedAuthVerifiedClaim,\n state: ManagedAuthLoginSlotState,\n});\nexport type ManagedAuthLoginSlot = z.infer<typeof ManagedAuthLoginSlot>;\n\nexport const ManagedAuthSessionSetState = z.enum([\"ready\", \"actor_change_required\"]);\nexport type ManagedAuthSessionSetState = z.infer<typeof ManagedAuthSessionSetState>;\n\nexport const ManagedAuthSessionSetProjection = z.object({\n mode: ManagedAuthSessionSetMode,\n generation: z.string().regex(/^[1-9][0-9]*$/),\n actorEpoch: z.string().regex(/^[1-9][0-9]*$/),\n csrfToken: z.string().min(32).max(512),\n selectedSlotId: z.string().uuid().nullable(),\n state: ManagedAuthSessionSetState,\n slots: z.array(ManagedAuthLoginSlot).max(MANAGED_AUTH_SESSION_SET_MAX_SLOTS),\n});\nexport type ManagedAuthSessionSetProjection = z.infer<typeof ManagedAuthSessionSetProjection>;\n\nexport const ManagedAuthOperationIdentity = z.object({\n operationId: z.string().uuid(),\n expectedGeneration: z.string().regex(/^[1-9][0-9]*$/),\n});\nexport type ManagedAuthOperationIdentity = z.infer<typeof ManagedAuthOperationIdentity>;\n\nexport const BootstrapManagedAuthSessionSetRequest = ManagedAuthOperationIdentity;\nexport type BootstrapManagedAuthSessionSetRequest = z.infer<\n typeof BootstrapManagedAuthSessionSetRequest\n>;\n\nexport const ManagedAuthReturnIntent = z\n .string()\n .min(1)\n .superRefine((value, context) => {\n if (new TextEncoder().encode(value).byteLength > MANAGED_AUTH_RETURN_INTENT_MAX_BYTES) {\n context.addIssue({ code: \"custom\", message: \"return intent exceeds its UTF-8 byte limit\" });\n }\n if (\n !value.startsWith(\"/\") ||\n value.startsWith(\"//\") ||\n value.includes(\"?\") ||\n value.includes(\"#\") ||\n /[\\u0000-\\u001f\\u007f\\\\]/.test(value)\n ) {\n context.addIssue({\n code: \"custom\",\n message: \"return intent must be a safe same-origin path\",\n });\n return;\n }\n try {\n const parsed = new URL(value, \"https://opengeni.invalid\");\n const uuid = \"[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}\";\n const supportedPath = new RegExp(\n `^/(?:sessions/${uuid}|workspaces/${uuid}(?:/sessions(?:/${uuid})?)?)$`,\n \"i\",\n );\n if (\n parsed.origin !== \"https://opengeni.invalid\" ||\n parsed.username ||\n parsed.password ||\n parsed.search ||\n parsed.hash ||\n !supportedPath.test(value) ||\n parsed.pathname !== value\n ) {\n context.addIssue({\n code: \"custom\",\n message: \"return intent contains unsafe authority data\",\n });\n }\n } catch {\n context.addIssue({\n code: \"custom\",\n message: \"return intent is not a valid same-origin path\",\n });\n }\n });\n\nexport const BeginManagedAuthLoginTransactionRequest = ManagedAuthOperationIdentity.extend({\n kind: z.enum([\"add\", \"reauth\"]),\n slotId: z.string().uuid().optional(),\n returnIntent: ManagedAuthReturnIntent.optional(),\n}).superRefine((value, context) => {\n if ((value.kind === \"reauth\") !== Boolean(value.slotId)) {\n context.addIssue({\n code: \"custom\",\n path: [\"slotId\"],\n message: \"reauth requires exactly one slot id and add forbids one\",\n });\n }\n});\nexport type BeginManagedAuthLoginTransactionRequest = z.infer<\n typeof BeginManagedAuthLoginTransactionRequest\n>;\n\nexport const ManagedAuthLoginTransaction = z.object({\n id: z.string().uuid(),\n kind: z.enum([\"add\", \"reauth\"]),\n expiresAt: z.string().datetime(),\n returnIntentId: z.string().uuid().nullable(),\n});\nexport type ManagedAuthLoginTransaction = z.infer<typeof ManagedAuthLoginTransaction>;\n\nexport const CompleteManagedAuthEmailPasswordTransactionRequest =\n ManagedAuthOperationIdentity.extend({\n transactionId: z.string().uuid(),\n email: z.string().email().max(320),\n password: z.string().min(1).max(1_024),\n });\nexport type CompleteManagedAuthEmailPasswordTransactionRequest = z.infer<\n typeof CompleteManagedAuthEmailPasswordTransactionRequest\n>;\n\nexport const CompleteManagedAuthLoginTransactionResponse = z.object({\n projection: ManagedAuthSessionSetProjection,\n returnIntent: ManagedAuthReturnIntent.nullable(),\n});\nexport type CompleteManagedAuthLoginTransactionResponse = z.infer<\n typeof CompleteManagedAuthLoginTransactionResponse\n>;\n\nexport const CancelManagedAuthLoginTransactionRequest = ManagedAuthOperationIdentity.extend({\n transactionId: z.string().uuid(),\n});\nexport type CancelManagedAuthLoginTransactionRequest = z.infer<\n typeof CancelManagedAuthLoginTransactionRequest\n>;\n\nexport const SelectManagedAuthLoginSlotRequest = ManagedAuthOperationIdentity.extend({\n slotId: z.string().uuid(),\n});\nexport type SelectManagedAuthLoginSlotRequest = z.infer<typeof SelectManagedAuthLoginSlotRequest>;\n\nexport const LogoutManagedAuthLoginSlotRequest = ManagedAuthOperationIdentity.extend({\n slotId: z.string().uuid(),\n replacementSlotId: z.string().uuid().nullable(),\n});\nexport type LogoutManagedAuthLoginSlotRequest = z.infer<typeof LogoutManagedAuthLoginSlotRequest>;\n\nexport const LogoutManagedAuthSessionSetRequest = ManagedAuthOperationIdentity;\nexport type LogoutManagedAuthSessionSetRequest = z.infer<typeof LogoutManagedAuthSessionSetRequest>;\n\nexport const ManagedAuthLogoutAllReceipt = z.object({\n generation: z.string().regex(/^[1-9][0-9]*$/),\n actorEpoch: z.string().regex(/^[1-9][0-9]*$/),\n state: z.literal(\"logged_out\"),\n});\nexport type ManagedAuthLogoutAllReceipt = z.infer<typeof ManagedAuthLogoutAllReceipt>;\n\nexport const ResolveManagedAuthDeepLinkRequest = z.object({\n path: ManagedAuthReturnIntent,\n});\nexport type ResolveManagedAuthDeepLinkRequest = z.infer<typeof ResolveManagedAuthDeepLinkRequest>;\n\nexport const ManagedAuthDeepLinkResolution = z.discriminatedUnion(\"kind\", [\n z.object({ kind: z.literal(\"current\") }),\n z.object({ kind: z.literal(\"switch_required\"), slot: ManagedAuthLoginSlot }),\n z.object({ kind: z.literal(\"unavailable\") }),\n]);\nexport type ManagedAuthDeepLinkResolution = z.infer<typeof ManagedAuthDeepLinkResolution>;\n\nexport const ManagedAuthSessionSetErrorCode = z.enum([\n \"actor_change_required\",\n \"actor_mutation_in_flight\",\n \"api_contract_changed\",\n \"browser_session_set_required\",\n \"browser_session_set_unavailable\",\n \"generation_conflict\",\n \"invalid_browser_session_set_request\",\n \"invalid_transaction\",\n \"managed_authentication_required\",\n \"managed_authentication_unavailable\",\n \"operation_outcome_unknown\",\n \"operation_reused\",\n \"origin_rejected\",\n \"login_transaction_rate_limited\",\n \"provider_route_blocked\",\n \"slot_limit_reached\",\n \"slot_already_exists\",\n \"slot_unavailable\",\n]);\nexport type ManagedAuthSessionSetErrorCode = z.infer<typeof ManagedAuthSessionSetErrorCode>;\n"],"mappings":";AAAA,SAAS,SAAS;AAEX,IAAM,qCAAqC;AAC3C,IA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EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,iBAAiB,GAAG,MAAM,qBAAqB,CAAC;AAAA,EAC3E,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,aAAa,EAAE,CAAC;AAC7C,CAAC;AAGM,IAAM,iCAAiC,EAAE,KAAK;AAAA,EACnD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/managed-auth-session-sets.ts"],"sourcesContent":["import { z } from \"zod\";\n\nexport const MANAGED_AUTH_SESSION_SET_MAX_SLOTS = 8 as const;\nexport const MANAGED_AUTH_TRANSACTION_TTL_SECONDS = 600 as const;\nexport const MANAGED_AUTH_RETURN_INTENT_MAX_BYTES = 2_048 as const;\nexport const MANAGED_AUTH_SESSION_SET_API_CONTRACT_HEADER = \"x-opengeni-api-contract\" as const;\nexport const MANAGED_AUTH_SESSION_SET_API_CONTRACT_REVISION =\n \"2026-08-personal-only-organization-setup-v1\" as const;\n\nexport const ManagedAuthSessionSetMode = z.enum([\"legacy\", \"dual\", \"broker\"]);\nexport type ManagedAuthSessionSetMode = z.infer<typeof ManagedAuthSessionSetMode>;\n\nexport const ManagedAuthLoginSlotState = z.enum([\"active\", \"reauth_required\"]);\nexport type ManagedAuthLoginSlotState = z.infer<typeof ManagedAuthLoginSlotState>;\n\nexport const ManagedAuthVerifiedClaim = z.object({\n kind: z.literal(\"email\"),\n value: z.string().email().max(320),\n});\nexport type ManagedAuthVerifiedClaim = z.infer<typeof ManagedAuthVerifiedClaim>;\n\n/** Secret-free, browser-safe summary. Provider session ids and tokens never enter this shape. */\nexport const ManagedAuthLoginSlot = z.object({\n id: z.string().uuid(),\n displayName: z.string().min(1).max(256),\n verifiedClaim: ManagedAuthVerifiedClaim,\n state: ManagedAuthLoginSlotState,\n});\nexport type ManagedAuthLoginSlot = z.infer<typeof ManagedAuthLoginSlot>;\n\nexport const ManagedAuthSessionSetState = z.enum([\"ready\", \"actor_change_required\"]);\nexport type ManagedAuthSessionSetState = z.infer<typeof ManagedAuthSessionSetState>;\n\nexport const ManagedAuthSessionSetProjection = z.object({\n mode: ManagedAuthSessionSetMode,\n generation: z.string().regex(/^[1-9][0-9]*$/),\n actorEpoch: z.string().regex(/^[1-9][0-9]*$/),\n csrfToken: z.string().min(32).max(512),\n selectedSlotId: z.string().uuid().nullable(),\n state: ManagedAuthSessionSetState,\n slots: z.array(ManagedAuthLoginSlot).max(MANAGED_AUTH_SESSION_SET_MAX_SLOTS),\n});\nexport type ManagedAuthSessionSetProjection = z.infer<typeof ManagedAuthSessionSetProjection>;\n\nexport const ManagedAuthOperationIdentity = z.object({\n operationId: z.string().uuid(),\n expectedGeneration: z.string().regex(/^[1-9][0-9]*$/),\n});\nexport type ManagedAuthOperationIdentity = z.infer<typeof ManagedAuthOperationIdentity>;\n\nexport const BootstrapManagedAuthSessionSetRequest = ManagedAuthOperationIdentity;\nexport type BootstrapManagedAuthSessionSetRequest = z.infer<\n typeof BootstrapManagedAuthSessionSetRequest\n>;\n\nexport const ManagedAuthReturnIntent = z\n .string()\n .min(1)\n .superRefine((value, context) => {\n if (new TextEncoder().encode(value).byteLength > MANAGED_AUTH_RETURN_INTENT_MAX_BYTES) {\n context.addIssue({ code: \"custom\", message: \"return intent exceeds its UTF-8 byte limit\" });\n }\n if (\n !value.startsWith(\"/\") ||\n value.startsWith(\"//\") ||\n value.includes(\"?\") ||\n value.includes(\"#\") ||\n /[\\u0000-\\u001f\\u007f\\\\]/.test(value)\n ) {\n context.addIssue({\n code: \"custom\",\n message: \"return intent must be a safe same-origin path\",\n });\n return;\n }\n try {\n const parsed = new URL(value, \"https://opengeni.invalid\");\n const uuid = \"[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}\";\n const supportedPath = new RegExp(\n `^/(?:sessions/${uuid}|workspaces/${uuid}(?:/sessions(?:/${uuid})?)?)$`,\n \"i\",\n );\n if (\n parsed.origin !== \"https://opengeni.invalid\" ||\n parsed.username ||\n parsed.password ||\n parsed.search ||\n parsed.hash ||\n !supportedPath.test(value) ||\n parsed.pathname !== value\n ) {\n context.addIssue({\n code: \"custom\",\n message: \"return intent contains unsafe authority data\",\n });\n }\n } catch {\n context.addIssue({\n code: \"custom\",\n message: \"return intent is not a valid same-origin path\",\n });\n }\n });\n\nexport const BeginManagedAuthLoginTransactionRequest = ManagedAuthOperationIdentity.extend({\n kind: z.enum([\"add\", \"reauth\"]),\n slotId: z.string().uuid().optional(),\n returnIntent: ManagedAuthReturnIntent.optional(),\n}).superRefine((value, context) => {\n if ((value.kind === \"reauth\") !== Boolean(value.slotId)) {\n context.addIssue({\n code: \"custom\",\n path: [\"slotId\"],\n message: \"reauth requires exactly one slot id and add forbids one\",\n });\n }\n});\nexport type BeginManagedAuthLoginTransactionRequest = z.infer<\n typeof BeginManagedAuthLoginTransactionRequest\n>;\n\nexport const ManagedAuthLoginTransaction = z.object({\n id: z.string().uuid(),\n kind: z.enum([\"add\", \"reauth\"]),\n expiresAt: z.string().datetime(),\n returnIntentId: z.string().uuid().nullable(),\n});\nexport type ManagedAuthLoginTransaction = z.infer<typeof ManagedAuthLoginTransaction>;\n\nexport const ManagedAuthSocialProvider = z.enum([\"google\", \"github\"]);\nexport type ManagedAuthSocialProvider = z.infer<typeof ManagedAuthSocialProvider>;\n\nexport const StartManagedAuthSocialTransactionRequest = ManagedAuthOperationIdentity.extend({\n transactionId: z.string().uuid(),\n provider: ManagedAuthSocialProvider,\n});\nexport type StartManagedAuthSocialTransactionRequest = z.infer<\n typeof StartManagedAuthSocialTransactionRequest\n>;\n\nexport const StartManagedAuthSocialTransactionResponse = z.object({\n url: z.string().url().max(4_096),\n});\nexport type StartManagedAuthSocialTransactionResponse = z.infer<\n typeof StartManagedAuthSocialTransactionResponse\n>;\n\nexport const CompleteManagedAuthEmailPasswordTransactionRequest =\n ManagedAuthOperationIdentity.extend({\n transactionId: z.string().uuid(),\n email: z.string().email().max(320),\n password: z.string().min(1).max(1_024),\n });\nexport type CompleteManagedAuthEmailPasswordTransactionRequest = z.infer<\n typeof CompleteManagedAuthEmailPasswordTransactionRequest\n>;\n\nexport const CompleteManagedAuthLoginTransactionResponse = z.object({\n projection: ManagedAuthSessionSetProjection,\n returnIntent: ManagedAuthReturnIntent.nullable(),\n});\nexport type CompleteManagedAuthLoginTransactionResponse = z.infer<\n typeof CompleteManagedAuthLoginTransactionResponse\n>;\n\nexport const CancelManagedAuthLoginTransactionRequest = ManagedAuthOperationIdentity.extend({\n transactionId: z.string().uuid(),\n});\nexport type CancelManagedAuthLoginTransactionRequest = z.infer<\n typeof CancelManagedAuthLoginTransactionRequest\n>;\n\nexport const SelectManagedAuthLoginSlotRequest = ManagedAuthOperationIdentity.extend({\n slotId: z.string().uuid(),\n});\nexport type SelectManagedAuthLoginSlotRequest = z.infer<typeof SelectManagedAuthLoginSlotRequest>;\n\nexport const LogoutManagedAuthLoginSlotRequest = ManagedAuthOperationIdentity.extend({\n slotId: z.string().uuid(),\n replacementSlotId: z.string().uuid().nullable(),\n});\nexport type LogoutManagedAuthLoginSlotRequest = z.infer<typeof LogoutManagedAuthLoginSlotRequest>;\n\nexport const LogoutManagedAuthSessionSetRequest = ManagedAuthOperationIdentity;\nexport type LogoutManagedAuthSessionSetRequest = z.infer<typeof LogoutManagedAuthSessionSetRequest>;\n\nexport const ManagedAuthLogoutAllReceipt = z.object({\n generation: z.string().regex(/^[1-9][0-9]*$/),\n actorEpoch: z.string().regex(/^[1-9][0-9]*$/),\n state: z.literal(\"logged_out\"),\n});\nexport type ManagedAuthLogoutAllReceipt = z.infer<typeof ManagedAuthLogoutAllReceipt>;\n\nexport const ResolveManagedAuthDeepLinkRequest = z.object({\n path: ManagedAuthReturnIntent,\n});\nexport type ResolveManagedAuthDeepLinkRequest = z.infer<typeof ResolveManagedAuthDeepLinkRequest>;\n\nexport const ManagedAuthDeepLinkResolution = z.discriminatedUnion(\"kind\", [\n z.object({ kind: z.literal(\"current\") }),\n z.object({ kind: z.literal(\"switch_required\"), slot: ManagedAuthLoginSlot }),\n z.object({ kind: z.literal(\"unavailable\") }),\n]);\nexport type ManagedAuthDeepLinkResolution = z.infer<typeof ManagedAuthDeepLinkResolution>;\n\nexport const ManagedAuthSessionSetErrorCode = z.enum([\n \"actor_change_required\",\n \"actor_mutation_in_flight\",\n \"api_contract_changed\",\n \"browser_session_set_required\",\n \"browser_session_set_unavailable\",\n \"generation_conflict\",\n \"invalid_browser_session_set_request\",\n \"invalid_transaction\",\n \"managed_authentication_required\",\n \"managed_authentication_unavailable\",\n \"operation_outcome_unknown\",\n \"operation_reused\",\n \"origin_rejected\",\n \"login_transaction_rate_limited\",\n \"provider_route_blocked\",\n \"slot_limit_reached\",\n \"slot_already_exists\",\n \"slot_unavailable\",\n]);\nexport type ManagedAuthSessionSetErrorCode = z.infer<typeof ManagedAuthSessionSetErrorCode>;\n"],"mappings":";AAAA,SAAS,SAAS;AAEX,IAAM,qCAAqC;AAC3C,IAAM,uCAAuC;AAC7C,IAAM,uCAAuC;AAC7C,IAAM,+CAA+C;AACrD,IAAM,iDACX;AAEK,IAAM,4BAA4B,EAAE,KAAK,CAAC,UAAU,QAAQ,QAAQ,CAAC;AAGrE,IAAM,4BAA4B,EAAE,KAAK,CAAC,UAAU,iBAAiB,CAAC;AAGtE,IAAM,2BAA2B,EAAE,OAAO;AAAA,EAC/C,MAAM,EAAE,QAAQ,OAAO;AAAA,EACvB,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,GAAG;AACnC,CAAC;AAIM,IAAM,uBAAuB,EAAE,OAAO;AAAA,EAC3C,IAAI,EAAE,OAAO,EAAE,KAAK;AAAA,EACpB,aAAa,EAAE,OAAO,EAAE,I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AK;AAAA,EACnD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;","names":[]}
|
|
@@ -272,6 +272,7 @@ export declare const OrganizationWorkspaceRoleDefinition: z.ZodObject<{
|
|
|
272
272
|
"artifacts:read": "artifacts:read";
|
|
273
273
|
"billing:manage": "billing:manage";
|
|
274
274
|
"billing:read": "billing:read";
|
|
275
|
+
"capabilities:manage": "capabilities:manage";
|
|
275
276
|
"codemode:call": "codemode:call";
|
|
276
277
|
"connections:read": "connections:read";
|
|
277
278
|
"connections:write": "connections:write";
|
|
@@ -338,6 +339,7 @@ export declare const OrganizationAdministrationOverview: z.ZodObject<{
|
|
|
338
339
|
"artifacts:read": "artifacts:read";
|
|
339
340
|
"billing:manage": "billing:manage";
|
|
340
341
|
"billing:read": "billing:read";
|
|
342
|
+
"capabilities:manage": "capabilities:manage";
|
|
341
343
|
"codemode:call": "codemode:call";
|
|
342
344
|
"connections:read": "connections:read";
|
|
343
345
|
"connections:write": "connections:write";
|
|
@@ -444,6 +446,7 @@ export declare const PutOrganizationWorkspaceMemberRequest: z.ZodDiscriminatedUn
|
|
|
444
446
|
"artifacts:read": "artifacts:read";
|
|
445
447
|
"billing:manage": "billing:manage";
|
|
446
448
|
"billing:read": "billing:read";
|
|
449
|
+
"capabilities:manage": "capabilities:manage";
|
|
447
450
|
"codemode:call": "codemode:call";
|
|
448
451
|
"connections:read": "connections:read";
|
|
449
452
|
"connections:write": "connections:write";
|
package/dist/permissions.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ export declare const Permission: z.ZodEnum<{
|
|
|
8
8
|
"artifacts:read": "artifacts:read";
|
|
9
9
|
"billing:manage": "billing:manage";
|
|
10
10
|
"billing:read": "billing:read";
|
|
11
|
+
"capabilities:manage": "capabilities:manage";
|
|
11
12
|
"codemode:call": "codemode:call";
|
|
12
13
|
"connections:read": "connections:read";
|
|
13
14
|
"connections:write": "connections:write";
|
package/dist/personal-github.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ConnectionMetadata
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-AWNGBY5I.js";
|
|
4
4
|
import "./chunk-WYBDERIY.js";
|
|
5
5
|
import "./chunk-MRWYRAS5.js";
|
|
6
|
+
import "./chunk-4IVHBXRI.js";
|
|
6
7
|
import "./chunk-CM6BMECR.js";
|
|
7
8
|
import "./chunk-JUFK3T4Q.js";
|
|
8
9
|
import "./chunk-YBW5JSA3.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/personal-github.ts"],"sourcesContent":["import { z } from \"zod\";\n\nimport { ConnectionMetadata } from \"./index\";\n\nexport const PERSONAL_GITHUB_PROVIDER_DOMAIN = \"github.com\" as const;\nexport const PERSONAL_GITHUB_PROVIDER_FAMILY = \"github\" as const;\nexport const PERSONAL_GITHUB_CREDENTIAL_ROLE = \"opengeni_github_personal\" as const;\nexport const PERSONAL_GITHUB_CONNECTION_SURFACE_ID = \"github:personal\" as const;\nexport const PERSONAL_GITHUB_REQUESTED_SCOPES = [\"repo\"] as const;\nexport const PERSONAL_GITHUB_AUTHORIZATION_URL =\n \"https://github.com/login/oauth/authorize\" as const;\nexport const PERSONAL_GITHUB_TOKEN_URL = \"https://github.com/login/oauth/access_token\" as const;\nexport const PERSONAL_GITHUB_USER_URL = \"https://api.github.com/user\" as const;\nexport const PERSONAL_GITHUB_API_ORIGIN = \"https://api.github.com\" as const;\nexport const PERSONAL_GITHUB_REPOSITORY_CATALOG_MAX = 100 as const;\n\nexport const PersonalGitHubRepositoryId = z.string().regex(/^[1-9]\\d*$/u);\nexport type PersonalGitHubRepositoryId = z.infer<typeof PersonalGitHubRepositoryId>;\n\nexport const PersonalGitHubRepositoryAccess = z.enum([\"read\", \"write\"]);\nexport type PersonalGitHubRepositoryAccess = z.infer<typeof PersonalGitHubRepositoryAccess>;\n\nexport const PersonalGitHubRepositoryPermissions = z\n .object({\n pull: z.boolean(),\n push: z.boolean(),\n admin: z.boolean(),\n maintain: z.boolean(),\n triage: z.boolean(),\n })\n .strict();\nexport type PersonalGitHubRepositoryPermissions = z.infer<\n typeof PersonalGitHubRepositoryPermissions\n>;\n\nexport const PersonalGitHubRepositoryVisibility = z.enum([\"public\", \"private\", \"internal\"]);\nexport type PersonalGitHubRepositoryVisibility = z.infer<typeof PersonalGitHubRepositoryVisibility>;\n\nconst PersonalGitHubRepositoryFullName = z\n .string()\n .min(3)\n .max(140)\n .regex(/^[A-Za-z0-9](?:[A-Za-z0-9-]{0,38})\\/[A-Za-z0-9_.-]{1,100}$/u);\n\nexport function canonicalPersonalGitHubRepositoryUrl(fullName: string): string {\n return `https://github.com/${fullName}`;\n}\n\n/** A bounded, credential-free projection verified directly against GitHub. */\nexport const PersonalGitHubRepository = z\n .object({\n repositoryId: PersonalGitHubRepositoryId,\n fullName: PersonalGitHubRepositoryFullName,\n canonicalUrl: z.string().url().max(512),\n defaultBranch: z.string().min(1).max(255),\n visibility: PersonalGitHubRepositoryVisibility,\n private: z.boolean(),\n archived: z.boolean(),\n disabled: z.boolean(),\n permissions: PersonalGitHubRepositoryPermissions,\n })\n .strict()\n .superRefine((repository, context) => {\n if (repository.canonicalUrl !== canonicalPersonalGitHubRepositoryUrl(repository.fullName)) {\n context.addIssue({\n code: \"custom\",\n path: [\"canonicalUrl\"],\n message: \"canonicalUrl must be derived from fullName\",\n });\n }\n if (repository.private !== (repository.visibility === \"private\")) {\n context.addIssue({\n code: \"custom\",\n path: [\"private\"],\n message: \"private must agree with visibility\",\n });\n }\n });\nexport type PersonalGitHubRepository = z.infer<typeof PersonalGitHubRepository>;\n\nexport const PersonalGitHubSelectedRepository = PersonalGitHubRepository.safeExtend({\n selectedAccess: PersonalGitHubRepositoryAccess,\n selectionGeneration: z.number().int().positive(),\n selectedAt: z.string().datetime({ offset: true }),\n lastVerifiedAt: z.string().datetime({ offset: true }),\n}).strict();\nexport type PersonalGitHubSelectedRepository = z.infer<typeof PersonalGitHubSelectedRepository>;\n\nexport const PersonalGitHubRepositorySelectionState = z\n .object({\n connectionAuthorityGeneration: z.number().int().positive(),\n credentialBindingId: z.string().uuid(),\n providerPrincipalId: PersonalGitHubRepositoryId,\n selectionGeneration: z.number().int().nonnegative(),\n repositories: z\n .array(PersonalGitHubSelectedRepository)\n .max(PERSONAL_GITHUB_REPOSITORY_CATALOG_MAX),\n })\n .strict();\nexport type PersonalGitHubRepositorySelectionState = z.infer<\n typeof PersonalGitHubRepositorySelectionState\n>;\n\nexport const ListPersonalGitHubRepositoriesQuery = z\n .object({\n cursor: z.coerce.number().int().positive().max(10_000).default(1),\n limit: z.coerce.number().int().min(1).max(PERSONAL_GITHUB_REPOSITORY_CATALOG_MAX).default(50),\n })\n .strict();\nexport type ListPersonalGitHubRepositoriesQuery = z.infer<\n typeof ListPersonalGitHubRepositoriesQuery\n>;\n\nexport const PersonalGitHubRepositoryCatalogItem = PersonalGitHubRepository.safeExtend({\n selectedAccess: PersonalGitHubRepositoryAccess.nullable(),\n}).strict();\nexport type PersonalGitHubRepositoryCatalogItem = z.infer<\n typeof PersonalGitHubRepositoryCatalogItem\n>;\n\nexport const ListPersonalGitHubRepositoriesResponse = z\n .object({\n repositories: z\n .array(PersonalGitHubRepositoryCatalogItem)\n .max(PERSONAL_GITHUB_REPOSITORY_CATALOG_MAX),\n nextCursor: z.number().int().positive().nullable(),\n selection: PersonalGitHubRepositorySelectionState,\n })\n .strict();\nexport type ListPersonalGitHubRepositoriesResponse = z.infer<\n typeof ListPersonalGitHubRepositoriesResponse\n>;\n\nexport const PersonalGitHubRepositorySelectionInput = z\n .object({\n repositoryId: PersonalGitHubRepositoryId,\n fullName: PersonalGitHubRepositoryFullName,\n access: PersonalGitHubRepositoryAccess,\n })\n .strict();\nexport type PersonalGitHubRepositorySelectionInput = z.infer<\n typeof PersonalGitHubRepositorySelectionInput\n>;\n\nexport const ReplacePersonalGitHubRepositorySelectionsRequest = z\n .object({\n expectedConnectionAuthorityGeneration: z.number().int().positive(),\n expectedSelectionGeneration: z.number().int().nonnegative(),\n idempotencyKey: z.string().trim().min(1).max(200),\n repositories: z\n .array(PersonalGitHubRepositorySelectionInput)\n .max(PERSONAL_GITHUB_REPOSITORY_CATALOG_MAX),\n })\n .strict()\n .superRefine((request, context) => {\n const repositoryIds = new Set<string>();\n const fullNames = new Set<string>();\n request.repositories.forEach((repository, index) => {\n const normalizedFullName = repository.fullName.toLowerCase();\n if (repositoryIds.has(repository.repositoryId)) {\n context.addIssue({\n code: \"custom\",\n path: [\"repositories\", index, \"repositoryId\"],\n message: \"repositoryId must be unique\",\n });\n }\n if (fullNames.has(normalizedFullName)) {\n context.addIssue({\n code: \"custom\",\n path: [\"repositories\", index, \"fullName\"],\n message: \"fullName must be unique\",\n });\n }\n repositoryIds.add(repository.repositoryId);\n fullNames.add(normalizedFullName);\n });\n });\nexport type ReplacePersonalGitHubRepositorySelectionsRequest = z.infer<\n typeof ReplacePersonalGitHubRepositorySelectionsRequest\n>;\n\nexport const VerifyPersonalGitHubRepositorySelectionsRequest = z\n .object({\n expectedConnectionAuthorityGeneration: z.number().int().positive(),\n expectedSelectionGeneration: z.number().int().nonnegative(),\n idempotencyKey: z.string().trim().min(1).max(200),\n })\n .strict();\nexport type VerifyPersonalGitHubRepositorySelectionsRequest = z.infer<\n typeof VerifyPersonalGitHubRepositorySelectionsRequest\n>;\n\n/**\n * Owner-visible, credential-free metadata for one dedicated personal GitHub\n * OAuth connection. Repository selections are a separate authority and never\n * live in this credential record.\n */\nexport const PersonalGitHubConnectionMetadata = z\n .object({\n credentialRole: z.literal(PERSONAL_GITHUB_CREDENTIAL_ROLE),\n providerFamily: z.literal(PERSONAL_GITHUB_PROVIDER_FAMILY),\n providerPrincipalId: z.string().regex(/^\\d+$/u),\n githubUserId: z.string().regex(/^\\d+$/u),\n githubLogin: z.string().min(1).max(100),\n oauthEnvironment: z.string().min(1).max(128),\n oauthClientMarker: z.string().regex(/^[a-f0-9]{32}$/u),\n credentialBindingId: z.string().uuid(),\n connectedAt: z.string().datetime({ offset: true }),\n lastVerifiedAt: z.string().datetime({ offset: true }),\n disconnectedAt: z.string().datetime({ offset: true }).nullable().optional(),\n refreshTokenExpiresAt: z.string().datetime({ offset: true }).nullable().optional(),\n })\n .passthrough();\nexport type PersonalGitHubConnectionMetadata = z.infer<typeof PersonalGitHubConnectionMetadata>;\n\nexport const PersonalGitHubOAuthStartRequest = z\n .object({\n /** Existing exact connection generation to re-authorize in place. */\n connectionId: z.string().uuid().optional(),\n /** Same-workspace UI path restored after the callback. */\n returnPath: z.string().min(1).max(2048).optional(),\n })\n .strict();\nexport type PersonalGitHubOAuthStartRequest = z.infer<typeof PersonalGitHubOAuthStartRequest>;\n\nexport const PersonalGitHubOAuthStartResponse = z\n .object({\n authorizationUrl: z.string().url(),\n expiresAt: z.string().datetime({ offset: true }),\n })\n .strict();\nexport type PersonalGitHubOAuthStartResponse = z.infer<typeof PersonalGitHubOAuthStartResponse>;\n\nexport const PersonalGitHubConnectionStatusResponse = z\n .object({\n enabled: z.boolean(),\n connection: ConnectionMetadata.nullable(),\n reviewUrl: z.string().url().nullable(),\n })\n .strict();\nexport type PersonalGitHubConnectionStatusResponse = z.infer<\n typeof PersonalGitHubConnectionStatusResponse\n>;\n\nexport const PersonalGitHubDisconnectRequest = z\n .object({\n expectedVersion: z.number().int().positive(),\n idempotencyKey: z.string().trim().min(1).max(200),\n })\n .strict();\nexport type PersonalGitHubDisconnectRequest = z.infer<typeof PersonalGitHubDisconnectRequest>;\n\nexport function isPersonalGitHubConnection(\n connection: Pick<z.infer<typeof ConnectionMetadata>, \"providerDomain\" | \"kind\" | \"metadata\">,\n): boolean {\n return (\n connection.providerDomain.toLowerCase() === PERSONAL_GITHUB_PROVIDER_DOMAIN &&\n connection.kind === \"oauth2\" &&\n PersonalGitHubConnectionMetadata.safeParse(connection.metadata).success\n );\n}\n\nexport function hasReservedPersonalGitHubMetadata(\n metadata: Record<string, unknown> | undefined,\n): boolean {\n return metadata?.credentialRole === PERSONAL_GITHUB_CREDENTIAL_ROLE;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,SAAS;AAIX,IAAM,kCAAkC;AACxC,IAAM,kCAAkC;AACxC,IAAM,kCAAkC;AACxC,IAAM,wCAAwC;AAC9C,IAAM,mCAAmC,CAAC,MAAM;AAChD,IAAM,oCACX;AACK,IAAM,4BAA4B;AAClC,IAAM,2BAA2B;AACjC,IAAM,6BAA6B;AACnC,IAAM,yCAAyC;AAE/C,IAAM,6BAA6B,EAAE,OAAO,EAAE,MAAM,aAAa;AAGjE,IAAM,iCAAiC,EAAE,KAAK,CAAC,QAAQ,OAAO,CAAC;AAG/D,IAAM,sCAAsC,EAChD,OAAO;AAAA,EACN,MAAM,EAAE,QAAQ;AAAA,EAChB,MAAM,EAAE,QAAQ;AAAA,EAChB,OAAO,EAAE,QAAQ;AAAA,EACjB,UAAU,EAAE,QAAQ;AAAA,EACpB,QAAQ,EAAE,QAAQ;AACpB,CAAC,EACA,OAAO;AAKH,IAAM,qCAAqC,EAAE,KAAK,CAAC,UAAU,WAAW,UAAU,CAAC;AAG1F,IAAM,mCAAmC,EACtC,OAAO,EACP,IAAI,CAAC,EACL,IAAI,GAAG,EACP,MAAM,6DAA6D;AAE/D,SAAS,qCAAqC,UAA0B;AAC7E,SAAO,sBAAsB,QAAQ;AACvC;AAGO,IAAM,2BAA2B,EACrC,OAAO;AAAA,EACN,cAAc;AAAA,EACd,UAAU;AAAA,EACV,cAAc,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,GAAG;AAAA,EACtC,eAAe,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,IAAI,GAAG;AAAA,EACxC,YAAY;AAAA,EACZ,SAAS,EAAE,QAAQ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c,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS;AAAA;AAAA,EAEzC,YAAY,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,IAAI,IAAI,EAAE,SAAS;AACnD,CAAC,EACA,OAAO;AAGH,IAAM,mCAAmC,EAC7C,OAAO;AAAA,EACN,kBAAkB,EAAE,OAAO,EAAE,IAAI;AAAA,EACjC,WAAW,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,KAAK,CAAC;AACjD,CAAC,EACA,OAAO;AAGH,IAAM,yCAAyC,EACnD,OAAO;AAAA,EACN,SAAS,EAAE,QAAQ;AAAA,EACnB,YAAY,mBAAmB,SAAS;AAAA,EACxC,WAAW,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS;AACvC,CAAC,EACA,OAAO;AAKH,IAAM,kCAAkC,EAC5C,OAAO;AAAA,EACN,iBAAiB,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS;AAAA,EAC3C,gBAAgB,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,EAAE,IAAI,GAAG;AAClD,CAAC,EACA,OAAO;AAGH,SAAS,2BACd,YACS;AACT,SACE,WAAW,eAAe,YAAY,MAAM,mCAC5C,WAAW,SAAS,YACpB,iCAAiC,UAAU,WAAW,QAAQ,EAAE;AAEpE;AAEO,SAAS,kCACd,UACS;AACT,SAAO,UAAU,mBAAmB;AACtC;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/personal-github.ts"],"sourcesContent":["import { z } from \"zod\";\n\nimport { ConnectionMetadata } from \"./index\";\n\nexport const PERSONAL_GITHUB_PROVIDER_DOMAIN = \"github.com\" as const;\nexport const PERSONAL_GITHUB_PROVIDER_FAMILY = \"github\" as const;\nexport const PERSONAL_GITHUB_CREDENTIAL_ROLE = \"opengeni_github_personal\" as const;\nexport const PERSONAL_GITHUB_CONNECTION_SURFACE_ID = \"github:personal\" as const;\nexport const PERSONAL_GITHUB_REQUESTED_SCOPES = [\"repo\"] as const;\nexport const PERSONAL_GITHUB_AUTHORIZATION_URL =\n \"https://github.com/login/oauth/authorize\" as const;\nexport const PERSONAL_GITHUB_TOKEN_URL = \"https://github.com/login/oauth/access_token\" as const;\nexport const PERSONAL_GITHUB_USER_URL = \"https://api.github.com/user\" as const;\nexport const PERSONAL_GITHUB_API_ORIGIN = \"https://api.github.com\" as const;\nexport const PERSONAL_GITHUB_REPOSITORY_CATALOG_MAX = 100 as const;\n\nexport const PersonalGitHubRepositoryId = z.string().regex(/^[1-9]\\d*$/u);\nexport type PersonalGitHubRepositoryId = z.infer<typeof PersonalGitHubRepositoryId>;\n\nexport const PersonalGitHubRepositoryAccess = z.enum([\"read\", \"write\"]);\nexport type PersonalGitHubRepositoryAccess = z.infer<typeof PersonalGitHubRepositoryAccess>;\n\nexport const PersonalGitHubRepositoryPermissions = z\n .object({\n pull: z.boolean(),\n push: z.boolean(),\n admin: z.boolean(),\n maintain: z.boolean(),\n triage: z.boolean(),\n })\n .strict();\nexport type PersonalGitHubRepositoryPermissions = z.infer<\n typeof PersonalGitHubRepositoryPermissions\n>;\n\nexport const PersonalGitHubRepositoryVisibility = z.enum([\"public\", \"private\", \"internal\"]);\nexport type PersonalGitHubRepositoryVisibility = z.infer<typeof PersonalGitHubRepositoryVisibility>;\n\nconst PersonalGitHubRepositoryFullName = z\n .string()\n .min(3)\n .max(140)\n .regex(/^[A-Za-z0-9](?:[A-Za-z0-9-]{0,38})\\/[A-Za-z0-9_.-]{1,100}$/u);\n\nexport function canonicalPersonalGitHubRepositoryUrl(fullName: string): string {\n return `https://github.com/${fullName}`;\n}\n\n/** A bounded, credential-free projection verified directly against GitHub. */\nexport const PersonalGitHubRepository = z\n .object({\n repositoryId: PersonalGitHubRepositoryId,\n fullName: PersonalGitHubRepositoryFullName,\n canonicalUrl: z.string().url().max(512),\n defaultBranch: z.string().min(1).max(255),\n visibility: PersonalGitHubRepositoryVisibility,\n private: z.boolean(),\n archived: z.boolean(),\n disabled: z.boolean(),\n permissions: PersonalGitHubRepositoryPermissions,\n })\n .strict()\n .superRefine((repository, context) => {\n if (repository.canonicalUrl !== canonicalPersonalGitHubRepositoryUrl(repository.fullName)) {\n context.addIssue({\n code: \"custom\",\n path: [\"canonicalUrl\"],\n message: \"canonicalUrl must be derived from fullName\",\n });\n }\n if (repository.private !== (repository.visibility === \"private\")) {\n context.addIssue({\n code: \"custom\",\n path: [\"private\"],\n message: \"private must agree with visibility\",\n });\n }\n });\nexport type PersonalGitHubRepository = z.infer<typeof PersonalGitHubRepository>;\n\nexport const PersonalGitHubSelectedRepository = PersonalGitHubRepository.safeExtend({\n selectedAccess: PersonalGitHubRepositoryAccess,\n selectionGeneration: z.number().int().positive(),\n selectedAt: z.string().datetime({ offset: true }),\n lastVerifiedAt: z.string().datetime({ offset: true }),\n}).strict();\nexport type PersonalGitHubSelectedRepository = z.infer<typeof PersonalGitHubSelectedRepository>;\n\nexport const PersonalGitHubRepositorySelectionState = z\n .object({\n connectionAuthorityGeneration: z.number().int().positive(),\n credentialBindingId: z.string().uuid(),\n providerPrincipalId: PersonalGitHubRepositoryId,\n selectionGeneration: z.number().int().nonnegative(),\n repositories: z\n .array(PersonalGitHubSelectedRepository)\n .max(PERSONAL_GITHUB_REPOSITORY_CATALOG_MAX),\n })\n .strict();\nexport type PersonalGitHubRepositorySelectionState = z.infer<\n typeof PersonalGitHubRepositorySelectionState\n>;\n\nexport const ListPersonalGitHubRepositoriesQuery = z\n .object({\n cursor: z.coerce.number().int().positive().max(10_000).default(1),\n limit: z.coerce.number().int().min(1).max(PERSONAL_GITHUB_REPOSITORY_CATALOG_MAX).default(50),\n })\n .strict();\nexport type ListPersonalGitHubRepositoriesQuery = z.infer<\n typeof ListPersonalGitHubRepositoriesQuery\n>;\n\nexport const PersonalGitHubRepositoryCatalogItem = PersonalGitHubRepository.safeExtend({\n selectedAccess: PersonalGitHubRepositoryAccess.nullable(),\n}).strict();\nexport type PersonalGitHubRepositoryCatalogItem = z.infer<\n typeof PersonalGitHubRepositoryCatalogItem\n>;\n\nexport const ListPersonalGitHubRepositoriesResponse = z\n .object({\n repositories: z\n .array(PersonalGitHubRepositoryCatalogItem)\n .max(PERSONAL_GITHUB_REPOSITORY_CATALOG_MAX),\n nextCursor: z.number().int().positive().nullable(),\n selection: PersonalGitHubRepositorySelectionState,\n })\n .strict();\nexport type ListPersonalGitHubRepositoriesResponse = z.infer<\n typeof ListPersonalGitHubRepositoriesResponse\n>;\n\nexport const PersonalGitHubRepositorySelectionInput = z\n .object({\n repositoryId: PersonalGitHubRepositoryId,\n fullName: PersonalGitHubRepositoryFullName,\n access: PersonalGitHubRepositoryAccess,\n })\n .strict();\nexport type PersonalGitHubRepositorySelectionInput = z.infer<\n typeof PersonalGitHubRepositorySelectionInput\n>;\n\nexport const ReplacePersonalGitHubRepositorySelectionsRequest = z\n .object({\n expectedConnectionAuthorityGeneration: z.number().int().positive(),\n expectedSelectionGeneration: z.number().int().nonnegative(),\n idempotencyKey: z.string().trim().min(1).max(200),\n repositories: z\n .array(PersonalGitHubRepositorySelectionInput)\n .max(PERSONAL_GITHUB_REPOSITORY_CATALOG_MAX),\n })\n .strict()\n .superRefine((request, context) => {\n const repositoryIds = new Set<string>();\n const fullNames = new Set<string>();\n request.repositories.forEach((repository, index) => {\n const normalizedFullName = repository.fullName.toLowerCase();\n if (repositoryIds.has(repository.repositoryId)) {\n context.addIssue({\n code: \"custom\",\n path: [\"repositories\", index, \"repositoryId\"],\n message: \"repositoryId must be unique\",\n });\n }\n if (fullNames.has(normalizedFullName)) {\n context.addIssue({\n code: \"custom\",\n path: [\"repositories\", index, \"fullName\"],\n message: \"fullName must be unique\",\n });\n }\n repositoryIds.add(repository.repositoryId);\n fullNames.add(normalizedFullName);\n });\n });\nexport type ReplacePersonalGitHubRepositorySelectionsRequest = z.infer<\n typeof ReplacePersonalGitHubRepositorySelectionsRequest\n>;\n\nexport const VerifyPersonalGitHubRepositorySelectionsRequest = z\n .object({\n expectedConnectionAuthorityGeneration: z.number().int().positive(),\n expectedSelectionGeneration: z.number().int().nonnegative(),\n idempotencyKey: z.string().trim().min(1).max(200),\n })\n .strict();\nexport type VerifyPersonalGitHubRepositorySelectionsRequest = z.infer<\n typeof VerifyPersonalGitHubRepositorySelectionsRequest\n>;\n\n/**\n * Owner-visible, credential-free metadata for one dedicated personal GitHub\n * OAuth connection. Repository selections are a separate authority and never\n * live in this credential record.\n */\nexport const PersonalGitHubConnectionMetadata = z\n .object({\n credentialRole: z.literal(PERSONAL_GITHUB_CREDENTIAL_ROLE),\n providerFamily: z.literal(PERSONAL_GITHUB_PROVIDER_FAMILY),\n providerPrincipalId: z.string().regex(/^\\d+$/u),\n githubUserId: z.string().regex(/^\\d+$/u),\n githubLogin: z.string().min(1).max(100),\n oauthEnvironment: z.string().min(1).max(128),\n oauthClientMarker: z.string().regex(/^[a-f0-9]{32}$/u),\n credentialBindingId: z.string().uuid(),\n connectedAt: z.string().datetime({ offset: true }),\n lastVerifiedAt: z.string().datetime({ offset: true }),\n disconnectedAt: z.string().datetime({ offset: true }).nullable().optional(),\n refreshTokenExpiresAt: z.string().datetime({ offset: true }).nullable().optional(),\n })\n .passthrough();\nexport type PersonalGitHubConnectionMetadata = z.infer<typeof PersonalGitHubConnectionMetadata>;\n\nexport const PersonalGitHubOAuthStartRequest = z\n .object({\n /** Existing exact connection generation to re-authorize in place. */\n connectionId: z.string().uuid().optional(),\n /** Same-workspace UI path restored after the callback. */\n returnPath: z.string().min(1).max(2048).optional(),\n })\n .strict();\nexport type PersonalGitHubOAuthStartRequest = z.infer<typeof PersonalGitHubOAuthStartRequest>;\n\nexport const PersonalGitHubOAuthStartResponse = z\n .object({\n authorizationUrl: z.string().url(),\n expiresAt: z.string().datetime({ offset: true }),\n })\n .strict();\nexport type PersonalGitHubOAuthStartResponse = z.infer<typeof PersonalGitHubOAuthStartResponse>;\n\nexport const PersonalGitHubConnectionStatusResponse = z\n .object({\n enabled: z.boolean(),\n connection: ConnectionMetadata.nullable(),\n reviewUrl: z.string().url().nullable(),\n })\n .strict();\nexport type PersonalGitHubConnectionStatusResponse = z.infer<\n typeof PersonalGitHubConnectionStatusResponse\n>;\n\nexport const PersonalGitHubDisconnectRequest = z\n .object({\n expectedVersion: z.number().int().positive(),\n idempotencyKey: z.string().trim().min(1).max(200),\n })\n .strict();\nexport type PersonalGitHubDisconnectRequest = z.infer<typeof PersonalGitHubDisconnectRequest>;\n\nexport function isPersonalGitHubConnection(\n connection: Pick<z.infer<typeof ConnectionMetadata>, \"providerDomain\" | \"kind\" | \"metadata\">,\n): boolean {\n return (\n connection.providerDomain.toLowerCase() === PERSONAL_GITHUB_PROVIDER_DOMAIN &&\n connection.kind === \"oauth2\" &&\n PersonalGitHubConnectionMetadata.safeParse(connection.metadata).success\n );\n}\n\nexport function hasReservedPersonalGitHubMetadata(\n metadata: Record<string, unknown> | undefined,\n): boolean {\n return metadata?.credentialRole === PERSONAL_GITHUB_CREDENTIAL_ROLE;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,SAAS;AAIX,IAAM,kCAAkC;AACxC,IAAM,kCAAkC;AACxC,IAAM,kCAAkC;AACxC,IAAM,wCAAwC;AAC9C,IAAM,mCAAmC,CAAC,MAAM;AAChD,IAAM,oCACX;AACK,IAAM,4BAA4B;AAClC,IAAM,2BAA2B;AACjC,IAAM,6BAA6B;AACnC,IAAM,yCAAyC;AAE/C,IAAM,6BAA6B,EAAE,OAAO,EAAE,MAAM,aAAa;AAGjE,IAAM,iCAAiC,EAAE,KAAK,CAAC,QAAQ,OAAO,CAAC;AAG/D,IAAM,sCAAsC,EAChD,OAAO;AAAA,EACN,MAAM,EAAE,QAAQ;AAAA,EAChB,MAAM,EAAE,QAAQ;AAAA,EAChB,OAAO,EAAE,QAAQ;AAAA,EACjB,UAAU,EAAE,QAAQ;AAAA,EACpB,QAAQ,EAAE,QAAQ;AACpB,CAAC,EACA,OAAO;AAKH,IAAM,qCAAqC,EAAE,KAAK,CAAC,UAAU,WAAW,UAAU,CAAC;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mBAAmB;AACtC;","names":[]}
|
package/dist/session-titles.d.ts
CHANGED
|
@@ -12,6 +12,15 @@ export declare const AUTOMATIC_SESSION_TITLE_MAX_GRAPHEMES = 80;
|
|
|
12
12
|
* credential or leave a raw prompt prefix in navigation surfaces.
|
|
13
13
|
*/
|
|
14
14
|
export declare const AUTOMATIC_SESSION_TITLE_FALLBACK = "New conversation";
|
|
15
|
+
/**
|
|
16
|
+
* Whether a bounded automatic-title candidate contains a credential, URL, or
|
|
17
|
+
* opaque identifier that must stay out of navigation and other display-title
|
|
18
|
+
* surfaces. Callers handling an unbounded source must bound it before invoking
|
|
19
|
+
* this helper.
|
|
20
|
+
*/
|
|
21
|
+
export declare function containsSensitiveAutomaticSessionTitleValue(value: string): boolean;
|
|
22
|
+
/** Bound an already-normalized automatic-title candidate without splitting graphemes. */
|
|
23
|
+
export declare function boundAutomaticSessionTitle(value: string): string;
|
|
15
24
|
/**
|
|
16
25
|
* Normalize a model/system-authored title before it reaches durable session
|
|
17
26
|
* metadata. Human renames intentionally do not use this path.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AUTOMATIC_SESSION_TITLE_FALLBACK,
|
|
3
|
+
AUTOMATIC_SESSION_TITLE_MAX_GRAPHEMES,
|
|
4
|
+
SESSION_TITLE_MAX_CHARACTERS,
|
|
5
|
+
boundAutomaticSessionTitle,
|
|
6
|
+
containsSensitiveAutomaticSessionTitleValue,
|
|
7
|
+
normalizeAutomaticSessionTitle
|
|
8
|
+
} from "./chunk-4IVHBXRI.js";
|
|
9
|
+
export {
|
|
10
|
+
AUTOMATIC_SESSION_TITLE_FALLBACK,
|
|
11
|
+
AUTOMATIC_SESSION_TITLE_MAX_GRAPHEMES,
|
|
12
|
+
SESSION_TITLE_MAX_CHARACTERS,
|
|
13
|
+
boundAutomaticSessionTitle,
|
|
14
|
+
containsSensitiveAutomaticSessionTitleValue,
|
|
15
|
+
normalizeAutomaticSessionTitle
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=session-titles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opengeni/contracts",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.9.2",
|
|
4
4
|
"description": "Shared zod schemas and wire-contract types for the OpenGeni API.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -58,6 +58,10 @@
|
|
|
58
58
|
"types": "./dist/canonical-human-identities.d.ts",
|
|
59
59
|
"import": "./dist/canonical-human-identities.js"
|
|
60
60
|
},
|
|
61
|
+
"./session-titles": {
|
|
62
|
+
"types": "./dist/session-titles.d.ts",
|
|
63
|
+
"import": "./dist/session-titles.js"
|
|
64
|
+
},
|
|
61
65
|
"./managed-auth-session-sets": {
|
|
62
66
|
"types": "./dist/managed-auth-session-sets.d.ts",
|
|
63
67
|
"import": "./dist/managed-auth-session-sets.js"
|
|
@@ -57,8 +57,8 @@ export const AGENT_AUTHORED_PREFERENCE_CONTENT_TOO_LONG_MESSAGE =
|
|
|
57
57
|
"A Skill is durable Agent Knowledge that agents retrieve on demand, so its length is " +
|
|
58
58
|
"retrieval cost rather than standing prompt cost: only its short title and description are composed into " +
|
|
59
59
|
`every session prompt. Keep it under ${AGENT_AUTHORED_PREFERENCE_CONTENT_MAX_CHARS} characters: state the ` +
|
|
60
|
-
"
|
|
61
|
-
"
|
|
60
|
+
"trigger and outcome plainly, include only the necessary procedure, checks, and exceptions, and remove " +
|
|
61
|
+
"background, repeated guidance, and decorative examples.";
|
|
62
62
|
|
|
63
63
|
export const AGENT_AUTHORED_COMPANY_PROFILE_TOO_LONG_MESSAGE =
|
|
64
64
|
"Organization identity and mission are mandatory prompt context in every root session across the " +
|
|
@@ -84,10 +84,17 @@ export const AGENT_AUTHORED_REMEMBER_CONTENT_TOO_LONG_MESSAGE =
|
|
|
84
84
|
* preference*. Deliberately not reused for the company profile, which is a
|
|
85
85
|
* descriptive profile rather than an instruction and needs its own wording.
|
|
86
86
|
*/
|
|
87
|
-
export const
|
|
88
|
-
"
|
|
89
|
-
"
|
|
90
|
-
|
|
87
|
+
export const AGENT_AUTHORED_INSTRUCTION_POLICY_STYLE =
|
|
88
|
+
"Write the shortest complete imperative rule in 1-3 sentences, with no numbered procedure, examples, " +
|
|
89
|
+
"rationale, or restated defaults. Split unrelated rules, and move conditional procedure into a Skill.";
|
|
90
|
+
|
|
91
|
+
export const AGENT_AUTHORED_SKILL_STYLE =
|
|
92
|
+
"Write one focused Skill with a clear trigger and outcome. Include only the prerequisites, necessary steps, " +
|
|
93
|
+
"verification, and important failure handling an agent needs to execute it; omit background, repetition, " +
|
|
94
|
+
"generic advice, and decorative examples. Split unrelated workflows into separate Skills.";
|
|
95
|
+
|
|
96
|
+
/** @deprecated Use the destination-specific instruction or Skill style. */
|
|
97
|
+
export const AGENT_AUTHORED_DURABLE_TEXT_STYLE = AGENT_AUTHORED_INSTRUCTION_POLICY_STYLE;
|
|
91
98
|
|
|
92
99
|
/**
|
|
93
100
|
* Actionable over-budget message including the text the caller actually sent,
|
package/src/company-profile.ts
CHANGED
|
@@ -296,6 +296,29 @@ export type CompanyProfileMutationResponse = z.infer<typeof CompanyProfileMutati
|
|
|
296
296
|
export const COMPANY_PROFILE_AGENT_APPROVE_OPTION = "activate" as const;
|
|
297
297
|
export const COMPANY_PROFILE_AGENT_REJECT_OPTION = "skip" as const;
|
|
298
298
|
|
|
299
|
+
export const CompanyProfileAgentPolicyMode = z.enum(["off", "suggest", "automatic"]);
|
|
300
|
+
export type CompanyProfileAgentPolicyMode = z.infer<typeof CompanyProfileAgentPolicyMode>;
|
|
301
|
+
|
|
302
|
+
export const CompanyProfileAgentPolicy = z.object({
|
|
303
|
+
organizationId: z.string().uuid(),
|
|
304
|
+
mode: CompanyProfileAgentPolicyMode,
|
|
305
|
+
version: z.number().int().nonnegative(),
|
|
306
|
+
updatedAt: z.string().datetime({ offset: true }),
|
|
307
|
+
changed: z.boolean().optional(),
|
|
308
|
+
});
|
|
309
|
+
export type CompanyProfileAgentPolicy = z.infer<typeof CompanyProfileAgentPolicy>;
|
|
310
|
+
|
|
311
|
+
export const UpdateCompanyProfileAgentPolicyRequest = z
|
|
312
|
+
.object({
|
|
313
|
+
mode: CompanyProfileAgentPolicyMode,
|
|
314
|
+
expectedVersion: z.number().int().nonnegative(),
|
|
315
|
+
operationId: z.string().uuid(),
|
|
316
|
+
})
|
|
317
|
+
.strict();
|
|
318
|
+
export type UpdateCompanyProfileAgentPolicyRequest = z.infer<
|
|
319
|
+
typeof UpdateCompanyProfileAgentPolicyRequest
|
|
320
|
+
>;
|
|
321
|
+
|
|
299
322
|
export const CompanyProfileAgentAttempt = z
|
|
300
323
|
.object({
|
|
301
324
|
accountId: z.string().uuid(),
|
|
@@ -328,15 +351,37 @@ export type CompanyProfileAgentHumanInputPrompt = z.infer<
|
|
|
328
351
|
typeof CompanyProfileAgentHumanInputPrompt
|
|
329
352
|
>;
|
|
330
353
|
|
|
331
|
-
export const
|
|
354
|
+
export const CompanyProfileAgentReviewRequiredReceipt = z.object({
|
|
332
355
|
status: z.literal("confirmation_required"),
|
|
333
356
|
operationId: z.string().uuid(),
|
|
334
357
|
proposalReceiptId: z.string().uuid(),
|
|
335
358
|
revision: CompanyProfileRevision,
|
|
359
|
+
policyMode: z.literal("suggest"),
|
|
336
360
|
humanInput: CompanyProfileAgentHumanInputPrompt,
|
|
337
361
|
confirmWith: z.literal("company_profile_confirm"),
|
|
338
362
|
replayed: z.boolean(),
|
|
339
363
|
});
|
|
364
|
+
export type CompanyProfileAgentReviewRequiredReceipt = z.infer<
|
|
365
|
+
typeof CompanyProfileAgentReviewRequiredReceipt
|
|
366
|
+
>;
|
|
367
|
+
|
|
368
|
+
export const CompanyProfileAgentAutomaticActivationReceipt = z.object({
|
|
369
|
+
status: z.literal("activated"),
|
|
370
|
+
operationId: z.string().uuid(),
|
|
371
|
+
proposalReceiptId: z.string().uuid(),
|
|
372
|
+
automaticActivationReceiptId: z.string().uuid(),
|
|
373
|
+
policyMode: z.literal("automatic"),
|
|
374
|
+
mutation: CompanyProfileMutationResponse,
|
|
375
|
+
replayed: z.boolean(),
|
|
376
|
+
});
|
|
377
|
+
export type CompanyProfileAgentAutomaticActivationReceipt = z.infer<
|
|
378
|
+
typeof CompanyProfileAgentAutomaticActivationReceipt
|
|
379
|
+
>;
|
|
380
|
+
|
|
381
|
+
export const CompanyProfileAgentProposalReceipt = z.discriminatedUnion("status", [
|
|
382
|
+
CompanyProfileAgentReviewRequiredReceipt,
|
|
383
|
+
CompanyProfileAgentAutomaticActivationReceipt,
|
|
384
|
+
]);
|
|
340
385
|
export type CompanyProfileAgentProposalReceipt = z.infer<typeof CompanyProfileAgentProposalReceipt>;
|
|
341
386
|
|
|
342
387
|
export const CompanyProfileAgentConfirmRequest = z
|