@gaia-ai/addon-essentials 0.10.0 → 0.11.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.
package/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
  # @gaia-ai/addon-essentials
2
2
 
3
- GAIA aggregator plugin: auto-loads the config-free dropsh essentials (markdown + authoritative JSON:API schema).
3
+ GAIA aggregator plugin: auto-loads the dropsh essentials (markdown + authoritative JSON:API schema) and the ambient-workspace filler.
4
4
 
5
5
  Part of the GAIA CLI. Install the meta package `@gaia-ai/gaia` to get the `gaia` CLI with all addons. Source: https://git.key-tec.de/keytec/gaia (gaia-cli/).
@@ -0,0 +1,23 @@
1
+ import type { DropSHPlugin } from 'dropsh/plugin';
2
+ /** Options essentials forwards to the children that take any. */
3
+ export interface EssentialsOptions {
4
+ /**
5
+ * GAIA-351: the ambient workspace uuid. It is the connection config's
6
+ * top-level, REQUIRED `workspace_id`, handed to every preset/descriptor as a
7
+ * global option by `loadGaiaConfig` — never written under an addon entry.
8
+ */
9
+ workspace_id?: string;
10
+ }
11
+ /**
12
+ * The config-free essentials (markdown renderer, authoritative JSON:API schema
13
+ * and GAIA-403's name resolver, which lives in its own
14
+ * `@gaia-ai/addon-name-refs` package) plus GAIA-351's ambient-workspace filler.
15
+ *
16
+ * The workspace child is the one that reads an option, and it is appended only
17
+ * when a uuid is actually present. That guard is not a "configured?" toggle —
18
+ * `workspace_id` is required at config load, so a missing one means this
19
+ * discovery bypassed `loadGaiaConfig` entirely (a hand-built context, a test),
20
+ * where contributing a plugin with no uuid to inject would be worse than
21
+ * contributing none.
22
+ */
23
+ export declare function essentialChildren(opts?: EssentialsOptions): DropSHPlugin[];
@@ -0,0 +1,34 @@
1
+ // The one place that says which plugins `@gaia-ai/addon-essentials` pulls in.
2
+ //
3
+ // It exists because essentials is reachable through TWO config forms that must
4
+ // not drift: the legacy `plugins: [{ plugin: '@gaia-ai/addon-essentials' }]`
5
+ // descriptor, which constructs this package's DEFAULT EXPORT, and the
6
+ // Storybook-style `addons: ['@gaia-ai/addon-essentials']`, which runs its
7
+ // `./preset`. Both call this function, so a child added here appears on both.
8
+ import { jsonapiSchemaPlugin } from '@dropsh/plugin-jsonapi-schema';
9
+ import { markdownPlugin } from '@dropsh/plugin-markdown';
10
+ import { nameRefsPlugin } from '@gaia-ai/addon-name-refs';
11
+ import { workspacePlugin } from '@gaia-ai/addon-workspace';
12
+ /**
13
+ * The config-free essentials (markdown renderer, authoritative JSON:API schema
14
+ * and GAIA-403's name resolver, which lives in its own
15
+ * `@gaia-ai/addon-name-refs` package) plus GAIA-351's ambient-workspace filler.
16
+ *
17
+ * The workspace child is the one that reads an option, and it is appended only
18
+ * when a uuid is actually present. That guard is not a "configured?" toggle —
19
+ * `workspace_id` is required at config load, so a missing one means this
20
+ * discovery bypassed `loadGaiaConfig` entirely (a hand-built context, a test),
21
+ * where contributing a plugin with no uuid to inject would be worse than
22
+ * contributing none.
23
+ */
24
+ export function essentialChildren(opts = {}) {
25
+ const workspaceId = typeof opts.workspace_id === 'string' ? opts.workspace_id.trim() : '';
26
+ return [
27
+ markdownPlugin(),
28
+ jsonapiSchemaPlugin(),
29
+ nameRefsPlugin(),
30
+ ...(workspaceId === ''
31
+ ? []
32
+ : [workspacePlugin({ workspace_id: workspaceId })]),
33
+ ];
34
+ }
@@ -1,16 +1,23 @@
1
+ import { type EssentialsOptions } from './children.js';
1
2
  /**
2
- * Aggregator: pull the config-free dropsh essentials in through a single
3
- * `plugins[]` entry. `composePlugins(...)` returns the flat child list; dropsh
4
- * (>= 0.5.6) flattens a plugins[] entry that resolves to an array into separate
5
- * plugin entries, and the conductor's own resolver does the same — so each
6
- * child stays a distinct, genuine plugin, indistinguishable from listing them
7
- * one by one. No hand-merged or presence-guarded composite hooks.
3
+ * Aggregator: pull the essentials in through a single `plugins[]` entry.
4
+ * `composePlugins(...)` returns the flat child list; dropsh (>= 0.5.6) flattens
5
+ * a plugins[] entry that resolves to an array into separate plugin entries, and
6
+ * the conductor's own resolver does the same — so each child stays a distinct,
7
+ * genuine plugin, indistinguishable from listing them one by one. No hand-merged
8
+ * or presence-guarded composite hooks.
8
9
  *
9
10
  * `authProvider`-carrying plugins (oauth2, with per-profile credentials) are
10
11
  * deliberately NOT here — they stay explicit in the config (AC-4).
11
12
  *
12
- * Add a new config-free essential = instantiate it here (+ a real dependency in
13
+ * GAIA-351: `@gaia-ai/addon-workspace` is a child too, so the ambient workspace
14
+ * is filled on every connection without any config naming it. The uuid reaches
15
+ * this factory as the descriptor's options, which `loadGaiaConfig` seeds from
16
+ * the connection config's top-level, required `workspace_id`.
17
+ *
18
+ * Add a new essential = add it in `children.ts` (+ a real dependency in
13
19
  * package.json). Existing configs naming only this aggregator pick it up (AC-5).
14
20
  */
