@vess-id/ai-identity 0.0.0-dev-20260902121045

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.
Files changed (173) hide show
  1. package/README.md +265 -0
  2. package/dist/agent/agent-did-manager.d.ts +97 -0
  3. package/dist/agent/agent-did-manager.d.ts.map +1 -0
  4. package/dist/auth/auth-provider.d.ts +51 -0
  5. package/dist/auth/auth-provider.d.ts.map +1 -0
  6. package/dist/auth/index.d.ts +2 -0
  7. package/dist/auth/index.d.ts.map +1 -0
  8. package/dist/client.d.ts +63 -0
  9. package/dist/client.d.ts.map +1 -0
  10. package/dist/config/index.d.ts +84 -0
  11. package/dist/config/index.d.ts.map +1 -0
  12. package/dist/constraint/constraint-evaluator.d.ts +103 -0
  13. package/dist/constraint/constraint-evaluator.d.ts.map +1 -0
  14. package/dist/constraint/index.d.ts +5 -0
  15. package/dist/constraint/index.d.ts.map +1 -0
  16. package/dist/did/agent.d.ts +58 -0
  17. package/dist/did/agent.d.ts.map +1 -0
  18. package/dist/did/did-utils.d.ts +82 -0
  19. package/dist/did/did-utils.d.ts.map +1 -0
  20. package/dist/did/key-manager.d.ts +19 -0
  21. package/dist/did/key-manager.d.ts.map +1 -0
  22. package/dist/gateway/gateway-client.d.ts +103 -0
  23. package/dist/gateway/gateway-client.d.ts.map +1 -0
  24. package/dist/gateway/index.d.ts +2 -0
  25. package/dist/gateway/index.d.ts.map +1 -0
  26. package/dist/grant/grant-manager.d.ts +140 -0
  27. package/dist/grant/grant-manager.d.ts.map +1 -0
  28. package/dist/grant/index.d.ts +2 -0
  29. package/dist/grant/index.d.ts.map +1 -0
  30. package/dist/identity/device-enroll-manager.d.ts +117 -0
  31. package/dist/identity/device-enroll-manager.d.ts.map +1 -0
  32. package/dist/identity/user-identity-manager.d.ts +123 -0
  33. package/dist/identity/user-identity-manager.d.ts.map +1 -0
  34. package/dist/identity/user-key-pair-manager.d.ts +22 -0
  35. package/dist/identity/user-key-pair-manager.d.ts.map +1 -0
  36. package/dist/index.d.mts +42685 -0
  37. package/dist/index.d.ts +57 -0
  38. package/dist/index.d.ts.map +1 -0
  39. package/dist/index.js +19534 -0
  40. package/dist/index.js.map +1 -0
  41. package/dist/index.mjs +19347 -0
  42. package/dist/index.mjs.map +1 -0
  43. package/dist/internal-signature/canonical.d.ts +80 -0
  44. package/dist/internal-signature/canonical.d.ts.map +1 -0
  45. package/dist/internal-signature/index.d.ts +17 -0
  46. package/dist/internal-signature/index.d.ts.map +1 -0
  47. package/dist/internal-signature/signer.d.ts +76 -0
  48. package/dist/internal-signature/signer.d.ts.map +1 -0
  49. package/dist/policy/cedar-engine.d.ts +334 -0
  50. package/dist/policy/cedar-engine.d.ts.map +1 -0
  51. package/dist/policy/cedar-entities.d.ts +59 -0
  52. package/dist/policy/cedar-entities.d.ts.map +1 -0
  53. package/dist/policy/decision.d.ts +46 -0
  54. package/dist/policy/decision.d.ts.map +1 -0
  55. package/dist/policy/index.d.ts +15 -0
  56. package/dist/policy/index.d.ts.map +1 -0
  57. package/dist/registry/access-orchestrator.d.ts +184 -0
  58. package/dist/registry/access-orchestrator.d.ts.map +1 -0
  59. package/dist/registry/action-aliases.d.ts +37 -0
  60. package/dist/registry/action-aliases.d.ts.map +1 -0
  61. package/dist/registry/action-input-validator.d.ts +19 -0
  62. package/dist/registry/action-input-validator.d.ts.map +1 -0
  63. package/dist/registry/action-normalizer.d.ts +47 -0
  64. package/dist/registry/action-normalizer.d.ts.map +1 -0
  65. package/dist/registry/action-registry-json.d.ts +35897 -0
  66. package/dist/registry/action-registry-json.d.ts.map +1 -0
  67. package/dist/registry/action-registry.d.ts +101 -0
  68. package/dist/registry/action-registry.d.ts.map +1 -0
  69. package/dist/registry/action-risk.d.ts +109 -0
  70. package/dist/registry/action-risk.d.ts.map +1 -0
  71. package/dist/registry/action-summary.d.ts +16 -0
  72. package/dist/registry/action-summary.d.ts.map +1 -0
  73. package/dist/registry/index.d.ts +14 -0
  74. package/dist/registry/index.d.ts.map +1 -0
  75. package/dist/registry/providers.d.ts +32 -0
  76. package/dist/registry/providers.d.ts.map +1 -0
  77. package/dist/registry/reauth-constants.d.ts +56 -0
  78. package/dist/registry/reauth-constants.d.ts.map +1 -0
  79. package/dist/registry/resource-type-labels.d.ts +15 -0
  80. package/dist/registry/resource-type-labels.d.ts.map +1 -0
  81. package/dist/registry/resource-types.d.ts +47 -0
  82. package/dist/registry/resource-types.d.ts.map +1 -0
  83. package/dist/resolver/approval-time-resolution.d.ts +72 -0
  84. package/dist/resolver/approval-time-resolution.d.ts.map +1 -0
  85. package/dist/resolver/canonical-resource-id.d.ts +37 -0
  86. package/dist/resolver/canonical-resource-id.d.ts.map +1 -0
  87. package/dist/resolver/compare-resource-id.d.ts +37 -0
  88. package/dist/resolver/compare-resource-id.d.ts.map +1 -0
  89. package/dist/resolver/salient-digest.d.ts +48 -0
  90. package/dist/resolver/salient-digest.d.ts.map +1 -0
  91. package/dist/resolver/target-resolver.d.ts +28 -0
  92. package/dist/resolver/target-resolver.d.ts.map +1 -0
  93. package/dist/state/index.d.ts +3 -0
  94. package/dist/state/index.d.ts.map +1 -0
  95. package/dist/state/json-state-store.d.ts +24 -0
  96. package/dist/state/json-state-store.d.ts.map +1 -0
  97. package/dist/state/state-store.interface.d.ts +37 -0
  98. package/dist/state/state-store.interface.d.ts.map +1 -0
  99. package/dist/storage/filesystem-key-storage.d.ts +16 -0
  100. package/dist/storage/filesystem-key-storage.d.ts.map +1 -0
  101. package/dist/storage/index.d.ts +4 -0
  102. package/dist/storage/index.d.ts.map +1 -0
  103. package/dist/storage/key-storage.interface.d.ts +42 -0
  104. package/dist/storage/key-storage.interface.d.ts.map +1 -0
  105. package/dist/storage/memory-key-storage.d.ts +17 -0
  106. package/dist/storage/memory-key-storage.d.ts.map +1 -0
  107. package/dist/tool/tool-manager.d.ts +44 -0
  108. package/dist/tool/tool-manager.d.ts.map +1 -0
  109. package/dist/types/agent.d.ts +139 -0
  110. package/dist/types/agent.d.ts.map +1 -0
  111. package/dist/types/audit.d.ts +23 -0
  112. package/dist/types/audit.d.ts.map +1 -0
  113. package/dist/types/cedar-policy.d.ts +60 -0
  114. package/dist/types/cedar-policy.d.ts.map +1 -0
  115. package/dist/types/connector-plugin.d.ts +252 -0
  116. package/dist/types/connector-plugin.d.ts.map +1 -0
  117. package/dist/types/connectors.d.ts +39 -0
  118. package/dist/types/connectors.d.ts.map +1 -0
  119. package/dist/types/context.d.ts +152 -0
  120. package/dist/types/context.d.ts.map +1 -0
  121. package/dist/types/did.d.ts +18 -0
  122. package/dist/types/did.d.ts.map +1 -0
  123. package/dist/types/errors.d.ts +24 -0
  124. package/dist/types/errors.d.ts.map +1 -0
  125. package/dist/types/grant.d.ts +522 -0
  126. package/dist/types/grant.d.ts.map +1 -0
  127. package/dist/types/index.d.ts +22 -0
  128. package/dist/types/index.d.ts.map +1 -0
  129. package/dist/types/intent.d.ts +133 -0
  130. package/dist/types/intent.d.ts.map +1 -0
  131. package/dist/types/invitation.d.ts +97 -0
  132. package/dist/types/invitation.d.ts.map +1 -0
  133. package/dist/types/jira.d.ts +348 -0
  134. package/dist/types/jira.d.ts.map +1 -0
  135. package/dist/types/oauth.d.ts +72 -0
  136. package/dist/types/oauth.d.ts.map +1 -0
  137. package/dist/types/organization.d.ts +77 -0
  138. package/dist/types/organization.d.ts.map +1 -0
  139. package/dist/types/permission-mode.d.ts +138 -0
  140. package/dist/types/permission-mode.d.ts.map +1 -0
  141. package/dist/types/permission-vc.d.ts +800 -0
  142. package/dist/types/permission-vc.d.ts.map +1 -0
  143. package/dist/types/receipt.d.ts +133 -0
  144. package/dist/types/receipt.d.ts.map +1 -0
  145. package/dist/types/target-binding.d.ts +163 -0
  146. package/dist/types/target-binding.d.ts.map +1 -0
  147. package/dist/types/tier.d.ts +13 -0
  148. package/dist/types/tier.d.ts.map +1 -0
  149. package/dist/types/vc.d.ts +213 -0
  150. package/dist/types/vc.d.ts.map +1 -0
  151. package/dist/types/vp.d.ts +25 -0
  152. package/dist/types/vp.d.ts.map +1 -0
  153. package/dist/utils/action-classifier.d.ts +13 -0
  154. package/dist/utils/action-classifier.d.ts.map +1 -0
  155. package/dist/utils/crypto.d.ts +22 -0
  156. package/dist/utils/crypto.d.ts.map +1 -0
  157. package/dist/utils/freemail-domains.d.ts +13 -0
  158. package/dist/utils/freemail-domains.d.ts.map +1 -0
  159. package/dist/utils/sdjwt-client.d.ts +415 -0
  160. package/dist/utils/sdjwt-client.d.ts.map +1 -0
  161. package/dist/utils/sdjwt-disclosure.d.ts +13 -0
  162. package/dist/utils/sdjwt-disclosure.d.ts.map +1 -0
  163. package/dist/utils/tier-utils.d.ts +15 -0
  164. package/dist/utils/tier-utils.d.ts.map +1 -0
  165. package/dist/vc/api-vc-manager.d.ts +43 -0
  166. package/dist/vc/api-vc-manager.d.ts.map +1 -0
  167. package/dist/vc/vc-manager.d.ts +55 -0
  168. package/dist/vc/vc-manager.d.ts.map +1 -0
  169. package/dist/vp/kb-jwt-builder.d.ts +89 -0
  170. package/dist/vp/kb-jwt-builder.d.ts.map +1 -0
  171. package/dist/vp/vp-manager.d.ts +75 -0
  172. package/dist/vp/vp-manager.d.ts.map +1 -0
  173. package/package.json +66 -0
