@contractspec/bundle.library 3.0.0 → 3.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/.turbo/turbo-build.log +178 -166
  2. package/AGENTS.md +19 -12
  3. package/CHANGELOG.md +46 -0
  4. package/dist/application/context-storage/index.d.ts +18 -0
  5. package/dist/application/context-storage/index.js +29 -0
  6. package/dist/application/index.d.ts +1 -0
  7. package/dist/application/index.js +662 -2
  8. package/dist/application/mcp/cliMcp.js +12 -2
  9. package/dist/application/mcp/common.d.ts +11 -1
  10. package/dist/application/mcp/common.js +12 -2
  11. package/dist/application/mcp/contractsMcp.d.ts +51 -0
  12. package/dist/application/mcp/contractsMcp.js +531 -0
  13. package/dist/application/mcp/contractsMcpResources.d.ts +7 -0
  14. package/dist/application/mcp/contractsMcpResources.js +124 -0
  15. package/dist/application/mcp/contractsMcpTools.d.ts +9 -0
  16. package/dist/application/mcp/contractsMcpTools.js +200 -0
  17. package/dist/application/mcp/contractsMcpTypes.d.ts +50 -0
  18. package/dist/application/mcp/contractsMcpTypes.js +1 -0
  19. package/dist/application/mcp/docsMcp.js +12 -2
  20. package/dist/application/mcp/index.d.ts +2 -0
  21. package/dist/application/mcp/index.js +635 -2
  22. package/dist/application/mcp/internalMcp.js +12 -2
  23. package/dist/application/mcp/providerRankingMcp.d.ts +46 -0
  24. package/dist/application/mcp/providerRankingMcp.js +494 -0
  25. package/dist/node/application/context-storage/index.js +28 -0
  26. package/dist/node/application/index.js +662 -2
  27. package/dist/node/application/mcp/cliMcp.js +12 -2
  28. package/dist/node/application/mcp/common.js +12 -2
  29. package/dist/node/application/mcp/contractsMcp.js +530 -0
  30. package/dist/node/application/mcp/contractsMcpResources.js +123 -0
  31. package/dist/node/application/mcp/contractsMcpTools.js +199 -0
  32. package/dist/node/application/mcp/contractsMcpTypes.js +0 -0
  33. package/dist/node/application/mcp/docsMcp.js +12 -2
  34. package/dist/node/application/mcp/index.js +635 -2
  35. package/dist/node/application/mcp/internalMcp.js +12 -2
  36. package/dist/node/application/mcp/providerRankingMcp.js +493 -0
  37. package/package.json +111 -25
  38. package/src/application/context-storage/index.ts +58 -0
  39. package/src/application/index.ts +1 -0
  40. package/src/application/mcp/common.ts +28 -1
  41. package/src/application/mcp/contractsMcp.ts +34 -0
  42. package/src/application/mcp/contractsMcpResources.ts +142 -0
  43. package/src/application/mcp/contractsMcpTools.ts +246 -0
  44. package/src/application/mcp/contractsMcpTypes.ts +47 -0
  45. package/src/application/mcp/index.ts +2 -0
  46. package/src/application/mcp/providerRankingMcp.ts +380 -0
  47. package/src/components/docs/generated/docs-index._common.json +879 -1
  48. package/src/components/docs/generated/docs-index.manifest.json +5 -5
  49. package/src/components/docs/generated/docs-index.metrics.json +8 -0
  50. package/src/components/docs/generated/docs-index.platform-integrations.json +8 -0
package/AGENTS.md CHANGED
@@ -1,13 +1,15 @@
1
- # bundle.library
1
+ # AI Agent Guide — `@contractspec/bundle.library`
2
+
3
+ Scope: `packages/bundles/library/*`
2
4
 
3
5
  Shared library bundle with docs, templates, MCP servers, and common components.
4
6
 
5
7
  ## Quick Context
6
8
 
7
- - **Type**: Bundle (shared business logic)
9
+ - **Layer**: bundle
8
10
  - **Consumers**: `app.api-library`, `app.web-landing`, `app.web-studio`
9
11
 
10
- ## Key Directories
12
+ ## Architecture
11
13
 
12
14
  - `src/application/mcp/` — MCP server implementations
13
15
  - `src/components/docs/` — Documentation pages
@@ -16,18 +18,23 @@ Shared library bundle with docs, templates, MCP servers, and common components.
16
18
  - `src/hooks/studio/` — React hooks for GraphQL
17
19
  - `src/providers/auth/` — Authentication providers
18
20
 
19
- ## Exports
21
+ ## Public Exports
20
22
 
21
23
  Use subpath imports:
24
+
22
25
  ```typescript
23
- import { ... } from '@contractspec/bundle.library/components/docs';
24
- import { ... } from '@contractspec/bundle.library/hooks/studio';
26
+ import { ... } from "@contractspec/bundle.library/components/docs";
27
+ import { ... } from "@contractspec/bundle.library/hooks/studio";
25
28
  ```
26
29
 
27
- ## Commands
30
+ ## Guardrails
28
31
 
29
- ```bash
30
- bun build # Build bundle
31
- bun build:types # Type check
32
- bun lint # Lint code
33
- ```
32
+ - This bundle is consumed by multiple apps — breaking export changes cascade widely.
33
+ - MCP server implementations must stay transport-agnostic (the app layer wires the transport).
34
+ - Keep side effects behind explicit adapters; do not perform I/O at import time.
35
+
36
+ ## Local Commands
37
+
38
+ - Build: `bun run build`
39
+ - Types: `bun run build:types`
40
+ - Lint: `bun run lint`
package/CHANGELOG.md CHANGED
@@ -1,5 +1,51 @@
1
1
  # @contractspec/bundle.library