15
- declare const _default: () => import("dropsh/plugin").DropSHPlugin[];
21
+ declare const _default: (opts?: EssentialsOptions) => import("dropsh/plugin").DropSHPlugin[];
16
22
  export default _default;
23
+ export { type EssentialsOptions, essentialChildren } from './children.js';
package/dist/src/index.js CHANGED
@@ -1,18 +1,23 @@
1
- import { jsonapiSchemaPlugin } from '@dropsh/plugin-jsonapi-schema';
2
- import { markdownPlugin } from '@dropsh/plugin-markdown';
3
1
  import { composePlugins } from 'dropsh/plugin';
2
+ import { essentialChildren } from './children.js';
4
3
  /**
5
- * Aggregator: pull the config-free dropsh essentials in through a single
6
- * `plugins[]` entry. `composePlugins(...)` returns the flat child list; dropsh
7
- * (>= 0.5.6) flattens a plugins[] entry that resolves to an array into separate
8
- * plugin entries, and the conductor's own resolver does the same — so each
9
- * child stays a distinct, genuine plugin, indistinguishable from listing them
10
- * one by one. No hand-merged or presence-guarded composite hooks.
4
+ * Aggregator: pull the essentials in through a single `plugins[]` entry.
5
+ * `composePlugins(...)` returns the flat child list; dropsh (>= 0.5.6) flattens
6
+ * a plugins[] entry that resolves to an array into separate plugin entries, and
7
+ * the conductor's own resolver does the same — so each child stays a distinct,
8
+ * genuine plugin, indistinguishable from listing them one by one. No hand-merged
9
+ * or presence-guarded composite hooks.
11
10
  *
12
11
  * `authProvider`-carrying plugins (oauth2, with per-profile credentials) are
13
12
  * deliberately NOT here — they stay explicit in the config (AC-4).
14
13
  *
15
- * Add a new config-free essential = instantiate it here (+ a real dependency in
14
+ * GAIA-351: `@gaia-ai/addon-workspace` is a child too, so the ambient workspace
15
+ * is filled on every connection without any config naming it. The uuid reaches
16
+ * this factory as the descriptor's options, which `loadGaiaConfig` seeds from
17
+ * the connection config's top-level, required `workspace_id`.
18
+ *
19
+ * Add a new essential = add it in `children.ts` (+ a real dependency in
16
20
  * package.json). Existing configs naming only this aggregator pick it up (AC-5).
17
21
  */
