@phyzess/pappra 0.1.0-beta.1 → 0.1.0-beta.3

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.
@@ -55,8 +55,26 @@ export async function loadHostBundle(host, packageVersion, options = {}) {
55
55
  kind: source.endsWith('/SKILL.md') ? 'skill' : 'reference',
56
56
  });
57
57
  }
58
- const template = renderHostTemplate(host, options.runtimeEntry ??
59
- join(packageRoot(), 'dist/hosts/integration/hook-entry.js'));
58
+ const hookSource = options.hookSource ??
59
+ join(packageRoot(), 'dist/hosts/integration/pappra-hook.mjs');
60
+ const hookBytes = await readFile(hookSource);
61
+ contents.set('hooks/pappra-hook.mjs', hookBytes);
62
+ files.push({
63
+ path: 'hooks/pappra-hook.mjs',
64
+ digest: sha256Digest(hookBytes),
65
+ kind: 'hook',
66
+ });
67
+ if (host === 'pi') {
68
+ const runtimePath = join(dirname(hookSource), 'pappra-extension-runtime.mjs');
69
+ const runtimeBytes = await readFile(runtimePath);
70
+ contents.set('templates/pi/runtime.mjs', runtimeBytes);
71
+ files.push({
72
+ path: 'templates/pi/runtime.mjs',
73
+ digest: sha256Digest(runtimeBytes),
74
+ kind: 'extension',
75
+ });
76
+ }
77
+ const template = renderHostTemplate(host, options.hookExpression ?? hookSource);
60
78
  contents.set(template.path, template.bytes);
61
79
  files.push({
62
80
  path: template.path,