shraga 0.1.11 → 0.1.12

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": "shraga",
3
- "version": "0.1.11",
3
+ "version": "0.1.12",
4
4
  "description": "The teammate you delegate coding to — a self-hostable, multi-user AI coding agent web UI (Claude Code, with a pluggable engine seam).",
5
5
  "type": "module",
6
6
  "main": "./src/index.ts",
@@ -1,5 +1,13 @@
1
+ import { fileURLToPath } from 'node:url';
1
2
  import type { Schedule } from './types.ts';
2
3
 
4
+ // The conversation summarizer is one of Shraga's own scripts. Reference it by an ABSOLUTE path
5
+ // resolved from this module, so `bun run <it>` works from any cwd and whether Shraga runs from
6
+ // source (src/) or is consumed as an npm package (node_modules/shraga/src/). A bare
7
+ // `bun run summarize:conversations` only works when the app-root package.json is Shraga's own,
8
+ // which it is NOT for an npm-consumer app.
9
+ const SUMMARIZER_CMD = `bun run ${fileURLToPath(new URL('../../scripts/summarize-conversations.ts', import.meta.url))}`;
10
+
3
11
  export const SYSTEM_UID = '__system__';
4
12
  export const NIGHTLY_RECONCILE_SCHEDULE_ID = 'builtin-nightly-reconcile';
5
13
  export const DAILY_GARDEN_SCHEDULE_ID = 'builtin-daily-garden';
@@ -51,11 +59,16 @@ export function backfillScope(schedules: Schedule[]): void {
51
59
  const legacyMap: Record<string, string> = {
52
60
  'daily-facebook-ads-spend': 'bun run data/scripts/daily-fb-ads-spend.ts',
53
61
  'daily-payback-sheet': 'bun run data/scripts/daily-payback-sheet.ts --slack',
54
- 'conversation-summarizer': 'bun run summarize:conversations',
62
+ 'conversation-summarizer': SUMMARIZER_CMD,
55
63
  };
56
64
  task.command = legacyMap[task.jobId] ?? task.jobId;
57
65
  delete task.jobId;
58
66
  }
67
+ // Heal a persisted summarizer command that still uses the app-root package-script form
68
+ // (breaks for npm-consumer apps) → the resolved absolute path.
69
+ if (task.kind === 'job' && task.command === 'bun run summarize:conversations') {
70
+ task.command = SUMMARIZER_CMD;
71
+ }
59
72
  }
60
73
  }
61
74
 
@@ -81,7 +94,7 @@ export function ensureBuiltinSchedules(schedules: Schedule[]): Schedule[] {
81
94
  name: 'Conversation Summarizer',
82
95
  enabled: false,
83
96
  trigger: { kind: 'cron', expr: '0 * * * *', tz: 'UTC' },
84
- task: { kind: 'job', command: 'bun run summarize:conversations' },
97
+ task: { kind: 'job', command: SUMMARIZER_CMD },
85
98
  scope: 'system',
86
99
  createdBy: { uid: SYSTEM_UID, email: 'system@shraga.local' },
87
100
  createdAt: now,