@project-ava-supernova/core 0.2.176 → 0.2.178

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.
Files changed (197) hide show
  1. package/dist/agent/agent.d.ts +3 -0
  2. package/dist/agent/agent.d.ts.map +1 -1
  3. package/dist/agent/agent.js +44 -11
  4. package/dist/agent/agent.js.map +1 -1
  5. package/dist/agent/social-craft.d.ts +30 -67
  6. package/dist/agent/social-craft.d.ts.map +1 -1
  7. package/dist/agent/social-craft.js +58 -185
  8. package/dist/agent/social-craft.js.map +1 -1
  9. package/dist/agent/system-prompt.d.ts +10 -3
  10. package/dist/agent/system-prompt.d.ts.map +1 -1
  11. package/dist/agent/system-prompt.js +1184 -1321
  12. package/dist/agent/system-prompt.js.map +1 -1
  13. package/dist/auto/aurora-router.d.ts +1 -1
  14. package/dist/auto/aurora-router.d.ts.map +1 -1
  15. package/dist/auto/aurora-router.js +4 -1
  16. package/dist/auto/aurora-router.js.map +1 -1
  17. package/dist/auto/auto-coordinator.d.ts.map +1 -1
  18. package/dist/auto/auto-coordinator.js +2 -1
  19. package/dist/auto/auto-coordinator.js.map +1 -1
  20. package/dist/auto/longxiang-router.d.ts.map +1 -1
  21. package/dist/auto/longxiang-router.js +1 -0
  22. package/dist/auto/longxiang-router.js.map +1 -1
  23. package/dist/auto/model-router.d.ts.map +1 -1
  24. package/dist/auto/model-router.js +1 -0
  25. package/dist/auto/model-router.js.map +1 -1
  26. package/dist/auto/supernova-router.d.ts.map +1 -1
  27. package/dist/auto/supernova-router.js +3 -0
  28. package/dist/auto/supernova-router.js.map +1 -1
  29. package/dist/auto/task-classifier.d.ts.map +1 -1
  30. package/dist/auto/task-classifier.js +8 -1
  31. package/dist/auto/task-classifier.js.map +1 -1
  32. package/dist/auto/types.d.ts +1 -1
  33. package/dist/auto/types.d.ts.map +1 -1
  34. package/dist/brand/brand-kits.d.ts +217 -0
  35. package/dist/brand/brand-kits.d.ts.map +1 -0
  36. package/dist/brand/brand-kits.js +681 -0
  37. package/dist/brand/brand-kits.js.map +1 -0
  38. package/dist/brand/kit-py.d.ts +7 -0
  39. package/dist/brand/kit-py.d.ts.map +1 -0
  40. package/dist/brand/kit-py.js +49 -0
  41. package/dist/brand/kit-py.js.map +1 -0
  42. package/dist/config/schema.d.ts +5 -0
  43. package/dist/config/schema.d.ts.map +1 -1
  44. package/dist/config/schema.js.map +1 -1
  45. package/dist/creative/folder-export.d.ts +72 -0
  46. package/dist/creative/folder-export.d.ts.map +1 -0
  47. package/dist/creative/folder-export.js +463 -0
  48. package/dist/creative/folder-export.js.map +1 -0
  49. package/dist/creative/library-folders.d.ts +171 -0
  50. package/dist/creative/library-folders.d.ts.map +1 -0
  51. package/dist/creative/library-folders.js +515 -0
  52. package/dist/creative/library-folders.js.map +1 -0
  53. package/dist/creative/library-upload.d.ts +23 -0
  54. package/dist/creative/library-upload.d.ts.map +1 -0
  55. package/dist/creative/library-upload.js +152 -0
  56. package/dist/creative/library-upload.js.map +1 -0
  57. package/dist/creative/making-report.d.ts +46 -0
  58. package/dist/creative/making-report.d.ts.map +1 -0
  59. package/dist/creative/making-report.js +244 -0
  60. package/dist/creative/making-report.js.map +1 -0
  61. package/dist/creative/pack-plan-status.d.ts +18 -0
  62. package/dist/creative/pack-plan-status.d.ts.map +1 -0
  63. package/dist/creative/pack-plan-status.js +58 -0
  64. package/dist/creative/pack-plan-status.js.map +1 -0
  65. package/dist/creative/store-profiles.d.ts +46 -0
  66. package/dist/creative/store-profiles.d.ts.map +1 -0
  67. package/dist/creative/store-profiles.js +486 -0
  68. package/dist/creative/store-profiles.js.map +1 -0
  69. package/dist/docs/data/tools.d.ts.map +1 -1
  70. package/dist/docs/data/tools.js +17 -0
  71. package/dist/docs/data/tools.js.map +1 -1
  72. package/dist/index.d.ts +32 -1
  73. package/dist/index.d.ts.map +1 -1
  74. package/dist/index.js +22 -0
  75. package/dist/index.js.map +1 -1
  76. package/dist/memory/config.d.ts +12 -0
  77. package/dist/memory/config.d.ts.map +1 -1
  78. package/dist/memory/config.js +12 -0
  79. package/dist/memory/config.js.map +1 -1
  80. package/dist/memory/memory-manager.d.ts +11 -0
  81. package/dist/memory/memory-manager.d.ts.map +1 -1
  82. package/dist/memory/memory-manager.js +90 -2
  83. package/dist/memory/memory-manager.js.map +1 -1
  84. package/dist/memory/project-brain.d.ts.map +1 -1
  85. package/dist/memory/project-brain.js +2 -1
  86. package/dist/memory/project-brain.js.map +1 -1
  87. package/dist/memory/tfidf.d.ts +10 -0
  88. package/dist/memory/tfidf.d.ts.map +1 -1
  89. package/dist/memory/tfidf.js +27 -0
  90. package/dist/memory/tfidf.js.map +1 -1
  91. package/dist/portability/bundle.d.ts.map +1 -1
  92. package/dist/portability/bundle.js +1 -0
  93. package/dist/portability/bundle.js.map +1 -1
  94. package/dist/portability/factory-reset.js +1 -1
  95. package/dist/portability/factory-reset.js.map +1 -1
  96. package/dist/social/index.d.ts +57 -0
  97. package/dist/social/index.d.ts.map +1 -1
  98. package/dist/social/index.js +54 -5
  99. package/dist/social/index.js.map +1 -1
  100. package/dist/social/tag-volume.d.ts +7 -0
  101. package/dist/social/tag-volume.d.ts.map +1 -1
  102. package/dist/social/tag-volume.js +27 -0
  103. package/dist/social/tag-volume.js.map +1 -1
  104. package/dist/tools/blender/build-model.d.ts +62 -0
  105. package/dist/tools/blender/build-model.d.ts.map +1 -0
  106. package/dist/tools/blender/build-model.js +501 -0
  107. package/dist/tools/blender/build-model.js.map +1 -0
  108. package/dist/tools/blender/find-blender.d.ts +43 -0
  109. package/dist/tools/blender/find-blender.d.ts.map +1 -0
  110. package/dist/tools/blender/find-blender.js +154 -0
  111. package/dist/tools/blender/find-blender.js.map +1 -0
  112. package/dist/tools/blender/model-brief.d.ts +64 -0
  113. package/dist/tools/blender/model-brief.d.ts.map +1 -0
  114. package/dist/tools/blender/model-brief.js +117 -0
  115. package/dist/tools/blender/model-brief.js.map +1 -0
  116. package/dist/tools/blender/model-history.d.ts +42 -0
  117. package/dist/tools/blender/model-history.d.ts.map +1 -0
  118. package/dist/tools/blender/model-history.js +145 -0
  119. package/dist/tools/blender/model-history.js.map +1 -0
  120. package/dist/tools/blender/paths.d.ts +20 -0
  121. package/dist/tools/blender/paths.d.ts.map +1 -0
  122. package/dist/tools/blender/paths.js +37 -0
  123. package/dist/tools/blender/paths.js.map +1 -0
  124. package/dist/tools/blender/runner-py.d.ts +2 -0
  125. package/dist/tools/blender/runner-py.d.ts.map +1 -0
  126. package/dist/tools/blender/runner-py.js +455 -0
  127. package/dist/tools/blender/runner-py.js.map +1 -0
  128. package/dist/tools/brief-store.d.ts +28 -0
  129. package/dist/tools/brief-store.d.ts.map +1 -0
  130. package/dist/tools/brief-store.js +76 -0
  131. package/dist/tools/brief-store.js.map +1 -0
  132. package/dist/tools/check-posts.d.ts.map +1 -1
  133. package/dist/tools/check-posts.js +21 -3
  134. package/dist/tools/check-posts.js.map +1 -1
  135. package/dist/tools/design-checkin.d.ts +28 -0
  136. package/dist/tools/design-checkin.d.ts.map +1 -0
  137. package/dist/tools/design-checkin.js +74 -0
  138. package/dist/tools/design-checkin.js.map +1 -0
  139. package/dist/tools/design-docs.d.ts +37 -0
  140. package/dist/tools/design-docs.d.ts.map +1 -0
  141. package/dist/tools/design-docs.js +367 -0
  142. package/dist/tools/design-docs.js.map +1 -0
  143. package/dist/tools/design-folder.d.ts +24 -0
  144. package/dist/tools/design-folder.d.ts.map +1 -0
  145. package/dist/tools/design-folder.js +277 -0
  146. package/dist/tools/design-folder.js.map +1 -0
  147. package/dist/tools/design-fonts.d.ts +58 -0
  148. package/dist/tools/design-fonts.d.ts.map +1 -0
  149. package/dist/tools/design-fonts.js +316 -0
  150. package/dist/tools/design-fonts.js.map +1 -0
  151. package/dist/tools/design-studio-tools.d.ts +16 -0
  152. package/dist/tools/design-studio-tools.d.ts.map +1 -1
  153. package/dist/tools/design-studio-tools.js +288 -43
  154. package/dist/tools/design-studio-tools.js.map +1 -1
  155. package/dist/tools/generation-manager.d.ts +1 -1
  156. package/dist/tools/generation-manager.d.ts.map +1 -1
  157. package/dist/tools/gimp/build-image.d.ts +161 -0
  158. package/dist/tools/gimp/build-image.d.ts.map +1 -0
  159. package/dist/tools/gimp/build-image.js +900 -0
  160. package/dist/tools/gimp/build-image.js.map +1 -0
  161. package/dist/tools/gimp/find-gimp.d.ts +32 -0
  162. package/dist/tools/gimp/find-gimp.d.ts.map +1 -0
  163. package/dist/tools/gimp/find-gimp.js +149 -0
  164. package/dist/tools/gimp/find-gimp.js.map +1 -0
  165. package/dist/tools/gimp/runner-py.d.ts +2 -0
  166. package/dist/tools/gimp/runner-py.d.ts.map +1 -0
  167. package/dist/tools/gimp/runner-py.js +750 -0
  168. package/dist/tools/gimp/runner-py.js.map +1 -0
  169. package/dist/tools/making-record.d.ts +80 -0
  170. package/dist/tools/making-record.d.ts.map +1 -0
  171. package/dist/tools/making-record.js +221 -0
  172. package/dist/tools/making-record.js.map +1 -0
  173. package/dist/tools/propose-brief.d.ts.map +1 -1
  174. package/dist/tools/propose-brief.js +6 -1
  175. package/dist/tools/propose-brief.js.map +1 -1
  176. package/dist/tools/research-post.d.ts +1 -1
  177. package/dist/tools/research-post.d.ts.map +1 -1
  178. package/dist/tools/research-post.js +20 -9
  179. package/dist/tools/research-post.js.map +1 -1
  180. package/dist/tools/review-post.d.ts +25 -0
  181. package/dist/tools/review-post.d.ts.map +1 -0
  182. package/dist/tools/review-post.js +63 -0
  183. package/dist/tools/review-post.js.map +1 -0
  184. package/dist/tools/tool-registry.d.ts.map +1 -1
  185. package/dist/tools/tool-registry.js +42 -1
  186. package/dist/tools/tool-registry.js.map +1 -1
  187. package/dist/tools/tool-request-words.d.ts +7 -0
  188. package/dist/tools/tool-request-words.d.ts.map +1 -0
  189. package/dist/tools/tool-request-words.js +39 -0
  190. package/dist/tools/tool-request-words.js.map +1 -0
  191. package/dist/tools/write-post.d.ts.map +1 -1
  192. package/dist/tools/write-post.js +38 -2
  193. package/dist/tools/write-post.js.map +1 -1
  194. package/dist/tools/write-video-post.d.ts.map +1 -1
  195. package/dist/tools/write-video-post.js +10 -1
  196. package/dist/tools/write-video-post.js.map +1 -1
  197. package/package.json +2 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runner-py.js","sourceRoot":"","sources":["../../../src/tools/gimp/runner-py.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE/C,kBAAkB;AAClB,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;;;;;;;;;EAetC,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqtBP,CAAC"}
@@ -0,0 +1,80 @@
1
+ /**
2
+ * The making record: how a piece of Design Studio work was made, step by step.
3
+ *
4
+ * Stores that take AI-assisted work want it declared, and Unity wants it
5
+ * described plainly — which AI tools, what was generated, what the person
6
+ * changed. That is hard to reconstruct afterwards, so it is written as it
7
+ * happens (Library folders and packs plan, 7 Nov 2026).
8
+ *
9
+ * WHO WRITES IT: this code, as a side effect of each action — never Ava. She
10
+ * has no tool that touches it, so it cannot be misreported. One file per work,
11
+ * making.jsonl in the work's own folder, one JSON line per event. Lines are
12
+ * only ever added, never rewritten.
13
+ *
14
+ * WHAT IT NEVER DOES: claim less AI involvement than there was, or fill a gap
15
+ * by guessing. Work made before the record existed says so in its first line,
16
+ * and an AI model that isn't known is written as null — "not recorded".
17
+ *
18
+ * Hand edits are a FACT, not a guess: after every action that changes the
19
+ * source files (.blend, .xcf) their fingerprints are stored; before the next
20
+ * one they are compared. A difference nothing in core explains is recorded as
21
+ * a change made outside Ava. Failed runs are not recorded: they save nothing,
22
+ * so they did not shape the work (his call, 9 Nov 2026).
23
+ */
24
+ import type { ToolExecutionContext } from './types.js';
25
+ export type MakingTool = 'blender' | 'gimp';
26
+ /** The AI model Ava was running on. null in a record means "not recorded". */
27
+ export interface MakingAi {
28
+ id: string;
29
+ name?: string;
30
+ provider?: string;
31
+ }
32
+ export interface MakingFont {
33
+ /** As the file names it: a GIMP font name, or a Blender font file. */
34
+ name: string;
35
+ /** OFL, Apache-2.0, UFL — from Google's own fonts repository. */
36
+ licence: 'OFL' | 'Apache-2.0' | 'UFL' | 'not-google' | 'alias' | 'builtin' | 'unchecked' | 'unread';
37
+ }
38
+ export type MakingEventName = 'record_started' | 'brief_proposed' | 'brief_edited' | 'brief_agreed' | 'step' | 'outside_change' | 'restored' | 'copied_from' | 'version_kept' | 'version_deleted' | 'brought_in' | 'options_shown' | 'option_picked' | 'main_chosen' | 'marked_final' | 'final_removed';
39
+ export interface MakingEvent {
40
+ v: 1;
41
+ at: string;
42
+ event: MakingEventName;
43
+ /** Who did it. 'ava' is always paired with `ai`. */
44
+ by: 'ava' | 'person' | 'outside' | 'system';
45
+ ai?: MakingAi | null;
46
+ /** The person's last message before Ava acted, word for word: their direction. */
47
+ ask?: string | null;
48
+ /** Fingerprints of the source files AFTER this event (sha256 by file name). */
49
+ sources?: Record<string, string>;
50
+ [field: string]: unknown;
51
+ }
52
+ export declare const makingFile: (dir: string) => string;
53
+ export declare function appendMaking(dir: string, event: Omit<MakingEvent, 'v' | 'at'>): Promise<void>;
54
+ export declare function readMaking(dir: string): Promise<MakingEvent[]>;
55
+ /**
56
+ * Only the person's own words from a user message. The design room sends its
57
+ * whole briefing in front of them (getDesignStudioPrefix), ending in "## Their
58
+ * request". A room message without that heading gives null: the record holds
59
+ * their words or nothing, never the room's instructions.
60
+ */
61
+ export declare function personsWords(text: string | null | undefined): string | null;
62
+ /** The model Ava is running on and the person's last message, from the turn. */
63
+ export declare function avaContext(context?: ToolExecutionContext): {
64
+ ai: MakingAi | null;
65
+ ask: string | null;
66
+ };
67
+ /** The files a person could open and change: the .blend, or every top-level .xcf. */
68
+ export declare function sourceFingerprints(dir: string, tool: MakingTool): Promise<Record<string, string>>;
69
+ /**
70
+ * Call BEFORE anything in core changes a work. Starts the record if there is
71
+ * none, and records any change to the source files that nothing explains.
72
+ */
73
+ export declare function beforeChange(dir: string, tool: MakingTool): Promise<void>;
74
+ /** Fingerprints now, for the line that records the change just made. */
75
+ export declare const sourcesNow: (dir: string, tool: MakingTool) => Promise<Record<string, string> | {}>;
76
+ /** "Space Grotesk Bold" → "spacegrotesk"; "SpaceGrotesk-700.ttf" → "spacegrotesk". */
77
+ export declare function fontStem(name: string): string;
78
+ /** Each font with its licence. Never throws; an unknown is said as unknown. */
79
+ export declare function fontLicences(names: string[]): Promise<MakingFont[]>;
80
+ //# sourceMappingURL=making-record.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"making-record.d.ts","sourceR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,eAAO,MAAM,UAAU,GAAI,KAAK,MAAM,WAAsB,CAAC;AAM7D,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,CAAC,WAAW,EAAE,GAAG,GAAG,IAAI,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAQ7F;AAED,wBAAsB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC,CASpE;AAMD;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,GAAG,IAAI,CAM3E;AAED,gFAAgF;AAChF,wBAAgB,UAAU,CAAC,OAAO,CAAC,EAAE,oBAAoB,GAAG;IAAE,EAAE,EAAE,QAAQ,GAAG,IAAI,CAAC;IAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,CAKtG;AAWD,qFAAqF;AACrF,wBAAsB,kBAAkB,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CASvG;AAOD;;;GAGG;AACH,wBAAsB,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAsB/E;AAED,wEAAwE;AACxE,eAAO,MAAM,UAAU,GAAI,KAAK,MAAM,EAAE,MAAM,UAAU,yCAAoD,CAAC;AAe7G,sFAAsF;AACtF,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAK7C;AA6BD,+EAA+E;AAC/E,wBAAsB,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC,CAUzE"}
@@ -0,0 +1,221 @@
1
+ /**
2
+ * The making record: how a piece of Design Studio work was made, step by step.
3
+ *
4
+ * Stores that take AI-assisted work want it declared, and Unity wants it
5
+ * described plainly — which AI tools, what was generated, what the person
6
+ * changed. That is hard to reconstruct afterwards, so it is written as it
7
+ * happens (Library folders and packs plan, 7 Nov 2026).
8
+ *
9
+ * WHO WRITES IT: this code, as a side effect of each action — never Ava. She
10
+ * has no tool that touches it, so it cannot be misreported. One file per work,
11
+ * making.jsonl in the work's own folder, one JSON line per event. Lines are
12
+ * only ever added, never rewritten.
13
+ *
14
+ * WHAT IT NEVER DOES: claim less AI involvement than there was, or fill a gap
15
+ * by guessing. Work made before the record existed says so in its first line,
16
+ * and an AI model that isn't known is written as null — "not recorded".
17
+ *
18
+ * Hand edits are a FACT, not a guess: after every action that changes the
19
+ * source files (.blend, .xcf) their fingerprints are stored; before the next
20
+ * one they are compared. A difference nothing in core explains is recorded as
21
+ * a change made outside Ava. Failed runs are not recorded: they save nothing,
22
+ * so they did not shape the work (his call, 9 Nov 2026).
23
+ */
24
+ import { createHash } from 'node:crypto';
25
+ import { createReadStream, existsSync } from 'node:fs';
26
+ import { appendFile, mkdir, readdir, readFile, writeFile } from 'node:fs/promises';
27
+ import { basename, dirname, join } from 'node:path';
28
+ import { AVA_HOME } from '../core/constants.js';
29
+ const RECORD = 'making.jsonl';
30
+ const MAX_ASK = 2000;
31
+ export const makingFile = (dir) => join(dir, RECORD);
32
+ // ── Writing ──────────────────────────────────────────────────────────────────
33
+ // One queue per file: two events from the same turn must not interleave.
34
+ const queues = new Map();
35
+ export function appendMaking(dir, event) {
36
+ const file = makingFile(dir);
37
+ const line = JSON.stringify({ v: 1, at: new Date().toISOString(), ...event }) + '\n';
38
+ const next = (queues.get(file) ?? Promise.resolve())
39
+ .then(async () => { await mkdir(dir, { recursive: true }); await appendFile(file, line, 'utf-8'); })
40
+ .catch(() => { });
41
+ queues.set(file, next);
42
+ return next;
43
+ }
44
+ export async function readMaking(dir) {
45
+ let text;
46
+ try {
47
+ text = await readFile(makingFile(dir), 'utf-8');
48
+ }
49
+ catch {
50
+ return [];
51
+ }
52
+ const out = [];
53
+ for (const line of text.split('\n')) {
54
+ if (!line.trim())
55
+ continue;
56
+ try {
57
+ out.push(JSON.parse(line));
58
+ }
59
+ catch { /* a torn last line is skipped, not fatal */ }
60
+ }
61
+ return out;
62
+ }
63
+ // ── Who acted ────────────────────────────────────────────────────────────────
64
+ const THEIR_REQUEST = '\n## Their request\n';
65
+ /**
66
+ * Only the person's own words from a user message. The design room sends its
67
+ * whole briefing in front of them (getDesignStudioPrefix), ending in "## Their
68
+ * request". A room message without that heading gives null: the record holds
69
+ * their words or nothing, never the room's instructions.
70
+ */
71
+ export function personsWords(text) {
72
+ if (!text)
73
+ return null;
74
+ const at = text.lastIndexOf(THEIR_REQUEST);
75
+ if (at >= 0)
76
+ return text.slice(at + THEIR_REQUEST.length).trim() || null;
77
+ if (/^\[[^\]\n]{2,40}\]/.test(text))
78
+ return null;
79
+ return text.trim() || null;
80
+ }
81
+ /** The model Ava is running on and the person's last message, from the turn. */
82
+ export function avaContext(context) {
83
+ const s = context?.sharedState;
84
+ const ai = s?.designModel;
85
+ const ask = typeof s?.designAsk === 'string' ? s.designAsk.trim().slice(0, MAX_ASK) : null;
86
+ return { ai: ai?.id ? { id: ai.id, ...(ai.name ? { name: ai.name } : {}), ...(ai.provider ? { provider: ai.provider } : {}) } : null, ask: ask || null };
87
+ }
88
+ // ── Source fingerprints (hand edits) ─────────────────────────────────────────
89
+ function hashFile(path) {
90
+ return new Promise((resolve, reject) => {
91
+ const h = createHash('sha256');
92
+ createReadStream(path).on('data', (d) => h.update(d)).on('end', () => resolve(h.digest('hex'))).on('error', reject);
93
+ });
94
+ }
95
+ /** The files a person could open and change: the .blend, or every top-level .xcf. */
96
+ export async function sourceFingerprints(dir, tool) {
97
+ const names = tool === 'blender'
98
+ ? [`${basename(dir)}.blend`].filter((f) => existsSync(join(dir, f)))
99
+ : (await readdir(dir, { withFileTypes: true }).catch(() => [])).filter((e) => e.isFile() && e.name.endsWith('.xcf')).map((e) => e.name).sort();
100
+ const out = {};
101
+ for (const n of names) {
102
+ try {
103
+ out[n] = await hashFile(join(dir, n));
104
+ }
105
+ catch { /* gone between listing and reading */ }
106
+ }
107
+ return out;
108
+ }
109
+ function lastSources(events) {
110
+ for (let i = events.length - 1; i >= 0; i--)
111
+ if (events[i].sources)
112
+ return events[i].sources;
113
+ return null;
114
+ }
115
+ /**
116
+ * Call BEFORE anything in core changes a work. Starts the record if there is
117
+ * none, and records any change to the source files that nothing explains.
118
+ */
119
+ export async function beforeChange(dir, tool) {
120
+ try {
121
+ const events = await readMaking(dir);
122
+ const now = await sourceFingerprints(dir, tool);
123
+ if (events.length === 0) {
124
+ const made = Object.keys(now).length > 0 || existsSync(join(dir, 'scripts'));
125
+ await appendMaking(dir, made
126
+ ? { event: 'record_started', by: 'system', tool, earlier: true,
127
+ note: 'This work existed before the making record. Earlier steps, the AI model that made them, and any changes by hand are not recorded.',
128
+ sources: now }
129
+ : { event: 'record_started', by: 'system', tool, earlier: false, sources: now });
130
+ return;
131
+ }
132
+ const before = lastSources(events) ?? {};
133
+ const changed = Object.keys(now).filter((f) => f in before && before[f] !== now[f]);
134
+ const added = Object.keys(now).filter((f) => !(f in before));
135
+ const removed = Object.keys(before).filter((f) => !(f in now));
136
+ if (changed.length || added.length || removed.length) {
137
+ await appendMaking(dir, { event: 'outside_change', by: 'outside', tool, changed, added, removed,
138
+ note: 'These source files changed outside Ava since the last recorded step.', sources: now });
139
+ }
140
+ }
141
+ catch { /* the record must never break the work */ }
142
+ }
143
+ /** Fingerprints now, for the line that records the change just made. */
144
+ export const sourcesNow = (dir, tool) => sourceFingerprints(dir, tool).catch(() => ({}));
145
+ // ── Font licences ────────────────────────────────────────────────────────────
146
+ // Google Fonts are not all one licence: about 1,900 families are OFL, 44 are
147
+ // Apache 2.0 and 5 are the Ubuntu Font Licence (google/fonts, 9 Nov 2026).
148
+ // Google's repository files every family under its licence folder, so the
149
+ // folder it sits in IS its licence. Unity refuses Apache licences that require
150
+ // attribution, so this matters to anyone selling a pack.
151
+ const GOOGLE_FONTS_RAW = 'https://raw.githubusercontent.com/google/fonts/main';
152
+ const LICENCE_DIRS = [['ofl', 'OFL'], ['apache', 'Apache-2.0'], ['ufl', 'UFL']];
153
+ const GENERIC = /^(sans-serif|sans|serif|monospace|system-ui)\b/i;
154
+ const STYLE_WORDS = /\s+(Regular|Normal|Roman|Bold|Italic|Oblique|Thin|Hairline|Light|Medium|Book|Black|Heavy|(?:Semi|Demi|Extra|Ultra)[- ]?(?:Bold|Light)|Condensed|Expanded)$/i;
155
+ const licencesFile = () => join(process.env.AVA_FONTS_DIR ?? AVA_HOME, 'font-licences.json');
156
+ /** "Space Grotesk Bold" → "spacegrotesk"; "SpaceGrotesk-700.ttf" → "spacegrotesk". */
157
+ export function fontStem(name) {
158
+ let n = name.replace(/\.(ttf|otf|woff2?|ttc)$/i, '');
159
+ if (/^[^\s]+-[^\s]+$/.test(n))
160
+ n = n.split('-')[0];
161
+ for (let next = n.replace(STYLE_WORDS, ''); next !== n; next = n.replace(STYLE_WORDS, ''))
162
+ n = next;
163
+ return n.toLowerCase().replace(/[^a-z0-9]/g, '');
164
+ }
165
+ let cache = null;
166
+ async function loadCache() {
167
+ if (cache)
168
+ return cache;
169
+ try {
170
+ cache = JSON.parse(await readFile(licencesFile(), 'utf-8'));
171
+ }
172
+ catch {
173
+ cache = {};
174
+ }
175
+ return cache;
176
+ }
177
+ async function lookUpStem(stem) {
178
+ const known = (await loadCache())[stem];
179
+ if (known)
180
+ return known;
181
+ let reached = 0;
182
+ const found = await Promise.all(LICENCE_DIRS.map(async ([dir, licence]) => {
183
+ try {
184
+ const res = await fetch(`${GOOGLE_FONTS_RAW}/${dir}/${stem}/METADATA.pb`, { method: 'HEAD', signal: AbortSignal.timeout(6000) });
185
+ reached++;
186
+ return res.ok ? licence : null;
187
+ }
188
+ catch {
189
+ return null;
190
+ }
191
+ }));
192
+ const licence = found.find(Boolean) ?? (reached === LICENCE_DIRS.length ? 'not-google' : 'unchecked');
193
+ if (licence !== 'unchecked') {
194
+ cache[stem] = licence;
195
+ await mkdir(dirname(licencesFile()), { recursive: true }).catch(() => { });
196
+ await writeFile(licencesFile(), JSON.stringify(cache, null, 2), 'utf-8').catch(() => { });
197
+ }
198
+ return licence;
199
+ }
200
+ /** Each font with its licence. Never throws; an unknown is said as unknown. */
201
+ export async function fontLicences(names) {
202
+ const out = [];
203
+ for (const raw of [...new Set(names)]) {
204
+ if (raw === '?') {
205
+ out.push({ name: 'a text layer whose font could not be read', licence: 'unread' });
206
+ continue;
207
+ }
208
+ if (raw.endsWith('|builtin')) {
209
+ out.push({ name: raw.slice(0, -'|builtin'.length), licence: 'builtin' });
210
+ continue;
211
+ }
212
+ if (GENERIC.test(raw)) {
213
+ out.push({ name: raw, licence: 'alias' });
214
+ continue;
215
+ }
216
+ const stem = fontStem(raw);
217
+ out.push({ name: raw, licence: stem ? await lookUpStem(stem) : 'not-google' });
218
+ }
219
+ return out;
220
+ }
221
+ //# sourceMappingURL=making-record.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"making-record.js","sourceRoot":"","sources":["../../src/tools/making-record.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACnF,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAkChD,MAAM,MAAM,GAAG,cAAc,CAAC;AAC9B,MAAM,OAAO,GAAG,IAAI,CAAC;AAErB,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,GAAW,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE,MAAM,C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CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC,CAAC;YAAC,SAAS;QAAC,CAAC;QAC/E,MAAM,IAAI,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC;QAC3B,GAAG,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC,MAAM,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,YAAY,EAAE,CAAC,CAAC;IACjF,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"propose-brief.d.ts","sourceRoot":"","sources":["../../src/tools/propose-brief.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,UAAU,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AACxF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAY5D,qBAAa,gBAAiB,YAAW,IAAI;IAC3C,QAAQ,CAAC,IAAI,mBAAmB;IAChC,QAAQ,CAAC,WAAW,yLAC0J;IAC9K,QAAQ,CAAC,SAAS,EAAE,aAAa,CAAU;IAC3C,QAAQ,CAAC,oBAAoB,SAAS;IAEtC,QAAQ,CAAC,MAAM,EAAE,cAAc,CAqB7B;IAEI,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,UAAU,CAAC;CAyCjG"}
1
+ {"version":3,"file":"propose-brief.d.ts","sourceRoot":"","sources":["../../src/tools/propose-brief.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,UAAU,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AACxF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAY5D,qBAAa,gBAAiB,YAAW,IAAI;IAC3C,QAAQ,CAAC,IAAI,mBAAmB;IAChC,QAAQ,CAAC,WAAW,yLAC0J;IAC9K,QAAQ,CAAC,SAAS,EAAE,aAAa,CAAU;IAC3C,QAAQ,CAAC,oBAAoB,SAAS;IAEtC,QAAQ,CAAC,MAAM,EAAE,cAAc,CAuB7B;IAEI,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,UAAU,CAAC;CA2CjG"}
@@ -12,6 +12,7 @@
12
12
  * Side-effect-free, and NOT a producing tool: it works in a talking turn,
13
13
  * which is exactly where a brief is discussed.
14
14
  */
15
+ import { DAILY_PARAM_DESCRIPTION, FEATURE_PARAM_DESCRIPTION, postMarker } from '../social/index.js';
15
16
  const FIELDS = [
16
17
  ['argues', 'what it argues'],
17
18
  ['audience', 'who it is for'],
@@ -35,13 +36,15 @@ export class ProposeBriefTool {
35
36
  parameters: {
36
37
  type: 'object',
37
38
  properties: {
38
- subject: { type: 'string', description: 'The story, as it stands on the plan.' },
39
+ subject: { type: 'string', description: 'The story, in a few plain words — what this post is about.' },
39
40
  argues: { type: 'string', description: 'What this post ARGUES — its point, in one sentence. Not its topic.' },
40
41
  audience: { type: 'string', description: 'Who it is for, specifically enough to picture one person. "Developers" is a category; "a backend dev who tried an agent once, got burned, and stopped" is a reader.' },
41
42
  angle: { type: 'string', description: 'The way in — what makes THAT reader stop scrolling and care.' },
42
43
  form: { type: 'string', description: 'The shape — single post, thread, clip, piece to camera, still — and why that form suits this idea.' },
43
44
  mustLand: { type: 'string', description: 'The ONE line the post has to land. Everything else serves it.' },
44
45
  reasoning: { type: 'string', description: 'Why this brief: what you weighed, what you rejected and why. This is the part he learns from — teach the thinking, not only the conclusion.' },
46
+ daily: { type: 'string', description: DAILY_PARAM_DESCRIPTION + ' Set here, it is carried to the writing turn for you.' },
47
+ feature: { type: 'string', description: FEATURE_PARAM_DESCRIPTION + ' Set here, it is carried to the writing turn for you.' },
45
48
  },
46
49
  required: ['subject', 'argues', 'audience', 'angle', 'form', 'mustLand', 'reasoning'],
47
50
  },
@@ -63,6 +66,8 @@ export class ProposeBriefTool {
63
66
  form: str('form'),
64
67
  mustLand: str('mustLand'),
65
68
  reasoning: str('reasoning'),
69
+ ...(postMarker(args.daily, 40) ? { daily: postMarker(args.daily, 40) } : {}),
70
+ ...(postMarker(args.feature) ? { feature: postMarker(args.feature) } : {}),
66
71
  };
67
72
  // A brief with a hole in it is the vague brief this replaces. Say which
68
73
  // part is missing rather than accepting it and letting the writing fill it.
@@ -1 +1 @@
1
- {"version":3,"file":"propose-brief.js","sourceRoot":"","sources":["../../src/tools/propose-brief.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAMH,MAAM,MAAM,GAAqC;IAC/C,CAAC,QAAQ,EAAE,gBAAgB,CAAC;IAC5B,CAAC,UAAU,EAAE,eAAe,CAAC;IAC7B,CAAC,OAAO,EAAE,YAAY,CAAC;IACvB,CAAC,MAAM,EAAE,UAAU,CAAC;IACpB,CAAC,UAAU,EAAE,6BAA6B,CAAC;IAC3C,CAAC,WAAW,EAAE,gBAAgB,CAAC;CAChC,CAAC;AAEF,MAAM,OAAO,gBAAgB;IAClB,IAAI,GAAG,eAAe,CAAC;IACvB,WAAW,GAClB,2KAA2K,CAAC;IACrK,SAAS,GAAkB,MAAM,CAAC;IAClC,oBAAoB,GAAG,KAAK,CAAC;IAE7B,MAAM,GAAmB;QAChC,IAAI,EAAE,eAAe;QACrB,WAAW,EACT,4GAA4G;cAC1G,kHAAkH;cAClH,oHAAoH;cACpH,uHAAuH;cACvH,mGAAmG;QACvG,UAAU,EAAE;YACV,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,sCAAsC,EA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AE,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SAC3E,CAAC;QAEF,wEAAwE;QACxE,4EAA4E;QAC5E,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC;QAC5E,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;YACnB,OAAO;gBACL,OAAO,EAAE,KAAK;gBACd,MAAM,EAAE,wBAAwB,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,qFAAqF;aACxI,CAAC;QACJ,CAAC;QAED,IAAI,CAAC;YACH,MAAM,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;YAC3B,OAAO;gBACL,OAAO,EAAE,IAAI;gBACb,MAAM,EAAE,mMAAmM;gBAC3M,QAAQ,EAAE,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE;aACrC,CAAC;QACJ,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,gCAAgC,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC;QACxH,CAAC;IACH,CAAC;CACF"}
@@ -10,7 +10,7 @@ import type { FunctionSchema } from '../providers/types.js';
10
10
  */
11
11
  export declare class ResearchPostTool implements Tool {
12
12
  readonly name = "research_post";
13
- readonly description = "Research what is CURRENTLY landing for a subject before drafting a post \u2014 how it is being framed right now + candidate hashtags in use + the platform tag policy. Call before write_post when given a subject.";
13
+ readonly description = "Research what is CURRENTLY landing for a subject before drafting a post \u2014 how it is being framed right now, MEASURED tag use on Bluesky and Mastodon, and the platform tag policy. Call before write_post when given a subject.";
14
14
  readonly riskLevel: ToolRiskLevel;
15
15
  readonly outputTrust: ToolOutputTrust;
16
16
  readonly requiresConfirmation = false;
@@ -1 +1 @@
1
- {"version":3,"file":"research-post.d.ts","sourceRoot":"","sources":["../../src/tools/research-post.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,UAAU,EAAE,oBAAoB,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AACzG,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAK5D;;;;;;;GAOG;AACH,qBAAa,gBAAiB,YAAW,IAAI;IAC3C,QAAQ,CAAC,IAAI,mBAAmB;IAChC,QAAQ,CAAC,WAAW,yNAC+L;IACnN,QAAQ,CAAC,SAAS,EAAE,aAAa,CAAU;IAC3C,QAAQ,CAAC,WAAW,EAAE,eAAe,CAAe;IACpD,QAAQ,CAAC,oBAAoB,SAAS;IAEtC,QAAQ,CAAC,MAAM,EAAE,cAAc,CAe7B;IAEI,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,UAAU,CAAC;CA8DjG"}
1
+ {"version":3,"file":"research-post.d.ts","sourceRoot":"","sources":["../../src/tools/research-post.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,UAAU,EAAE,oBAAoB,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AACzG,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAK5D;;;;;;;GAOG;AACH,qBAAa,gBAAiB,YAAW,IAAI;IAC3C,QAAQ,CAAC,IAAI,mBAAmB;IAChC,QAAQ,CAAC,WAAW,0OACgN;IACpO,QAAQ,CAAC,SAAS,EAAE,aAAa,CAAU;IAC3C,QAAQ,CAAC,WAAW,EAAE,eAAe,CAAe;IACpD,QAAQ,CAAC,oBAAoB,SAAS;IAEtC,QAAQ,CAAC,MAAM,EAAE,cAAc,CAoB7B;IAEI,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,UAAU,CAAC;CAoEjG"}
@@ -1,6 +1,6 @@
1
1
  import { PLATFORM_TAG_POLICY } from '../social/index.js';
2
2
  import { resolveWebSearch } from './web-search.js';
3
- import { blueskyTagsFor, measureTags } from '../social/tag-volume.js';
3
+ import { blueskyTagsFor, measureTags, mastodonTagVolume } from '../social/tag-volume.js';
4
4
  /**
5
5
  * Ground a post in the present BEFORE drafting: how the subject is being framed
6
6
  * right now (Reddit / HN / open web) + hashtags actually in use, harvested from
@@ -11,13 +11,13 @@ import { blueskyTagsFor, measureTags } from '../social/tag-volume.js';
11
11
  */
12
12
  export class ResearchPostTool {
13
13
  name = 'research_post';
14
- description = 'Research what is CURRENTLY landing for a subject before drafting a post — how it is being framed right now + candidate hashtags in use + the platform tag policy. Call before write_post when given a subject.';
14
+ description = 'Research what is CURRENTLY landing for a subject before drafting a post — how it is being framed right now, MEASURED tag use on Bluesky and Mastodon, and the platform tag policy. Call before write_post when given a subject.';
15
15
  riskLevel = 'safe';
16
16
  outputTrust = 'untrusted';
17
17
  requiresConfirmation = false;
18
18
  schema = {
19
19
  name: 'research_post',
20
- description: 'Research what is CURRENTLY landing for a subject BEFORE you draft a post. Returns how the topic is being framed right now (Reddit / Hacker News / open web), candidate hashtags actually in use (split so you choose reach vs niche), and the target platform\'s tag policy. ALWAYS call this before write_post when the operator gives you a subject — it grounds your angle and tags in the present instead of guessing. It also returns MEASURED tags: how many posts a day really carry each candidate on Bluesky (the only platform with free tag data) — reach ≥50/day, niche 1-50, quiet <1. Pick from those within the platform tag policy: a mix of reach and niche, never a quiet tag. Filter everything through the brand voice.',
20
+ description: 'Research what is CURRENTLY landing for a subject BEFORE you draft a post. Returns how the topic is being framed right now (Reddit, Hacker News, open web), the platform’s tag policy, and MEASURED tags: posts a day on Bluesky and uses a day on Mastodon for the tags people really put on this subject, plus any tags you pass in `tags` to check (for example from the tag library in his template). Bands on Bluesky: reach 50+/day, niche 1-50, quiet under 1, which nobody reads. Pick tags for THIS post’s subject and audience from the measured ones, never a quiet one, never by habit.',
21
21
  parameters: {
22
22
  type: 'object',
23
23
  properties: {
@@ -27,6 +27,11 @@ export class ResearchPostTool {
27
27
  enum: ['tweet', 'linkedin', 'thread', 'bluesky', 'eurosky', 'facebook', 'reddit', 'tiktok', 'youtube', 'instagram', 'blog'],
28
28
  description: 'Target platform — shapes the tag policy returned. Defaults to tweet.',
29
29
  },
30
+ tags: {
31
+ type: 'array',
32
+ items: { type: 'string' },
33
+ description: 'Tags you are considering (up to 6), to be measured alongside the ones found for the subject.',
34
+ },
30
35
  },
31
36
  required: ['subject'],
32
37
  },
@@ -65,7 +70,12 @@ export class ResearchPostTool {
65
70
  // volume. Best effort: if Bluesky is unreachable the harvest still stands.
66
71
  const tagFetch = context.sharedState?.tagFetch;
67
72
  const fromBluesky = await blueskyTagsFor(subject, tagFetch).catch(() => []);
68
- const measured = await measureTags([...fromBluesky.slice(0, 6), ...ranked.slice(0, 6)], tagFetch).catch(() => []);
73
+ // Her own candidates first, then what Bluesky users actually tag this
74
+ // subject with. The web harvest is NOT offered as tags any more: it is
75
+ // mostly "best hashtags" spam pages (10 Nov 2026). It is only measured.
76
+ const asked = Array.isArray(args.tags) ? args.tags.map(t => String(t).replace(/^#/, '').trim()).filter(Boolean).slice(0, 6) : [];
77
+ const measured = await measureTags([...asked, ...fromBluesky.slice(0, 5), ...ranked.slice(0, 3)], tagFetch).catch(() => []);
78
+ const masto = await Promise.all(measured.map(m => mastodonTagVolume(m.tag).catch(() => null)));
69
79
  const discussion = all
70
80
  .filter(r => r.snippet)
71
81
  .slice(0, 6)
@@ -76,13 +86,14 @@ export class ResearchPostTool {
76
86
  subject,
77
87
  platform,
78
88
  tag_policy: PLATFORM_TAG_POLICY[platform] || PLATFORM_TAG_POLICY.tweet,
79
- candidate_reach_tags: ranked.slice(0, 3),
80
- candidate_niche_tags: ranked.slice(3, 8),
81
- measured_tags: measured.map(m => ({ tag: `#${m.tag}`, bluesky_posts_per_day: m.perDay, band: m.band })),
89
+ measured_tags: measured.map((m, i) => ({
90
+ tag: `#${m.tag}`, bluesky_posts_per_day: m.perDay, band: m.band,
91
+ ...(masto[i] !== null ? { mastodon_uses_per_day: masto[i] } : {}),
92
+ })),
82
93
  current_discussion: discussion,
83
94
  note: measured.length
84
- ? 'measured_tags are REAL Bluesky volume (posts/day). Prefer them: a mix of reach and niche within the tag policy, never a quiet one. Other platforms publish no tag data, so this is a guide to what people genuinely use, not a guarantee for X or TikTok. Say which tags you picked and why in tag_note.'
85
- : 'Bluesky could not be measured just now, so these tags are harvested from current discussion, not measured. Choose reach vs niche within the tag policy; filter everything through the brand voice.',
95
+ ? 'These are REAL measurements (Bluesky posts a day, Mastodon uses a day). Pick tags for this post’s subject and audience, within the tag policy, never a quiet one. X, LinkedIn, TikTok, Instagram and Facebook publish no free tag data, so treat these as the best guide to what people really use. CamelCase, no hyphens. Say which tags you picked and why in tag_note.'
96
+ : 'Tags could not be measured just now. Use the tag library in his template if it is in your context, and say in tag_note that the tags are unmeasured.',
86
97
  }),
87
98
  };
88
99
  }
@@ -1 +1 @@
1
- {"version":3,"file":"research-post.js","sourceRoot":"","sources":["../../src/tools/research-post.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,WAAW,EAAiB,MAAM,yBAAyB,CAAC;AAErF;;;;;;;GAOG;AACH,MAAM,OAAO,gBAAgB;IAClB,IAAI,GAAG,eAAe,CAAC;IACvB,WAAW,GAClB,gNAAgN,CAAC;IAC1M,SAAS,GAAkB,MAAM,CAAC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CAAC,KAAK;oBACtE,aAAa,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;wBACrC,GAAG,EAAE,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,qBAAqB,EAAE,CAAC,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI;wBAC/D,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,qBAAqB,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;qBAClE,CAAC,CAAC;oBACH,kBAAkB,EAAE,UAAU;oBAC9B,IAAI,EAAE,QAAQ,CAAC,MAAM;wBACnB,CAAC,CAAC,2WAA2W;wBAC7W,CAAC,CAAC,sJAAsJ;iBAC3J,CAAC;aACH,CAAC;QACJ,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,yBAAyB,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC;QACjH,CAAC;IACH,CAAC;CACF"}
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Her verdict on her own post, once it is out (8 Nov 2026).
3
+ *
4
+ * The same rule as the day plan's review, moved to where the record now is.
5
+ * The operator, 20 Oct: "i want ava to always have her say and judge her own
6
+ * work — it is what will help her improve as she has her memory too." He marks
7
+ * what landed on the post; she says what she thinks of what she made. Neither
8
+ * replaces the other, and where the two disagree is the most useful thing in
9
+ * the record.
10
+ *
11
+ * The Posts room stopped planning the day on 8 Nov — "we never plan out
12
+ * anything, it's all done on demand" — so there is no plan row to hang a
13
+ * verdict on. The post itself is the record.
14
+ */
15
+ import type { Tool, ToolResult, ToolExecutionContext, ToolRiskLevel } from './types.js';
16
+ import type { FunctionSchema } from '../providers/types.js';
17
+ export declare class ReviewPostTool implements Tool {
18
+ readonly name = "review_post";
19
+ readonly description = "Record your own honest verdict on a post that went out \u2014 what worked, what did not, what you would do differently.";
20
+ readonly riskLevel: ToolRiskLevel;
21
+ readonly requiresConfirmation = false;
22
+ readonly schema: FunctionSchema;
23
+ execute(args: Record<string, unknown>, context: ToolExecutionContext): Promise<ToolResult>;
24
+ }
25
+ //# sourceMappingURL=review-post.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"review-post.d.ts","sourceRoot":"","sources":["../../src/tools/review-post.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,UAAU,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AACxF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAG5D,qBAAa,cAAe,YAAW,IAAI;IACzC,QAAQ,CAAC,IAAI,iBAAiB;IAC9B,QAAQ,CAAC,WAAW,6HACmG;IACvH,QAAQ,CAAC,SAAS,EAAE,aAAa,CAAU;IAC3C,QAAQ,CAAC,oBAAoB,SAAS;IAEtC,QAAQ,CAAC,MAAM,EAAE,cAAc,CAe7B;IAEI,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,UAAU,CAAC;CAwBjG"}
@@ -0,0 +1,63 @@
1
+ /**
2
+ * Her verdict on her own post, once it is out (8 Nov 2026).
3
+ *
4
+ * The same rule as the day plan's review, moved to where the record now is.
5
+ * The operator, 20 Oct: "i want ava to always have her say and judge her own
6
+ * work — it is what will help her improve as she has her memory too." He marks
7
+ * what landed on the post; she says what she thinks of what she made. Neither
8
+ * replaces the other, and where the two disagree is the most useful thing in
9
+ * the record.
10
+ *
11
+ * The Posts room stopped planning the day on 8 Nov — "we never plan out
12
+ * anything, it's all done on demand" — so there is no plan row to hang a
13
+ * verdict on. The post itself is the record.
14
+ */
15
+ export class ReviewPostTool {
16
+ name = 'review_post';
17
+ description = 'Record your own honest verdict on a post that went out — what worked, what did not, what you would do differently.';
18
+ riskLevel = 'safe';
19
+ requiresConfirmation = false;
20
+ schema = {
21
+ name: 'review_post',
22
+ description: 'Record YOUR verdict on YOUR OWN work for a post that went out: what worked, what did not, and what you would change. '
23
+ + 'Always give one, honestly. A weak post called weak is worth more than a flattering record. '
24
+ + 'Judge the work yourself; do not echo his Landed mark. Where you and he disagree, that is the thing to learn from. '
25
+ + 'The ids come from check_posts. If a verdict should change how you work, save the lesson with memory_save as well.',
26
+ parameters: {
27
+ type: 'object',
28
+ properties: {
29
+ ids: { type: 'array', items: { type: 'string' }, description: 'The post ids from check_posts — one platform, or every platform the story went to.' },
30
+ verdict: { type: 'string', description: 'One to three plain sentences. Specific: name the line that worked or the choice that did not.' },
31
+ },
32
+ required: ['ids', 'verdict'],
33
+ },
34
+ };
35
+ async execute(args, context) {
36
+ const store = context.sharedState?.postStore;
37
+ if (!store)
38
+ return { success: false, output: 'Post storage is not available in this context.' };
39
+ if (typeof store.review !== 'function') {
40
+ return { success: false, output: 'This surface cannot record a verdict on a post. Say it to him in the chat instead, and save the lesson with memory_save.' };
41
+ }
42
+ const ids = Array.isArray(args.ids) ? args.ids.map(String).map(x => x.trim()).filter(Boolean) : [];
43
+ const verdict = typeof args.verdict === 'string' ? args.verdict.trim() : '';
44
+ if (!ids.length)
45
+ return { success: false, output: 'Missing `ids`. Call check_posts first to get them.' };
46
+ if (!verdict)
47
+ return { success: false, output: 'An empty verdict is not a verdict. Say what you actually think of the work.' };
48
+ try {
49
+ const n = await store.review(ids, verdict.slice(0, 1000));
50
+ if (n === 0)
51
+ return { success: false, output: 'None of those ids are posts that exist. Call check_posts again for the right ones.' };
52
+ return {
53
+ success: true,
54
+ output: `Verdict recorded on ${n} post${n === 1 ? '' : 's'}. If it changes how you will work, save the lesson with memory_save.`,
55
+ metadata: { updated: n },
56
+ };
57
+ }
58
+ catch (err) {
59
+ return { success: false, output: `Could not record the verdict: ${err instanceof Error ? err.message : String(err)}` };
60
+ }
61
+ }
62
+ }
63
+ //# sourceMappingURL=review-post.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"review-post.js","sourceRoot":"","sources":["../../src/tools/review-post.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAMH,MAAM,OAAO,cAAc;IAChB,IAAI,GAAG,aAAa,CAAC;IACrB,WAAW,GAClB,oHAAoH,CAAC;IAC9G,SAAS,GAAkB,MAAM,CAAC;IAClC,oBAAoB,GAAG,KAAK,CAAC;IAE7B,MAAM,GAAmB;QAChC,IAAI,EAAE,aAAa;QACnB,WAAW,EACT,uHAAuH;cACrH,6FAA6F;cAC7F,oHAAoH;cACpH,mHAAmH;QACvH,UAAU,EAAE;YACV,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,GAAG,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,WAAW,EAAE,oFAAoF,EAAE;gBACpJ,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,+FAA+F,EAAE;aAC1I;YACD,QAAQ,EAAE,CAAC,KAAK,EAAE,SAAS,CAAC;SAC7B;KACF,CAAC;IAEF,KAAK,CAAC,OAAO,CAAC,IAA6B,EAAE,OAA6B;QACxE,MAAM,KAAK,GAAG,OAAO,CAAC,WAAW,EAAE,SAAkC,CAAC;QACtE,IAAI,CAAC,KAAK;YAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,gDAAgD,EAAE,CAAC;QAChG,IAAI,OAAO,KAAK,CAAC,MAAM,KAAK,UAAU,EAAE,CAAC;YACvC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,0HAA0H,EAAE,CAAC;QAChK,CAAC;QAED,MAAM,GAAG,GAAG,KA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