Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a new higher level agent package, make core lower level #2119

Open
TimoGlastra opened this issue Nov 28, 2024 · 0 comments
Open

Create a new higher level agent package, make core lower level #2119

TimoGlastra opened this issue Nov 28, 2024 · 0 comments

Comments

@TimoGlastra
Copy link
Contributor

TimoGlastra commented Nov 28, 2024

The exports from the core package are getting a bit crowded and there's a lot of imports you probably never need if you just use the agent provided modules

Some ideas:

  1. For public modules we export in the index only the public services and apis, and create a separate /internal import (@credo-ts/anoncreds/internal) for internal APIs
  2. We create a new package (let's call it agent for now, but name would be TBD) and this is the main package the end-user interacts with. If you're implementing custom plugins or protocols etc.. you would import from core still.
  3. Creating a sort of namespace structure. (see example)

2

This would also allow basically the following dependency tree:

  • agent
    • core
    • kms
      • core

It's very complex to extract a module out of core at the moment if we also want to enable that module by default in the agent. By extracting it we can split modules into separate packages while still keeping access to the all the core functionality, as well as making the modules available in the default agent.

3

import {  Kms } from '@credo-ts/core'

// namespaced entries?
Kms.CreateKeyOptions
Kms.DeleteKeyOptions

i think approach 2 / 3 both seem interesting to me (and maybe a combination of both). There's a lot of type utils that shouldn't exposed in core, but they are because extension modules depend on it.

@genaris i think this is also relevant for the work of extracting DIDComm out of core to some extent

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant