freddie 0.0.108 → 0.0.109

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "freddie",
3
- "version": "0.0.108",
3
+ "version": "0.0.109",
4
4
  "type": "module",
5
5
  "description": "Open JS agent harness built on pi-mono, floosie, xstate, and anentrypoint-design",
6
6
  "bin": {
@@ -1,20 +1,14 @@
1
- import { createRequire } from 'module'
2
1
  import { getConfigValue } from '../config.js'
3
2
  import { MATRIX_FILE } from './model-matrix.js'
4
3
  import { callLLM as bridgeCall, isReachable as bridgeReachable } from './acptoapi-bridge.js'
4
+ import * as sdkNs from 'acptoapi'
5
5
  export { matrixUsable } from './model-matrix.js'
6
6
 
7
- // In browser bundles createRequire('acptoapi') resolves to an empty/stub
8
- // module acptoapi is a node-only CJS package. Guard so consumers (browser
9
- // freddie) fall through to the acptoapi-bridge HTTP path instead of crashing
10
- // with 'sdk.buildAutoChain is not a function'.
11
- let sdk = {}
12
- try {
13
- const _require = createRequire(import.meta.url)
14
- sdk = _require('acptoapi') || {}
15
- } catch {
16
- sdk = {}
17
- }
7
+ // `acptoapi` is externalized by vite (browser) so the host environment
8
+ // supplies it (thebird ships docs/lib/acptoapi-browser.js via importmap).
9
+ // Node CLI gets the real CJS package. Defensive `|| {}` keeps the bundle
10
+ // boot-safe if either env hands back an empty namespace.
11
+ const sdk = (sdkNs && (sdkNs.default || sdkNs)) || {}
18
12
 
19
13
  export const PROVIDER_KEYS = sdk.PROVIDER_KEYS || {}
20
14
  export const DEFAULTS = sdk.PROVIDER_DEFAULTS || {}
@@ -1,12 +1,11 @@
1
1
  // Upstream model enumeration lives in acptoapi. This module is a thin shim
2
2
  // over GET /v1/models so freddie has zero direct vendor connectivity.
3
- import { createRequire } from 'module'
4
3
  import { getAcptoapiUrl } from './acptoapi-bridge.js'
5
4
  import { saveConfigValue, getConfigValue } from '../config.js'
6
5
  import { logger } from '../observability/log.js'
6
+ import * as _sdkNs from 'acptoapi'
7
7
 
8
- const _require = createRequire(import.meta.url)
9
- const _sdk = _require('acptoapi')
8
+ const _sdk = (_sdkNs && (_sdkNs.default || _sdkNs)) || {}
10
9
  const log = logger('model-discovery')
11
10
 
12
11
  const NON_KEY_PROVIDERS = ['claude-cli', 'kilo', 'opencode', 'ollama']