# docs/lib

`agentjs.es.js` is @prayas_abhinav/agentjs-core 1.2.0: a copy of `dist/index.es.js` built from this repository at version 1.2.0, with three comment lines added on top and its last line, the source map reference, left out (the map is not copied). The site loads this copy rather than a CDN because npm has only 1.0.1.

To rebuild it after a change to `src/`:

```bash
npm run build:framework
{ head -3 docs/lib/agentjs.es.js; sed '$ d' dist/index.es.js; } > docs/lib/agentjs.es.js.new && mv docs/lib/agentjs.es.js.new docs/lib/agentjs.es.js
```

The build imports `@tensorflow/tfjs` by name, which a browser cannot resolve on its own, so every page carries an import map. Pages without NSMnum map it to `no-tfjs.js`, an empty module, because the library calls TensorFlow.js only inside NSMnum and its ML classes. The NSMnum example maps it to `https://cdnjs.cloudflare.com/ajax/libs/tensorflow/4.22.0/tf.fesm.min.js`, the version in `package-lock.json`.