18
- export default () => composePlugins(markdownPlugin(), jsonapiSchemaPlugin());
22
+ export default (opts = {}) => composePlugins(...essentialChildren(opts));
23
+ export { essentialChildren } from './children.js';
@@ -1,2 +1,3 @@
1
1
  import type { GaiaPreset } from '@gaia-ai/core';
2
- export declare const connectionPlugins: GaiaPreset['connectionPlugins'];
2
+ import { type EssentialsOptions } from './children.js';
3
+ export declare const connectionPlugins: GaiaPreset<EssentialsOptions>['connectionPlugins'];
@@ -1,14 +1,16 @@
1
1
  // GAIA-215: the essentials meta-addon self-declares its connection contributions
2
- // via `./preset`. It pulls the config-free dropsh essentials (markdown renderer +
3
- // authoritative JSON:API schema) into the connection surface through a single
4
- // entry `composePlugins(...)` returns the flat child list, exactly as the old
5
- // default-export aggregator did, so each child stays a distinct plugin. The
6
- // children are essentials' OWN deps (imported here, resolved from this package's
2
+ // via `./preset`. It pulls the essentials into the connection surface through a
3
+ // single entry the children are returned flat, exactly as the default-export
4
+ // aggregator does, so each child stays a distinct plugin. The children are
5
+ // essentials' OWN deps (imported in `children.ts`, resolved from this package's
7
6
  // node_modules), so no fragile transitive resolution from the config's bases.
8
- import { jsonapiSchemaPlugin } from '@dropsh/plugin-jsonapi-schema';
9
- import { markdownPlugin } from '@dropsh/plugin-markdown';
10
- import { composePlugins } from 'dropsh/plugin';
11
- export const connectionPlugins = (acc) => [
7
+ //
8
+ // GAIA-351: one of those children is `@gaia-ai/addon-workspace`, and it is the
9
+ // only one that reads an option. `opts` here is not an addon entry's `with` —
10
+ // no config writes one but the GLOBAL options `loadGaiaConfig` hands every
11
+ // preset, seeded from the connection config's top-level, required `workspace_id`.
12
+ import { essentialChildren } from './children.js';
13
+ export const connectionPlugins = (acc, opts) => [
12
14
  ...acc,
13
- ...composePlugins(markdownPlugin(), jsonapiSchemaPlugin()),
15
+ ...essentialChildren((opts ?? {})),
14
16
  ];
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@gaia-ai/addon-essentials",
3
- "version": "0.10.0",
4
- "description": "GAIA aggregator plugin: auto-loads the config-free dropsh essentials (markdown + authoritative JSON:API schema).",
3
+ "version": "0.11.1",
4
+ "description": "GAIA aggregator plugin: auto-loads the dropsh essentials (markdown + authoritative JSON:API schema) and the ambient-workspace filler.",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "exports": {
@@ -20,11 +20,13 @@
20
20
  "directory": "gaia-cli/addons/essentials"
21
21
  },
22
22
  "dependencies": {
23
- "@dropsh/plugin-markdown": "^0.5.8",
24
- "@dropsh/plugin-jsonapi-schema": "^0.5.8",
25
- "dropsh": "^0.5.8"
23
+ "@dropsh/plugin-markdown": "^0.6.1",
24
+ "@dropsh/plugin-jsonapi-schema": "^0.6.1",
25
+ "@gaia-ai/addon-name-refs": "^0.11.1",
26
+ "@gaia-ai/addon-workspace": "^0.11.1",
27
+ "dropsh": "^0.6.1"
26
28
  },
27
29
  "peerDependencies": {
28
- "@gaia-ai/core": "^0.10.0"
30
+ "@gaia-ai/core": "^0.11.1"
29
31
  }
30
32
  }