@matatbread/matbot-core 0.1.8 → 0.2.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/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "node",
5
5
  "browser"
6
6
  ],
7
- "version": "0.1.8",
7
+ "version": "0.2.1",
8
8
  "engines": {
9
9
  "node": ">=24.0.0"
10
10
  },
@@ -12,6 +12,13 @@
12
12
  "src"
13
13
  ],
14
14
  "description": "matbot core runtime: agentic loop, hook dispatch, plugin loader, config, security, and knowledge. Exposes ./providers-base and ./storage-base for plugin authors.",
15
+ "keywords": [
16
+ "matbot",
17
+ "matbot-core",
18
+ "llm",
19
+ "ai",
20
+ "agent"
21
+ ],
15
22
  "license": "Apache-2.0",
16
23
  "type": "module",
17
24
  "exports": {
@@ -28,7 +35,7 @@
28
35
  "access": "public"
29
36
  },
30
37
  "dependencies": {
31
- "@matatbread/matbot-plugin-api": "^0.1.8"
38
+ "@matatbread/matbot-plugin-api": "^0.2.1"
32
39
  },
33
40
  "devDependencies": {
34
41
  "typescript": "^5.8.0"
package/src/index.ts CHANGED
@@ -1,7 +1,17 @@
1
1
  export type * from './types.js';
2
- // Explicit value re-export: MissingSecretError is a class, so the `export type *`
3
- // above would otherwise win and strip its value meaning under verbatimModuleSyntax.
4
- export { MissingSecretError, PromptCancelledError, IncompatibleRuntimeError, NotAPluginError, StoreQueryError } from '@matatbread/matbot-plugin-api';
2
+ // matbot's typed errors are duck-typed: factory `xError()` builders + `isXError()` brand guards are
3
+ // runtime values (re-exported here, since the `export type *` above would strip their value meaning),
4
+ // while the `XError` shapes are types (re-exported below). StoreQueryError is still a class value.
5
+ export {
6
+ missingSecretError, isMissingSecretError,
7
+ incompatibleRuntimeError, isIncompatibleRuntimeError,
8
+ notAPluginError, isNotAPluginError,
9
+ promptCancelledError, isPromptCancelledError,
10
+ StoreQueryError,
11
+ } from '@matatbread/matbot-plugin-api';
12
+ export type {
13
+ MissingSecretError, IncompatibleRuntimeError, NotAPluginError, PromptCancelledError, MatbotErrorKind,
14
+ } from '@matatbread/matbot-plugin-api';
5
15
  export { applyCreateSecret } from '@matatbread/matbot-plugin-api';
6
16
  // unifyServices is a runtime fn; the `export type *` above would otherwise strip its value meaning.
7
17
  export { unifyServices } from '@matatbread/matbot-plugin-api';
package/src/loader.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import type { MatbotPlugin, MatbotPluginSpec, MatbotMachine, PluginSource, Runtime } from './plugin.js';
2
2
  import type { PromptFn } from './types.js';
3
- import { IncompatibleRuntimeError, NotAPluginError } from '@matatbread/matbot-plugin-api';
3
+ import { incompatibleRuntimeError, notAPluginError } from '@matatbread/matbot-plugin-api';
4
4
  import { registerPlugin, setupPlugin, unloadPlugin } from './registry.js';
5
5
 
6
6
  /**
@@ -124,7 +124,7 @@ export async function loadPlugins(
124
124
  const runtimes = declared[i];
125
125
  if (runtimes !== undefined && runtimes.length > 0 && !runtimes.includes(CURRENT_RUNTIME)) {
126
126
  if (onLoadError === 'throw') {
127
- throw new IncompatibleRuntimeError(spec, runtimes, CURRENT_RUNTIME);
127
+ throw incompatibleRuntimeError(spec, runtimes, CURRENT_RUNTIME);
128
128
  }
129
129
  console.warn(`[matbot] Skipping plugin "${spec}": declares matbotRuntime [${runtimes.join(', ')}], host runtime is "${CURRENT_RUNTIME}".`);
130
130
  continue;
@@ -152,7 +152,7 @@ export async function loadPlugins(
152
152
  // permanently-not-a-plugin: it throws NotAPluginError so the `add` flow can roll back the config
153
153
  // write, where an import failure may be a fixable typo and is left in config.
154
154
  const failLoad = (spec: string, reason: string, kind: 'load' | 'shape' = 'load'): void => {
155
- if (onLoadError === 'throw') throw kind === 'shape' ? new NotAPluginError(spec, reason) : new Error(reason);
155
+ if (onLoadError === 'throw') throw kind === 'shape' ? notAPluginError(spec, reason) : new Error(reason);
156
156
  console.warn(`[matbot] Skipping plugin "${spec}": ${reason}`);
157
157
  };
158
158
 
@@ -1,5 +1,5 @@
1
1
  import type { Vault } from '@matatbread/matbot-plugin-api';
2
- import { MissingSecretError, applyCreateSecret } from '@matatbread/matbot-plugin-api';
2
+ import { missingSecretError, applyCreateSecret } from '@matatbread/matbot-plugin-api';
3
3
 
4
4
  const REF_RE = /\$\{([^}]+)\}/g;
5
5
 
@@ -59,7 +59,7 @@ export class VaultImpl implements Vault {
59
59
  });
60
60
 
61
61
  if (errors.length > 0) {
62
- throw new MissingSecretError(errors);
62
+ throw missingSecretError(errors);
63
63
  }
64
64
  return result;
65
65
  }