agentic-ads-engine 0.3.0 → 0.3.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
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "agentic-ads-engine",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "Offline ad templates, hook selection, policy lint, and planning tools",
5
5
  "type": "module",
6
- "engines": { "node": ">=20" },
6
+ "engines": { "node": ">=20.10" },
7
7
  "license": "MIT",
8
8
  "repository": { "type": "git", "url": "git+https://github.com/itsryanarmani/agentic-ads-engine.git" },
9
9
  "homepage": "https://github.com/itsryanarmani/agentic-ads-engine#readme",
@@ -1,6 +1,6 @@
1
1
  import { checklistFor, gateChecklistFor, costRatchet } from '../qa/index.js';
2
- import { readFileSync } from 'node:fs';
3
- const library = JSON.parse(readFileSync(new URL('./library.json', import.meta.url), 'utf8'));
2
+ import libraryJson from './library.json' with { type: 'json' };
3
+ const library = libraryJson;
4
4
  const costs = ['free', 'cheap', 'mid', 'expensive'], risks = ['low', 'medium', 'high'];
5
5
  function argumentsFor(value, keys) {
6
6
  if (!value || typeof value !== 'object' || Array.isArray(value) || Object.keys(value).some(k => !keys.includes(k))) throw new Error('Invalid format arguments');
@@ -1,9 +1,9 @@
1
1
  import { getFormat } from '../formats/index.js';
2
- import { readFileSync } from 'node:fs';
2
+ import libraryJson from './library.json' with { type: 'json' };
3
3
  import { mkdir, readFile, open, rename, unlink } from 'node:fs/promises';
4
4
  import { join } from 'node:path';
5
5
  import { randomUUID } from 'node:crypto';
6
- export const hooks = Object.freeze(JSON.parse(readFileSync(new URL('./library.json', import.meta.url), 'utf8'))
6
+ export const hooks = Object.freeze(structuredClone(libraryJson)
7
7
  .map(hook => Object.freeze({ ...hook, tags: Object.freeze(hook.tags), formats: Object.freeze(hook.formats) })));
8
8
  export const emotions = Object.freeze(['shock', 'fear', 'curiosity', 'relief', 'humor', 'pride']);
9
9
  /** Filters combine with AND; returned descriptors are independent copies. */
package/src/qa/index.js CHANGED
@@ -1,6 +1,7 @@
1
- import { readFileSync } from 'node:fs';
2
- const rules = JSON.parse(readFileSync(new URL('./rules.json', import.meta.url), 'utf8'));
3
- const gates = JSON.parse(readFileSync(new URL('./gates.json', import.meta.url), 'utf8'));
1
+ import rulesJson from './rules.json' with { type: 'json' };
2
+ import gatesJson from './gates.json' with { type: 'json' };
3
+ const rules = rulesJson;
4
+ const gates = gatesJson;
4
5
  export function gateChecklistFor(format) {
5
6
  return format.qaGates.map(id => {
6
7
  if (!Object.hasOwn(gates, id)) throw new Error('Unknown QA gate: ' + id);