2
2
 
3
+ ## 3.1.1
4
+
5
+ ### Patch Changes
6
+
7
+ - f1a249b: Regenerate docs-index JSON files to reflect new provider-ranking, ACP, agent, context, and database contract documentation entries produced by the build.
8
+ - Updated dependencies [02c0cc5]
9
+ - @contractspec/lib.contracts-integrations@3.1.1
10
+ - @contractspec/lib.contracts-spec@3.1.1
11
+ - @contractspec/lib.design-system@3.1.1
12
+ - @contractspec/lib.knowledge@3.1.1
13
+ - @contractspec/module.context-storage@0.1.2
14
+ - @contractspec/lib.contracts-library@3.1.1
15
+ - @contractspec/lib.contracts-runtime-server-graphql@3.1.1
16
+ - @contractspec/lib.contracts-runtime-server-mcp@3.1.1
17
+ - @contractspec/lib.contracts-runtime-server-rest@3.1.1
18
+ - @contractspec/lib.example-shared-ui@3.1.1
19
+ - @contractspec/module.examples@3.1.1
20
+
21
+ ## 3.1.0
22
+
23
+ ### Minor Changes
24
+
25
+ - 28987eb: chore: upgrade dependencies
26
+
27
+ ### Patch Changes
28
+
29
+ - Updated dependencies [f2a4faf]
30
+ - Updated dependencies [28987eb]
31
+ - Updated dependencies [28987eb]
32
+ - @contractspec/lib.contracts-spec@3.1.0
33
+ - @contractspec/lib.contracts-runtime-server-graphql@3.1.0
34
+ - @contractspec/lib.contracts-runtime-server-rest@3.1.0
35
+ - @contractspec/lib.contracts-runtime-server-mcp@3.1.0
36
+ - @contractspec/lib.contracts-integrations@3.1.0
37
+ - @contractspec/lib.contracts-library@3.1.0
38
+ - @contractspec/lib.example-shared-ui@3.1.0
39
+ - @contractspec/lib.runtime-sandbox@2.1.0
40
+ - @contractspec/lib.design-system@3.1.0
41
+ - @contractspec/module.examples@3.1.0
42
+ - @contractspec/lib.ui-kit-web@3.1.0
43
+ - @contractspec/lib.knowledge@3.1.0
44
+ - @contractspec/lib.ui-link@3.1.0
45
+ - @contractspec/lib.logger@3.1.0
46
+ - @contractspec/lib.schema@3.1.0
47
+ - @contractspec/module.context-storage@0.1.1
48
+
3
49
  ## 3.0.0
4
50
 
5
51
  ### Major Changes
@@ -0,0 +1,18 @@
1
+ import type { DatabaseProvider, EmbeddingProvider, VectorStoreProvider } from '@contractspec/lib.contracts-integrations';
2
+ import { DocumentProcessor, type VectorIndexConfig } from '@contractspec/lib.knowledge/ingestion';
3
+ import { ContextSnapshotPipeline, PostgresContextStorage } from '@contractspec/module.context-storage';
4
+ export interface ContextStorageServiceOptions {
5
+ database: DatabaseProvider;
6
+ schema?: string;
7
+ createTablesIfMissing?: boolean;
8
+ documentProcessor?: DocumentProcessor;
9
+ embeddingProvider?: EmbeddingProvider;
10
+ embeddingBatchSize?: number;
11
+ vectorStoreProvider?: VectorStoreProvider;
12
+ vectorIndex?: VectorIndexConfig;
13
+ }
14
+ export interface ContextStorageService {
15
+ store: PostgresContextStorage;
16
+ pipeline: ContextSnapshotPipeline;
17
+ }
18
+ export declare function createContextStorageService(options: ContextStorageServiceOptions): ContextStorageService;
@@ -0,0 +1,29 @@
1
+ // @bun
2
+ // src/application/context-storage/index.ts
3
+ import {
4
+ EmbeddingService,
5
+ VectorIndexer
6
+ } from "@contractspec/lib.knowledge/ingestion";
7
+ import {
8
+ ContextSnapshotPipeline,
9
+ PostgresContextStorage
10
+ } from "@contractspec/module.context-storage";
11
+ function createContextStorageService(options) {
12
+ const store = new PostgresContextStorage({
13
+ database: options.database,
14
+ schema: options.schema,
15
+ createTablesIfMissing: options.createTablesIfMissing
16
+ });
17
+ const embeddingService = options.embeddingProvider ? new EmbeddingService(options.embeddingProvider, options.embeddingBatchSize) : undefined;
18
+ const vectorIndexer = options.vectorStoreProvider && options.vectorIndex ? new VectorIndexer(options.vectorStoreProvider, options.vectorIndex) : undefined;
19
+ const pipeline = new ContextSnapshotPipeline({
20
+ store,
21
+ documentProcessor: options.documentProcessor,
22
+ embeddingService,
23
+ vectorIndexer
24
+ });
25
+ return { store, pipeline };
26
+ }
27
+ export {
28
+ createContextStorageService
29
+ };
@@ -1 +1,2 @@
1
1
  export * from './mcp';
2
+ export * from './context-storage';