@vess-id/ai-identity 0.16.0-alpha.10 → 0.16.0-alpha.12
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.mts +110 -5
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +5 -3
- package/dist/index.mjs.map +1 -1
- package/dist/registry/__tests__/action-risk.spec.d.ts +6 -1
- package/dist/registry/__tests__/action-risk.spec.d.ts.map +1 -1
- package/dist/registry/action-risk.d.ts +27 -4
- package/dist/registry/action-risk.d.ts.map +1 -1
- package/dist/types/grant.d.ts +11 -0
- package/dist/types/grant.d.ts.map +1 -1
- package/dist/types/permission-vc.d.ts +71 -0
- package/dist/types/permission-vc.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -974,6 +974,24 @@ interface PermissionRule {
|
|
|
974
974
|
actions: string[];
|
|
975
975
|
/** Rule-level constraints */
|
|
976
976
|
constraints?: PermissionConstraints;
|
|
977
|
+
/**
|
|
978
|
+
* RAR authorization-details type (RFC 9396 §2), carried verbatim (#952).
|
|
979
|
+
*
|
|
980
|
+
* A free-form URN naming the kind of authorization this delegate represents,
|
|
981
|
+
* for consumers that speak RAR. Deliberately unvalidated: the registry of
|
|
982
|
+
* types belongs to whoever issues them, and rejecting an unrecognised URN
|
|
983
|
+
* here would make this service the gatekeeper of a vocabulary it does not
|
|
984
|
+
* own.
|
|
985
|
+
*
|
|
986
|
+
* NOT an authorization input. Gate-2 authorises on `provider`, `actions`,
|
|
987
|
+
* `resource.type` and `resource.id`; a credential must not be able to widen
|
|
988
|
+
* or narrow what it may do by naming a type. Note how close this sits to
|
|
989
|
+
* `resource.type`, which Gate-2 *does* read — the two are one level apart
|
|
990
|
+
* and the format is unchecked, so a line reaching for the wrong one would
|
|
991
|
+
* not be caught by the compiler or at runtime. Pinned in
|
|
992
|
+
* `gate2-fast-path.spec.ts` ("delegates[].type is inert at Gate-2").
|
|
993
|
+
*/
|
|
994
|
+
type?: string;
|
|
977
995
|
/**
|
|
978
996
|
* Cedar policy binding (Phase 1).
|
|
979
997
|
*
|
|
@@ -1244,6 +1262,59 @@ interface PermissionVcClaims_V3 extends Omit<PermissionVcClaims_V2, 'v'> {
|
|
|
1244
1262
|
* no enforcement gate reads it. {@link VcSchedulingDelegationClaim}.
|
|
1245
1263
|
*/
|
|
1246
1264
|
schedulingDelegation?: VcSchedulingDelegationClaim;
|
|
1265
|
+
/**
|
|
1266
|
+
* How this credential came to exist (#954).
|
|
1267
|
+
*
|
|
1268
|
+
* - `'user_approved'` — a person consented. Paired with {@link approval},
|
|
1269
|
+
* which carries the back-reference to the approval request and outcome.
|
|
1270
|
+
* - `'auto_issued'` — consent was given on the user's behalf: a Cedar
|
|
1271
|
+
* permit, an advance delegation policy, or a signup funnel.
|
|
1272
|
+
* - `'unrecorded'` — provenance is genuinely unknown. Credentials issued
|
|
1273
|
+
* before the consent type was recorded, and any path where no approval
|
|
1274
|
+
* assertion reaches the issuer, land here.
|
|
1275
|
+
*
|
|
1276
|
+
* Derived from the approval's `consent_type` — HOW the consent was
|
|
1277
|
+
* obtained — and never from `granted_by`, which records WHO. Those come
|
|
1278
|
+
* apart in practice: booking start writes `granted_by: 'system'` for both
|
|
1279
|
+
* an explicit human click and an automatic funnel, because the visitor's
|
|
1280
|
+
* identity is gone by the time the credential is issued.
|
|
1281
|
+
*
|
|
1282
|
+
* The third value is not a placeholder to be tidied away later. Guessing
|
|
1283
|
+
* between the other two would fabricate audit data, and this claim is
|
|
1284
|
+
* signed — it cannot be corrected once issued.
|
|
1285
|
+
*
|
|
1286
|
+
* Never taken from the request: `approvalAssertion` is an internal-only
|
|
1287
|
+
* extension on `issueVC` precisely so this stays true (see the comment on
|
|
1288
|
+
* `IssueVCRequestDto`).
|
|
1289
|
+
*
|
|
1290
|
+
* Optional, and permanently so. The type describes credentials that are
|
|
1291
|
+
* already signed and in circulation; those cannot be re-issued to carry a
|
|
1292
|
+
* new field, so a required one would invalidate them at the type layer.
|
|
1293
|
+
* Absent means "issued before #954", not "auto-issued".
|
|
1294
|
+
*
|
|
1295
|
+
* Audit and disclosure metadata — no gate reads it to decide anything. If a
|
|
1296
|
+
* gate ever should, the decision belongs in policy, against `approval`,
|
|
1297
|
+
* rather than against a label the issuer wrote about itself.
|
|
1298
|
+
*/
|
|
1299
|
+
issuance_mode?: 'user_approved' | 'auto_issued' | 'unrecorded';
|
|
1300
|
+
/**
|
|
1301
|
+
* Why this credential was requested, in the requester's own words (#955).
|
|
1302
|
+
*
|
|
1303
|
+
* Free text, deliberately. Narrowing it to a vocabulary would turn a
|
|
1304
|
+
* description into a decision input, and Phase 1 neither records nor
|
|
1305
|
+
* evaluates it (DEV-INSTRUCTIONS §256) — no gate reads it, and none should
|
|
1306
|
+
* without that being a decision someone makes on purpose.
|
|
1307
|
+
*
|
|
1308
|
+
* SD-protected at issuance. Natural language written by a person tends to
|
|
1309
|
+
* name people, accounts and circumstances, so a verifier gets it only when
|
|
1310
|
+
* the holder chooses to disclose it. Keep it out of audit logs and error
|
|
1311
|
+
* messages for the same reason.
|
|
1312
|
+
*
|
|
1313
|
+
* Optional, and permanently so: the type describes credentials already
|
|
1314
|
+
* signed and in circulation, which cannot be re-issued to carry a new
|
|
1315
|
+
* field.
|
|
1316
|
+
*/
|
|
1317
|
+
intent_description?: string;
|
|
1247
1318
|
}
|
|
1248
1319
|
/**
|
|
1249
1320
|
* Permission VC Claims (canonical union of v2 + v3).
|
|
@@ -1977,6 +2048,17 @@ interface ApprovalContext {
|
|
|
1977
2048
|
granted_at: string;
|
|
1978
2049
|
/** user id or `'system'` for auto-approve. */
|
|
1979
2050
|
granted_by: string;
|
|
2051
|
+
/**
|
|
2052
|
+
* HOW the consent was obtained — `'explicit'` (the user acted) or `'auto'`
|
|
2053
|
+
* (consent given on their behalf). Distinct from `granted_by`, which
|
|
2054
|
+
* records WHO: booking start writes `'system'` for both, because the
|
|
2055
|
+
* visitor's identity is gone by issuance time.
|
|
2056
|
+
*
|
|
2057
|
+
* Optional and nullable on purpose. Absent means "not recorded" — rows
|
|
2058
|
+
* predating the column, which are deliberately not backfilled. Readers must
|
|
2059
|
+
* treat that as a third state rather than defaulting it either way.
|
|
2060
|
+
*/
|
|
2061
|
+
consent_type?: 'explicit' | 'auto';
|
|
1980
2062
|
}
|
|
1981
2063
|
|
|
1982
2064
|
/**
|
|
@@ -38799,7 +38881,7 @@ declare function isDecision(value: unknown): value is Decision;
|
|
|
38799
38881
|
* deterministic suffix heuristic below:
|
|
38800
38882
|
* - write/send/delete-class suffixes → 'high'
|
|
38801
38883
|
* - read/list/get-class suffixes → 'low'
|
|
38802
|
-
* - everything else → '
|
|
38884
|
+
* - everything else → UNCLASSIFIED_ACTION_RISK ('high', fail-closed)
|
|
38803
38885
|
*
|
|
38804
38886
|
* The suffix heuristic classifies by the **last dotted segment** of the
|
|
38805
38887
|
* action name (e.g., `gmail.message.send` → `send` → 'high').
|
|
@@ -38825,6 +38907,29 @@ declare function isDecision(value: unknown): value is Decision;
|
|
|
38825
38907
|
* declare it); no registry action uses it yet as of 2026-07-05.
|
|
38826
38908
|
*/
|
|
38827
38909
|
type ActionRisk = 'low' | 'medium' | 'high' | 'critical';
|
|
38910
|
+
/**
|
|
38911
|
+
* Risk assigned to an action we cannot classify — unregistered, unrecognised
|
|
38912
|
+
* suffix, or malformed input.
|
|
38913
|
+
*
|
|
38914
|
+
* This is `'high'`, not `'medium'`, and the distinction is load-bearing.
|
|
38915
|
+
* `'medium'` reads like a cautious middle ground but is on the permissive
|
|
38916
|
+
* side of every gate downstream:
|
|
38917
|
+
*
|
|
38918
|
+
* - The Cedar default policy permits `["low","medium"]` unconditionally,
|
|
38919
|
+
* without consulting `context.approval.granted`
|
|
38920
|
+
* (`api/src/grant/services/system-policy.service.ts:105`), so a medium
|
|
38921
|
+
* action is approved with no prompt at all.
|
|
38922
|
+
* - Gate-2 only pins an invocation to its delegated resource when the risk
|
|
38923
|
+
* is high or critical (`api/src/tool/services/tool-executor.service.ts`),
|
|
38924
|
+
* so a medium action also escapes resource narrowing.
|
|
38925
|
+
*
|
|
38926
|
+
* An action nobody registered therefore got *less* scrutiny than one that was.
|
|
38927
|
+
* The rest of the codebase already treats unknown as dangerous — agentd
|
|
38928
|
+
* (`agentd/src/core/execution-engine.ts`), the approval UI's own table, the
|
|
38929
|
+
* remote-mcp tool gate, and the approval-request validator all reject or
|
|
38930
|
+
* escalate. This constant brings the SDK resolver in line. (#1285)
|
|
38931
|
+
*/
|
|
38932
|
+
declare const UNCLASSIFIED_ACTION_RISK: ActionRisk;
|
|
38828
38933
|
/**
|
|
38829
38934
|
* Resolve the risk level for a dotted action name.
|
|
38830
38935
|
*
|
|
@@ -38837,14 +38942,14 @@ type ActionRisk = 'low' | 'medium' | 'high' | 'critical';
|
|
|
38837
38942
|
* resolveActionRisk('jira.issue.transition') → 'high' (registry)
|
|
38838
38943
|
* resolveActionRisk('unknown.connector.send') → 'high' (suffix fallback)
|
|
38839
38944
|
* resolveActionRisk('unknown.connector.read') → 'low' (suffix fallback)
|
|
38840
|
-
* resolveActionRisk('unknown.connector.sync') → '
|
|
38945
|
+
* resolveActionRisk('unknown.connector.sync') → 'high' (unclassified, #1285)
|
|
38841
38946
|
*
|
|
38842
38947
|
* Defensive defaults:
|
|
38843
|
-
* - empty / falsy input → '
|
|
38844
|
-
* - unknown suffix → '
|
|
38948
|
+
* - empty / falsy input → 'high' (fail-closed; never throws)
|
|
38949
|
+
* - unknown suffix → 'high'
|
|
38845
38950
|
*/
|
|
38846
38951
|
declare function resolveActionRisk(action: string | undefined | null): ActionRisk;
|
|
38847
38952
|
|
|
38848
38953
|
declare const version = "0.0.1";
|
|
38849
38954
|
|
|
38850
|
-
export { type ABACPolicyEngine, ACTION_PARAMS_MAX_SIZE, ACTION_PREFIXES, ACTION_REGISTRY, AIdentityClient, type AIdentityConfig, AIdentityError, type APIAgent, type APICredential, APIVCManager, APPROVAL_REQUIRED_ACTION, type AbacDecision, type AbacInput, type AcceptInvitationRequest, type AckEventResponse, type ActionInputSchema, type ActionMapping, type ActionMeta, type ActionParamDisplay, type ActionRegistry, type ActionRisk, type ActionRiskLevel, type Agent, type AgentCreateOptions, type AgentDIDConfig, AgentDIDManager, AgentManager, AgentStatus, AgentType, type AgentWithId, AllowAllAbac, type AnyProvider, type ApiKeyValidationResult, type ApprovalContext, type ApprovalResolverKind, type AuditEvent, type AuditQuery, AuthProvider, type AuthState, AuthenticationError, type AutoApproveConfig, type BindingSource, type BuildKbJwtPayloadArgs, type BuildKbJwtPayloadDeps, CANONICAL_PROVIDERS, type CanonicalProvider, type CapabilityMeta, type CedarDecision, type CedarDecisionDiagnostic, type CedarDecisionValue, type CedarEngine, CedarEngineUnavailableError, type CedarEntitiesInput, type CedarEntity, type CedarEntityDescriptor, type CedarError, type CedarEvaluateRequest, CedarParseError, type CedarPolicySetHandle, type CedarSchema, type CedarSchemaHandle, type CheckGrantPermissionRequest, type CheckGrantPermissionResult, type CheckPermissionInput, type CheckPermissionResult, type CollectContextRequest, type ConfirmGrantSuggestionRequest, type ConnectorAction, type ConnectorConfig, type ConnectorExecutionContext, type ConnectorResponse, type ConnectorResponseMetadata, type ConnectorTokenConfig, type ConstraintEvaluationResult, ConstraintEvaluator, type ConstraintEvaluatorOptions, type ConstraintViolation, type ConstraintWarning, type ContextBindingSource, type ContextProvider, type CreateGrantRequest, type CreateInvitationRequest, type CreateReceiptRequest, type CredentialRef, CredentialStatus, type CredentialStore, CredentialType, DECISION_VALUES, DEFAULT_CONSTRAINTS_BY_RISK, type DIDDocument, type DataAccessVC, type Decision, type DecisionTrace, type DelegationVC, DeviceEnrollManager, type DeviceEnrollPollResult, type DeviceEnrollServerSideParams, type DeviceEnrollStartParams, type DeviceEnrollStartResult, type DisclosureFields, DummyCreds, DummyVpVerifier, type EmployeeVPRequest, type EvaluateInput, type EvaluateResult, type EvaluationContext, type ExternalActionRequest, FREEMAIL_DOMAINS, FilesystemKeyStorage, GATEWAY_ERROR_CODE, GatewayClient, GatewayError, type GatewayErrorCode, type GatewayEvent, type GetEventsOptions, type GetEventsResponse, type GitHubConfig, type GoogleConfig, type Grant, type GrantConstraints, type GrantResource, GrantResourceType, GrantScope, GrantStatus, type GrantUsage, type IConnectorService, type IStateStore, type Intent, type IntentEvaluationResult, type IntentObligation, type IntentResource, type InternalHmacSignerKey, InvalidVPError, type Invitation, type InvitationRole, InvitationStatus, type IssueSDJWTVCRequest, type IssueSDJWTVCResult, type JiraBoard, type JiraConfig, type JiraIssue, type JiraIssueLink, type JiraIssueLinkType, type JiraIssueType, type JiraProject, type JiraSprint, type JiraStatus, type JiraUser, type JiraWorklog, type JsonSchema, JsonStateStore, KB_JWT_DEFAULT_LIFETIME_SECONDS, type KbJwtPayload, KeyManager, type KeyPairGenerationResult, type KeyStorageConfig, type KeyStorageProvider, LEGACY_RESOURCE_TYPE_MAP, MIN_SIGNER_KEY_BYTES, MemoryKeyStorage, NetworkError, type NormalizeIntentRequest, type NormalizedIntent, type OAuthAuthorizeRequest, type OAuthCallbackParams, type OAuthConnection, OAuthProvider, type OAuthToken, type OrganizationConfig, type OrganizationPermission, type OrganizationPolicy, type OrganizationVC, PHASE_1_VC_LAYER, PROVIDER_ALIASES, type ParamBindingSource, type ParsedResourceType, type ParsedSignature, type PermissionConstraints, type PermissionMode, type PermissionResource, type PermissionRule, type PermissionTimeConstraint, type PermissionVcClaims, type PermissionVcClaims_V2, type PermissionVcClaims_V3, type Phase1VcLayer, type PlanDelegationInput, type PlanDelegationResult, type PolicyCondition, type PolicyEvaluationResult, type PolicyInput, type PolicyRef, type PolicyRefInline, type PolicyRefReference, type PolicyRule, type PolicySetHandle, type PolicyTarget, type PolicyValidationError, type Provider, REAUTH_REQUIRED_ACTION, RESOLVED_PARAMS_KEY, RESOURCE_TYPES, RESOURCE_TYPE_LABELS, type ReBACChecker, type Receipt, type ReceiptListResult, type ReceiptOutcome, type ReceiptSearchQuery, ReceiptStatus, type Relation, type ResolvedTargets, type ResolverBackedField, type ResourceIdBinding, type ResourceMatch, type ResourceRef, type ResourceScope, type ResourceType, type RiskAssessmentResult, type RiskFactor, type RiskLevel, SDJwtClient, SIGNATURE_HEADER, SIGNATURE_VERSION_PREFIX, type SchemaHandle, ScopeUnmatchedError, type SecondaryBinding, type SignRequestArgs, SimpleRebac, type SlackConfig, StandardActionCategory, type SuggestGrantRequest, type SuggestedAction, type SuggestedConstraints, type SuggestedGrant, type SuggestedResource, type SuggestionRiskLevel, TIER_LIMITS, type TargetBindings, type TargetConstraint, TargetResolver, type TierLimits, type TimeWindowCheckResult, type TimeWindowConstraint, type ToolDefinition, type ToolInvocation, ToolManager, type ToolPermissionRequest, type ToolPermissionVC, type UnifiedResourceType, type UpdateGrantRequest, type UserIdentity, type UserIdentityConfig, type UserIdentityCreateOptions, UserIdentityManager, UserKeyPairManager, type UserTier, VALID_MCP_ACTIONS, VALID_MCP_TOOLS, VCExpiredError, VCManager, VCRevokedError, VCStatus, type VCTemplate, VCType, VPManager, type VPRequest, type ValidateActionInputResult, type VcApprovalClaim, type VcSchedulingDelegationClaim, type VerifiablePresentation, type VerificationMethod, type VerifiedVcClaims, type VerifyInvitationResponse, type VerifyReceiptRequest, type VerifyReceiptResult, type VerifySDJWTVCResult, type VpVerifier, WRITE_ACTION_NAMES, type WeeklyReportData, type WeeklyReportSummary, buildCanonicalString, buildCedarEntities, buildGrantIdFields, buildKbJwtPayload, buildPhase1VcClaims, buildValidationErrors, canonicalResourceId, canonicalizeAction, canonicalizeSalient, canonicalizeWithFields, checkPermissionWithVP, classifyCedarErrorMessage, compareResourceIds, configure, createAjv, createCedarEngine, createDidJwk, credentialStatusToVCStatus, defaultConstraintEvaluator, digestWithFields, evaluateConstraints, extractProjectKey, extractPublicKey, extractPublicKeyFromDid, formatSignatureHeader, generateActionParamsDisplay, generateActionSummary, generateKeyPair, generateNonce, getActionAliases, getAllActionForms, getAllValidMcpActionNames, getClient, getDefaultDisclosureFields, getKeyIdFromDid, getRequiredRelations, getRequiredScopes, getTierLimits, getValidMcpActionNames, grantConstraintsToPermissionConstraints, grantToPermissionRules, indexActions, indexCapabilities, isActionEquivalent, isCanonicalProvider, isDecision, isFreemailDomain, isPolicyRefInline, isPolicyRefReference, isUnlimited, isValidDidJwk, isValidProvider, isWriteAction, loadActionRegistryFromFile, loadActionRegistryFromObject, looksLikeNativeId, normalizeDomain, normalizeMcpActionName, parseGrantAction, parseGrantResourceType, parseSignatureHeader, planDelegationForVC, publicKeysMatch, readVcExpSeconds, resolveActionRisk, resolveActionsFromSelection, resolveProvider, resolveResourceType, resolveUserTier, resolverBackedFieldsFor, salientDigest, salientFieldsFor, sha256Hex, signJWT, signRequest, stripResolvedParams, validateActionInput, validateRegistryObject, vcStatusToCredentialStatus, verifyJWT, version };
|
|
38955
|
+
export { type ABACPolicyEngine, ACTION_PARAMS_MAX_SIZE, ACTION_PREFIXES, ACTION_REGISTRY, AIdentityClient, type AIdentityConfig, AIdentityError, type APIAgent, type APICredential, APIVCManager, APPROVAL_REQUIRED_ACTION, type AbacDecision, type AbacInput, type AcceptInvitationRequest, type AckEventResponse, type ActionInputSchema, type ActionMapping, type ActionMeta, type ActionParamDisplay, type ActionRegistry, type ActionRisk, type ActionRiskLevel, type Agent, type AgentCreateOptions, type AgentDIDConfig, AgentDIDManager, AgentManager, AgentStatus, AgentType, type AgentWithId, AllowAllAbac, type AnyProvider, type ApiKeyValidationResult, type ApprovalContext, type ApprovalResolverKind, type AuditEvent, type AuditQuery, AuthProvider, type AuthState, AuthenticationError, type AutoApproveConfig, type BindingSource, type BuildKbJwtPayloadArgs, type BuildKbJwtPayloadDeps, CANONICAL_PROVIDERS, type CanonicalProvider, type CapabilityMeta, type CedarDecision, type CedarDecisionDiagnostic, type CedarDecisionValue, type CedarEngine, CedarEngineUnavailableError, type CedarEntitiesInput, type CedarEntity, type CedarEntityDescriptor, type CedarError, type CedarEvaluateRequest, CedarParseError, type CedarPolicySetHandle, type CedarSchema, type CedarSchemaHandle, type CheckGrantPermissionRequest, type CheckGrantPermissionResult, type CheckPermissionInput, type CheckPermissionResult, type CollectContextRequest, type ConfirmGrantSuggestionRequest, type ConnectorAction, type ConnectorConfig, type ConnectorExecutionContext, type ConnectorResponse, type ConnectorResponseMetadata, type ConnectorTokenConfig, type ConstraintEvaluationResult, ConstraintEvaluator, type ConstraintEvaluatorOptions, type ConstraintViolation, type ConstraintWarning, type ContextBindingSource, type ContextProvider, type CreateGrantRequest, type CreateInvitationRequest, type CreateReceiptRequest, type CredentialRef, CredentialStatus, type CredentialStore, CredentialType, DECISION_VALUES, DEFAULT_CONSTRAINTS_BY_RISK, type DIDDocument, type DataAccessVC, type Decision, type DecisionTrace, type DelegationVC, DeviceEnrollManager, type DeviceEnrollPollResult, type DeviceEnrollServerSideParams, type DeviceEnrollStartParams, type DeviceEnrollStartResult, type DisclosureFields, DummyCreds, DummyVpVerifier, type EmployeeVPRequest, type EvaluateInput, type EvaluateResult, type EvaluationContext, type ExternalActionRequest, FREEMAIL_DOMAINS, FilesystemKeyStorage, GATEWAY_ERROR_CODE, GatewayClient, GatewayError, type GatewayErrorCode, type GatewayEvent, type GetEventsOptions, type GetEventsResponse, type GitHubConfig, type GoogleConfig, type Grant, type GrantConstraints, type GrantResource, GrantResourceType, GrantScope, GrantStatus, type GrantUsage, type IConnectorService, type IStateStore, type Intent, type IntentEvaluationResult, type IntentObligation, type IntentResource, type InternalHmacSignerKey, InvalidVPError, type Invitation, type InvitationRole, InvitationStatus, type IssueSDJWTVCRequest, type IssueSDJWTVCResult, type JiraBoard, type JiraConfig, type JiraIssue, type JiraIssueLink, type JiraIssueLinkType, type JiraIssueType, type JiraProject, type JiraSprint, type JiraStatus, type JiraUser, type JiraWorklog, type JsonSchema, JsonStateStore, KB_JWT_DEFAULT_LIFETIME_SECONDS, type KbJwtPayload, KeyManager, type KeyPairGenerationResult, type KeyStorageConfig, type KeyStorageProvider, LEGACY_RESOURCE_TYPE_MAP, MIN_SIGNER_KEY_BYTES, MemoryKeyStorage, NetworkError, type NormalizeIntentRequest, type NormalizedIntent, type OAuthAuthorizeRequest, type OAuthCallbackParams, type OAuthConnection, OAuthProvider, type OAuthToken, type OrganizationConfig, type OrganizationPermission, type OrganizationPolicy, type OrganizationVC, PHASE_1_VC_LAYER, PROVIDER_ALIASES, type ParamBindingSource, type ParsedResourceType, type ParsedSignature, type PermissionConstraints, type PermissionMode, type PermissionResource, type PermissionRule, type PermissionTimeConstraint, type PermissionVcClaims, type PermissionVcClaims_V2, type PermissionVcClaims_V3, type Phase1VcLayer, type PlanDelegationInput, type PlanDelegationResult, type PolicyCondition, type PolicyEvaluationResult, type PolicyInput, type PolicyRef, type PolicyRefInline, type PolicyRefReference, type PolicyRule, type PolicySetHandle, type PolicyTarget, type PolicyValidationError, type Provider, REAUTH_REQUIRED_ACTION, RESOLVED_PARAMS_KEY, RESOURCE_TYPES, RESOURCE_TYPE_LABELS, type ReBACChecker, type Receipt, type ReceiptListResult, type ReceiptOutcome, type ReceiptSearchQuery, ReceiptStatus, type Relation, type ResolvedTargets, type ResolverBackedField, type ResourceIdBinding, type ResourceMatch, type ResourceRef, type ResourceScope, type ResourceType, type RiskAssessmentResult, type RiskFactor, type RiskLevel, SDJwtClient, SIGNATURE_HEADER, SIGNATURE_VERSION_PREFIX, type SchemaHandle, ScopeUnmatchedError, type SecondaryBinding, type SignRequestArgs, SimpleRebac, type SlackConfig, StandardActionCategory, type SuggestGrantRequest, type SuggestedAction, type SuggestedConstraints, type SuggestedGrant, type SuggestedResource, type SuggestionRiskLevel, TIER_LIMITS, type TargetBindings, type TargetConstraint, TargetResolver, type TierLimits, type TimeWindowCheckResult, type TimeWindowConstraint, type ToolDefinition, type ToolInvocation, ToolManager, type ToolPermissionRequest, type ToolPermissionVC, UNCLASSIFIED_ACTION_RISK, type UnifiedResourceType, type UpdateGrantRequest, type UserIdentity, type UserIdentityConfig, type UserIdentityCreateOptions, UserIdentityManager, UserKeyPairManager, type UserTier, VALID_MCP_ACTIONS, VALID_MCP_TOOLS, VCExpiredError, VCManager, VCRevokedError, VCStatus, type VCTemplate, VCType, VPManager, type VPRequest, type ValidateActionInputResult, type VcApprovalClaim, type VcSchedulingDelegationClaim, type VerifiablePresentation, type VerificationMethod, type VerifiedVcClaims, type VerifyInvitationResponse, type VerifyReceiptRequest, type VerifyReceiptResult, type VerifySDJWTVCResult, type VpVerifier, WRITE_ACTION_NAMES, type WeeklyReportData, type WeeklyReportSummary, buildCanonicalString, buildCedarEntities, buildGrantIdFields, buildKbJwtPayload, buildPhase1VcClaims, buildValidationErrors, canonicalResourceId, canonicalizeAction, canonicalizeSalient, canonicalizeWithFields, checkPermissionWithVP, classifyCedarErrorMessage, compareResourceIds, configure, createAjv, createCedarEngine, createDidJwk, credentialStatusToVCStatus, defaultConstraintEvaluator, digestWithFields, evaluateConstraints, extractProjectKey, extractPublicKey, extractPublicKeyFromDid, formatSignatureHeader, generateActionParamsDisplay, generateActionSummary, generateKeyPair, generateNonce, getActionAliases, getAllActionForms, getAllValidMcpActionNames, getClient, getDefaultDisclosureFields, getKeyIdFromDid, getRequiredRelations, getRequiredScopes, getTierLimits, getValidMcpActionNames, grantConstraintsToPermissionConstraints, grantToPermissionRules, indexActions, indexCapabilities, isActionEquivalent, isCanonicalProvider, isDecision, isFreemailDomain, isPolicyRefInline, isPolicyRefReference, isUnlimited, isValidDidJwk, isValidProvider, isWriteAction, loadActionRegistryFromFile, loadActionRegistryFromObject, looksLikeNativeId, normalizeDomain, normalizeMcpActionName, parseGrantAction, parseGrantResourceType, parseSignatureHeader, planDelegationForVC, publicKeysMatch, readVcExpSeconds, resolveActionRisk, resolveActionsFromSelection, resolveProvider, resolveResourceType, resolveUserTier, resolverBackedFieldsFor, salientDigest, salientFieldsFor, sha256Hex, signJWT, signRequest, stripResolvedParams, validateActionInput, validateRegistryObject, vcStatusToCredentialStatus, verifyJWT, version };
|
package/dist/index.d.ts
CHANGED
|
@@ -48,7 +48,7 @@ export { buildValidationErrors, classifyCedarErrorMessage, } from './policy';
|
|
|
48
48
|
export type { PolicyValidationError } from './policy';
|
|
49
49
|
export { buildCedarEntities, DECISION_VALUES, isDecision } from './policy';
|
|
50
50
|
export type { CedarEntitiesInput, CedarEntityDescriptor, Decision, } from './policy';
|
|
51
|
-
export { resolveActionRisk } from './registry/action-risk';
|
|
51
|
+
export { resolveActionRisk, UNCLASSIFIED_ACTION_RISK } from './registry/action-risk';
|
|
52
52
|
export type { ActionRisk } from './registry/action-risk';
|
|
53
53
|
export declare const version = "0.0.1";
|
|
54
54
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAGrD,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAGrD,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAC3D,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAA;AACtE,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAA;AACrE,YAAY,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAA;AAC/E,OAAO,EACL,mBAAmB,EACnB,uBAAuB,EACvB,4BAA4B,EAC5B,uBAAuB,EACvB,sBAAsB,GACvB,MAAM,kCAAkC,CAAA;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAC3C,OAAO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AqB,EAAE,MAAM,UAAU,CAAA;AAGrD,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AAC1E,YAAY,EACV,kBAAkB,EAClB,qBAAqB,EACrB,QAAQ,GACT,MAAM,UAAU,CAAA;AACjB,OAAO,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAA;AACpF,YAAY,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAGxD,eAAO,MAAM,OAAO,UAAU,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -89,6 +89,7 @@ __export(index_exports, {
|
|
|
89
89
|
TIER_LIMITS: () => TIER_LIMITS,
|
|
90
90
|
TargetResolver: () => TargetResolver,
|
|
91
91
|
ToolManager: () => ToolManager,
|
|
92
|
+
UNCLASSIFIED_ACTION_RISK: () => UNCLASSIFIED_ACTION_RISK,
|
|
92
93
|
UserIdentityManager: () => UserIdentityManager,
|
|
93
94
|
UserKeyPairManager: () => UserKeyPairManager,
|
|
94
95
|
VALID_MCP_ACTIONS: () => VALID_MCP_ACTIONS,
|
|
@@ -11337,6 +11338,7 @@ function parseEntityUid(uid) {
|
|
|
11337
11338
|
}
|
|
11338
11339
|
|
|
11339
11340
|
// src/registry/action-risk.ts
|
|
11341
|
+
var UNCLASSIFIED_ACTION_RISK = "high";
|
|
11340
11342
|
var HIGH_RISK_SUFFIXES = /* @__PURE__ */ new Set([
|
|
11341
11343
|
"send",
|
|
11342
11344
|
"post",
|
|
@@ -11380,13 +11382,13 @@ var REGISTRY_RISK_BY_ACTION = (() => {
|
|
|
11380
11382
|
function resolveActionRiskBySuffix(lowerAction) {
|
|
11381
11383
|
const segments = lowerAction.split(".");
|
|
11382
11384
|
const last = segments[segments.length - 1] ?? "";
|
|
11383
|
-
if (!last) return
|
|
11385
|
+
if (!last) return UNCLASSIFIED_ACTION_RISK;
|
|
11384
11386
|
if (HIGH_RISK_SUFFIXES.has(last)) return "high";
|
|
11385
11387
|
if (LOW_RISK_SUFFIXES.has(last)) return "low";
|
|
11386
|
-
return
|
|
11388
|
+
return UNCLASSIFIED_ACTION_RISK;
|
|
11387
11389
|
}
|
|
11388
11390
|
function resolveActionRisk(action) {
|
|
11389
|
-
if (!action || typeof action !== "string") return
|
|
11391
|
+
if (!action || typeof action !== "string") return UNCLASSIFIED_ACTION_RISK;
|
|
11390
11392
|
const lower = action.toLowerCase();
|
|
11391
11393
|
const registryRisk = REGISTRY_RISK_BY_ACTION.get(lower);
|
|
11392
11394
|
if (registryRisk) return registryRisk;
|
|
@@ -11491,6 +11493,7 @@ var version = "0.0.1";
|
|
|
11491
11493
|
TIER_LIMITS,
|
|
11492
11494
|
TargetResolver,
|
|
11493
11495
|
ToolManager,
|
|
11496
|
+
UNCLASSIFIED_ACTION_RISK,
|
|
11494
11497
|
UserIdentityManager,
|
|
11495
11498
|
UserKeyPairManager,
|
|
11496
11499
|
VALID_MCP_ACTIONS,
|