@@ -0,0 +1,37 @@
1
+ /**
2
+ * THE single canonical resource-id function (INV-1). Consumed by Cedar-context,
3
+ * Gate-2 enforcement, and issuance so all participants agree byte-for-byte.
4
+ *
5
+ * Returns undefined when the action's binding cannot resolve a concrete id.
6
+ *
7
+ * The function is intentionally CONTEXT-FREE for the canonical id: the same
8
+ * (action, params) always yields the same string, with NO tenant qualification.
9
+ * This is what guarantees INV-1 across every participant — including agentd,
10
+ * which derives resource ids via its own extraction path and never qualifies.
11
+ * An earlier revision tenant-qualified calendar's default `primary`
12
+ * (`<tenant>:primary`) ONLY when a `tenant` ctx key was passed, but only ONE of
13
+ * the four api-side callers threaded it, so the same default-calendar write
14
+ * produced divergent strings (`<tenant>:primary` on Gate-2 vs bare `primary` on
15
+ * issuance/Cedar/agentd) — an INV-1 violation. That qualification has been
16
+ * removed (#884 Task 3 review, Option B).
17
+ *
18
+ * KNOWN LIMITATION: two tenants' default `primary` calendars share the id
19
+ * `primary`. This is NOT currently exploitable because calendar grants default
20
+ * to a wildcard resource (`pattern:'*'`), and Gate-2's
21
+ * `validateVCResourceConstraint` short-circuits on wildcard delegates, so the
22
+ * resource id is never compared cross-tenant. If calendar ever issues
23
+ * resource-pinned grants, tenant disambiguation must be re-introduced UNIFORMLY
24
+ * across ALL participants (api + agentd) at once, not on a single caller.
25
+ *
26
+ * TODO(#884-followup): if a resource-PINNED calendar grant is ever introduced
27
+ * (non-wildcard calendar resource), two tenants' `primary` would collide — solve
28
+ * tenant-qualification at the binding level for ALL participants (api + agentd)
29
+ * before that lands. Tracked as a #884 follow-up.
30
+ *
31
+ * @param ctx Binding context map forwarded to {@link TargetResolver.resolve}
32
+ * for any `source: 'context'` bindings. (No registry binding is currently
33
+ * context-sourced.) The previously-reserved `tenant` key no longer has special
34
+ * meaning and is ignored for qualification.
35
+ */
36
+ export declare function canonicalResourceId(action: string, params: Record<string, unknown> | undefined, ctx?: Record<string, string>): string | undefined;
37
+ //# sourceMappingURL=canonical-resource-id.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"canonical-resource-id.d.ts","sourceRoot":"","sources":["../../src/resolver/canonical-resource-id.ts"],"names":[],"mappings":"AAMA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,EAC3C,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC3B,MAAM,GAAG,SAAS,CA8CpB"}
@@ -0,0 +1,37 @@
1
+ /**
2
+ * THE single source of truth for resource-id EQUIVALENCE (#884).
3
+ *
4
+ * Pairs with {@link canonicalResourceId} (`./canonical-resource-id`):
5
+ * - `canonicalResourceId` NORMALIZES an (action, params) pair into a single
6
+ * canonical resource-id string.
7
+ * - `compareResourceIds` COMPARES two resource-id strings (a credential's
8
+ * constraint vs an incoming request's resource).
9
+ *
10
+ * Both api and remote-mcp import this from the SDK so every participant agrees
11
+ * byte-for-byte on what "the same resource" means.
12
+ *
13
+ * The comparison is intentionally 3-VALUED:
14
+ * - 'match' — definitely the same resource.
15
+ * - 'mismatch' — definitely a different resource.
16
+ * - 'indeterminate' — one side is a provider-native id (e.g. a Slack channel
17
+ * id `C0123ABCD`) and the other is a human-readable name
18
+ * (e.g. `#general`). These cannot be resolved to a common
19
+ * form without calling the external provider API, so the
20
+ * caller MUST decide the safe side (fail-closed for
21
+ * enforcement, or defer to an API-backed resolution).
22
+ */
23
+ export type ResourceMatch = 'match' | 'mismatch' | 'indeterminate';
24
+ /**
25
+ * Check if a string looks like a provider-native resource ID
26
+ * (e.g., Slack channel IDs like "C0A159PP6QM", "D01234ABCDE", "G98765ZYXWV").
27
+ * Returns false for human-readable names like "#general" or "dev-weekly-report".
28
+ */
29
+ export declare function looksLikeNativeId(value: string): boolean;
30
+ /**
31
+ * Check if two resource identifiers can be compared at the remote-mcp level.
32
+ * When one is a native ID and the other is a human-readable name, we cannot
33
+ * determine equivalence without calling the external provider API (e.g., Slack).
34
+ * In that case, return 'indeterminate' so the caller can defer to the API side.
35
+ */
36
+ export declare function compareResourceIds(credResourceId: string, requestResourceId: string): ResourceMatch;
37
+ //# sourceMappingURL=compare-resource-id.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compare-resource-id.d.ts","sourceRoot":"","sources":["../../src/resolver/compare-resource-id.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,UAAU,GAAG,eAAe,CAAA;AAElE;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAgBxD;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAChC,cAAc,EAAE,MAAM,EACtB,iBAAiB,EAAE,MAAM,GACxB,aAAa,CAYf"}
@@ -0,0 +1,48 @@
1
+ /**
2
+ * Produce the deterministic canonical JSON string over ONLY the given salient
3
+ * `fields` of `params`. Field-list-explicit variant — the pure core that the
4
+ * golden vectors pin and that the action-aware wrappers delegate to.
5
+ *
6
+ * @throws if any selected value violates the number rules (float / non-finite)
7
+ * or contains an unsupported value type.
8
+ */
9
+ export declare function canonicalizeWithFields(fields: string[], params: Record<string, unknown>): string;
10
+ /**
11
+ * `sha256:` + lowercase-hex sha256 of {@link canonicalizeWithFields}.
12
+ * Field-list-explicit variant.
13
+ */
14
+ export declare function digestWithFields(fields: string[], params: Record<string, unknown>): string;
15
+ /**
16
+ * Look up the action's declared approval-salient fields.
17
+ *
18
+ * As of Step 2 the registry declares `approval_salient_fields` (typed on
19
+ * `ActionMeta`) for every approval-gated action. The runtime guards below still
20
+ * defend against a malformed literal (the registry JSON is a widened object
21
+ * literal, not schema-validated at import time), returning `undefined` when the
22
+ * action is unknown or has no well-formed string[] salient set.
23
+ *
24
+ * @returns the declared salient field names, or `undefined` if the action is
25
+ * unknown or has not declared a salient set.
26
+ */
27
+ export declare function salientFieldsFor(action: string): string[] | undefined;
28
+ /**
29
+ * Canonical JSON string over the action's declared salient set.
30
+ *
31
+ * Thin wrapper: resolves the field list via {@link salientFieldsFor} then
32
+ * delegates to {@link canonicalizeWithFields}.
33
+ *
34
+ * @throws if the action has no declared salient set — callers that may hit an
35
+ * action without a set should gate on {@link salientFieldsFor} /
36
+ * {@link salientDigest} (which returns `undefined`) first. Throwing here keeps
37
+ * the "no set" case loud rather than silently canonicalizing `{}`.
38
+ */
39
+ export declare function canonicalizeSalient(action: string, params: Record<string, unknown>): string;
40
+ /**
41
+ * `sha256:` digest over the action's declared salient set.
42
+ *
43
+ * Thin wrapper: resolves the field list via {@link salientFieldsFor} then
44
+ * delegates to {@link digestWithFields}. Returns `undefined` when the action has
45
+ * no salient set (issuer omits `params_hash`; PEP skips the salient gate).
46
+ */
47
+ export declare function salientDigest(action: string, params: Record<string, unknown>): string | undefined;
48
+ //# sourceMappingURL=salient-digest.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"salient-digest.d.ts","sourceRoot":"","sources":["../../src/resolver/salient-digest.ts"],"names":[],"mappings":"AA4HA;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CA4BhG;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAI1F;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAOrE;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAM3F;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,GAAG,SAAS,CAIjG"}
@@ -0,0 +1,28 @@
1
+ import { TargetBindings, ResolvedTargets } from '../types/target-binding';
2
+ /**
3
+ * Extract the project key from a Jira issue key.
4
+ * Returns the project prefix (e.g., "AIDENTITY" from "AIDENTITY-35") or null if not a valid issue key.
5
+ *
6
+ * @remarks Project keys must be at least 2 uppercase characters, matching Jira's requirement.
7
+ * Single-letter keys (e.g., "A-1") return null.
8
+ */
9
+ export declare function extractProjectKey(value: string): string | null;
10
+ /**
11
+ * TargetResolver — extracts resource IDs and secondary targets from tool parameters.
12
+ *
13
+ * Pure function with no external dependencies (NestJS, DB, etc.).
14
+ * Used by the API layer to populate PolicyInput.request.resource.id and targets[].
15
+ */
16
+ export declare class TargetResolver {
17
+ /**
18
+ * Resolve target bindings against tool invocation parameters.
19
+ *
20
+ * @param bindings - Target binding declarations from ACTION_REGISTRY
21
+ * @param params - Tool invocation parameters
22
+ * @param context - Optional pre-resolved context values (e.g., resource_id from URL)
23
+ */
24
+ resolve(bindings: TargetBindings, params: Record<string, unknown>, context?: Record<string, string>): ResolvedTargets;
25
+ private resolveBinding;
26
+ private resolveSecondary;
27
+ }
28
+ //# sourceMappingURL=target-resolver.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"target-resolver.d.ts","sourceRoot":"","sources":["../../src/resolver/target-resolver.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,eAAe,EAIhB,MAAM,yBAAyB,CAAA;AAShC;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAG9D;AAED;;;;;GAKG;AACH,qBAAa,cAAc;IACzB;;;;;;OAMG;IACH,OAAO,CACL,QAAQ,EAAE,cAAc,EACxB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC/B,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC/B,eAAe;IAiBlB,OAAO,CAAC,cAAc;IAgDtB,OAAO,CAAC,gBAAgB;CAmBzB"}
@@ -0,0 +1,3 @@
1
+ export { IStateStore } from './state-store.interface';
2
+ export { JsonStateStore } from './json-state-store';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/state/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA"}
@@ -0,0 +1,24 @@
1
+ import { IStateStore } from './state-store.interface';
2
+ /**
3
+ * JSON file-based state store.
4
+ * Stores state in ~/.vess/state.json by default.
5
+ * Uses atomic write (temp file → rename) for safety.
6
+ */
7
+ export declare class JsonStateStore implements IStateStore {
8
+ private filePath;
9
+ private data;
10
+ constructor(filePath?: string);
11
+ get<T = unknown>(key: string): Promise<T | undefined>;
12
+ set<T = unknown>(key: string, value: T): Promise<void>;
13
+ delete(key: string): Promise<boolean>;
14
+ has(key: string): Promise<boolean>;
15
+ getAll(): Promise<Record<string, unknown>>;
16
+ clear(): Promise<void>;
17
+ /**
18
+ * Get the file path used by this store (useful for diagnostics)
19
+ */
20
+ getFilePath(): string;
21
+ private load;
22
+ private save;
23
+ }
24
+ //# sourceMappingURL=json-state-store.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"json-state-store.d.ts","sourceRoot":"","sources":["../../src/state/json-state-store.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAErD;;;;GAIG;AACH,qBAAa,cAAe,YAAW,WAAW;IAChD,OAAO,CAAC,QAAQ,CAAQ;IACxB,OAAO,CAAC,IAAI,CAAuC;gBAEvC,QAAQ,CAAC,EAAE,MAAM;IAIvB,GAAG,CAAC,CAAC,GAAG,OAAO,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,GAAG,SAAS,CAAC;IAKrD,GAAG,CAAC,CAAC,GAAG,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAMtD,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAUrC,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAKlC,MAAM,IAAI,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAI1C,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAK5B;;OAEG;IACH,WAAW,IAAI,MAAM;YAIP,IAAI;YAoBJ,IAAI;CAUnB"}
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Generic state store interface for persisting application state.
3
+ * Allows different backends: JSON file, SQLite, Postgres, etc.
4
+ */
5
+ export interface IStateStore {
6
+ /**
7
+ * Get a value by key
8
+ * @param key Dot-notation key (e.g., "auth.token", "events.cursor")
9
+ * @returns The stored value, or undefined if not found
10
+ */
11
+ get<T = unknown>(key: string): Promise<T | undefined>;
12
+ /**
13
+ * Set a value by key
14
+ * @param key Dot-notation key
15
+ * @param value Value to store
16
+ */
17
+ set<T = unknown>(key: string, value: T): Promise<void>;
18
+ /**
19
+ * Delete a value by key
20
+ * @param key Dot-notation key
21
+ * @returns true if the key existed and was deleted
22
+ */
23
+ delete(key: string): Promise<boolean>;
24
+ /**
25
+ * Check if a key exists
26
+ */
27
+ has(key: string): Promise<boolean>;
28
+ /**
29
+ * Get all stored data as a plain object
30
+ */
31
+ getAll(): Promise<Record<string, unknown>>;
32
+ /**
33
+ * Clear all stored data
34
+ */
35
+ clear(): Promise<void>;
36
+ }
37
+ //# sourceMappingURL=state-store.interface.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"state-store.interface.d.ts","sourceRoot":"","sources":["../../src/state/state-store.interface.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,WAAW,WAAW;IAC1B;;;;OAIG;IACH,GAAG,CAAC,CAAC,GAAG,OAAO,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,GAAG,SAAS,CAAC,CAAA;IAErD;;;;OAIG;IACH,GAAG,CAAC,CAAC,GAAG,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAEtD;;;;OAIG;IACH,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;IAErC;;OAEG;IACH,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;IAElC;;OAEG;IACH,MAAM,IAAI,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAA;IAE1C;;OAEG;IACH,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;CACvB"}
@@ -0,0 +1,16 @@
1
+ import { KeyStorageProvider, KeyStorageConfig } from './key-storage.interface';
2
+ /**
3
+ * Filesystem-based key storage provider
4
+ */
5
+ export declare class FilesystemKeyStorage implements KeyStorageProvider {
6
+ private keyStorePath;
7
+ constructor(config?: KeyStorageConfig);
8
+ store(id: string, encryptedKey: string): Promise<void>;
9
+ retrieve(id: string): Promise<string | null>;
10
+ delete(id: string): Promise<void>;
11
+ list(): Promise<string[]>;
12
+ isAvailable(): Promise<boolean>;
13
+ private ensureKeyStoreExists;
14
+ private getKeyPath;
15
+ }
16
+ //# sourceMappingURL=filesystem-key-storage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"filesystem-key-storage.d.ts","sourceRoot":"","sources":["../../src/storage/filesystem-key-storage.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;AAE9E;;GAEG;AACH,qBAAa,oBAAqB,YAAW,kBAAkB;IAC7D,OAAO,CAAC,YAAY,CAAQ;gBAEhB,MAAM,CAAC,EAAE,gBAAgB;IAI/B,KAAK,CAAC,EAAE,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAMtD,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAa5C,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAYjC,IAAI,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;IASzB,WAAW,IAAI,OAAO,CAAC,OAAO,CAAC;YASvB,oBAAoB;IAQlC,OAAO,CAAC,UAAU;CAGnB"}
@@ -0,0 +1,4 @@
1
+ export * from './key-storage.interface';
2
+ export * from './filesystem-key-storage';
3
+ export * from './memory-key-storage';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/storage/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAA;AACvC,cAAc,0BAA0B,CAAA;AACxC,cAAc,sBAAsB,CAAA"}
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Interface for key storage persistence
3
+ * Allows different storage backends (filesystem, database, memory, etc.)
4
+ */
5
+ export interface KeyStorageProvider {
6
+ /**
7
+ * Store an encrypted key
8
+ * @param id Unique identifier for the key (e.g., DID hash)
9
+ * @param encryptedKey Encrypted key data
10
+ */
11
+ store(id: string, encryptedKey: string): Promise<void>;
12
+ /**
13
+ * Retrieve an encrypted key
14
+ * @param id Unique identifier for the key
15
+ * @returns Encrypted key data, or null if not found
16
+ */
17
+ retrieve(id: string): Promise<string | null>;
18
+ /**
19
+ * Delete a key
20
+ * @param id Unique identifier for the key
21
+ */
22
+ delete(id: string): Promise<void>;
23
+ /**
24
+ * List all stored key identifiers
25
+ * @returns Array of key identifiers
26
+ */
27
+ list(): Promise<string[]>;
28
+ /**
29
+ * Check if the storage is available and initialized
30
+ */
31
+ isAvailable(): Promise<boolean>;
32
+ }
33
+ /**
34
+ * Configuration for key storage
35
+ */
36
+ export interface KeyStorageConfig {
37
+ /** Storage type identifier */
38
+ type: string;
39
+ /** Storage-specific options */
40
+ options?: Record<string, any>;
41
+ }
42
+ //# sourceMappingURL=key-storage.interface.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"key-storage.interface.d.ts","sourceRoot":"","sources":["../../src/storage/key-storage.interface.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IACjC;;;;OAIG;IACH,KAAK,CAAC,EAAE,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAEtD;;;;OAIG;IACH,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAA;IAE5C;;;OAGG;IACH,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAEjC;;;OAGG;IACH,IAAI,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC,CAAA;IAEzB;;OAEG;IACH,WAAW,IAAI,OAAO,CAAC,OAAO,CAAC,CAAA;CAChC;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,8BAA8B;IAC9B,IAAI,EAAE,MAAM,CAAA;IACZ,+BAA+B;IAC/B,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;CAC9B"}
@@ -0,0 +1,17 @@
1
+ import { KeyStorageProvider } from './key-storage.interface';
2
+ /**
3
+ * In-memory key storage provider (for testing)
4
+ */
5
+ export declare class MemoryKeyStorage implements KeyStorageProvider {
6
+ private keys;
7
+ store(id: string, encryptedKey: string): Promise<void>;
8
+ retrieve(id: string): Promise<string | null>;
9
+ delete(id: string): Promise<void>;
10
+ list(): Promise<string[]>;
11
+ isAvailable(): Promise<boolean>;
12
+ /**
13
+ * Clear all stored keys (for testing)
14
+ */
15
+ clear(): void;
16
+ }
17
+ //# sourceMappingURL=memory-key-storage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"memory-key-storage.d.ts","sourceRoot":"","sources":["../../src/storage/memory-key-storage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAE5D;;GAEG;AACH,qBAAa,gBAAiB,YAAW,kBAAkB;IACzD,OAAO,CAAC,IAAI,CAAiC;IAEvC,KAAK,CAAC,EAAE,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAItD,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAI5C,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIjC,IAAI,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;IAIzB,WAAW,IAAI,OAAO,CAAC,OAAO,CAAC;IAIrC;;OAEG;IACH,KAAK,IAAI,IAAI;CAGd"}
@@ -0,0 +1,44 @@
1
+ import { ConnectorResponse } from '../types';
2
+ import { VPManager } from '../vp/vp-manager';
3
+ export interface ToolDefinition {
4
+ name: string;
5
+ description: string;
6
+ actions: {
7
+ name: string;
8
+ description: string;
9
+ parameters: Record<string, any>;
10
+ }[];
11
+ }
12
+ export declare class ToolManager {
13
+ private vpManager;
14
+ private tools;
15
+ private proxyApiUrl;
16
+ constructor(vpManager?: VPManager);
17
+ /**
18
+ * Invoke a tool action with VC authorization
19
+ */
20
+ invoke<T = any>(tool: string, action: string, params: Record<string, any>, options: {
21
+ vcs: string[];
22
+ holderDid: string;
23
+ }): Promise<ConnectorResponse<T>>;
24
+ /**
25
+ * List available tools
26
+ */
27
+ list(): ToolDefinition[];
28
+ /**
29
+ * Get a specific tool definition
30
+ */
31
+ getTool(name: string): ToolDefinition | undefined;
32
+ /**
33
+ * Register a custom tool
34
+ */
35
+ registerTool(tool: ToolDefinition): void;
36
+ /**
37
+ * Check if VCs authorize a tool action
38
+ */
39
+ checkAuthorization(vcs: string[], tool: string, action: string, resourceScope?: Record<string, any>): Promise<boolean>;
40
+ private matchScope;
41
+ private generateChallenge;
42
+ private registerDefaultTools;
43
+ }
44
+ //# sourceMappingURL=tool-manager.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tool-manager.d.ts","sourceRoot":"","sources":["../../src/tool/tool-manager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAA;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAG5C,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,MAAM,CAAA;IACnB,OAAO,EAAE;QACP,IAAI,EAAE,MAAM,CAAA;QACZ,WAAW,EAAE,MAAM,CAAA;QACnB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;KAChC,EAAE,CAAA;CACJ;AAED,qBAAa,WAAW;IACtB,OAAO,CAAC,SAAS,CAAW;IAC5B,OAAO,CAAC,KAAK,CAAyC;IACtD,OAAO,CAAC,WAAW,CAAQ;gBAEf,SAAS,CAAC,EAAE,SAAS;IAOjC;;OAEG;IACG,MAAM,CAAC,CAAC,GAAG,GAAG,EAClB,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC3B,OAAO,EAAE;QACP,GAAG,EAAE,MAAM,EAAE,CAAA;QACb,SAAS,EAAE,MAAM,CAAA;KAClB,GACA,OAAO,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC;IAgHhC;;OAEG;IACH,IAAI,IAAI,cAAc,EAAE;IAIxB;;OAEG;IACH,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS;IAIjD;;OAEG;IACH,YAAY,CAAC,IAAI,EAAE,cAAc,GAAG,IAAI;IAIxC;;OAEG;IACG,kBAAkB,CACtB,GAAG,EAAE,MAAM,EAAE,EACb,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EACd,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAClC,OAAO,CAAC,OAAO,CAAC;IAyBnB,OAAO,CAAC,UAAU;IAUlB,OAAO,CAAC,iBAAiB;IAIzB,OAAO,CAAC,oBAAoB;CAuO7B"}
@@ -0,0 +1,139 @@
1
+ import { DIDDocument } from './did';
2
+ /**
3
+ * Agent Status enumeration
4
+ */
5
+ export declare enum AgentStatus {
6
+ ACTIVE = "active",
7
+ SUSPENDED = "suspended",// @deprecated — kept for backward compatibility with existing DB rows
8
+ REVOKED = "revoked",// @deprecated — kept for backward compatibility with existing DB rows
9
+ DELETED = "deleted"
10
+ }
11
+ /**
12
+ * Agent Type enumeration
13
+ */
14
+ export declare enum AgentType {
15
+ AUTONOMOUS = "autonomous",// Independent AI Agent
16
+ SUB_AGENT = "sub_agent",// Part of multi-agent system
17
+ TOOL_AGENT = "tool_agent",// Tool-specific agent
18
+ ASSISTANT = "assistant",// AI Assistant (Claude Code etc.)
19
+ PROXY = "proxy"
20
+ }
21
+ /**
22
+ * AI Agent Identity representation
23
+ * Agents are AI entities that need identity for permission delegation
24
+ */
25
+ export interface Agent {
26
+ /** The DID associated with this agent */
27
+ did: string;
28
+ /** DID Document for the agent's identity */
29
+ didDocument: DIDDocument;
30
+ /** ISO 8601 timestamp of when the agent was created */
31
+ createdAt: string;
32
+ /** Optional metadata for the agent */
33
+ metadata?: Record<string, any>;
34
+ }
35
+ /**
36
+ * Extended Agent interface matching API entity structure
37
+ */
38
+ export interface APIAgent {
39
+ /** Unique identifier */
40
+ id: string;
41
+ /** Agent's DID (Decentralized Identifier) */
42
+ did: string;
43
+ /** Agent's display name */
44
+ name: string;
45
+ /** Agent type */
46
+ type: AgentType;
47
+ /** Agent status */
48
+ status: AgentStatus;
49
+ /** Agent information */
50
+ agentInfo: {
51
+ model?: string;
52
+ capabilities?: string[];
53
+ configuration?: Record<string, any>;
54
+ [key: string]: any;
55
+ };
56
+ /** Additional metadata */
57
+ metadata?: Record<string, any>;
58
+ /** Owner user ID */
59
+ ownerId?: string;
60
+ /** Parent agent ID for hierarchical agents */
61
+ parentAgentId?: string;
62
+ /** Whether agent is currently active */
63
+ isActive: boolean;
64
+ /** Last activity timestamp */
65
+ lastActiveAt?: Date;
66
+ /** Creation timestamp */
67
+ createdAt: Date;
68
+ /** Update timestamp */
69
+ updatedAt: Date;
70
+ }
71
+ /**
72
+ * Agent with unique identifier
73
+ * Used for managing multiple agents with distinct identities
74
+ */
75
+ export interface AgentWithId extends Agent {
76
+ /** Unique identifier for this agent instance */
77
+ id: string;
78
+ }
79
+ /**
80
+ * User Identity representation
81
+ * Users are human entities who issue VCs to agents
82
+ */
83
+ export interface UserIdentity {
84
+ /** The DID associated with this user */
85
+ did: string;
86
+ /** DID Document for the user's identity */
87
+ didDocument: DIDDocument;
88
+ /** ISO 8601 timestamp of when the user identity was created */
89
+ createdAt: string;
90
+ /** Optional metadata for the user */
91
+ metadata?: Record<string, any>;
92
+ }
93
+ /**
94
+ * Configuration for Agent DID generation
95
+ */
96
+ export interface AgentDIDConfig {
97
+ /** Whether to auto-generate DID for new agents */
98
+ generateDID: boolean;
99
+ /** DID method to use (currently only 'jwk' supported) */
100
+ didMethod: 'jwk';
101
+ /** Key type for cryptographic operations */
102
+ keyType: 'ES256';
103
+ /** Whether agent DIDs are ephemeral (deleted with agent) */
104
+ ephemeral: boolean;
105
+ }
106
+ /**
107
+ * Configuration for User Identity management
108
+ */
109
+ export interface UserIdentityConfig {
110
+ /** Whether to auto-create user identity if none exists */
111
+ autoCreate: boolean;
112
+ /** DID method to use (currently only 'jwk' supported) */
113
+ didMethod: 'jwk';
114
+ /** Key type for cryptographic operations */
115
+ keyType: 'ES256';
116
+ /** Whether to support external DIDs (future feature) */
117
+ allowExternalDID: boolean;
118
+ }
119
+ /**
120
+ * Agent creation options
121
+ */
122
+ export interface AgentCreateOptions {
123
+ /** Optional name for the agent */
124
+ name?: string;
125
+ /** Optional metadata to associate with the agent */
126
+ metadata?: Record<string, any>;
127
+ /** Override default DID generation behavior */
128
+ generateDID?: boolean;
129
+ }
130
+ /**
131
+ * User identity creation options
132
+ */
133
+ export interface UserIdentityCreateOptions {
134
+ /** Optional metadata to associate with the user */
135
+ metadata?: Record<string, any>;
136
+ /** Force creation of new identity (replace existing) */
137
+ force?: boolean;
138
+ }
139
+ //# sourceMappingURL=agent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../src/types/agent.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,23 @@
1
+ export interface AuditEvent {
2
+ id: string;
3
+ ts: string;
4
+ actorDid: string;
5
+ issuerDid: string;
6
+ vcId: string;
7
+ action: string;
8
+ resource?: string;
9
+ result: 'allow' | 'deny' | 'expired' | 'revoked';
10
+ requestId: string;
11
+ metadata?: Record<string, any>;
12
+ }
13
+ export interface AuditQuery {
14
+ actorDid?: string;
15
+ issuerDid?: string;
16
+ action?: string;
17
+ result?: AuditEvent['result'];
18
+ startTime?: string;
19
+ endTime?: string;
20
+ limit?: number;
21
+ offset?: number;
22
+ }
23
+ //# sourceMappingURL=audit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"audit.d.ts","sourceRoot":"","sources":["../../src/types/audit.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAA;IACV,EAAE,EAAE,MAAM,CAAA;IACV,QAAQ,EAAE,MAAM,CAAA;IAChB,SAAS,EAAE,MAAM,CAAA;IACjB,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,MAAM,CAAA;IACd,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,MAAM,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,CAAA;IAChD,SAAS,EAAE,MAAM,CAAA;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;CAC/B;AAED,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,MAAM,CAAC,EAAE,UAAU,CAAC,QAAQ,CAAC,CAAA;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB"}
@@ -0,0 +1,60 @@
1
+ /**
2
+ * Cedar-specific schema / policy / decision wire types.
3
+ *
4
+ * Phase 1 Step 2: Type-only declarations. The actual Cedar engine wrapper
5
+ * lives in Step 1's lane (`packages/sdk/src/policy/cedar-engine.ts` — not
6
+ * touched here). This module exposes the opaque handle types that other
7
+ * services (PEP, decision audit, policy registry) use to communicate
8
+ * *about* Cedar without depending on cedar-wasm internals.
9
+ *
10
+ * Spec refs:
11
+ * - docs/specs/2026-05-23-cedar-rar-implementation-plan-phase1.md Task 2.2
12
+ * - docs/specs/2026-05-23-cedar-rar-permission-redesign.md §3.3 (Cedar schema)
13
+ */
14
+ /**
15
+ * Cedar schema (entity types + actions + context shapes).
16
+ *
17
+ * Opaque to AIdentity at the type level — the concrete JSON shape follows
18
+ * the Cedar spec and is produced by `connector-plugin` codegen. Treat
19
+ * instances as black-box payloads that round-trip through the Cedar engine.
20
+ */
21
+ export interface CedarSchema {
22
+ }
23
+ /**
24
+ * Opaque handle returned by the Cedar engine after parsing / compiling a
25
+ * PolicySet. Implementations may store wasm pointers, validation state, etc.
26
+ * Consumers MUST NOT introspect the shape.
27
+ */
28
+ export interface CedarPolicySetHandle {
29
+ }
30
+ /**
31
+ * Opaque handle returned by the Cedar engine after parsing / compiling a
32
+ * Schema. See {@link CedarPolicySetHandle} for usage notes.
33
+ */
34
+ export interface CedarSchemaHandle {
35
+ }
36
+ /**
37
+ * 3-valued decision returned by the AIdentity Decision Service after the
38
+ * 2-phase Cedar evaluation.
39
+ *
40
+ * Mapping:
41
+ * - `Permit` → Cedar Permit && no constraints failed
42
+ * - `Forbid` → Cedar Forbid OR no matching permit
43
+ * - `RequireApproval` → AIdentity-specific intermediate state (e.g.,
44
+ * high-risk action that needs human approval).
45
+ * Cedar itself only emits Permit / Forbid; the
46
+ * decision service derives `RequireApproval` from
47
+ * annotated policies or constraint-level escalation.
48
+ */
49
+ export type CedarDecisionValue = 'Permit' | 'Forbid' | 'RequireApproval';
50
+ /**
51
+ * Diagnostic information accompanying a Cedar decision. Surfaced to audit
52
+ * logs and (in shadow mode) to legacy/Cedar parity checks.
53
+ */
54
+ export interface CedarDecisionDiagnostic {
55
+ /** IDs of the Cedar policies that matched the request (in evaluation order). */
56
+ matched_policy_ids: string[];
57
+ /** Cedar diagnostics passthrough (parse / validation errors, if any). */
58
+ errors: string[];
59
+ }
60
+ //# sourceMappingURL=cedar-policy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cedar-policy.d.ts","sourceRoot":"","sources":["../../src/types/cedar-policy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH;;;;;;GAMG;AAEH,MAAM,WAAW,WAAW;CAE3B;AAED;;;;GAIG;AAEH,MAAM,WAAW,oBAAoB;CAEpC;AAED;;;GAGG;AAEH,MAAM,WAAW,iBAAiB;CAEjC;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,kBAAkB,GAAG,QAAQ,GAAG,QAAQ,GAAG,iBAAiB,CAAA;AAExE;;;GAGG;AACH,MAAM,WAAW,uBAAuB;IACtC,gFAAgF;IAChF,kBAAkB,EAAE,MAAM,EAAE,CAAA;IAC5B,yEAAyE;IACzE,MAAM,EAAE,MAAM,EAAE,CAAA;CACjB"}