yt-briefing 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.
@@ -17,7 +17,7 @@
17
17
  */
18
18
  import { readFileSync, writeFileSync, mkdirSync } from 'node:fs';
19
19
  import { join, resolve } from 'node:path';
20
- import { PKG_ROOT } from "./paths.js";
20
+ import { PKG_ROOT, DATA_DIR } from "./paths.js";
21
21
  /** Compiled output dir — what a baked (dist) skill command points the runtime at. */
22
22
  const DIST_DIR = join(PKG_ROOT, 'dist');
23
23
  /** True when the installer itself is running under Bun (vs plain Node). */
@@ -39,8 +39,11 @@ export const AGENTS = {
39
39
  /**
40
40
  * The shipped SKILL.md. `dist=false` (default) returns it verbatim — the `bun run src/X.ts`
41
41
  * dev form, correct only when cwd is the package AND the runtime is Bun. `dist=true` rewrites
42
- * the engine commands to `"<process.execPath>" "<abs>/dist/X.js"` — this machine's runtime
43
- * (Node or Bun) against the compiled build, so it runs from any cwd.
42
+ * for the consumed case: engine commands become `"<process.execPath>" "<abs>/dist/X.js"` (this
43
+ * machine's runtime, Node or Bun, against the compiled build, so they run from any cwd), and the
44
+ * bare `data/…` paths the agent reads (e.g. `data/config.json`) become the absolute `DATA_DIR`.
45
+ * In dev the agent's cwd IS the package so `data/` resolves; when consumed, DATA_DIR moves to
46
+ * `<project>/.yt-briefing/data`, so the dev-relative paths would miss — hence the rewrite.
44
47
  */
45
48
  export function skillBody(dist = false) {
46
49
  const raw = readFileSync(SOURCE, 'utf8');
@@ -50,7 +53,8 @@ export function skillBody(dist = false) {
50
53
  const cmd = (base) => `"${exe}" "${join(DIST_DIR, base + '.js')}"`;
51
54
  return raw
52
55
  .replace(/bun run src\/yt-sweep\.ts/g, cmd('yt-sweep'))
53
- .replace(/bun run src\/yt-rating\.ts/g, cmd('yt-rating'));
56
+ .replace(/bun run src\/yt-rating\.ts/g, cmd('yt-rating'))
57
+ .replace(/data\//g, DATA_DIR + '/');
54
58
  }
55
59
  /** Write the skill into `dir` (created if needed). Returns the SKILL.md path written. */
56
60
  export function installSkill(dir, dist = false) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yt-briefing",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "A self-learning YouTube briefing engine: it sweeps the channels you follow, filters noise in two stages (title, then transcript), summarizes the rest in your language, and adapts to your ratings — one video at a time.",
5
5
  "type": "module",
6
6
  "bin": {