@ai-markdown/core 3.0.0-beta.2 → 3.0.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 +16 -9
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,14 +1,21 @@
|
|
|
1
1
|
# @ai-markdown/core
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://www.npmjs.com/package/@ai-markdown/core?activeTab=versions)
|
|
4
|
+
[](https://www.npmjs.com/package/@ai-markdown/core)
|
|
5
|
+
[](https://github.com/ai-markdown/ai-markdown/tree/main/packages/core)
|
|
6
|
+
[](https://github.com/ai-markdown/ai-markdown/blob/main/LICENSE)
|
|
4
7
|
|
|
5
|
-
|
|
8
|
+
Framework-independent orchestration for ai-markdown adapters, on the **3.0.0** train alongside the React and Vue adapters. It supplies pipeline sessions, block planning, cross-chunk contributions, aggregate footnote trees and streaming coordination. Applications install `@ai-markdown/react` or `@ai-markdown/vue`; adapter authors can install `@ai-markdown/core` and `@ai-markdown/engine` directly.
|
|
9
|
+
|
|
10
|
+
This package was the private runtime in the legacy v2.14.1 release. It is now a real external dependency of both framework adapters, with an explicit public export list. The old `@ai-react-markdown/core` React package maps to `@ai-markdown/react`, not this package. See the [migration guide](../../docs/framework-transition.md). Public contracts follow semantic versioning from 3.0.0; keep the shared packages at the same exact train version.
|
|
6
11
|
|
|
7
12
|
## Responsibility and dependency direction
|
|
8
13
|
|
|
9
14
|
```text
|
|
10
|
-
|
|
11
|
-
|
|
15
|
+
@ai-markdown/react-mantine → @ai-markdown/react (peer)
|
|
16
|
+
@ai-markdown/react → @ai-markdown/core + @ai-markdown/engine
|
|
17
|
+
@ai-markdown/vue → @ai-markdown/core + @ai-markdown/engine
|
|
18
|
+
@ai-markdown/core → @ai-markdown/engine
|
|
12
19
|
```
|
|
13
20
|
|
|
14
21
|
The adapter may also consume engine primitives directly. Shared core does not duplicate the engine's public barrel or wrap every engine function merely to rename it. It owns reusable orchestration that would otherwise have to be copied into another framework adapter.
|
|
@@ -27,7 +34,7 @@ The adapter may also consume engine primitives directly. Shared core does not du
|
|
|
27
34
|
|
|
28
35
|
The engine remains responsible for grammar, preprocessing, plugin chains, scanners, incremental parsing algorithms, registry storage/indexing, reference resolution and URL policy primitives. Shared core uses those algorithms to implement reusable rendering decisions.
|
|
29
36
|
|
|
30
|
-
|
|
37
|
+
Framework adapters retain component construction and lifecycle integration. React retains `ReactNode` caching, contexts, effects, `useSyncExternalStore`, registration lifetimes, provenance credential allocation, final element conversion and DOM cursor measurement. Shared core's root has no React, Vue, Svelte or DOM dependency. Its production source is typechecked without the DOM libraries. Node types supply declarations for cross-host primitives such as `queueMicrotask`; they do not add a Node runtime dependency.
|
|
31
38
|
|
|
32
39
|
## A pipeline session is local to one consumer
|
|
33
40
|
|
|
@@ -66,7 +73,7 @@ const blocks = planBlocks(trees.mdast, trees.hast, content);
|
|
|
66
73
|
// Convert blocks.plan using the host renderer; use item.key for sibling identity.
|
|
67
74
|
```
|
|
68
75
|
|
|
69
|
-
This is
|
|
76
|
+
This is a standalone example using the public package entries. A coordinated adapter must obtain a per-instance provenance credential, pass the same credential to the engine's verifier and coordinated handlers, derive actual phantom targets, and preserve definition bodies while registered. A constant credential from an example is not suitable for that path.
|
|
70
77
|
|
|
71
78
|
The host chooses `incrementalParse: false` for a one-shot server render. Shared core does not inspect `window` to infer the host. A later incremental frame starts from fresh state after a non-incremental frame. Call `reset()` when the host invalidates retained parse state because render policy changed. Parse-input identities are also checked by the engine's dependency key; phantom suffix changes remain always-tail input rather than invalidating all retained source.
|
|
72
79
|
|
|
@@ -82,7 +89,7 @@ An incremental failure clears the retained state before retrying the full pipeli
|
|
|
82
89
|
|
|
83
90
|
These functions do not register, subscribe, publish or mutate their supplied snapshots. Treat label sets and returned objects as immutable; pass a previous result only from the same logical consumer. React retains the previous snapshots in refs and uses memoization; Vue uses local variables behind computed values. The engine and planner still own correctness when a source is replaced or a retained render is discarded.
|
|
84
91
|
|
|
85
|
-
The Vue
|
|
92
|
+
The published [Vue adapter](../vue/README.md) uses these decisions in its component lifecycle while keeping AST/registry objects out of deep reactive proxies. It has SSR, hydration, slots, base styles and cursor support, with separate adapter and Chromium lifecycle tests. The earlier private prototype is archived under `prototypes/` and is not the application entry point.
|
|
86
93
|
|
|
87
94
|
## Preparation and commit have different effects
|
|
88
95
|
|
|
@@ -121,7 +128,7 @@ The dedicated `test:core-contracts` gate builds core and its workspace dependenc
|
|
|
121
128
|
|
|
122
129
|
`assert-boundary.mjs` checks public-package identity, allowed production dependencies, source import direction and folded environment gates. The React distribution guard requires external core and engine imports. Core's declarations must not expose `RegistryInternal`, `SmoothCoordinatorInternal` or private refcount/subscriber containers.
|
|
123
130
|
|
|
124
|
-
The release train is engine/core/react/react-mantine/vue at the same version. Vue now consumes the same shared contracts; see the [API contracts](../../docs/api/core-engine-contracts.md) for the
|
|
131
|
+
The release train is engine/core/react/react-mantine/vue at the same version. Vue now consumes the same shared contracts; see the [API contracts](../../docs/api/core-engine-contracts.md) for the beta.1-to-beta.2 signature changes. Core depends on engine through `workspace:*`, which becomes the exact train version in the published manifest. Both ESM and CJS have production and development entries; every build folds environment gates separately. Core has no `use client` directive and does not inline a second engine implementation.
|
|
125
132
|
|
|
126
133
|
## Public API and write capabilities
|
|
127
134
|
|
|
@@ -129,4 +136,4 @@ The root entry explicitly lists supported beta exports. Session creation, parsin
|
|
|
129
136
|
|
|
130
137
|
`createSmoothCoordinator` returns the read-only state and documented methods of `SmoothCoordinator`, excluding internal refcounts and notification containers. `ContributionOptions.registry` accepts only a `ContributionRegistry` write capability with `contributeChunkData`; it does not require an implementation registry. Create a registry through engine's `createRegistry`, whose `RegistryController` adds registration and publication to the read-only `Registry` contract. Pair every registration with release in the owning adapter.
|
|
131
138
|
|
|
132
|
-
These are type-level API boundaries, not object freezing or arbitrary deep cloning. Mutating returned sets, tree data or undocumented implementation fields is unsupported.
|
|
139
|
+
These are type-level API boundaries, not object freezing or arbitrary deep cloning. Mutating returned sets, tree data or undocumented implementation fields is unsupported. Public contracts and checked signatures are recorded in the [API contract document](../../docs/api/core-engine-contracts.md).
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ai-markdown/core",
|
|
3
|
-
"version": "3.0.0
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"description": "Framework-independent pipeline sessions, block planning, cross-chunk contributions and streaming coordination for ai-markdown adapters.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"engines": {
|
|
8
|
-
"node": ">=
|
|
8
|
+
"node": "^20.19.0 || >=22.12.0"
|
|
9
9
|
},
|
|
10
10
|
"sideEffects": false,
|
|
11
11
|
"main": "./dist/index.cjs",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"@types/hast": "^3.0.5",
|
|
34
34
|
"@types/mdast": "^4.0.4",
|
|
35
35
|
"unist-util-visit": "^5.1.0",
|
|
36
|
-
"@ai-markdown/engine": "3.0.0
|
|
36
|
+
"@ai-markdown/engine": "3.0.0"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@types/node": "^25.9.5",
|