@toa.io/norm 1.0.0-alpha.332 → 1.0.0-alpha.333

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/CHANGELOG.md CHANGED
@@ -3,6 +3,17 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [1.0.0-alpha.333](https://github.com/toa-io/toa/compare/v1.0.0-alpha.332...v1.0.0-alpha.333) (2026-10-26)
7
+
8
+ ### Bug Fixes
9
+
10
+ * **norm:** what an extension deployed for its annotation ships is the context's ([06432b7](https://github.com/toa-io/toa/commit/06432b7840cca907884c653ff580e27bcbc13786))
11
+
12
+ ### Features
13
+
14
+ * **chronicles:** a ClickHouse log of a context, read over MCP ([c94f693](https://github.com/toa-io/toa/commit/c94f693ad59d3156450a8041c101380ba1f42274))
15
+
16
+
6
17
  # [1.0.0-alpha.332](https://github.com/toa-io/toa/compare/v1.0.0-alpha.331...v1.0.0-alpha.332) (2026-10-23)
7
18
 
8
19
  **Note:** Version bump only for package @toa.io/norm
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@toa.io/norm",
3
- "version": "1.0.0-alpha.332",
3
+ "version": "1.0.0-alpha.333",
4
4
  "type": "module",
5
5
  "description": "Toa declarations normalization and validation",
6
6
  "author": "temich <tema.gurtovoy@gmail.com>",
@@ -21,12 +21,12 @@
21
21
  "test": "echo \"Error: run tests from root\" && exit 1"
22
22
  },
23
23
  "dependencies": {
24
- "@toa.io/core": "1.0.0-alpha.332",
25
- "@toa.io/definitions": "1.0.0-alpha.332",
24
+ "@toa.io/core": "1.0.0-alpha.333",
25
+ "@toa.io/definitions": "1.0.0-alpha.333",
26
26
  "@toa.io/generic": "1.0.0-alpha.332",
27
27
  "@toa.io/prototype": "1.0.0-alpha.327",
28
28
  "@toa.io/schemas": "1.0.0-alpha.332",
29
29
  "tinyglobby": "0.2.17"
30
30
  },
31
- "gitHead": "37dbdefd96c01df050ea0d46a647da7f2f9f93f2"
31
+ "gitHead": "ddb74b2f99026fae540a8a8e0a49c26cbd22886a"
32
32
  }
@@ -13,6 +13,7 @@ const SHORTCUTS = {
13
13
  stash: '@toa.io/extensions.stash',
14
14
  storages: '@toa.io/extensions.storages',
15
15
  cadence: '@toa.io/extensions.cadence',
16
+ chronicles: '@toa.io/extensions.chronicles',
16
17
  continuity: '@toa.io/extensions.continuity',
17
18
  introspection: '@toa.io/extensions.introspection',
18
19
  telemetry: '@toa.io/extensions.telemetry'
@@ -15,9 +15,18 @@ export const extensions = async (context) => {
15
15
  // and its own components must be extracted all the same
16
16
  const declared = await extractDeclaredServices(context, extensions, contributed)
17
17
 
18
- const extracted = declared.concat(
18
+ // and so may one deployed for its annotation alone
19
+ const { references: annotated, extracted: standing } = await extractAnnotatedServices(
20
+ context,
21
+ extensions,
22
+ contributed
23
+ )
24
+
25
+ const listed = declared.concat(standing)
26
+
27
+ const extracted = listed.concat(
19
28
  await extractExtensionComponents(
20
- components.concat(declared),
29
+ components.concat(listed),
21
30
  extensions,
22
31
  contributed,
23
32
  context.annotations
@@ -39,7 +48,7 @@ export const extensions = async (context) => {
39
48
  }
40
49
  }
41
50
 
42
- return { extensions, components: extracted, contributed }
51
+ return { extensions, components: extracted, contributed, annotated }
43
52
  }
44
53
 
45
54
  async function extractDeclaredServices(context, extensions, contributed) {
@@ -65,6 +74,40 @@ async function extractDeclaredServices(context, extensions, contributed) {
65
74
  return extracted
66
75
  }
67
76
 
77
+ /**
78
+ * The components of the extensions a context annotates that deploy for their annotation, which
79
+ * no component of the context need reference: what such an extension ships is the context's as
80
+ * much as what a composition runs is.
81
+ */
82
+ async function extractAnnotatedServices(context, extensions, contributed) {
83
+ const references = []
84
+ const extracted = []
85
+
86
+ for (const reference of Object.keys(context.annotations ?? {})) {
87
+ if (reference in extensions) continue
88
+
89
+ const module = await optional(reference)
90
+
91
+ if (module?.standalone !== true) continue
92
+
93
+ references.push(reference)
94
+ extracted.push(
95
+ ...(await extract(reference, extensions, contributed, context.annotations))
96
+ )
97
+ }
98
+
99
+ return { references, extracted }
100
+ }
101
+
102
+ /** What a reference defines, or nothing where it names no package. */
103
+ async function optional(reference) {
104
+ try {
105
+ return (await definition(reference)).module
106
+ } catch {
107
+ return null
108
+ }
109
+ }
110
+
68
111
  async function extractExtensionComponents(
69
112
  components,
70
113
  extensions,
@@ -1,9 +1,9 @@
1
1
  import { connectors, extensions, resolve } from './.dependencies/index.js'
2
2
 
3
3
  export const dependencies = async (context) => {
4
- const { extensions: e, components, contributed } = await extensions(context)
4
+ const { extensions: e, components, contributed, annotated } = await extensions(context)
5
5
 
6
- unmanaged(context, contributed)
6
+ unmanaged(context, contributed, annotated)
7
7
 
8
8
  const c = connectors(context, components)
9
9
  const references = { ...c, ...e }
@@ -19,9 +19,10 @@ export const dependencies = async (context) => {
19
19
  *
20
20
  * @param {toa.norm.Context} context
21
21
  * @param {Map<string, toa.norm.Component[]>} contributed
22
+ * @param {string[]} annotated the extensions deployed for their annotation
22
23
  * @returns {void}
23
24
  */
24
- function unmanaged(context, contributed) {
25
+ function unmanaged(context, contributed, annotated) {
25
26
  const components = context.components ?? []
26
27
 
27
28
  if (!components.some((component) => component.evicted === true)) return
@@ -34,6 +35,9 @@ function unmanaged(context, contributed) {
34
35
  for (const reference of composition.services ?? [])
35
36
  pending.push(...(contributed.get(reference) ?? []))
36
37
 
38
+ // and so is what an extension deployed for its annotation ships
39
+ for (const reference of annotated) pending.push(...(contributed.get(reference) ?? []))
40
+
37
41
  while (pending.length > 0) {
38
42
  const component = pending.pop()
39
43
 
package/src/shortcuts.js CHANGED
@@ -49,6 +49,7 @@ export const SHORTCUTS = {
49
49
  storages: '@toa.io/extensions.storages',
50
50
  telemetry: '@toa.io/extensions.telemetry',
51
51
  cadence: '@toa.io/extensions.cadence',
52
+ chronicles: '@toa.io/extensions.chronicles',
52
53
  continuity: '@toa.io/extensions.continuity',
53
54
  convergence: '@toa.io/extensions.convergence',
54
55
  introspection: '@toa.io/extensions.introspection'