@lssm/lib.contracts 1.11.1 → 1.41.0
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/README.md +1 -1
- package/dist/_virtual/rolldown_runtime.js +1 -0
- package/dist/app-config/app-config.feature.js +1 -0
- package/dist/app-config/contracts.js +1 -1
- package/dist/app-config/docs/app-config.docblock.js +220 -0
- package/dist/app-config/events.js +1 -1
- package/dist/app-config/index.js +1 -1
- package/dist/app-config/lifecycle-contracts.js +1 -1
- package/dist/capabilities/docs/capabilities.docblock.js +1 -0
- package/dist/contract-registry/index.js +1 -0
- package/dist/contract-registry/schemas.js +1 -0
- package/dist/contract-registry/types.js +0 -0
- package/dist/data-views/docs/data-views.docblock.js +1 -0
- package/dist/docs/PUBLISHING.docblock.js +76 -0
- package/dist/docs/accessibility_wcag_compliance_specs.docblock.js +350 -0
- package/dist/docs/index.js +1 -0
- package/dist/docs/meta.docs.js +13 -0
- package/dist/docs/presentations.js +1 -0
- package/dist/docs/registry.js +1 -0
- package/dist/docs/tech/PHASE_1_QUICKSTART.docblock.js +383 -0
- package/dist/docs/tech/PHASE_2_AI_NATIVE_OPERATIONS.docblock.js +68 -0
- package/dist/docs/tech/PHASE_3_AUTO_EVOLUTION.docblock.js +140 -0
- package/dist/docs/tech/PHASE_4_PERSONALIZATION_ENGINE.docblock.js +86 -0
- package/dist/docs/tech/PHASE_5_ZERO_TOUCH_OPERATIONS.docblock.js +1 -0
- package/dist/docs/tech/auth/better-auth-nextjs.docblock.js +58 -0
- package/dist/docs/tech/contracts/README.docblock.js +1 -0
- package/dist/docs/tech/contracts/create-subscription.docblock.js +1 -0
- package/dist/docs/tech/contracts/graphql-typed-outputs.docblock.js +180 -0
- package/dist/docs/tech/contracts/migrations.docblock.js +1 -0
- package/dist/docs/tech/contracts/openapi-export.docblock.js +38 -0
- package/dist/docs/tech/contracts/ops-to-presentation-linking.docblock.js +62 -0
- package/dist/docs/tech/contracts/overlays.docblock.js +68 -0
- package/dist/docs/tech/contracts/tests.docblock.js +132 -0
- package/dist/docs/tech/contracts/themes.docblock.js +1 -0
- package/dist/docs/tech/contracts/vertical-pocket-family-office.docblock.js +106 -0
- package/dist/docs/tech/lifecycle-stage-system.docblock.js +213 -0
- package/dist/docs/tech/llm/llm-integration.docblock.js +289 -0
- package/dist/docs/tech/mcp-endpoints.docblock.js +1 -0
- package/dist/docs/tech/presentation-runtime.docblock.js +1 -0
- package/dist/docs/tech/schema/README.docblock.js +262 -0
- package/dist/docs/tech/studio/learning-events.docblock.js +1 -0
- package/dist/docs/tech/studio/learning-journeys.docblock.js +57 -0
- package/dist/docs/tech/studio/platform-admin-panel.docblock.js +63 -0
- package/dist/docs/tech/studio/project-access-teams.docblock.js +36 -0
- package/dist/docs/tech/studio/project-routing.docblock.js +1 -0
- package/dist/docs/tech/studio/sandbox-unlogged.docblock.js +20 -0
- package/dist/docs/tech/studio/team-invitations.docblock.js +65 -0
- package/dist/docs/tech/studio/workspace-ops.docblock.js +1 -0
- package/dist/docs/tech/studio/workspaces.docblock.js +41 -0
- package/dist/docs/tech/telemetry-ingest.docblock.js +122 -0
- package/dist/docs/tech/templates/runtime.docblock.js +1 -0
- package/dist/docs/tech/vscode-extension.docblock.js +68 -0
- package/dist/docs/tech/workflows/overview.docblock.js +1 -0
- package/dist/docs/tech-contracts.docs.js +76 -0
- package/dist/docs/types.js +0 -0
- package/dist/events.js +1 -1
- package/dist/experiments/docs/experiments.docblock.js +128 -0
- package/dist/forms/docs/forms.docblock.js +1 -0
- package/dist/index.js +1 -1
- package/dist/install.js +1 -1
- package/dist/integrations/contracts.js +1 -1
- package/dist/integrations/docs/integrations.docblock.js +1 -0
- package/dist/integrations/index.js +1 -1
- package/dist/integrations/openbanking/contracts/accounts.js +1 -1
- package/dist/integrations/openbanking/contracts/balances.js +1 -1
- package/dist/integrations/openbanking/contracts/index.js +1 -1
- package/dist/integrations/openbanking/contracts/transactions.js +1 -1
- package/dist/integrations/openbanking/models.js +1 -1
- package/dist/integrations/openbanking/openbanking.feature.js +1 -0
- package/dist/integrations/providers/impls/index.js +1 -1
- package/dist/integrations/providers/impls/provider-factory.js +1 -1
- package/dist/integrations/providers/index.js +1 -1
- package/dist/integrations/providers/registry.js +1 -0
- package/dist/integrations/secrets/aws-secret-manager.js +1 -0
- package/dist/integrations/secrets/gcp-secret-manager.js +1 -1
- package/dist/integrations/secrets/index.js +1 -1
- package/dist/integrations/secrets/scaleway-secret-manager.js +1 -0
- package/dist/jobs/define-job.js +1 -0
- package/dist/jobs/gcp-cloud-tasks.js +1 -1
- package/dist/jobs/gcp-pubsub.js +1 -1
- package/dist/jobs/handlers/index.js +1 -1
- package/dist/jobs/handlers/ping-handler.js +1 -0
- package/dist/jobs/index.js +1 -1
- package/dist/jobs/memory-queue.js +1 -1
- package/dist/jobs/queue.js +1 -0
- package/dist/jobs/scaleway-sqs-queue.js +1 -0
- package/dist/knowledge/contracts.js +1 -1
- package/dist/knowledge/docs/knowledge.docblock.js +138 -0
- package/dist/llm/exporters.js +8 -0
- package/dist/llm/index.js +1 -0
- package/dist/llm/prompts.js +220 -0
- package/dist/llm/types.js +0 -0
- package/dist/node_modules/@pothos/plugin-complexity/esm/calculate-complexity.js +1 -0
- package/dist/node_modules/@pothos/plugin-complexity/esm/defaults.js +1 -0
- package/dist/node_modules/@pothos/plugin-complexity/esm/index.js +1 -0
- package/dist/node_modules/@pothos/plugin-complexity/esm/types.js +1 -0
- package/dist/node_modules/@pothos/plugin-complexity/esm/util.js +1 -0
- package/dist/node_modules/@pothos/plugin-complexity/esm/validator.js +1 -0
- package/dist/node_modules/@pothos/plugin-dataloader/esm/field-builder.js +1 -0
- package/dist/node_modules/@pothos/plugin-dataloader/esm/index.js +1 -0
- package/dist/node_modules/@pothos/plugin-dataloader/esm/refs/index.js +1 -0
- package/dist/node_modules/@pothos/plugin-dataloader/esm/refs/interface.js +1 -0
- package/dist/node_modules/@pothos/plugin-dataloader/esm/refs/node.js +1 -0
- package/dist/node_modules/@pothos/plugin-dataloader/esm/refs/object.js +1 -0
- package/dist/node_modules/@pothos/plugin-dataloader/esm/refs/union.js +1 -0
- package/dist/node_modules/@pothos/plugin-dataloader/esm/schema-builder.js +1 -0
- package/dist/node_modules/@pothos/plugin-dataloader/esm/util.js +1 -0
- package/dist/node_modules/@pothos/plugin-prisma/esm/connection-helpers.js +1 -0
- package/dist/node_modules/@pothos/plugin-prisma/esm/field-builder.js +1 -0
- package/dist/node_modules/@pothos/plugin-prisma/esm/index.js +1 -0
- package/dist/node_modules/@pothos/plugin-prisma/esm/interface-ref.js +1 -0
- package/dist/node_modules/@pothos/plugin-prisma/esm/model-loader.js +1 -0
- package/dist/node_modules/@pothos/plugin-prisma/esm/node-ref.js +1 -0
- package/dist/node_modules/@pothos/plugin-prisma/esm/object-ref.js +1 -0
- package/dist/node_modules/@pothos/plugin-prisma/esm/prisma-field-builder.js +1 -0
- package/dist/node_modules/@pothos/plugin-prisma/esm/schema-builder.js +1 -0
- package/dist/node_modules/@pothos/plugin-prisma/esm/types.js +0 -0
- package/dist/node_modules/@pothos/plugin-prisma/esm/util/cursors.js +1 -0
- package/dist/node_modules/@pothos/plugin-prisma/esm/util/datamodel.js +1 -0
- package/dist/node_modules/@pothos/plugin-prisma/esm/util/deep-equal.js +1 -0
- package/dist/node_modules/@pothos/plugin-prisma/esm/util/description.js +1 -0
- package/dist/node_modules/@pothos/plugin-prisma/esm/util/get-client.js +1 -0
- package/dist/node_modules/@pothos/plugin-prisma/esm/util/loader-map.js +1 -0
- package/dist/node_modules/@pothos/plugin-prisma/esm/util/map-query.js +1 -0
- package/dist/node_modules/@pothos/plugin-prisma/esm/util/relation-map.js +1 -0
- package/dist/node_modules/@pothos/plugin-prisma/esm/util/selections.js +1 -0
- package/dist/node_modules/@pothos/plugin-prisma/esm/util/usage.js +1 -0
- package/dist/node_modules/@pothos/plugin-tracing/esm/index.js +1 -0
- package/dist/node_modules/@pothos/plugin-tracing/esm/util.js +1 -0
- package/dist/node_modules/dataloader/index.js +7 -0
- package/dist/node_modules/graphql/error/GraphQLError.js +5 -0
- package/dist/node_modules/graphql/error/index.js +1 -0
- package/dist/node_modules/graphql/error/locatedError.js +1 -0
- package/dist/node_modules/graphql/error/syntaxError.js +1 -0
- package/dist/node_modules/graphql/execution/collectFields.js +1 -0
- package/dist/node_modules/graphql/execution/execute.js +1 -0
- package/dist/node_modules/graphql/execution/index.js +1 -0
- package/dist/node_modules/graphql/execution/mapAsyncIterator.js +1 -0
- package/dist/node_modules/graphql/execution/subscribe.js +1 -0
- package/dist/node_modules/graphql/execution/values.js +1 -0
- package/dist/node_modules/graphql/graphql.js +1 -0
- package/dist/node_modules/graphql/index.js +1 -0
- package/dist/node_modules/graphql/jsutils/Path.js +1 -0
- package/dist/node_modules/graphql/jsutils/devAssert.js +1 -0
- package/dist/node_modules/graphql/jsutils/didYouMean.js +1 -0
- package/dist/node_modules/graphql/jsutils/groupBy.js +1 -0
- package/dist/node_modules/graphql/jsutils/identityFunc.js +1 -0
- package/dist/node_modules/graphql/jsutils/inspect.js +1 -0
- package/dist/node_modules/graphql/jsutils/instanceOf.js +12 -0
- package/dist/node_modules/graphql/jsutils/invariant.js +1 -0
- package/dist/node_modules/graphql/jsutils/isAsyncIterable.js +1 -0
- package/dist/node_modules/graphql/jsutils/isIterableObject.js +1 -0
- package/dist/node_modules/graphql/jsutils/isObjectLike.js +1 -0
- package/dist/node_modules/graphql/jsutils/isPromise.js +1 -0
- package/dist/node_modules/graphql/jsutils/keyMap.js +1 -0
- package/dist/node_modules/graphql/jsutils/keyValMap.js +1 -0
- package/dist/node_modules/graphql/jsutils/mapValue.js +1 -0
- package/dist/node_modules/graphql/jsutils/memoize3.js +1 -0
- package/dist/node_modules/graphql/jsutils/naturalCompare.js +1 -0
- package/dist/node_modules/graphql/jsutils/printPathArray.js +1 -0
- package/dist/node_modules/graphql/jsutils/promiseForObject.js +1 -0
- package/dist/node_modules/graphql/jsutils/promiseReduce.js +1 -0
- package/dist/node_modules/graphql/jsutils/suggestionList.js +1 -0
- package/dist/node_modules/graphql/jsutils/toError.js +1 -0
- package/dist/node_modules/graphql/jsutils/toObjMap.js +1 -0
- package/dist/node_modules/graphql/language/ast.js +1 -0
- package/dist/node_modules/graphql/language/blockString.js +3 -0
- package/dist/node_modules/graphql/language/characterClasses.js +1 -0
- package/dist/node_modules/graphql/language/directiveLocation.js +1 -0
- package/dist/node_modules/graphql/language/index.js +1 -0
- package/dist/node_modules/graphql/language/kinds.js +1 -0
- package/dist/node_modules/graphql/language/lexer.js +3 -0
- package/dist/node_modules/graphql/language/location.js +1 -0
- package/dist/node_modules/graphql/language/parser.js +1 -0
- package/dist/node_modules/graphql/language/predicates.js +1 -0
- package/dist/node_modules/graphql/language/printLocation.js +2 -0
- package/dist/node_modules/graphql/language/printString.js +1 -0
- package/dist/node_modules/graphql/language/printer.js +34 -0
- package/dist/node_modules/graphql/language/schemaCoordinateLexer.js +1 -0
- package/dist/node_modules/graphql/language/source.js +1 -0
- package/dist/node_modules/graphql/language/tokenKind.js +1 -0
- package/dist/node_modules/graphql/language/visitor.js +1 -0
- package/dist/node_modules/graphql/type/assertName.js +1 -0
- package/dist/node_modules/graphql/type/definition.js +1 -0
- package/dist/node_modules/graphql/type/directives.js +1 -0
- package/dist/node_modules/graphql/type/index.js +1 -0
- package/dist/node_modules/graphql/type/introspection.js +3 -0
- package/dist/node_modules/graphql/type/scalars.js +1 -0
- package/dist/node_modules/graphql/type/schema.js +1 -0
- package/dist/node_modules/graphql/type/validate.js +3 -0
- package/dist/node_modules/graphql/utilities/TypeInfo.js +1 -0
- package/dist/node_modules/graphql/utilities/assertValidName.js +1 -0
- package/dist/node_modules/graphql/utilities/astFromValue.js +1 -0
- package/dist/node_modules/graphql/utilities/buildASTSchema.js +1 -0
- package/dist/node_modules/graphql/utilities/buildClientSchema.js +1 -0
- package/dist/node_modules/graphql/utilities/coerceInputValue.js +1 -0
- package/dist/node_modules/graphql/utilities/concatAST.js +1 -0
- package/dist/node_modules/graphql/utilities/extendSchema.js +1 -0
- package/dist/node_modules/graphql/utilities/findBreakingChanges.js +1 -0
- package/dist/node_modules/graphql/utilities/getIntrospectionQuery.js +107 -0
- package/dist/node_modules/graphql/utilities/getOperationAST.js +1 -0
- package/dist/node_modules/graphql/utilities/getOperationRootType.js +1 -0
- package/dist/node_modules/graphql/utilities/index.js +1 -0
- package/dist/node_modules/graphql/utilities/introspectionFromSchema.js +1 -0
- package/dist/node_modules/graphql/utilities/lexicographicSortSchema.js +1 -0
- package/dist/node_modules/graphql/utilities/printSchema.js +13 -0
- package/dist/node_modules/graphql/utilities/resolveSchemaCoordinate.js +1 -0
- package/dist/node_modules/graphql/utilities/separateOperations.js +1 -0
- package/dist/node_modules/graphql/utilities/sortValueNode.js +1 -0
- package/dist/node_modules/graphql/utilities/stripIgnoredCharacters.js +1 -0
- package/dist/node_modules/graphql/utilities/typeComparators.js +1 -0
- package/dist/node_modules/graphql/utilities/typeFromAST.js +1 -0
- package/dist/node_modules/graphql/utilities/valueFromAST.js +1 -0
- package/dist/node_modules/graphql/utilities/valueFromASTUntyped.js +1 -0
- package/dist/node_modules/graphql/validation/ValidationContext.js +1 -0
- package/dist/node_modules/graphql/validation/index.js +1 -0
- package/dist/node_modules/graphql/validation/rules/ExecutableDefinitionsRule.js +1 -0
- package/dist/node_modules/graphql/validation/rules/FieldsOnCorrectTypeRule.js +1 -0
- package/dist/node_modules/graphql/validation/rules/FragmentsOnCompositeTypesRule.js +1 -0
- package/dist/node_modules/graphql/validation/rules/KnownArgumentNamesRule.js +1 -0
- package/dist/node_modules/graphql/validation/rules/KnownDirectivesRule.js +1 -0
- package/dist/node_modules/graphql/validation/rules/KnownFragmentNamesRule.js +1 -0
- package/dist/node_modules/graphql/validation/rules/KnownTypeNamesRule.js +1 -0
- package/dist/node_modules/graphql/validation/rules/LoneAnonymousOperationRule.js +1 -0
- package/dist/node_modules/graphql/validation/rules/LoneSchemaDefinitionRule.js +1 -0
- package/dist/node_modules/graphql/validation/rules/MaxIntrospectionDepthRule.js +1 -0
- package/dist/node_modules/graphql/validation/rules/NoFragmentCyclesRule.js +1 -0
- package/dist/node_modules/graphql/validation/rules/NoUndefinedVariablesRule.js +1 -0
- package/dist/node_modules/graphql/validation/rules/NoUnusedFragmentsRule.js +1 -0
- package/dist/node_modules/graphql/validation/rules/NoUnusedVariablesRule.js +1 -0
- package/dist/node_modules/graphql/validation/rules/OverlappingFieldsCanBeMergedRule.js +1 -0
- package/dist/node_modules/graphql/validation/rules/PossibleFragmentSpreadsRule.js +1 -0
- package/dist/node_modules/graphql/validation/rules/PossibleTypeExtensionsRule.js +1 -0
- package/dist/node_modules/graphql/validation/rules/ProvidedRequiredArgumentsRule.js +1 -0
- package/dist/node_modules/graphql/validation/rules/ScalarLeafsRule.js +1 -0
- package/dist/node_modules/graphql/validation/rules/SingleFieldSubscriptionsRule.js +1 -0
- package/dist/node_modules/graphql/validation/rules/UniqueArgumentDefinitionNamesRule.js +1 -0
- package/dist/node_modules/graphql/validation/rules/UniqueArgumentNamesRule.js +1 -0
- package/dist/node_modules/graphql/validation/rules/UniqueDirectiveNamesRule.js +1 -0
- package/dist/node_modules/graphql/validation/rules/UniqueDirectivesPerLocationRule.js +1 -0
- package/dist/node_modules/graphql/validation/rules/UniqueEnumValueNamesRule.js +1 -0
- package/dist/node_modules/graphql/validation/rules/UniqueFieldDefinitionNamesRule.js +1 -0
- package/dist/node_modules/graphql/validation/rules/UniqueFragmentNamesRule.js +1 -0
- package/dist/node_modules/graphql/validation/rules/UniqueInputFieldNamesRule.js +1 -0
- package/dist/node_modules/graphql/validation/rules/UniqueOperationNamesRule.js +1 -0
- package/dist/node_modules/graphql/validation/rules/UniqueOperationTypesRule.js +1 -0
- package/dist/node_modules/graphql/validation/rules/UniqueTypeNamesRule.js +1 -0
- package/dist/node_modules/graphql/validation/rules/UniqueVariableNamesRule.js +1 -0
- package/dist/node_modules/graphql/validation/rules/ValuesOfCorrectTypeRule.js +1 -0
- package/dist/node_modules/graphql/validation/rules/VariablesAreInputTypesRule.js +1 -0
- package/dist/node_modules/graphql/validation/rules/VariablesInAllowedPositionRule.js +1 -0
- package/dist/node_modules/graphql/validation/rules/custom/NoDeprecatedCustomRule.js +1 -0
- package/dist/node_modules/graphql/validation/rules/custom/NoSchemaIntrospectionCustomRule.js +1 -0
- package/dist/node_modules/graphql/validation/specifiedRules.js +1 -0
- package/dist/node_modules/graphql/validation/validate.js +5 -0
- package/dist/node_modules/graphql/version.js +1 -0
- package/dist/onboarding-base.js +1 -1
- package/dist/openapi.js +1 -0
- package/dist/openbanking/docs/openbanking.docblock.js +109 -0
- package/dist/policy/docs/policy.docblock.js +1 -0
- package/dist/presentations/docs/presentations-conventions.docblock.js +8 -0
- package/dist/presentations.js +1 -1
- package/dist/presentations.v2.js +7 -1
- package/dist/prompt.js +1 -1
- package/dist/promptRegistry.js +1 -1
- package/dist/regenerator/docs/regenerator.docblock.js +184 -0
- package/dist/registry.js +1 -1
- package/dist/resources.js +1 -1
- package/dist/schema-to-markdown.js +10 -0
- package/dist/server/graphql-pothos.js +1 -1
- package/dist/server/index.js +1 -1
- package/dist/server/mcp/createMcpServer.js +1 -0
- package/dist/server/mcp/mcpTypes.js +0 -0
- package/dist/server/mcp/registerPresentations.js +1 -0
- package/dist/server/mcp/registerPrompts.js +3 -0
- package/dist/server/mcp/registerResources.js +1 -0
- package/dist/server/mcp/registerTools.js +1 -0
- package/dist/server/provider-mcp.js +1 -1
- package/dist/telemetry/docs/telemetry.docblock.js +139 -0
- package/package.json +353 -193
- package/dist/app-config/branding.d.ts +0 -55
- package/dist/app-config/contracts.d.ts +0 -244
- package/dist/app-config/events.d.ts +0 -122
- package/dist/app-config/index.d.ts +0 -8
- package/dist/app-config/lifecycle-contracts.d.ts +0 -382
- package/dist/app-config/lifecycle.d.ts +0 -27
- package/dist/app-config/runtime.d.ts +0 -114
- package/dist/app-config/spec.d.ts +0 -175
- package/dist/app-config/validation.d.ts +0 -47
- package/dist/capabilities/openbanking.d.ts +0 -9
- package/dist/capabilities.d.ts +0 -45
- package/dist/client/index.d.ts +0 -6
- package/dist/client/react/drivers/rn-reusables.d.ts +0 -22
- package/dist/client/react/drivers/shadcn.d.ts +0 -12
- package/dist/client/react/feature-render.d.ts +0 -20
- package/dist/client/react/form-render.d.ts +0 -91
- package/dist/client/react/index.d.ts +0 -5
- package/dist/contracts-adapter-hydration.d.ts +0 -15
- package/dist/contracts-adapter-input.d.ts +0 -10
- package/dist/data-views/query-generator.d.ts +0 -39
- package/dist/data-views/runtime.d.ts +0 -26
- package/dist/data-views.d.ts +0 -131
- package/dist/events.d.ts +0 -44
- package/dist/experiments/evaluator.d.ts +0 -37
- package/dist/experiments/spec-resolver.d.ts +0 -16
- package/dist/experiments/spec.d.ts +0 -89
- package/dist/features.d.ts +0 -87
- package/dist/forms.d.ts +0 -258
- package/dist/graphql-federation/dist/index.js +0 -1
- package/dist/index.d.ts +0 -130
- package/dist/install.d.ts +0 -76
- package/dist/integrations/binding.d.ts +0 -17
- package/dist/integrations/connection.d.ts +0 -51
- package/dist/integrations/contracts.d.ts +0 -435
- package/dist/integrations/health.d.ts +0 -21
- package/dist/integrations/index.d.ts +0 -53
- package/dist/integrations/openbanking/contracts/accounts.d.ts +0 -287
- package/dist/integrations/openbanking/contracts/balances.d.ts +0 -163
- package/dist/integrations/openbanking/contracts/index.d.ts +0 -9
- package/dist/integrations/openbanking/contracts/transactions.d.ts +0 -211
- package/dist/integrations/openbanking/guards.d.ts +0 -12
- package/dist/integrations/openbanking/models.d.ts +0 -228
- package/dist/integrations/openbanking/telemetry.d.ts +0 -15
- package/dist/integrations/providers/calendar.d.ts +0 -78
- package/dist/integrations/providers/elevenlabs.d.ts +0 -7
- package/dist/integrations/providers/email.d.ts +0 -86
- package/dist/integrations/providers/embedding.d.ts +0 -24
- package/dist/integrations/providers/gcs-storage.d.ts +0 -7
- package/dist/integrations/providers/gmail.d.ts +0 -7
- package/dist/integrations/providers/google-calendar.d.ts +0 -7
- package/dist/integrations/providers/impls/elevenlabs-voice.d.ts +0 -20
- package/dist/integrations/providers/impls/gcs-storage.d.ts +0 -24
- package/dist/integrations/providers/impls/gmail-inbound.d.ts +0 -26
- package/dist/integrations/providers/impls/gmail-outbound.d.ts +0 -18
- package/dist/integrations/providers/impls/google-calendar.d.ts +0 -23
- package/dist/integrations/providers/impls/index.d.ts +0 -15
- package/dist/integrations/providers/impls/mistral-embedding.d.ts +0 -23
- package/dist/integrations/providers/impls/mistral-llm.d.ts +0 -31
- package/dist/integrations/providers/impls/postmark-email.d.ts +0 -19
- package/dist/integrations/providers/impls/powens-client.d.ts +0 -124
- package/dist/integrations/providers/impls/powens-openbanking.d.ts +0 -27
- package/dist/integrations/providers/impls/provider-factory.d.ts +0 -26
- package/dist/integrations/providers/impls/qdrant-vector.d.ts +0 -24
- package/dist/integrations/providers/impls/stripe-payments.d.ts +0 -28
- package/dist/integrations/providers/impls/twilio-sms.d.ts +0 -20
- package/dist/integrations/providers/index.d.ts +0 -36
- package/dist/integrations/providers/llm.d.ts +0 -82
- package/dist/integrations/providers/mistral.d.ts +0 -7
- package/dist/integrations/providers/openbanking.d.ts +0 -128
- package/dist/integrations/providers/payments.d.ts +0 -109
- package/dist/integrations/providers/postmark.d.ts +0 -7
- package/dist/integrations/providers/powens.d.ts +0 -7
- package/dist/integrations/providers/qdrant.d.ts +0 -7
- package/dist/integrations/providers/sms.d.ts +0 -34
- package/dist/integrations/providers/storage.d.ts +0 -60
- package/dist/integrations/providers/stripe.d.ts +0 -7
- package/dist/integrations/providers/twilio-sms.d.ts +0 -7
- package/dist/integrations/providers/vector-store.d.ts +0 -43
- package/dist/integrations/providers/voice.d.ts +0 -34
- package/dist/integrations/runtime.d.ts +0 -99
- package/dist/integrations/secrets/env-secret-provider.d.ts +0 -31
- package/dist/integrations/secrets/gcp-secret-manager.d.ts +0 -32
- package/dist/integrations/secrets/index.d.ts +0 -5
- package/dist/integrations/secrets/manager.d.ts +0 -47
- package/dist/integrations/secrets/provider.d.ts +0 -52
- package/dist/integrations/spec.d.ts +0 -79
- package/dist/jobs/gcp-cloud-tasks.d.ts +0 -41
- package/dist/jobs/gcp-pubsub.d.ts +0 -25
- package/dist/jobs/handlers/gmail-sync-handler.d.ts +0 -9
- package/dist/jobs/handlers/index.d.ts +0 -3
- package/dist/jobs/handlers/storage-document-handler.d.ts +0 -12
- package/dist/jobs/index.d.ts +0 -7
- package/dist/jobs/memory-queue.d.ts +0 -18
- package/dist/jobs/queue.d.ts +0 -26
- package/dist/jsonschema.d.ts +0 -26
- package/dist/knowledge/binding.d.ts +0 -25
- package/dist/knowledge/contracts.d.ts +0 -316
- package/dist/knowledge/index.d.ts +0 -10
- package/dist/knowledge/ingestion/document-processor.d.ts +0 -24
- package/dist/knowledge/ingestion/embedding-service.d.ts +0 -12
- package/dist/knowledge/ingestion/gmail-adapter.d.ts +0 -18
- package/dist/knowledge/ingestion/index.d.ts +0 -6
- package/dist/knowledge/ingestion/storage-adapter.d.ts +0 -15
- package/dist/knowledge/ingestion/vector-indexer.d.ts +0 -18
- package/dist/knowledge/query/index.d.ts +0 -2
- package/dist/knowledge/query/service.d.ts +0 -29
- package/dist/knowledge/runtime.d.ts +0 -32
- package/dist/knowledge/source.d.ts +0 -32
- package/dist/knowledge/spaces/email-threads.d.ts +0 -7
- package/dist/knowledge/spaces/financial-docs.d.ts +0 -7
- package/dist/knowledge/spaces/financial-overview.d.ts +0 -7
- package/dist/knowledge/spaces/index.d.ts +0 -7
- package/dist/knowledge/spaces/product-canon.d.ts +0 -7
- package/dist/knowledge/spaces/support-faq.d.ts +0 -7
- package/dist/knowledge/spaces/uploaded-docs.d.ts +0 -7
- package/dist/knowledge/spec.d.ts +0 -52
- package/dist/markdown.d.ts +0 -21
- package/dist/migrations.d.ts +0 -52
- package/dist/onboarding-base.d.ts +0 -137
- package/dist/ownership.d.ts +0 -75
- package/dist/policy/engine.d.ts +0 -39
- package/dist/policy/opa-adapter.d.ts +0 -45
- package/dist/policy/spec.d.ts +0 -114
- package/dist/presentations.backcompat.d.ts +0 -7
- package/dist/presentations.d.ts +0 -96
- package/dist/presentations.v2.d.ts +0 -95
- package/dist/prompt.d.ts +0 -60
- package/dist/promptRegistry.d.ts +0 -15
- package/dist/regenerator/adapters.d.ts +0 -19
- package/dist/regenerator/executor.d.ts +0 -70
- package/dist/regenerator/index.d.ts +0 -7
- package/dist/regenerator/service.d.ts +0 -33
- package/dist/regenerator/sinks.d.ts +0 -26
- package/dist/regenerator/types.d.ts +0 -107
- package/dist/regenerator/utils.d.ts +0 -9
- package/dist/registry.d.ts +0 -72
- package/dist/resources.d.ts +0 -64
- package/dist/schema/dist/EnumType.js +0 -1
- package/dist/schema/dist/FieldType.js +0 -1
- package/dist/schema/dist/ScalarTypeEnum.js +0 -1
- package/dist/schema/dist/SchemaModel.js +0 -1
- package/dist/schema/dist/index.js +0 -1
- package/dist/server/graphql-pothos.d.ts +0 -31
- package/dist/server/graphql-schema-export.d.ts +0 -6
- package/dist/server/graphql-schema-export.js +0 -1
- package/dist/server/index.d.ts +0 -9
- package/dist/server/provider-mcp.d.ts +0 -51
- package/dist/server/rest-elysia.d.ts +0 -40
- package/dist/server/rest-express.d.ts +0 -16
- package/dist/server/rest-generic.d.ts +0 -32
- package/dist/server/rest-next-app.d.ts +0 -35
- package/dist/server/rest-next-mcp.d.ts +0 -11
- package/dist/server/rest-next-pages.d.ts +0 -9
- package/dist/spec.d.ts +0 -171
- package/dist/telemetry/anomaly.d.ts +0 -27
- package/dist/telemetry/index.d.ts +0 -4
- package/dist/telemetry/spec.d.ts +0 -98
- package/dist/telemetry/tracker.d.ts +0 -51
- package/dist/tests/index.d.ts +0 -3
- package/dist/tests/runner.d.ts +0 -43
- package/dist/tests/spec.d.ts +0 -89
- package/dist/themes.d.ts +0 -55
- package/dist/translations/catalog.d.ts +0 -28
- package/dist/translations/tenant.d.ts +0 -15
- package/dist/types/all.d.ts +0 -60
- package/dist/types.d.ts +0 -88
- package/dist/workflow/adapters/db-adapter.d.ts +0 -34
- package/dist/workflow/adapters/file-adapter.d.ts +0 -14
- package/dist/workflow/adapters/index.d.ts +0 -4
- package/dist/workflow/adapters/memory-store.d.ts +0 -18
- package/dist/workflow/expression.d.ts +0 -9
- package/dist/workflow/index.d.ts +0 -10
- package/dist/workflow/runner.d.ts +0 -74
- package/dist/workflow/sla-monitor.d.ts +0 -20
- package/dist/workflow/spec.d.ts +0 -99
- package/dist/workflow/state.d.ts +0 -35
- package/dist/workflow/validation.d.ts +0 -28
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{defineCommand as e,defineQuery as t}from"../../../spec.js";import{AccountBalanceRecord as n}from"../models.js";import{OPENBANKING_TELEMETRY_EVENTS as r}from"../telemetry.js";import{ScalarTypeEnum as i,SchemaModel as a}from"@lssm/lib.schema";const o=new a({name:`OpenBankingGetBalancesInput`,description:`Parameters for retrieving bank account balances from the canonical ledger.`,fields:{tenantId:{type:i.ID(),isOptional:!1},accountId:{type:i.ID(),isOptional:!1},balanceTypes:{type:i.String_unsecure(),isArray:!0,isOptional:!0}}}),s=new a({name:`OpenBankingGetBalancesOutput`,description:`Canonical balances for a bank account.`,fields:{balances:{type:n,isOptional:!1,isArray:!0},asOf:{type:i.DateTime(),isOptional:!0}}}),c=new a({name:`OpenBankingRefreshBalancesInput`,description:`Command payload to refresh balances for a bank account via the open banking provider.`,fields:{tenantId:{type:i.ID(),isOptional:!1},accountId:{type:i.ID(),isOptional:!1},connectionId:{type:i.ID(),isOptional:!0},balanceTypes:{type:i.String_unsecure(),isArray:!0,isOptional:!0},forceRefresh:{type:i.Boolean(),isOptional:!0}}}),l=new a({name:`OpenBankingRefreshBalancesOutput`,description:`Result of a balance refresh against the open banking provider.`,fields:{balances:{type:n,isOptional:!1,isArray:!0},refreshedAt:{type:i.DateTime(),isOptional:!1},errors:{type:i.String_unsecure(),isArray:!0,isOptional:!0}}}),u=t({meta:{name:`openbanking.balances.get`,version:1,description:`Retrieve the latest cached balances for a bank account.`,goal:`Expose current and available balances required by dashboards and analytics.`,context:`Used by Pocket Family Office UI surfaces and automation steps that require balance totals prior to generating summaries.`,owners:[`platform.finance`],tags:[`open-banking`,`powens`,`balances`],stability:`experimental`},io:{input:o,output:s},policy:{auth:`user`}}),d=e({meta:{name:`openbanking.balances.refresh`,version:1,description:`Refresh balances for a bank account via the configured open banking provider.`,goal:`Ensure canonical balance records reflect the latest values from Powens.`,context:`Triggered by scheduled workflows before generating summaries or forecasting cashflow.`,owners:[`platform.finance`],tags:[`open-banking`,`powens`,`balances`],stability:`experimental`},io:{input:c,output:l},policy:{auth:`admin`},telemetry:{success:{event:{name:r.balancesRefreshed},properties:({input:e,output:t})=>{let n=e,r=t;return{tenantId:n?.tenantId,accountId:n?.accountId,refreshedAt:r?.refreshedAt,balanceCount:Array.isArray(r?.balances)?r?.balances.length:void 0}}},failure:{event:{name:r.balancesRefreshFailed},properties:({input:e,error:t})=>{let n=e;return{tenantId:n?.tenantId,accountId:n?.accountId,error:t instanceof Error?t.message:String(t??`unknown`)}}}}}),f={OpenBankingGetBalances:u,OpenBankingRefreshBalances:d};function p(e){return e.register(u).register(d)}export{u as OpenBankingGetBalances,d as OpenBankingRefreshBalances,f as openBankingBalanceContracts,p as registerOpenBankingBalanceContracts};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{OpenBankingGetAccount as e,OpenBankingListAccounts as t,OpenBankingSyncAccounts as n,registerOpenBankingAccountContracts as r}from"./accounts.js";import{OpenBankingListTransactions as i,OpenBankingSyncTransactions as a,registerOpenBankingTransactionContracts as o}from"./transactions.js";import{OpenBankingGetBalances as s,OpenBankingRefreshBalances as c,registerOpenBankingBalanceContracts as l}from"./balances.js";function
|
|
1
|
+
import{OpenBankingGetAccount as e,OpenBankingListAccounts as t,OpenBankingSyncAccounts as n,registerOpenBankingAccountContracts as r}from"./accounts.js";import{OpenBankingListTransactions as i,OpenBankingSyncTransactions as a,registerOpenBankingTransactionContracts as o}from"./transactions.js";import{OpenBankingGetBalances as s,OpenBankingRefreshBalances as c,registerOpenBankingBalanceContracts as l}from"./balances.js";import{OpenBankingFeature as u}from"../openbanking.feature.js";function d(e){return l(o(r(e)))}export{u as OpenBankingFeature,e as OpenBankingGetAccount,s as OpenBankingGetBalances,t as OpenBankingListAccounts,i as OpenBankingListTransactions,c as OpenBankingRefreshBalances,n as OpenBankingSyncAccounts,a as OpenBankingSyncTransactions,d as registerOpenBankingContracts};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{defineCommand as e,defineQuery as t}from"../../../spec.js";import{BankTransactionRecord as n}from"../models.js";import{OPENBANKING_TELEMETRY_EVENTS as r}from"../telemetry.js";import{ScalarTypeEnum as i,SchemaModel as a}from"@lssm/lib.schema";const o=new a({name:`OpenBankingListTransactionsInput`,description:`Parameters for listing bank transactions from the canonical ledger.`,fields:{tenantId:{type:i.ID(),isOptional:!1},accountId:{type:i.ID(),isOptional:!1},from:{type:i.DateTime(),isOptional:!0},to:{type:i.DateTime(),isOptional:!0},cursor:{type:i.String_unsecure(),isOptional:!0},pageSize:{type:i.Int_unsecure(),isOptional:!0},direction:{type:i.String_unsecure(),isOptional:!0},minimumAmount:{type:i.Float_unsecure(),isOptional:!0},maximumAmount:{type:i.Float_unsecure(),isOptional:!0},category:{type:i.String_unsecure(),isOptional:!0}}}),s=new a({name:`OpenBankingListTransactionsOutput`,description:`Paginated list of transactions for a bank account.`,fields:{transactions:{type:n,isOptional:!1,isArray:!0},nextCursor:{type:i.String_unsecure(),isOptional:!0},hasMore:{type:i.Boolean(),isOptional:!0}}}),c=new a({name:`OpenBankingSyncTransactionsInput`,description:`Command payload to synchronise transactions from the open banking provider into the canonical ledger.`,fields:{tenantId:{type:i.ID(),isOptional:!1},accountId:{type:i.ID(),isOptional:!1},from:{type:i.DateTime(),isOptional:!0},to:{type:i.DateTime(),isOptional:!0},connectionId:{type:i.ID(),isOptional:!0},includePending:{type:i.Boolean(),isOptional:!0},backfillDays:{type:i.Int_unsecure(),isOptional:!0}}}),l=new a({name:`OpenBankingSyncTransactionsOutput`,description:`Result of a transaction synchronisation run.`,fields:{synced:{type:i.Int_unsecure(),isOptional:!1},failed:{type:i.Int_unsecure(),isOptional:!1},earliestSyncedAt:{type:i.DateTime(),isOptional:!0},latestSyncedAt:{type:i.DateTime(),isOptional:!0},nextSinceToken:{type:i.String_unsecure(),isOptional:!0},errors:{type:i.String_unsecure(),isArray:!0,isOptional:!0}}}),u=t({meta:{name:`openbanking.transactions.list`,version:1,description:`List bank transactions that have been normalised into the canonical ledger.`,goal:`Allow downstream analytics and UI surfaces to page through canonical bank transactions.`,context:`Used by Pocket Family Office dashboards, reconciliation workflows, and analytics data views.`,owners:[`platform.finance`],tags:[`open-banking`,`powens`,`transactions`],stability:`experimental`},io:{input:o,output:s},policy:{auth:`user`}}),d=e({meta:{name:`openbanking.transactions.sync`,version:1,description:`Synchronise transactions for a bank account by calling the configured open banking provider.`,goal:`Ensure the canonical transaction ledger stays aligned with the external provider.`,context:`Triggered by scheduled workflows or on-demand actions when activity is expected on an account.`,owners:[`platform.finance`],tags:[`open-banking`,`powens`,`transactions`],stability:`experimental`},io:{input:c,output:l},policy:{auth:`admin`},telemetry:{success:{event:{name:r.transactionsSynced},properties:({input:e,output:t})=>{let n=e,r=t;return{tenantId:n?.tenantId,accountId:n?.accountId,synced:r?.synced,failed:r?.failed,earliestSyncedAt:r?.earliestSyncedAt,latestSyncedAt:r?.latestSyncedAt}}},failure:{event:{name:r.transactionsSyncFailed},properties:({input:e,error:t})=>{let n=e;return{tenantId:n?.tenantId,accountId:n?.accountId,error:t instanceof Error?t.message:String(t??`unknown`)}}}}}),f={OpenBankingListTransactions:u,OpenBankingSyncTransactions:d};function p(e){return e.register(u).register(d)}export{u as OpenBankingListTransactions,d as OpenBankingSyncTransactions,f as openBankingTransactionContracts,p as registerOpenBankingTransactionContracts};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{ScalarTypeEnum as e,SchemaModel as t}from"@lssm/lib.schema";const n=new t({name:`BankAccountRecord`,description:`Canonical representation of a bank account synced from an open banking provider.`,fields:{id:{type:e.ID(),isOptional:!1},tenantId:{type:e.ID(),isOptional:!1},userId:{type:e.ID(),isOptional:!1},connectionId:{type:e.ID(),isOptional:!1},externalId:{type:e.NonEmptyString(),isOptional:!1},institutionId:{type:e.NonEmptyString(),isOptional:!1},institutionName:{type:e.NonEmptyString(),isOptional:!1},institutionLogoUrl:{type:e.URL(),isOptional:!0},iban:{type:e.String_unsecure(),isOptional:!0},bic:{type:e.String_unsecure(),isOptional:!0},accountType:{type:e.NonEmptyString(),isOptional:!1},currency:{type:e.Currency(),isOptional:!1},displayName:{type:e.NonEmptyString(),isOptional:!1},accountNumberMasked:{type:e.String_unsecure(),isOptional:!0},productCode:{type:e.String_unsecure(),isOptional:!0},balance:{type:e.Float_unsecure(),isOptional:!0},availableBalance:{type:e.Float_unsecure(),isOptional:!0},lastSyncedAt:{type:e.DateTime(),isOptional:!1},createdAt:{type:e.DateTime(),isOptional:!1},updatedAt:{type:e.DateTime(),isOptional:!1},metadata:{type:e.JSONObject(),isOptional:!0}}}),r=new t({name:`BankTransactionRecord`,description:`Canonical transaction entry mapped from Powens into the open banking ledger.`,fields:{id:{type:e.ID(),isOptional:!1},accountId:{type:e.ID(),isOptional:!1},tenantId:{type:e.ID(),isOptional:!1},connectionId:{type:e.ID(),isOptional:!1},externalId:{type:e.NonEmptyString(),isOptional:!1},amount:{type:e.Float_unsecure(),isOptional:!1},currency:{type:e.Currency(),isOptional:!1},date:{type:e.DateTime(),isOptional:!1},bookingDate:{type:e.DateTime(),isOptional:!0},valueDate:{type:e.DateTime(),isOptional:!0},description:{type:e.String_unsecure(),isOptional:!0},counterpartyName:{type:e.String_unsecure(),isOptional:!0},counterpartyAccount:{type:e.String_unsecure(),isOptional:!0},merchantCategoryCode:{type:e.String_unsecure(),isOptional:!0},rawCategory:{type:e.String_unsecure(),isOptional:!0},standardizedCategory:{type:e.String_unsecure(),isOptional:!0},transactionType:{type:e.NonEmptyString(),isOptional:!1},status:{type:e.NonEmptyString(),isOptional:!1},runningBalance:{type:e.Float_unsecure(),isOptional:!0},metadata:{type:e.JSONObject(),isOptional:!0},createdAt:{type:e.DateTime(),isOptional:!1},updatedAt:{type:e.DateTime(),isOptional:!1}}}),i=new t({name:`AccountBalanceRecord`,description:`Canonical balance snapshot computed from Powens balance payloads.`,fields:{id:{type:e.ID(),isOptional:!1},accountId:{type:e.ID(),isOptional:!1},tenantId:{type:e.ID(),isOptional:!1},connectionId:{type:e.ID(),isOptional:!1},balanceType:{type:e.NonEmptyString(),isOptional:!1},currentBalance:{type:e.Float_unsecure(),isOptional:!1},availableBalance:{type:e.Float_unsecure(),isOptional:!0},currency:{type:e.Currency(),isOptional:!1},lastUpdatedAt:{type:e.DateTime(),isOptional:!1},createdAt:{type:e.DateTime(),isOptional:!1},metadata:{type:e.JSONObject(),isOptional:!0}}});export{i as AccountBalanceRecord,n as BankAccountRecord,r as BankTransactionRecord};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e={meta:{key:`openbanking`,title:`Open Banking Integration`,description:`Open banking account sync, balance refresh, and transaction synchronization`,domain:`integrations`,owners:[`@platform.finance`],tags:[`open-banking`,`powens`,`finance`,`banking`],stability:`experimental`},operations:[{name:`openbanking.accounts.sync`,version:1},{name:`openbanking.accounts.list`,version:1},{name:`openbanking.accounts.get`,version:1},{name:`openbanking.balances.refresh`,version:1},{name:`openbanking.balances.get`,version:1},{name:`openbanking.transactions.sync`,version:1},{name:`openbanking.transactions.list`,version:1}],events:[],presentations:[],opToPresentation:[],presentationsTargets:[],capabilities:{provides:[{key:`openbanking`,version:1}],requires:[{key:`identity`,version:1}]}};export{e as OpenBankingFeature};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{ElevenLabsVoiceProvider as e}from"./elevenlabs-voice.js";import{GoogleCloudStorageProvider as t}from"./gcs-storage.js";import{GmailInboundProvider as n}from"./gmail-inbound.js";import{GmailOutboundProvider as r}from"./gmail-outbound.js";import{GoogleCalendarProvider as i}from"./google-calendar.js";import{MistralLLMProvider as a}from"./mistral-llm.js";import{MistralEmbeddingProvider as o}from"./mistral-embedding.js";import{QdrantVectorProvider as s}from"./qdrant-vector.js";import{StripePaymentsProvider as c}from"./stripe-payments.js";import{PostmarkEmailProvider as l}from"./postmark-email.js";import{TwilioSmsProvider as u}from"./twilio-sms.js";import{PowensClient as d,PowensClientError as f}from"./powens-client.js";import{PowensOpenBankingProvider as p}from"./powens-openbanking.js";import{IntegrationProviderFactory as m}from"./provider-factory.js";export{e as ElevenLabsVoiceProvider,n as GmailInboundProvider,r as GmailOutboundProvider,i as GoogleCalendarProvider,t as GoogleCloudStorageProvider,m as IntegrationProviderFactory,o as MistralEmbeddingProvider,a as MistralLLMProvider,l as PostmarkEmailProvider,d as PowensClient,f as PowensClientError,p as PowensOpenBankingProvider,s as QdrantVectorProvider,c as StripePaymentsProvider,u as TwilioSmsProvider};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{ElevenLabsVoiceProvider as e}from"./elevenlabs-voice.js";import{GoogleCloudStorageProvider as t}from"./gcs-storage.js";import{MistralLLMProvider as n}from"./mistral-llm.js";import{MistralEmbeddingProvider as r}from"./mistral-embedding.js";import{QdrantVectorProvider as i}from"./qdrant-vector.js";import{StripePaymentsProvider as a}from"./stripe-payments.js";import{PostmarkEmailProvider as o}from"./postmark-email.js";import{TwilioSmsProvider as s}from"./twilio-sms.js";import{PowensOpenBankingProvider as c}from"./powens-openbanking.js";import{Buffer as l}from"node:buffer";const u=new Map;var d=class{async createPaymentsProvider(e){let t=await this.loadSecrets(e);switch(e.spec.meta.key){case`payments.stripe`:return new a({apiKey:p(t,`apiKey`,`Stripe API key is required`)});default:throw Error(`Unsupported payments integration: ${e.spec.meta.key}`)}}async createEmailOutboundProvider(e){let t=await this.loadSecrets(e);switch(e.spec.meta.key){case`email.postmark`:return new o({serverToken:p(t,`serverToken`,`Postmark server token is required`),defaultFromEmail:e.config.fromEmail,messageStream:e.config.messageStream});default:throw Error(`Unsupported email integration: ${e.spec.meta.key}`)}}async createSmsProvider(e){let t=await this.loadSecrets(e);switch(e.spec.meta.key){case`sms.twilio`:return new s({accountSid:p(t,`accountSid`,`Twilio account SID is required`),authToken:p(t,`authToken`,`Twilio auth token is required`),fromNumber:e.config.fromNumber});default:throw Error(`Unsupported SMS integration: ${e.spec.meta.key}`)}}async createVectorStoreProvider(e){let t=await this.loadSecrets(e);switch(e.spec.meta.key){case`vectordb.qdrant`:return new i({url:m(e,`apiUrl`,`Qdrant apiUrl config is required`),apiKey:t.apiKey});default:throw Error(`Unsupported vector store integration: ${e.spec.meta.key}`)}}async createObjectStorageProvider(e){let n=await this.loadSecrets(e);switch(e.spec.meta.key){case`storage.s3`:case`storage.gcs`:return new t({bucket:m(e,`bucket`,`Storage bucket is required`),clientOptions:n.type===`service_account`?{credentials:n}:void 0});default:throw Error(`Unsupported storage integration: ${e.spec.meta.key}`)}}async createVoiceProvider(t){let n=await this.loadSecrets(t);switch(t.spec.meta.key){case`ai-voice.elevenlabs`:return new e({apiKey:p(n,`apiKey`,`ElevenLabs API key is required`),defaultVoiceId:t.config.defaultVoiceId});default:throw Error(`Unsupported voice integration: ${t.spec.meta.key}`)}}async createLlmProvider(e){let t=await this.loadSecrets(e);switch(e.spec.meta.key){case`ai-llm.mistral`:return new n({apiKey:p(t,`apiKey`,`Mistral API key is required`),defaultModel:e.config.model});default:throw Error(`Unsupported LLM integration: ${e.spec.meta.key}`)}}async createEmbeddingProvider(e){let t=await this.loadSecrets(e);switch(e.spec.meta.key){case`ai-llm.mistral`:return new r({apiKey:p(t,`apiKey`,`Mistral API key is required`),defaultModel:e.config.embeddingModel});default:throw Error(`Unsupported embeddings integration: ${e.spec.meta.key}`)}}async createOpenBankingProvider(e){let t=await this.loadSecrets(e),n=e.config;switch(e.spec.meta.key){case`openbanking.powens`:{let r=m(e,`environment`,`Powens environment (sandbox | production) must be specified in integration config.`);if(r!==`sandbox`&&r!==`production`)throw Error(`Powens environment "${r}" is invalid. Expected "sandbox" or "production".`);return new c({clientId:p(t,`clientId`,`Powens clientId is required`),clientSecret:p(t,`clientSecret`,`Powens clientSecret is required`),apiKey:t.apiKey,environment:r,baseUrl:n?.baseUrl})}default:throw Error(`Unsupported open banking integration: ${e.spec.meta.key}`)}}async loadSecrets(e){let t=e.connection.meta.id;if(u.has(t))return u.get(t);let n=f(await e.secretProvider.getSecret(e.secretReference));return u.set(t,n),n}};function f(e){let t=l.from(e.data).toString(`utf-8`).trim();if(!t)return{};try{return JSON.parse(t)}catch{return{apiKey:t}}}function p(e,t,n){let r=e[t];if(r==null||r===``)throw Error(n);return r}function m(e,t,n){let r=e.config?.[t];if(r==null)throw Error(n);return r}export{d as IntegrationProviderFactory};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{registerStripeIntegration as e,stripeIntegrationSpec as t}from"./stripe.js";import{postmarkIntegrationSpec as n,registerPostmarkIntegration as r}from"./postmark.js";import{qdrantIntegrationSpec as i,registerQdrantIntegration as a}from"./qdrant.js";import{mistralIntegrationSpec as o,registerMistralIntegration as s}from"./mistral.js";import{elevenLabsIntegrationSpec as c,registerElevenLabsIntegration as l}from"./elevenlabs.js";import{gmailIntegrationSpec as u,registerGmailIntegration as d}from"./gmail.js";import{googleCalendarIntegrationSpec as f,registerGoogleCalendarIntegration as p}from"./google-calendar.js";import{registerTwilioSmsIntegration as m,twilioSmsIntegrationSpec as h}from"./twilio-sms.js";import{gcsStorageIntegrationSpec as g,registerGcsStorageIntegration as _}from"./gcs-storage.js";import{powensIntegrationSpec as v,registerPowensIntegration as y}from"./powens.js";import{
|
|
1
|
+
import{registerStripeIntegration as e,stripeIntegrationSpec as t}from"./stripe.js";import{postmarkIntegrationSpec as n,registerPostmarkIntegration as r}from"./postmark.js";import{qdrantIntegrationSpec as i,registerQdrantIntegration as a}from"./qdrant.js";import{mistralIntegrationSpec as o,registerMistralIntegration as s}from"./mistral.js";import{elevenLabsIntegrationSpec as c,registerElevenLabsIntegration as l}from"./elevenlabs.js";import{gmailIntegrationSpec as u,registerGmailIntegration as d}from"./gmail.js";import{googleCalendarIntegrationSpec as f,registerGoogleCalendarIntegration as p}from"./google-calendar.js";import{registerTwilioSmsIntegration as m,twilioSmsIntegrationSpec as h}from"./twilio-sms.js";import{gcsStorageIntegrationSpec as g,registerGcsStorageIntegration as _}from"./gcs-storage.js";import{powensIntegrationSpec as v,registerPowensIntegration as y}from"./powens.js";import{createDefaultIntegrationSpecRegistry as b}from"./registry.js";export{b as createDefaultIntegrationSpecRegistry,c as elevenLabsIntegrationSpec,g as gcsStorageIntegrationSpec,u as gmailIntegrationSpec,f as googleCalendarIntegrationSpec,o as mistralIntegrationSpec,n as postmarkIntegrationSpec,v as powensIntegrationSpec,i as qdrantIntegrationSpec,l as registerElevenLabsIntegration,_ as registerGcsStorageIntegration,d as registerGmailIntegration,p as registerGoogleCalendarIntegration,s as registerMistralIntegration,r as registerPostmarkIntegration,y as registerPowensIntegration,a as registerQdrantIntegration,e as registerStripeIntegration,m as registerTwilioSmsIntegration,t as stripeIntegrationSpec,h as twilioSmsIntegrationSpec};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{IntegrationSpecRegistry as e}from"../spec.js";import{registerStripeIntegration as t}from"./stripe.js";import{registerPostmarkIntegration as n}from"./postmark.js";import{registerQdrantIntegration as r}from"./qdrant.js";import{registerMistralIntegration as i}from"./mistral.js";import{registerElevenLabsIntegration as a}from"./elevenlabs.js";import{registerGmailIntegration as o}from"./gmail.js";import{registerGoogleCalendarIntegration as s}from"./google-calendar.js";import{registerTwilioSmsIntegration as c}from"./twilio-sms.js";import{registerGcsStorageIntegration as l}from"./gcs-storage.js";import{registerPowensIntegration as u}from"./powens.js";function d(){let d=new e;return t(d),n(d),r(d),i(d),a(d),o(d),s(d),c(d),l(d),u(d),d}export{d as createDefaultIntegrationSpecRegistry};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{SecretProviderError as e,normalizeSecretPayload as t,parseSecretUri as n}from"./provider.js";import{Buffer as r}from"node:buffer";import{CreateSecretCommand as i,DeleteSecretCommand as a,GetSecretValueCommand as o,PutSecretValueCommand as s,SecretsManagerClient as c}from"@aws-sdk/client-secrets-manager";var l=class{id=`aws-secrets-manager`;explicitRegion;injectedClient;clientConfig;clientsByRegion=new Map;constructor(e={}){this.explicitRegion=e.region,this.injectedClient=e.client,this.clientConfig=e.clientConfig}canHandle(e){try{let t=n(e);return t.provider===`aws`&&(t.path===`secretsmanager`||t.path.startsWith(`secretsmanager/`))}catch{return!1}}async getSecret(e,t){let n=this.parseReference(e),r=this.getClient(n.region),i=t?.version??n.stage??n.version,a={SecretId:n.secretId,...this.buildVersionSelector(i)};try{let t=await r.send(new o(a));return{data:u(t,e,this.id),version:typeof t.VersionId==`string`&&t.VersionId?t.VersionId:i,metadata:{region:n.region,secretId:n.secretId,...i?{requestedVersion:i}:{}},retrievedAt:new Date}}catch(t){throw p({error:t,provider:this.id,reference:e,operation:`getSecret`})}}async setSecret(n,r){let a=this.parseReference(n),o=this.getClient(a.region),c=t(r);try{let e=await o.send(new s({SecretId:a.secretId,SecretBinary:c})),t=typeof e.VersionId==`string`&&e.VersionId?e.VersionId:`latest`;return{reference:this.buildReference(a.region,a.secretId,{version:t}),version:t}}catch(t){if(!f(t))throw p({error:t,provider:this.id,reference:n,operation:`putSecretValue`});if(d(a.secretId))throw new e({message:`Secret not found: ${a.secretId}`,provider:this.id,reference:n,code:`NOT_FOUND`,cause:t});try{let e=await o.send(new i({Name:a.secretId,SecretBinary:c})),t=typeof e.VersionId==`string`&&e.VersionId?e.VersionId:`latest`;return{reference:this.buildReference(a.region,a.secretId,{version:t}),version:t}}catch(e){throw p({error:e,provider:this.id,reference:n,operation:`createSecret`})}}}async rotateSecret(e,t){return this.setSecret(e,t)}async deleteSecret(e){let t=this.parseReference(e),n=this.getClient(t.region);try{await n.send(new a({SecretId:t.secretId,RecoveryWindowInDays:7}))}catch(t){throw p({error:t,provider:this.id,reference:e,operation:`deleteSecret`})}}getClient(e){if(this.injectedClient)return this.injectedClient;let t=this.clientsByRegion.get(e);if(t)return t;let n=new c({...this.clientConfig??{},region:e});return this.clientsByRegion.set(e,n),n}parseReference(t){let r=n(t);if(r.provider!==`aws`)throw new e({message:`Unsupported secret provider: ${r.provider}`,provider:this.id,reference:t,code:`INVALID`});let i=r.path.split(`/`).filter(Boolean);if(i.length<3||i[0]!==`secretsmanager`)throw new e({message:`Expected secret reference format aws://secretsmanager/{region}/{secretIdOrArn}[?version=...]`,provider:this.id,reference:t,code:`INVALID`});let a=i[1],o=this.resolveRegion(a),s=i.slice(2).join(`/`);if(!s)throw new e({message:`Unable to resolve secret id from reference "${r.path}"`,provider:this.id,reference:t,code:`INVALID`});return{region:o,secretId:s,version:r.extras?.version,stage:r.extras?.stage}}resolveRegion(t){let n=t??this.explicitRegion??process.env.AWS_REGION??process.env.AWS_DEFAULT_REGION;if(!n)throw new e({message:`AWS region must be provided either in reference (aws://secretsmanager/{region}/...) or via AWS_REGION/AWS_DEFAULT_REGION.`,provider:this.id,reference:`aws://secretsmanager//`,code:`INVALID`});return n}buildVersionSelector(e){return e?e===`latest`||e===`current`?{VersionStage:`AWSCURRENT`}:e.startsWith(`AWS`)?{VersionStage:e}:{VersionId:e}:{}}buildReference(e,t,n){let r=`aws://secretsmanager/${e}/${t}`,i=n?Object.entries(n).filter(([,e])=>!!e).map(([e,t])=>`${encodeURIComponent(e)}=${encodeURIComponent(t)}`).join(`&`):``;return i?`${r}?${i}`:r}};function u(t,n,i){if(!t||typeof t!=`object`)throw new e({message:`Invalid AWS Secrets Manager response`,provider:i,reference:n,code:`UNKNOWN`,cause:t});let a=t;if(a.SecretBinary instanceof Uint8Array)return a.SecretBinary;if(typeof a.SecretBinary==`string`)return r.from(a.SecretBinary,`base64`);if(typeof a.SecretString==`string`)return r.from(a.SecretString,`utf-8`);throw new e({message:`AWS secret value is empty`,provider:i,reference:n,code:`NOT_FOUND`,cause:t})}function d(e){return e.startsWith(`arn:aws:secretsmanager:`)}function f(e){if(!e||typeof e!=`object`)return!1;let t=e;return typeof t.$metadata?.httpStatusCode==`number`?t.$metadata.httpStatusCode===404:t.name===`ResourceNotFoundException`}function p(t){let{error:n,provider:r,reference:i,operation:a}=t;if(n instanceof e)return n;let o=typeof n==`object`&&!!n&&`$metadata`in n&&typeof n.$metadata==`object`&&n.$metadata?.httpStatusCode,s=o===404?`NOT_FOUND`:o===401||o===403?`FORBIDDEN`:o===400?`INVALID`:`UNKNOWN`;return new e({message:n instanceof Error?n.message:`Unknown error during ${a}`,provider:r,reference:i,code:s,cause:n})}export{l as AwsSecretsManagerProvider};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{SecretProviderError as e,normalizeSecretPayload as t,parseSecretUri as n}from"./provider.js";import{SecretManagerServiceClient as r
|
|
1
|
+
import{SecretProviderError as e,normalizeSecretPayload as t,parseSecretUri as n}from"./provider.js";import{SecretManagerServiceClient as r}from"@google-cloud/secret-manager";const i={automatic:{}};var a=class{id=`gcp-secret-manager`;client;explicitProjectId;replication;constructor(e={}){this.client=e.client??new r(e.clientOptions??{}),this.explicitProjectId=e.projectId,this.replication=e.defaultReplication??i}canHandle(e){try{return n(e).provider===`gcp`}catch{return!1}}async getSecret(t,n,r){let i=this.parseReference(t),a=this.buildVersionName(i,n?.version);try{let[n]=await this.client.accessSecretVersion({name:a},r??{}),i=n.payload;if(!i?.data)throw new e({message:`Secret payload empty for ${a}`,provider:this.id,reference:t,code:`UNKNOWN`});let s=o(n.name??a);return{data:i.data,version:s,metadata:i.dataCrc32c?{crc32c:i.dataCrc32c.toString()}:void 0,retrievedAt:new Date}}catch(e){throw s({error:e,provider:this.id,reference:t,operation:`access`})}}async setSecret(n,r){let i=this.parseReference(n),{secretName:a}=this.buildNames(i),c=t(r);await this.ensureSecretExists(i,r);try{let t=await this.client.addSecretVersion({parent:a,payload:{data:c}});if(!t)throw new e({message:`No version returned when adding secret version for ${a}`,provider:this.id,reference:n,code:`UNKNOWN`});let[r]=t,i=r?.name??`${a}/versions/latest`;return{reference:`gcp://${i}`,version:o(i)??`latest`}}catch(e){throw s({error:e,provider:this.id,reference:n,operation:`addSecretVersion`})}}async rotateSecret(e,t){return this.setSecret(e,t)}async deleteSecret(e){let t=this.parseReference(e),{secretName:n}=this.buildNames(t);try{await this.client.deleteSecret({name:n})}catch(t){throw s({error:t,provider:this.id,reference:e,operation:`delete`})}}parseReference(t){let r=n(t);if(r.provider!==`gcp`)throw new e({message:`Unsupported secret provider: ${r.provider}`,provider:this.id,reference:t,code:`INVALID`});let i=r.path.split(`/`).filter(Boolean);if(i.length<4||i[0]!==`projects`)throw new e({message:`Expected secret reference format gcp://projects/{project}/secrets/{secret}[(/versions/{version})] but received "${r.path}"`,provider:this.id,reference:t,code:`INVALID`});let a=i[1]??this.explicitProjectId;if(!a)throw new e({message:`Unable to resolve project or secret from reference "${r.path}"`,provider:this.id,reference:t,code:`INVALID`});let o=i.indexOf(`secrets`);if(o===-1||o+1>=i.length)throw new e({message:`Unable to resolve project or secret from reference "${r.path}"`,provider:this.id,reference:t,code:`INVALID`});let s=a,c=i[o+1];if(!c)throw new e({message:`Unable to resolve secret ID from reference "${r.path}"`,provider:this.id,reference:t,code:`INVALID`});let l=c,u=i.indexOf(`versions`);return{projectId:s,secretId:l,version:r.extras?.version??(u!==-1&&u+1<i.length?i[u+1]:void 0)}}buildNames(t){let n=t.projectId??this.explicitProjectId;if(!n)throw new e({message:`Project ID must be provided either in reference or provider configuration`,provider:this.id,reference:`gcp://projects//secrets/${t.secretId}`,code:`INVALID`});let r=`projects/${n}`;return{projectParent:r,secretName:`${r}/secrets/${t.secretId}`}}buildVersionName(e,t){let{secretName:n}=this.buildNames(e);return`${n}/versions/${t??e.version??`latest`}`}async ensureSecretExists(e,t){let{secretName:n,projectParent:r}=this.buildNames(e);try{await this.client.getSecret({name:n})}catch(i){let a=s({error:i,provider:this.id,reference:`gcp://${n}`,operation:`getSecret`,suppressThrow:!0});if(!a||a.code!==`NOT_FOUND`)throw a||i;try{await this.client.createSecret({parent:r,secretId:e.secretId,secret:{replication:this.replication,labels:t.labels}})}catch(e){throw s({error:e,provider:this.id,reference:`gcp://${n}`,operation:`createSecret`})}}}};function o(e){let t=e.split(`/`).filter(Boolean),n=t.indexOf(`versions`);if(!(n===-1||n+1>=t.length))return t[n+1]}function s(t){let{error:n,provider:r,reference:i,operation:a,suppressThrow:o}=t;if(n instanceof e)return n;let s=c(n),l=new e({message:n instanceof Error?n.message:`Unknown error during ${a}`,provider:r,reference:i,code:s,cause:n});if(o)return l;throw l}function c(e){if(typeof e!=`object`||!e)return`UNKNOWN`;let t=e.code;return t===5||t===`NOT_FOUND`?`NOT_FOUND`:t===6||t===`ALREADY_EXISTS`?`INVALID`:t===7||t===`PERMISSION_DENIED`||t===403?`FORBIDDEN`:t===3||t===`INVALID_ARGUMENT`?`INVALID`:`UNKNOWN`}export{a as GcpSecretManagerProvider};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{SecretProviderError as e,normalizeSecretPayload as t,parseSecretUri as n}from"./provider.js";import{
|
|
1
|
+
import{SecretProviderError as e,normalizeSecretPayload as t,parseSecretUri as n}from"./provider.js";import{AwsSecretsManagerProvider as r}from"./aws-secret-manager.js";import{EnvSecretProvider as i}from"./env-secret-provider.js";import{GcpSecretManagerProvider as a}from"./gcp-secret-manager.js";import{ScalewaySecretManagerProvider as o}from"./scaleway-secret-manager.js";import{SecretProviderManager as s}from"./manager.js";export{r as AwsSecretsManagerProvider,i as EnvSecretProvider,a as GcpSecretManagerProvider,o as ScalewaySecretManagerProvider,e as SecretProviderError,s as SecretProviderManager,t as normalizeSecretPayload,n as parseSecretUri};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{SecretProviderError as e,normalizeSecretPayload as t,parseSecretUri as n}from"./provider.js";import{Buffer as r}from"node:buffer";const i=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;var a=class{id=`scaleway-secret-manager`;token;defaultRegion;defaultProjectId;baseUrl;fetchFn;constructor(e={}){this.token=e.token??process.env.SCW_SECRET_KEY??process.env.SCALEWAY_SECRET_KEY??``,this.defaultRegion=e.defaultRegion??process.env.SCW_DEFAULT_REGION??process.env.SCW_REGION,this.defaultProjectId=e.defaultProjectId??process.env.SCW_DEFAULT_PROJECT_ID??process.env.SCW_PROJECT_ID,this.baseUrl=e.baseUrl??`https://api.scaleway.com`,this.fetchFn=e.fetch??fetch}canHandle(e){try{let t=n(e);return t.provider===`scw`&&(t.path===`secret-manager`||t.path.startsWith(`secret-manager/`))}catch{return!1}}async getSecret(t,n){let a=this.parseReference(t);if(!this.token)throw new e({message:`Scaleway secret manager token is missing (set SCW_SECRET_KEY / SCALEWAY_SECRET_KEY).`,provider:this.id,reference:t,code:`FORBIDDEN`});if(!i.test(a.secretIdOrName))throw new e({message:`Scaleway getSecret requires a secretId (uuid) reference, not a secret name.`,provider:this.id,reference:t,code:`INVALID`});let s=n?.version??a.revision??`latest`,c=`${this.baseUrl}/secret-manager/v1beta1/regions/${encodeURIComponent(a.region)}/secrets/${encodeURIComponent(a.secretIdOrName)}/versions/${encodeURIComponent(s)}/access`,u=await this.fetchFn(c,{method:`GET`,headers:{"X-Auth-Token":this.token}});if(!u.ok)throw await l({response:u,provider:this.id,reference:t,operation:`getSecret`});let d=o(await u.json());return{data:r.from(d,`base64`),version:s,metadata:{region:a.region,secretId:a.secretIdOrName},retrievedAt:new Date}}async setSecret(n,a){let o=this.parseReference(n);if(!this.token)throw new e({message:`Scaleway secret manager token is missing (set SCW_SECRET_KEY / SCALEWAY_SECRET_KEY).`,provider:this.id,reference:n,code:`FORBIDDEN`});let s=t(a),c=r.from(s).toString(`base64`),l=i.test(o.secretIdOrName)?o.secretIdOrName:await this.createSecret({region:o.region,name:o.secretIdOrName,reference:n}),u=await this.createSecretVersion({region:o.region,secretId:l,dataB64:c,reference:n});return{reference:this.buildReference(o.region,l,{version:u}),version:u}}async rotateSecret(e,t){return this.setSecret(e,t)}async deleteSecret(t){let n=this.parseReference(t);if(!this.token)throw new e({message:`Scaleway secret manager token is missing (set SCW_SECRET_KEY / SCALEWAY_SECRET_KEY).`,provider:this.id,reference:t,code:`FORBIDDEN`});if(!i.test(n.secretIdOrName))throw new e({message:`Scaleway deleteSecret requires a secretId (uuid) reference, not a secret name.`,provider:this.id,reference:t,code:`INVALID`});let r=`${this.baseUrl}/secret-manager/v1beta1/regions/${encodeURIComponent(n.region)}/secrets/${encodeURIComponent(n.secretIdOrName)}`,a=await this.fetchFn(r,{method:`DELETE`,headers:{"X-Auth-Token":this.token}});if(!a.ok)throw await l({response:a,provider:this.id,reference:t,operation:`deleteSecret`})}parseReference(t){let r=n(t);if(r.provider!==`scw`)throw new e({message:`Unsupported secret provider: ${r.provider}`,provider:this.id,reference:t,code:`INVALID`});let i=r.path.split(`/`).filter(Boolean);if(i.length<2||i[0]!==`secret-manager`)throw new e({message:`Expected secret reference format scw://secret-manager/{region}/{secretIdOrName}[?version=...]`,provider:this.id,reference:t,code:`INVALID`});let a=i[1]??this.defaultRegion;if(!a)throw new e({message:`Scaleway region must be provided either in reference (scw://secret-manager/{region}/...) or via SCW_DEFAULT_REGION/SCW_REGION.`,provider:this.id,reference:t,code:`INVALID`});let o=i.slice(2).join(`/`);if(!o)throw new e({message:`Unable to resolve secret id/name from reference "${r.path}"`,provider:this.id,reference:t,code:`INVALID`});return{region:a,secretIdOrName:o,revision:r.extras?.version}}async createSecret(t){let n=this.defaultProjectId;if(!n)throw new e({message:`Scaleway project id is required to create secrets by name (set SCW_DEFAULT_PROJECT_ID/SCW_PROJECT_ID).`,provider:this.id,reference:t.reference,code:`INVALID`});let r=`${this.baseUrl}/secret-manager/v1beta1/regions/${encodeURIComponent(t.region)}/secrets`,i=await this.fetchFn(r,{method:`POST`,headers:{"Content-Type":`application/json`,"X-Auth-Token":this.token},body:JSON.stringify({name:t.name,project_id:n})});if(!i.ok)throw await l({response:i,provider:this.id,reference:t.reference,operation:`createSecret`});return s(await i.json())}async createSecretVersion(e){let t=`${this.baseUrl}/secret-manager/v1beta1/regions/${encodeURIComponent(e.region)}/secrets/${encodeURIComponent(e.secretId)}/versions`,n=await this.fetchFn(t,{method:`POST`,headers:{"Content-Type":`application/json`,"X-Auth-Token":this.token},body:JSON.stringify({data:e.dataB64})});if(!n.ok)throw await l({response:n,provider:this.id,reference:e.reference,operation:`createSecretVersion`});return c(await n.json())??`latest`}buildReference(e,t,n){let r=`scw://secret-manager/${e}/${t}`,i=n?Object.entries(n).filter(([,e])=>!!e).map(([e,t])=>`${encodeURIComponent(e)}=${encodeURIComponent(t)}`).join(`&`):``;return i?`${r}?${i}`:r}};function o(e){if(!e||typeof e!=`object`)throw Error(`Invalid scaleway secret payload`);let t=e;if(typeof t.data==`string`&&t.data)return t.data;throw Error(`Scaleway secret payload is missing data`)}function s(e){if(!e||typeof e!=`object`)throw Error(`Invalid scaleway createSecret payload`);let t=e;if(typeof t.id==`string`&&t.id)return t.id;throw Error(`Scaleway createSecret response is missing id`)}function c(e){if(!e||typeof e!=`object`)return;let t=e;if(typeof t.revision==`number`)return String(t.revision);if(typeof t.revision==`string`&&t.revision)return t.revision;if(typeof t.id==`string`&&t.id)return t.id}async function l(t){let{response:n,provider:r,reference:i,operation:a}=t,o=n.status===404?`NOT_FOUND`:n.status===401||n.status===403?`FORBIDDEN`:n.status>=400&&n.status<500?`INVALID`:`UNKNOWN`,s=await u(n);return new e({message:s?`Scaleway Secret Manager ${a} failed (${n.status}): ${s}`:`Scaleway Secret Manager ${a} failed (${n.status})`,provider:r,reference:i,code:o})}async function u(e){try{let t=(await e.text()).trim();return t.length?t:void 0}catch{return}}export{a as ScalewaySecretManagerProvider};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(e,t){e.register(t.type,async e=>{let n=t.schema.parse(e.payload);await t.handler(n,e)})}export{e as registerDefinedJob};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{DEFAULT_RETRY_POLICY as e}from"./queue.js";import{randomUUID as t}from"node:crypto";var n=class{handlers=new Map;constructor(e){this.options=e}async enqueue(n,r,i={}){let a=i.delaySeconds==null?void 0:{seconds:Math.floor(Date.now()/1e3)+i.delaySeconds},o=Buffer.from(JSON.stringify({id:t(),type:n,payload:r}),`utf-8`);return await this.options.client.createTask({parent:`projects/${this.options.projectId}/locations/${this.options.location}/queues/${this.options.queue}`,task:{httpRequest:{httpMethod:`POST`,url:this.options.resolveUrl(n),body:o,headers:{"Content-Type":`application/json`},oidcToken:this.options.serviceAccountEmail?{serviceAccountEmail:this.options.serviceAccountEmail}:void 0},scheduleTime:a}}),{id:t(),type:n,version:1,payload:r,status:`pending`,priority:i.priority??0,attempts:0,maxRetries:i.maxRetries??e.maxRetries,createdAt:new Date,updatedAt:new Date}}register(e,t){this.handlers.set(e,t)}start(){}async stop(){this.handlers.clear()}};export{n as GcpCloudTasksQueue};
|
package/dist/jobs/gcp-pubsub.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{DEFAULT_RETRY_POLICY as e}from"./queue.js";import{randomUUID as t}from"node:crypto";var n=class{handlers=new Map;constructor(e){this.options=e}async enqueue(n,r,i={}){return await this.options.client.topic(this.options.topicName).publishMessage({data:Buffer.from(JSON.stringify({id:t(),type:n,payload:r}),`utf-8`)}),{id:t(),type:n,version:1,payload:r,status:`pending`,priority:i.priority??0,attempts:0,maxRetries:i.maxRetries??e.maxRetries,createdAt:new Date,updatedAt:new Date}}register(e,t){this.handlers.set(e,t)}start(){}async stop(){this.handlers.clear()}};export{n as GcpPubSubQueue};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{registerDefinedJob as e}from"../define-job.js";import{createGmailSyncHandler as t}from"./gmail-sync-handler.js";import{PING_JOB_TYPE as n,PingPayloadSchema as r,pingJob as i}from"./ping-handler.js";import{createStorageDocumentHandler as a}from"./storage-document-handler.js";function o(t){e(t,i)}export{n as PING_JOB_TYPE,r as PingPayloadSchema,t as createGmailSyncHandler,a as createStorageDocumentHandler,i as pingJob,o as registerAllJobs};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import*as e from"zod";const t=`core.ping`,n=e.object({}),r={type:t,schema:n,handler:async(e,t)=>{console.log(`[ping] job id=%s attempts=%d`,t.id,t.attempts)}};export{t as PING_JOB_TYPE,n as PingPayloadSchema,r as pingJob};
|
package/dist/jobs/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{registerDefinedJob as e}from"./define-job.js";import{DEFAULT_RETRY_POLICY as t,calculateBackoff as n,defineJobType as r}from"./queue.js";export{t as DEFAULT_RETRY_POLICY,n as calculateBackoff,r as defineJobType,e as registerDefinedJob};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{DEFAULT_RETRY_POLICY as e}from"./queue.js";import{randomUUID as t}from"node:crypto";var n=class{jobs=[];handlers=new Map;timer;processing=!1;constructor(e=200){this.pollIntervalMs=e}async enqueue(n,r,i={}){let a={id:t(),type:n,version:1,payload:r,status:`pending`,priority:i.priority??0,attempts:0,maxRetries:i.maxRetries??e.maxRetries,createdAt:new Date,updatedAt:new Date};return i.delaySeconds&&(a.updatedAt=new Date(Date.now()+i.delaySeconds*1e3)),this.jobs.push(a),a}register(e,t){this.handlers.set(e,t)}start(){this.timer||=setInterval(()=>{this.processNext()},this.pollIntervalMs)}async stop(){for(this.timer&&=(clearInterval(this.timer),void 0);this.processing;)await new Promise(e=>setTimeout(e,10))}async processNext(){if(this.processing)return;let e=this.jobs.find(e=>e.status===`pending`&&e.updatedAt<=new Date);if(!e)return;let t=this.handlers.get(e.type);if(t){this.processing=!0,e.status=`running`,e.updatedAt=new Date,e.attempts+=1;try{await t(e),e.status=`completed`,e.updatedAt=new Date}catch(t){e.status=`failed`,e.lastError=t instanceof Error?t.message:`Unknown job error`,e.updatedAt=new Date}finally{this.processing=!1}}}};export{n as MemoryJobQueue};
|
package/dist/jobs/queue.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"zod";const e={maxRetries:3,initialBackoffMs:1e3,maxBackoffMs:6e4,multiplier:2,jitter:!0};function t(t,n=e){let r=Math.min(n.initialBackoffMs*n.multiplier**(t-1),n.maxBackoffMs);if(n.jitter){let e=.8+Math.random()*.4;return Math.floor(r*e)}return r}function n(e){return e}export{e as DEFAULT_RETRY_POLICY,t as calculateBackoff,n as defineJobType};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{DEFAULT_RETRY_POLICY as e}from"./queue.js";import{randomUUID as t}from"crypto";import{DeleteMessageCommand as n,ReceiveMessageCommand as r,SQSClient as i,SendMessageCommand as a}from"@aws-sdk/client-sqs";var o=class{sqs;queueUrl;waitTimeSeconds;maxNumberOfMessages;visibilityTimeoutSeconds;handlers=new Map;running=!1;constructor(e){let t=process.env.SCALEWAY_ACCESS_KEY_QUEUE,n=process.env.SCALEWAY_SECRET_KEY_QUEUE;if(!t||!n)throw Error(`Missing SCALEWAY_ACCESS_KEY_QUEUE / SCALEWAY_SECRET_KEY_QUEUE in env`);this.sqs=new i({region:e.region??process.env.SCALEWAY_REGION??`par`,endpoint:`https://sqs.mnq.fr-par.scaleway.com`,credentials:{accessKeyId:t,secretAccessKey:n}}),this.queueUrl=e.queueUrl,this.waitTimeSeconds=e.waitTimeSeconds??20,this.maxNumberOfMessages=e.maxNumberOfMessages??5,this.visibilityTimeoutSeconds=e.visibilityTimeoutSeconds??60}async enqueue(n,r,i={}){let o=t(),s=new Date,c={id:o,type:n,payload:r};return await this.sqs.send(new a({QueueUrl:this.queueUrl,MessageBody:JSON.stringify(c),DelaySeconds:i.delaySeconds??0})),{id:o,type:n,version:1,payload:r,status:`pending`,priority:i.priority??0,attempts:0,maxRetries:i.maxRetries??e.maxRetries,createdAt:s,updatedAt:s}}register(e,t){if(this.handlers.has(e))throw Error(`Handler already registered for job type "${e}"`);this.handlers.set(e,t)}start(){this.running||(this.running=!0,this.pollLoop().catch(e=>{console.error(`[queue] Fatal error in poll loop`,e),process.exit(1)}))}async stop(){this.running=!1}async pollLoop(){for(console.log(`[queue] SQS worker started for queue:`,this.queueUrl);this.running;)try{let t=(await this.sqs.send(new r({QueueUrl:this.queueUrl,MaxNumberOfMessages:this.maxNumberOfMessages,WaitTimeSeconds:this.waitTimeSeconds,VisibilityTimeout:this.visibilityTimeoutSeconds,MessageSystemAttributeNames:[`ApproximateReceiveCount`]}))).Messages??[];if(t.length===0)continue;for(let n of t){if(!n.Body||!n.ReceiptHandle){console.warn(`[queue] Message missing Body or ReceiptHandle`,n.MessageId);continue}let t;try{t=JSON.parse(n.Body)}catch(e){console.error(`[queue] Failed to parse message body (id=${n.MessageId}), deleting`,e),await this.deleteMessage(n.ReceiptHandle);continue}let r=this.handlers.get(t.type);if(!r){console.error(`[queue] No handler registered for type "${t.type}", deleting message`),await this.deleteMessage(n.ReceiptHandle);continue}let i=new Date,a=parseInt(n.Attributes?.ApproximateReceiveCount??`1`,10),o={id:t.id,type:t.type,version:1,payload:t.payload,status:`pending`,priority:0,attempts:a,maxRetries:e.maxRetries,createdAt:i,updatedAt:i};o.status=`running`,o.updatedAt=new Date;try{await r(o),o.status=`completed`,o.updatedAt=new Date,await this.deleteMessage(n.ReceiptHandle)}catch(e){o.status=`failed`,o.lastError=e instanceof Error?e.message:`Unknown job error`,o.updatedAt=new Date,console.error(`[queue] Error while handling job type=${o.type} id=${o.id}`,e)}}}catch(e){e&&typeof e==`object`&&`$response`in e?console.error(`[queue] Error while polling SQS`,e,e.$response):console.error(`[queue] Error while polling SQS`,e),await this.sleep(5e3)}console.log(`[queue] SQS worker stopped`)}async deleteMessage(e){try{await this.sqs.send(new n({QueueUrl:this.queueUrl,ReceiptHandle:e}))}catch(e){console.error(`[queue] Failed to delete message`,e)}}async sleep(e){await new Promise(t=>setTimeout(t,e))}};export{o as ScalewaySqsJobQueue};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{defineCommand as e,defineQuery as t}from"../spec.js";import{ScalarTypeEnum as n,SchemaModel as r}from"@lssm/lib.schema";const i=new r({name:`KnowledgeSyncSchedule`,fields:{enabled:{type:n.Boolean(),isOptional:!1},cron:{type:n.String_unsecure(),isOptional:!0},intervalMs:{type:n.Int_unsecure(),isOptional:!0}}}),a=new r({name:`KnowledgeSourceRecord`,fields:{id:{type:n.ID(),isOptional:!1},tenantId:{type:n.ID(),isOptional:!1},spaceKey:{type:n.NonEmptyString(),isOptional:!1},spaceVersion:{type:n.Int_unsecure(),isOptional:!1},label:{type:n.String_unsecure(),isOptional:!1},sourceType:{type:n.String_unsecure(),isOptional:!1},syncSchedule:{type:i,isOptional:!0},lastSyncStatus:{type:n.String_unsecure(),isOptional:!0},lastSyncAt:{type:n.DateTime(),isOptional:!0},itemsProcessed:{type:n.Int_unsecure(),isOptional:!0},createdAt:{type:n.DateTime(),isOptional:!0},updatedAt:{type:n.DateTime(),isOptional:!0}}}),o=new r({name:`CreateKnowledgeSourceInput`,fields:{tenantId:{type:n.ID(),isOptional:!1},spaceKey:{type:n.NonEmptyString(),isOptional:!1},spaceVersion:{type:n.Int_unsecure(),isOptional:!1},label:{type:n.String_unsecure(),isOptional:!1},sourceType:{type:n.NonEmptyString(),isOptional:!1},config:{type:n.JSONObject(),isOptional:!1},syncSchedule:{type:i,isOptional:!0}}}),s=new r({name:`UpdateKnowledgeSourceInput`,fields:{sourceId:{type:n.ID(),isOptional:!1},label:{type:n.String_unsecure(),isOptional:!0},config:{type:n.JSONObject(),isOptional:!0},syncSchedule:{type:i,isOptional:!0}}}),c=new r({name:`DeleteKnowledgeSourceInput`,fields:{sourceId:{type:n.ID(),isOptional:!1}}}),l=new r({name:`DeleteKnowledgeSourceOutput`,fields:{success:{type:n.Boolean(),isOptional:!1}}}),u=new r({name:`ListKnowledgeSourcesInput`,fields:{tenantId:{type:n.ID(),isOptional:!1},spaceKey:{type:n.NonEmptyString(),isOptional:!0}}}),d=new r({name:`ListKnowledgeSourcesOutput`,fields:{sources:{type:a,isOptional:!1,isArray:!0}}}),f=new r({name:`TriggerKnowledgeSyncInput`,fields:{sourceId:{type:n.ID(),isOptional:!1}}}),p=new r({name:`TriggerKnowledgeSyncOutput`,fields:{success:{type:n.Boolean(),isOptional:!1},itemsProcessed:{type:n.Int_unsecure(),isOptional:!0},error:{type:n.String_unsecure(),isOptional:!0}}}),m=e({meta:{name:`knowledge.source.create`,version:1,description:`Create a knowledge source binding for a tenant.`,goal:`Onboard a new knowledge ingestion source such as Notion or uploads.`,context:`Used by Ops and App Studio to configure knowledge ingestion per tenant and space.`,owners:[`platform.knowledge`],tags:[`knowledge`,`sources`],stability:`experimental`},io:{input:o,output:a},policy:{auth:`admin`,policies:[{name:`platform.knowledge.manage`,version:1}]}}),h=e({meta:{name:`knowledge.source.update`,version:1,description:`Update metadata or configuration for a knowledge source.`,goal:`Allow rotation of credentials, sync schedules, and labels.`,context:`Supports editing how a tenant ingests knowledge (e.g., toggling sync cadence).`,owners:[`platform.knowledge`],tags:[`knowledge`,`sources`],stability:`experimental`},io:{input:s,output:a},policy:{auth:`admin`,policies:[{name:`platform.knowledge.manage`,version:1}]}}),g=e({meta:{name:`knowledge.source.delete`,version:1,description:`Delete a knowledge source binding for a tenant.`,goal:`Remove obsolete or compromised knowledge ingestion paths.`,context:`Ensures ephemeral or external sources can be removed cleanly without leaving residual bindings.`,owners:[`platform.knowledge`],tags:[`knowledge`,`sources`],stability:`experimental`},io:{input:c,output:l},policy:{auth:`admin`,policies:[{name:`platform.knowledge.manage`,version:1}]}}),_=t({meta:{name:`knowledge.source.list`,version:1,description:`List knowledge sources configured for a tenant.`,goal:`Provide visibility into knowledge ingest configuration and schedules.`,context:`Used by App Studio and Ops flows to surface knowledge sources and their health.`,owners:[`platform.knowledge`],tags:[`knowledge`,`sources`],stability:`experimental`},io:{input:u,output:d},policy:{auth:`admin`,policies:[{name:`platform.knowledge.read`,version:1}]}}),v=e({meta:{name:`knowledge.source.triggerSync`,version:1,description:`Trigger an immediate sync for a knowledge source.`,goal:`Support manual or automated sync retries for knowledge ingestion.`,context:`Invoked by Ops tooling or monitors when knowledge content must be refreshed or reprocessed.`,owners:[`platform.knowledge`],tags:[`knowledge`,`sources`],stability:`experimental`},io:{input:f,output:p},policy:{auth:`admin`,policies:[{name:`platform.knowledge.manage`,version:1}]}}),y={CreateKnowledgeSource:m,UpdateKnowledgeSource:h,DeleteKnowledgeSource:g,ListKnowledgeSources:_,TriggerKnowledgeSourceSync:v};function b(e){return e.register(m).register(h).register(g).register(_).register(v)}export{m as CreateKnowledgeSource,g as DeleteKnowledgeSource,_ as ListKnowledgeSources,v as TriggerKnowledgeSourceSync,h as UpdateKnowledgeSource,y as knowledgeContracts,b as registerKnowledgeContracts};
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import{registerDocBlocks as e}from"../../docs/registry.js";import"../../registry.js";const t=[{id:`docs.tech.contracts.knowledge`,title:`Knowledge Layer`,summary:`The knowledge layer turns unstructured inputs (uploads, email threads,`,kind:`reference`,visibility:`public`,route:`/docs/tech/contracts/knowledge`,tags:[`tech`,`contracts`,`knowledge`],body:`# Knowledge Layer
|
|
2
|
+
|
|
3
|
+
The knowledge layer turns unstructured inputs (uploads, email threads,
|
|
4
|
+
notes) into searchable context for agents and workflows. The Pocket
|
|
5
|
+
Family Office vertical ships a minimal but production-ready stack that
|
|
6
|
+
covers ingestion, indexing, querying, and guardrails.
|
|
7
|
+
|
|
8
|
+
## Knowledge Spaces
|
|
9
|
+
|
|
10
|
+
Knowledge is organised via \`KnowledgeSpaceSpec\` definitions under
|
|
11
|
+
\`packages/libs/contracts/src/knowledge/spaces\`:
|
|
12
|
+
|
|
13
|
+
- \`knowledge.financial-docs\` – canonical invoices, bills, and contracts.
|
|
14
|
+
- \`knowledge.email-threads\` – operational Gmail threads.
|
|
15
|
+
- \`knowledge.support-faq\` / \`knowledge.product-canon\` – reusable shared
|
|
16
|
+
spaces available to any vertical.
|
|
17
|
+
|
|
18
|
+
Each space defines:
|
|
19
|
+
|
|
20
|
+
- Ownership metadata (domain, owners, stability tags).
|
|
21
|
+
- Retention policy (TTL/archival).
|
|
22
|
+
- Access policy (trust level, automation write permissions).
|
|
23
|
+
- Indexing configuration (embedding model, chunk size, vector DB slot).
|
|
24
|
+
|
|
25
|
+
## Sources & Bindings
|
|
26
|
+
|
|
27
|
+
- \`KnowledgeSourceConfig\` records tenant-specific connections (bucket,
|
|
28
|
+
Gmail labels, sync cadence). Pocket Family Office provides sample
|
|
29
|
+
configs in \`knowledge/sources.sample.ts\`.
|
|
30
|
+
- \`AppKnowledgeBinding\` associates spaces with workflows/agents and adds
|
|
31
|
+
per-tenant constraints (rate limits, scopes).
|
|
32
|
+
|
|
33
|
+
Validation ensures that:
|
|
34
|
+
|
|
35
|
+
- All referenced spaces exist in the registry.
|
|
36
|
+
- At least one source is configured per binding.
|
|
37
|
+
- External/ephemeral spaces trigger warnings for policy-sensitive flows.
|
|
38
|
+
|
|
39
|
+
## Ingestion Pipeline
|
|
40
|
+
|
|
41
|
+
Implemented in \`packages/libs/contracts/src/knowledge/ingestion\`:
|
|
42
|
+
|
|
43
|
+
1. **DocumentProcessor** – pluggable MIME extractors producing
|
|
44
|
+
\`DocumentFragment\`s.
|
|
45
|
+
2. **EmbeddingService** – batches fragments through an \`EmbeddingProvider\`
|
|
46
|
+
(Mistral in the reference implementation).
|
|
47
|
+
3. **VectorIndexer** – upserts fragments into a \`VectorStoreProvider\`
|
|
48
|
+
(Qdrant in production, with in-memory implementations for tests).
|
|
49
|
+
4. **Adapters**
|
|
50
|
+
- \`GmailIngestionAdapter\`: list threads → convert to raw documents →
|
|
51
|
+
index.
|
|
52
|
+
- \`StorageIngestionAdapter\`: fetch object from storage provider →
|
|
53
|
+
index.
|
|
54
|
+
|
|
55
|
+
Background jobs (see \`jobs/\`) orchestrate ingestion via Cloud Tasks /
|
|
56
|
+
Pub/Sub or in-memory workers. Handlers:
|
|
57
|
+
|
|
58
|
+
- \`storage-document-handler\` – resolves storage object + indexes.
|
|
59
|
+
- \`gmail-sync-handler\` – syncs threads based on label/date filters.
|
|
60
|
+
|
|
61
|
+
## Query Service
|
|
62
|
+
|
|
63
|
+
\`KnowledgeQueryService\` performs retrieval-augmented generation:
|
|
64
|
+
|
|
65
|
+
1. Embed the user query using the configured provider.
|
|
66
|
+
2. Search the vector store for top-k matches.
|
|
67
|
+
3. Compose prompts combining system instructions + contextual snippets.
|
|
68
|
+
4. Invoke the LLM provider (Mistral) and return the answer plus
|
|
69
|
+
references and token usage.
|
|
70
|
+
|
|
71
|
+
The service is designed for tooling: workflows can execute it directly
|
|
72
|
+
or through custom operations (see \`pfo.summary.generate\` contract).
|
|
73
|
+
|
|
74
|
+
## Guardrails
|
|
75
|
+
|
|
76
|
+
- Automation can only write to spaces where \`automationWritable\` is true.
|
|
77
|
+
- Canonical spaces default to high trust; external/ephemeral spaces are
|
|
78
|
+
flagged during validation.
|
|
79
|
+
- Telemetry captures query volumes per tenant + space.
|
|
80
|
+
|
|
81
|
+
## Extending
|
|
82
|
+
|
|
83
|
+
1. Define a new \`KnowledgeSpaceSpec\` with indexing/retention policies.
|
|
84
|
+
2. Add sources pointing to storage providers or APIs.
|
|
85
|
+
3. Register adapters if ingestion requires bespoke logic.
|
|
86
|
+
4. Reference the space in blueprints (\`AppKnowledgeBinding\`) and update
|
|
87
|
+
workflows/agents accordingly.
|
|
88
|
+
|
|
89
|
+
The Pocket Family Office tests (\`tests/pocket-family-office.test.ts\`)
|
|
90
|
+
show how to wire the ingestion pipeline, index a document, and run an
|
|
91
|
+
end-to-end knowledge query using in-memory providers.
|
|
92
|
+
## Knowledge Spaces & Guardrails
|
|
93
|
+
|
|
94
|
+
Knowledge surfaces (\`KnowledgeSpaceSpec\`) describe curated corpora that agents and workflows can consult. Tenant bindings (\`AppKnowledgeBinding\`) declare which spaces are active, who can use them, and optional usage constraints.
|
|
95
|
+
|
|
96
|
+
### Binding recap
|
|
97
|
+
|
|
98
|
+
- \`spaceKey\` / \`spaceVersion\`: pointer to the \`KnowledgeSpaceSpec\`
|
|
99
|
+
- \`scope.workflows\` / \`scope.agents\`: explicit allow-lists for consumers
|
|
100
|
+
- \`constraints.maxTokensPerQuery\` & \`constraints.maxQueriesPerMinute\`: throttling knobs for LLM-backed search
|
|
101
|
+
- \`required\`: mark the binding as blocking (defaults to \`true\`)
|
|
102
|
+
|
|
103
|
+
At runtime, \`ResolvedAppConfig.knowledge\` contains \`ResolvedKnowledge\` entries with the bound space, active sources, and the binding metadata above.
|
|
104
|
+
|
|
105
|
+
### KnowledgeAccessGuard
|
|
106
|
+
|
|
107
|
+
\`KnowledgeAccessGuard\` (\`@lssm/lib.contracts/knowledge/runtime\`) centralises the access checks that must run before any workflow/agent reads or mutates a knowledge space.
|
|
108
|
+
|
|
109
|
+
\`\`\`ts
|
|
110
|
+
import { KnowledgeAccessGuard } from '@lssm/lib.contracts/knowledge/runtime';
|
|
111
|
+
|
|
112
|
+
const guard = new KnowledgeAccessGuard({
|
|
113
|
+
disallowWriteCategories: ['external', 'ephemeral'], // default
|
|
114
|
+
requireWorkflowBinding: true,
|
|
115
|
+
requireAgentBinding: false,
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
const result = guard.checkAccess(resolvedKnowledge, {
|
|
119
|
+
tenantId,
|
|
120
|
+
appId,
|
|
121
|
+
workflowName: 'order-processing',
|
|
122
|
+
operation: 'read', // or 'write' / 'search'
|
|
123
|
+
}, resolvedAppConfig);
|
|
124
|
+
|
|
125
|
+
if (!result.allowed) {
|
|
126
|
+
throw new Error(result.reason);
|
|
127
|
+
}
|
|
128
|
+
\`\`\`
|
|
129
|
+
|
|
130
|
+
Key behaviours:
|
|
131
|
+
|
|
132
|
+
- **Binding**: rejects access when the space is not present in the resolved tenant config.
|
|
133
|
+
- **Category guardrails**: blocks writes to \`external\` and \`ephemeral\` spaces by default; allows reads but emits warnings for \`ephemeral\`.
|
|
134
|
+
- **Workflow/agent scoping**: when \`requireWorkflowBinding\` or \`requireAgentBinding\` is enabled, only explicitly authorised consumers may access the space.
|
|
135
|
+
|
|
136
|
+
Use the guard inside workflow operations or agent resolvers to guarantee multi-tenant isolation and honour data governance rules.
|
|
137
|
+
|
|
138
|
+
`}];e(t);export{t as tech_contracts_knowledge_DocBlocks};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import{jsonSchemaForSpec as e}from"../jsonschema.js";import{isEmitDeclRef as t}from"../spec.js";const n={format:`full`,includeSchemas:!0,includeScenarios:!0,includeExamples:!0,includePolicy:!0,includeSideEffects:!0},r={...n,includeRelatedSpecs:!0,includeRelatedEvents:!0,includeRelatedPresentations:!0};function i(e){let t=e.meta,n=[];if(n.push(`# ${t.name} (v${t.version})`),n.push(``),n.push(`> ${t.description}`),n.push(``),n.push(`**Type:** ${t.kind} | **Stability:** ${t.stability}`),n.push(``),n.push(`## Goal`),n.push(``),n.push(t.goal),n.push(``),n.push(`## Context`),n.push(``),n.push(t.context),n.push(``),e.acceptance?.scenarios?.length){n.push(`## Acceptance Criteria`),n.push(``);for(let t of e.acceptance.scenarios){n.push(`### ${t.name}`),n.push(``),n.push(`**Given:**`);for(let e of t.given)n.push(`- ${e}`);n.push(``),n.push(`**When:**`);for(let e of t.when)n.push(`- ${e}`);n.push(``),n.push(`**Then:**`);for(let e of t.then)n.push(`- ${e}`);n.push(``)}}return n.join(`
|
|
2
|
+
`)}function a(r,i={}){let a={...n,...i},o=r.meta,s=[];if(s.push(`# ${o.name}.v${o.version}`),s.push(``),s.push(`> ${o.description}`),s.push(``),s.push(`## Metadata`),s.push(``),s.push(`| Field | Value |`),s.push(`|-------|-------|`),s.push(`| Kind | ${o.kind} |`),s.push(`| Stability | ${o.stability} |`),s.push(`| Owners | ${o.owners.join(`, `)} |`),s.push(`| Tags | ${o.tags.join(`, `)} |`),s.push(``),s.push(`## Goal`),s.push(``),s.push(o.goal),s.push(``),s.push(`## Context`),s.push(``),s.push(o.context),s.push(``),a.includeSchemas){if(s.push(`## Input/Output`),s.push(``),r.io.input){s.push(`### Input Schema`),s.push(``),s.push("```json");try{let t=e(r);s.push(JSON.stringify(t.input??{},null,2))}catch{s.push(`// Schema generation not available`)}s.push("```"),s.push(``)}s.push(`### Output Schema`),s.push(``),s.push("```json");try{let t=e(r);s.push(JSON.stringify(t.output??{},null,2))}catch{s.push(`// Schema generation not available`)}if(s.push("```"),s.push(``),r.io.errors&&Object.keys(r.io.errors).length){s.push(`### Error Codes`),s.push(``),s.push(`| Code | HTTP | Description | When |`),s.push(`|------|------|-------------|------|`);for(let[e,t]of Object.entries(r.io.errors))s.push(`| \`${e}\` | ${t.http??400} | ${t.description} | ${t.when} |`);s.push(``)}}if(a.includePolicy&&(s.push(`## Policy`),s.push(``),s.push(`- **Auth Required:** ${r.policy.auth}`),s.push(`- **Idempotent:** ${r.policy.idempotent??o.kind===`query`}`),r.policy.rateLimit&&s.push(`- **Rate Limit:** ${r.policy.rateLimit.rpm} rpm per ${r.policy.rateLimit.key}`),r.policy.flags?.length&&s.push(`- **Feature Flags:** ${r.policy.flags.join(`, `)}`),r.policy.pii?.length&&s.push(`- **PII Fields:** ${r.policy.pii.join(`, `)}`),r.policy.escalate&&s.push(`- **Escalation:** ${r.policy.escalate}`),s.push(``)),a.includeSideEffects&&r.sideEffects){if(r.sideEffects.emits?.length){s.push(`## Events Emitted`),s.push(``);for(let e of r.sideEffects.emits)t(e)?s.push(`- \`${e.ref.name}.v${e.ref.version}\` — ${e.when}`):s.push(`- \`${e.name}.v${e.version}\` — ${e.when}`);s.push(``)}if(r.sideEffects.analytics?.length){s.push(`## Analytics Events`),s.push(``);for(let e of r.sideEffects.analytics)s.push(`- ${e}`);s.push(``)}}if(a.includeScenarios&&r.acceptance?.scenarios?.length){s.push(`## Acceptance Scenarios`),s.push(``);for(let e of r.acceptance.scenarios){s.push(`### ${e.name}`),s.push(``),s.push(`**Given:**`);for(let t of e.given)s.push(`- ${t}`);s.push(``),s.push(`**When:**`);for(let t of e.when)s.push(`- ${t}`);s.push(``),s.push(`**Then:**`);for(let t of e.then)s.push(`- ${t}`);s.push(``)}}if(a.includeExamples&&r.acceptance?.examples?.length){s.push(`## Examples`),s.push(``);for(let e of r.acceptance.examples)s.push(`### ${e.name}`),s.push(``),s.push(`**Input:**`),s.push("```json"),s.push(JSON.stringify(e.input,null,2)),s.push("```"),s.push(``),s.push(`**Output:**`),s.push("```json"),s.push(JSON.stringify(e.output,null,2)),s.push("```"),s.push(``)}return r.transport&&(s.push(`## Transport Configuration`),s.push(``),r.transport.rest&&s.push(`- **REST:** ${r.transport.rest.method??`POST`} ${r.transport.rest.path??`auto`}`),r.transport.gql&&s.push(`- **GraphQL:** ${r.transport.gql.field??`auto`}`),r.transport.mcp&&s.push(`- **MCP Tool:** ${r.transport.mcp.toolName??`auto`}`),s.push(``)),s.join(`
|
|
3
|
+
`)}function o(e,t){let n=t?.taskType??`implement`,r=e.meta,i=[],o={implement:`Implement`,test:`Write tests for`,refactor:`Refactor`,review:`Review`}[n];if(i.push(`# Task: ${o} ${r.name}.v${r.version}`),i.push(``),i.push(`## Context`),i.push(``),i.push(`You are working on a ContractSpec-driven codebase. This spec defines a ${r.kind} operation.`),i.push(``),i.push(`**Goal:** ${r.goal}`),i.push(``),i.push(`**Background:** ${r.context}`),i.push(``),i.push(`## Specification`),i.push(``),i.push(a(e)),i.push(``),i.push(`## Instructions`),i.push(``),n===`implement`){if(i.push(`Implement this specification following these requirements:`),i.push(``),i.push("1. **Type Safety**: Use TypeScript with strict typing. No `any` types."),i.push(`2. **Input Validation**: Validate input against the schema before processing.`),i.push(`3. **Error Handling**: Implement all error cases defined in the spec.`),i.push(`4. **Events**: Emit events as specified in sideEffects.emits.`),i.push(`5. **Policy**: Respect auth, rate limits, and feature flags.`),i.push(`6. **Idempotency**: `+(e.policy.idempotent?`This operation MUST be idempotent.`:`This operation may have side effects.`)),i.push(``),e.policy.pii?.length){i.push(`**PII Handling**: The following fields contain PII and must be handled carefully:`);for(let t of e.policy.pii)i.push(`- ${t}`);i.push(``)}}else n===`test`?(i.push(`Write comprehensive tests for this specification:`),i.push(``),i.push(`1. Test all acceptance scenarios defined in the spec.`),i.push(`2. Test all error cases with appropriate assertions.`),i.push(`3. Test edge cases and boundary conditions.`),i.push(`4. Verify events are emitted correctly.`),i.push(`5. Use descriptive test names following the pattern: "should [behavior] when [condition]"`),i.push(``)):n===`refactor`?(i.push(`Refactor this implementation while preserving all behavior:`),i.push(``),i.push(`1. Maintain compliance with the specification.`),i.push(`2. Improve code clarity and maintainability.`),i.push(`3. Reduce complexity where possible.`),i.push(`4. Ensure all existing tests still pass.`),i.push(``)):n===`review`&&(i.push(`Review this implementation against the specification:`),i.push(``),i.push(`1. Verify input/output types match the schema.`),i.push(`2. Check all error cases are handled.`),i.push(`3. Verify events are emitted as specified.`),i.push(`4. Check policy compliance (auth, rate limits).`),i.push(`5. Report any deviations from the spec.`),i.push(``));return t?.existingCode&&(i.push(`## Existing Code`),i.push(``),i.push("```typescript"),i.push(t.existingCode),i.push("```"),i.push(``)),i.push(`## Expected Output`),i.push(``),n===`implement`||n===`refactor`?(i.push(`Provide a complete TypeScript implementation. Include:`),i.push(`- Type definitions for input/output`),i.push(`- Handler function with proper error handling`),i.push(`- JSDoc comments explaining the implementation`)):n===`test`?i.push(`Provide a complete test file using the testing framework available (prefer Vitest).`):n===`review`&&(i.push(`Provide a structured review with:`),i.push(`- Compliance status (pass/fail for each requirement)`),i.push(`- Issues found with severity (error/warning/info)`),i.push(`- Suggestions for improvement`)),i.push(``),i.join(`
|
|
4
|
+
`)}function s(e,t,n={}){let i={...r,...n},o=e.meta,s=[];if(s.push(`# Feature: ${o.title??o.key}`),s.push(``),o.description&&(s.push(`> ${o.description}`),s.push(``)),s.push(`## Overview`),s.push(``),s.push(`- **Key:** \`${o.key}\``),s.push(`- **Stability:** ${o.stability}`),s.push(`- **Owners:** ${o.owners.join(`, `)}`),o.tags?.length&&s.push(`- **Tags:** ${o.tags.join(`, `)}`),s.push(``),e.operations?.length){s.push(`## Operations`),s.push(``),s.push(`| Name | Version | Type |`),s.push(`|------|---------|------|`);for(let n of e.operations){let e=(t?.specs?.getSpec(n.name,n.version))?.meta.kind??`unknown`;s.push(`| ${n.name} | v${n.version} | ${e} |`)}if(s.push(``),i.includeRelatedSpecs&&t?.specs){s.push(`### Operation Details`),s.push(``);for(let n of e.operations){let e=t.specs.getSpec(n.name,n.version);e&&(s.push(`---`),s.push(``),s.push(a(e,i)))}}}if(e.events?.length){s.push(`## Events`),s.push(``),s.push(`| Name | Version |`),s.push(`|------|---------|`);for(let t of e.events)s.push(`| ${t.name} | v${t.version} |`);s.push(``)}if(e.presentations?.length){s.push(`## Presentations`),s.push(``),s.push(`| Name | Version |`),s.push(`|------|---------|`);for(let t of e.presentations)s.push(`| ${t.name} | v${t.version} |`);if(s.push(``),i.includeRelatedPresentations&&t?.presentations){s.push(`### Presentation Details`),s.push(``);for(let n of e.presentations){let e=t.presentations.get(n.name,n.version);e&&(s.push(`#### ${n.name}.v${n.version}`),s.push(``),s.push(`- **Kind:** ${e.content.kind??`unknown`}`),`componentKey`in e.content&&s.push(`- **Component:** ${e.content.componentKey}`),s.push(``))}}}if(e.capabilities){if(e.capabilities.provides?.length){s.push(`## Capabilities Provided`),s.push(``);for(let t of e.capabilities.provides)s.push(`- \`${t.key}.v${t.version}\``);s.push(``)}if(e.capabilities.requires?.length){s.push(`## Capabilities Required`),s.push(``);for(let t of e.capabilities.requires)s.push(`- \`${t.key}\`${t.version?`.v${t.version}`:``} (${t.optional?`optional`:`required`})`);s.push(``)}}return s.join(`
|
|
5
|
+
`)}function c(e){let t=e.meta,n=[];n.push(`# Presentation: ${t.name}.v${t.version}`),n.push(``),t.description&&(n.push(`> ${t.description}`),n.push(``)),n.push(`## Metadata`),n.push(``),n.push(`- **Name:** ${t.name}`),n.push(`- **Version:** ${t.version}`),t.stability&&n.push(`- **Stability:** ${t.stability}`),t.owners?.length&&n.push(`- **Owners:** ${t.owners.join(`, `)}`),t.tags?.length&&n.push(`- **Tags:** ${t.tags.join(`, `)}`),n.push(``),n.push(`## Source`),n.push(``),n.push(`- **Type:** ${e.source.type}`),e.source.type===`component`&&(n.push(`- **Framework:** ${e.source.framework}`),n.push(`- **Component Key:** ${e.source.componentKey}`)),n.push(``),n.push(`## Supported Targets`),n.push(``);for(let t of e.targets)n.push(`- ${t}`);return n.push(``),e.policy&&(n.push(`## Policy`),n.push(``),e.policy.flags?.length&&n.push(`- **Feature Flags:** ${e.policy.flags.join(`, `)}`),e.policy.pii?.length&&n.push(`- **PII Fields:** ${e.policy.pii.join(`, `)}`),n.push(``)),n.join(`
|
|
6
|
+
`)}function l(e){let t=[];t.push(`# Event: ${e.name}.v${e.version}`),t.push(``),t.push(`## Metadata`),t.push(``),t.push(`- **Name:** ${e.name}`),t.push(`- **Version:** ${e.version}`),e.description&&t.push(`- **Description:** ${e.description}`),t.push(``),t.push(`## Payload Schema`),t.push(``),t.push("```json");try{let n=e.payload.getZod();if(`shape`in n&&n.shape){let e=n.shape,r=Object.keys(e);t.push(JSON.stringify({fields:r},null,2))}else t.push(`// Payload schema available at runtime`)}catch{t.push(`// Schema details available at runtime`)}return t.push("```"),t.push(``),t.join(`
|
|
7
|
+
`)}function u(e){let t=[];if(t.push(`# ${e.title}`),t.push(``),e.summary&&(t.push(`> ${e.summary}`),t.push(``)),t.push(`## Metadata`),t.push(``),t.push(`- **ID:** ${e.id}`),t.push(`- **Kind:** ${e.kind??`reference`}`),t.push(`- **Visibility:** ${e.visibility??`public`}`),e.tags?.length&&t.push(`- **Tags:** ${e.tags.join(`, `)}`),e.owners?.length&&t.push(`- **Owners:** ${e.owners.join(`, `)}`),e.domain&&t.push(`- **Domain:** ${e.domain}`),t.push(``),t.push(`## Content`),t.push(``),t.push(e.body),t.push(``),e.links?.length){t.push(`## Related Links`),t.push(``);for(let n of e.links)t.push(`- [${n.label}](${n.href})`);t.push(``)}return t.join(`
|
|
8
|
+
`)}function d(e,t={}){let n=t.format??`full`,r;switch(n){case`context`:r=i(e);break;case`prompt`:r=o(e);break;case`full`:default:r=a(e,t);break}return{spec:e,markdown:r,format:n,meta:{specName:e.meta.name,specVersion:e.meta.version,exportedAt:new Date().toISOString(),wordCount:r.split(/\s+/).length}}}function f(e,t,n={}){let r=n.format??`full`;return{feature:e,markdown:s(e,t,n),format:r,includedSpecs:e.operations?.map(e=>`${e.name}.v${e.version}`)??[],includedEvents:e.events?.map(e=>`${e.name}.v${e.version}`)??[],includedPresentations:e.presentations?.map(e=>`${e.name}.v${e.version}`)??[]}}export{u as docBlockToMarkdown,l as eventToMarkdown,f as exportFeature,d as exportSpec,s as featureToMarkdown,c as presentationToMarkdown,o as specToAgentPrompt,i as specToContextMarkdown,a as specToFullMarkdown};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{docBlockToMarkdown as e,eventToMarkdown as t,exportFeature as n,exportSpec as r,featureToMarkdown as i,presentationToMarkdown as a,specToAgentPrompt as o,specToContextMarkdown as s,specToFullMarkdown as c}from"./exporters.js";import{AGENT_SYSTEM_PROMPTS as l,formatPlanForAgent as u,generateFixViolationsPrompt as d,generateImplementationPlan as f,generateImplementationPrompt as p,generateReviewPrompt as m,generateTestPrompt as h,generateVerificationPrompt as g}from"./prompts.js";export{l as AGENT_SYSTEM_PROMPTS,e as docBlockToMarkdown,t as eventToMarkdown,n as exportFeature,r as exportSpec,i as featureToMarkdown,u as formatPlanForAgent,d as generateFixViolationsPrompt,f as generateImplementationPlan,p as generateImplementationPrompt,m as generateReviewPrompt,h as generateTestPrompt,g as generateVerificationPrompt,a as presentationToMarkdown,o as specToAgentPrompt,s as specToContextMarkdown,c as specToFullMarkdown};
|