@project-ava-supernova/core 0.2.175 → 0.2.177

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 (144) 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 +78 -52
  4. package/dist/agent/agent.js.map +1 -1
  5. package/dist/agent/system-prompt.d.ts +3 -2
  6. package/dist/agent/system-prompt.d.ts.map +1 -1
  7. package/dist/agent/system-prompt.js +1356 -1308
  8. package/dist/agent/system-prompt.js.map +1 -1
  9. package/dist/auto/aurora-router.d.ts +1 -1
  10. package/dist/auto/aurora-router.d.ts.map +1 -1
  11. package/dist/auto/aurora-router.js +4 -1
  12. package/dist/auto/aurora-router.js.map +1 -1
  13. package/dist/auto/auto-coordinator.d.ts.map +1 -1
  14. package/dist/auto/auto-coordinator.js +2 -1
  15. package/dist/auto/auto-coordinator.js.map +1 -1
  16. package/dist/auto/longxiang-router.d.ts.map +1 -1
  17. package/dist/auto/longxiang-router.js +1 -0
  18. package/dist/auto/longxiang-router.js.map +1 -1
  19. package/dist/auto/model-router.d.ts.map +1 -1
  20. package/dist/auto/model-router.js +1 -0
  21. package/dist/auto/model-router.js.map +1 -1
  22. package/dist/auto/supernova-router.d.ts.map +1 -1
  23. package/dist/auto/supernova-router.js +3 -0
  24. package/dist/auto/supernova-router.js.map +1 -1
  25. package/dist/auto/task-classifier.d.ts.map +1 -1
  26. package/dist/auto/task-classifier.js +8 -1
  27. package/dist/auto/task-classifier.js.map +1 -1
  28. package/dist/auto/types.d.ts +1 -1
  29. package/dist/auto/types.d.ts.map +1 -1
  30. package/dist/brand/brand-kits.d.ts +217 -0
  31. package/dist/brand/brand-kits.d.ts.map +1 -0
  32. package/dist/brand/brand-kits.js +681 -0
  33. package/dist/brand/brand-kits.js.map +1 -0
  34. package/dist/brand/kit-py.d.ts +7 -0
  35. package/dist/brand/kit-py.d.ts.map +1 -0
  36. package/dist/brand/kit-py.js +45 -0
  37. package/dist/brand/kit-py.js.map +1 -0
  38. package/dist/config/schema.d.ts +5 -0
  39. package/dist/config/schema.d.ts.map +1 -1
  40. package/dist/config/schema.js.map +1 -1
  41. package/dist/docs/data/tools.d.ts.map +1 -1
  42. package/dist/docs/data/tools.js +15 -0
  43. package/dist/docs/data/tools.js.map +1 -1
  44. package/dist/index.d.ts +16 -1
  45. package/dist/index.d.ts.map +1 -1
  46. package/dist/index.js +13 -0
  47. package/dist/index.js.map +1 -1
  48. package/dist/memory/config.d.ts +12 -0
  49. package/dist/memory/config.d.ts.map +1 -1
  50. package/dist/memory/config.js +12 -0
  51. package/dist/memory/config.js.map +1 -1
  52. package/dist/memory/memory-manager.d.ts +11 -0
  53. package/dist/memory/memory-manager.d.ts.map +1 -1
  54. package/dist/memory/memory-manager.js +90 -2
  55. package/dist/memory/memory-manager.js.map +1 -1
  56. package/dist/memory/project-brain.d.ts.map +1 -1
  57. package/dist/memory/project-brain.js +2 -1
  58. package/dist/memory/project-brain.js.map +1 -1
  59. package/dist/memory/tfidf.d.ts +10 -0
  60. package/dist/memory/tfidf.d.ts.map +1 -1
  61. package/dist/memory/tfidf.js +27 -0
  62. package/dist/memory/tfidf.js.map +1 -1
  63. package/dist/social/index.d.ts +48 -0
  64. package/dist/social/index.d.ts.map +1 -1
  65. package/dist/social/index.js +19 -0
  66. package/dist/social/index.js.map +1 -1
  67. package/dist/tools/blender/build-model.d.ts +52 -0
  68. package/dist/tools/blender/build-model.d.ts.map +1 -0
  69. package/dist/tools/blender/build-model.js +426 -0
  70. package/dist/tools/blender/build-model.js.map +1 -0
  71. package/dist/tools/blender/find-blender.d.ts +43 -0
  72. package/dist/tools/blender/find-blender.d.ts.map +1 -0
  73. package/dist/tools/blender/find-blender.js +154 -0
  74. package/dist/tools/blender/find-blender.js.map +1 -0
  75. package/dist/tools/blender/model-brief.d.ts +61 -0
  76. package/dist/tools/blender/model-brief.d.ts.map +1 -0
  77. package/dist/tools/blender/model-brief.js +117 -0
  78. package/dist/tools/blender/model-brief.js.map +1 -0
  79. package/dist/tools/blender/paths.d.ts +20 -0
  80. package/dist/tools/blender/paths.d.ts.map +1 -0
  81. package/dist/tools/blender/paths.js +37 -0
  82. package/dist/tools/blender/paths.js.map +1 -0
  83. package/dist/tools/blender/runner-py.d.ts +2 -0
  84. package/dist/tools/blender/runner-py.d.ts.map +1 -0
  85. package/dist/tools/blender/runner-py.js +442 -0
  86. package/dist/tools/blender/runner-py.js.map +1 -0
  87. package/dist/tools/brief-store.d.ts +25 -0
  88. package/dist/tools/brief-store.d.ts.map +1 -0
  89. package/dist/tools/brief-store.js +59 -0
  90. package/dist/tools/brief-store.js.map +1 -0
  91. package/dist/tools/check-posts.d.ts.map +1 -1
  92. package/dist/tools/check-posts.js +21 -3
  93. package/dist/tools/check-posts.js.map +1 -1
  94. package/dist/tools/design-checkin.d.ts +28 -0
  95. package/dist/tools/design-checkin.d.ts.map +1 -0
  96. package/dist/tools/design-checkin.js +74 -0
  97. package/dist/tools/design-checkin.js.map +1 -0
  98. package/dist/tools/design-docs.d.ts +37 -0
  99. package/dist/tools/design-docs.d.ts.map +1 -0
  100. package/dist/tools/design-docs.js +367 -0
  101. package/dist/tools/design-docs.js.map +1 -0
  102. package/dist/tools/design-fonts.d.ts +54 -0
  103. package/dist/tools/design-fonts.d.ts.map +1 -0
  104. package/dist/tools/design-fonts.js +312 -0
  105. package/dist/tools/design-fonts.js.map +1 -0
  106. package/dist/tools/design-studio-tools.d.ts +16 -0
  107. package/dist/tools/design-studio-tools.d.ts.map +1 -1
  108. package/dist/tools/design-studio-tools.js +288 -43
  109. package/dist/tools/design-studio-tools.js.map +1 -1
  110. package/dist/tools/generation-manager.d.ts +1 -1
  111. package/dist/tools/generation-manager.d.ts.map +1 -1
  112. package/dist/tools/gimp/build-image.d.ts +152 -0
  113. package/dist/tools/gimp/build-image.d.ts.map +1 -0
  114. package/dist/tools/gimp/build-image.js +809 -0
  115. package/dist/tools/gimp/build-image.js.map +1 -0
  116. package/dist/tools/gimp/find-gimp.d.ts +32 -0
  117. package/dist/tools/gimp/find-gimp.d.ts.map +1 -0
  118. package/dist/tools/gimp/find-gimp.js +149 -0
  119. package/dist/tools/gimp/find-gimp.js.map +1 -0
  120. package/dist/tools/gimp/runner-py.d.ts +2 -0
  121. package/dist/tools/gimp/runner-py.d.ts.map +1 -0
  122. package/dist/tools/gimp/runner-py.js +723 -0
  123. package/dist/tools/gimp/runner-py.js.map +1 -0
  124. package/dist/tools/propose-brief.d.ts.map +1 -1
  125. package/dist/tools/propose-brief.js +6 -1
  126. package/dist/tools/propose-brief.js.map +1 -1
  127. package/dist/tools/review-post.d.ts +25 -0
  128. package/dist/tools/review-post.d.ts.map +1 -0
  129. package/dist/tools/review-post.js +63 -0
  130. package/dist/tools/review-post.js.map +1 -0
  131. package/dist/tools/tool-registry.d.ts.map +1 -1
  132. package/dist/tools/tool-registry.js +39 -1
  133. package/dist/tools/tool-registry.js.map +1 -1
  134. package/dist/tools/tool-request-words.d.ts +7 -0
  135. package/dist/tools/tool-request-words.d.ts.map +1 -0
  136. package/dist/tools/tool-request-words.js +39 -0
  137. package/dist/tools/tool-request-words.js.map +1 -0
  138. package/dist/tools/write-post.d.ts.map +1 -1
  139. package/dist/tools/write-post.js +5 -1
  140. package/dist/tools/write-post.js.map +1 -1
  141. package/dist/tools/write-video-post.d.ts.map +1 -1
  142. package/dist/tools/write-video-post.js +6 -1
  143. package/dist/tools/write-video-post.js.map +1 -1
  144. package/package.json +1 -1
@@ -23,6 +23,22 @@ export interface SocialPostInput {
23
23
  * row survived inside a recency window, and then came round again.
24
24
  */
25
25
  subject?: string | null;
26
+ /**
27
+ * Set when this post IS one of his every-day posts — the id from his list
28
+ * ("discord", "star_repo"). 8 Nov 2026: the Posts room stopped planning the
29
+ * day, and the plan's beats were the only thing that carried this. Without
30
+ * it on the post, "has the Discord post gone out today?" can only be
31
+ * answered from her memory, which is the question check_posts exists to
32
+ * stop her answering that way.
33
+ */
34
+ daily?: string | null;
35
+ /**
36
+ * Set when this post promotes one of OUR features — its name, the same
37
+ * wording every time ("Talk mode", "Design Studio 3D"). Two to three of
38
+ * these go out a day and never the same feature twice in a row (his call,
39
+ * 8 Nov 2026), so both the count and the repeat check need it recorded.
40
+ */
41
+ feature?: string | null;
26
42
  }
27
43
  /** What the store returns after a post is written. */
28
44
  export interface SocialPostWritten {
@@ -49,6 +65,16 @@ export interface ExistingPost {
49
65
  status?: string;
50
66
  /** Text post or video post — the two come from different sinks. */
51
67
  kind: 'text' | 'video';
68
+ /** The every-day item this post was, when it was one. */
69
+ daily?: string;
70
+ /** The feature it promoted, when it promoted one. */
71
+ feature?: string;
72
+ /** His local day (YYYY-MM-DD) when it was written. Absent on old posts. */
73
+ localDay?: string;
74
+ /** HIS mark — did it land? null/undefined = not judged yet. */
75
+ landed?: boolean | null;
76
+ /** HER verdict on her own work, when she has given one. */
77
+ verdict?: string;
52
78
  }
53
79
  export interface PostStore {
54
80
  write(post: SocialPostInput): Promise<SocialPostWritten>;
@@ -71,6 +97,13 @@ export interface PostStore {
71
97
  list?(opts?: {
72
98
  sinceDays?: number;
73
99
  }): Promise<ExistingPost[]>;
100
+ /**
101
+ * Her verdict on posts that went out, by the ids `list` gives back. Moved
102
+ * here from the day plan (8 Nov 2026): the plan is gone, the posts are the
103
+ * record, so the judgement sits beside his Landed mark on the post itself.
104
+ * Returns how many were recorded. Optional — a host without it says so.
105
+ */
106
+ review?(ids: string[], verdict: string): Promise<number>;
74
107
  }
75
108
  /**
76
109
  * A finished short-form video post — as the PARTS a person assembles: the
@@ -146,6 +179,13 @@ export interface VideoPostInput {
146
179
  * report back that she had.
147
180
  */
148
181
  recipe?: string;
182
+ /** What the video is about — the same field text posts file (8 Nov 2026:
183
+ * it was required by the tool and then dropped before the store). */
184
+ subject?: string;
185
+ /** Every-day item this video is, when it is one. See SocialPostInput. */
186
+ daily?: string;
187
+ /** The feature it promotes, when it promotes one. See SocialPostInput. */
188
+ feature?: string;
149
189
  }
150
190
  /** What the surface reports back — the finished parts, not a job to poll. */
151
191
  export interface VideoPostWritten {
@@ -354,6 +394,10 @@ export interface PostBrief {
354
394
  mustLand: string;
355
395
  /** Her reasoning for the brief as a whole — what she weighed and rejected. */
356
396
  reasoning: string;
397
+ /** The every-day item this post is, when it is one ("discord"). */
398
+ daily?: string;
399
+ /** The feature this post promotes, when it promotes one. */
400
+ feature?: string;
357
401
  }
358
402
  /** Surface-injected sink for a proposed brief → `brief` SSE, rendered as a card. */
359
403
  export interface BriefStore {
@@ -545,4 +589,8 @@ export interface DailyItem {
545
589
  export interface BeatStore {
546
590
  suggest(beats: Beat[]): Promise<void>;
547
591
  }
592
+ export declare const DAILY_PARAM_DESCRIPTION: string;
593
+ export declare const FEATURE_PARAM_DESCRIPTION: string;
594
+ /** A marker as recorded: trimmed, non-empty, short — or nothing. */
595
+ export declare function postMarker(v: unknown, max?: number): string | undefined;
548
596
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/social/index.ts"],"names":[],"mappings":"AAYA,YAAY,EAAE,WAAW,IAAI,UAAU,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAE7F,oEAAoE;AACpE,MAAM,WAAW,eAAe;IAC9B,oFAAoF;IACpF,QAAQ,EAAE,MAAM,CAAC;IACjB,0DAA0D;IAC1D,OAAO,EAAE,MAAM,CAAC;IAChB,oCAAoC;IACpC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,wEAAwE;IACxE,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,iFAAiF;IACjF,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,oEAAoE;IACpE,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB;;;;;;;;OAQG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB;AAED,sD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InE"}
@@ -135,4 +135,23 @@ export const PLATFORM_TAG_POLICY = {
135
135
  reddit: 'Reddit: NO hashtags — they do nothing here and they mark a post as imported from somewhere else, which this crowd reads as an advert before reading the words. FLAIR is the thing people miss: a lot of subreddits require it and auto-remove anything posted without it, so a missing flair is not a weaker post, it is a deleted one. Several subs also confine promotion to a designated weekly thread, rate-limit it to one mention every month or two, or ban it outright, and the rules differ per sub and are mod-enforced — so say in the notes that the sub rules and the flair need checking before posting, and never assume a link post is allowed. The TITLE does double duty. In the feed it is the whole pitch, max 300 characters, and plain and specific beats a hook because clickbait reads as an insult here. But Reddit threads also rank strongly in Google and gain authority as they age, so the title outlives the post — write it in the words someone would SEARCH, not the words an ad would use, and it can keep earning for months. Never ask for upvotes; vote manipulation is a sitewide rule and it gets accounts actioned. Write the body as a person with something to say, with the working shown, not as a launch announcement. THE ARGUMENT IS THE POST: when the post is a take on news or on another company, Ava and the product stay OUT of the body — no link, no "which is why we built", and the product is never the conclusion. The moment a post pays off in the product, readers decide the whole argument was a setup and spend the thread on "is this an ad?" instead of the topic (21 Oct 2026: an 800-upvote r/AIsafety post drew exactly that, because it turned to Ava halfway). End on the topic itself — what would settle the question, what should change. If our stake matters, ONE plain disclosure line at the very end ("Disclosure: I build a small open-source AI tool") is honest; anything more is a pitch. People who like the thinking find the profile. Product posts belong only in subs that want them (r/SideProject, r/vscode, r/LocalLLaMA and the like), and only within their rules.',
136
136
  blog: 'Blog: no hashtags — there is no feed to be matched into. This is the one surface we own, so it is the canonical home everything else points back at: the full version lives here and the social posts are the trailers. Write for search and for a reader who arrived cold. The TITLE and the first paragraph are the search surface, so put the plain claim and the words someone would actually type in both, early. Use real headings, because they are how people skim and how search engines read structure. Length is not the point; completeness is — a post that answers the question fully is the one that gets linked to.',
137
137
  };
138
+ // ─── The two markers a post carries (8 Nov 2026) ────────────────────────────
139
+ //
140
+ // Shared by write_post, write_video_post and propose_brief so the three say
141
+ // the same thing — a marker described differently in each place gets set in
142
+ // one and forgotten in the others.
143
+ export const DAILY_PARAM_DESCRIPTION = 'ONLY when this post IS one of his every-day posts: its id from his list ("discord", "star_repo"). '
144
+ + 'It is how anyone can tell later that today\'s Discord post went out — leave it off and the record '
145
+ + 'says it did not. Never set it on any other post.';
146
+ export const FEATURE_PARAM_DESCRIPTION = 'ONLY when this post promotes one of OUR features: the feature\'s plain name, worded the same way every '
147
+ + 'time ("Talk mode", "Design Studio 3D", "Local memory"). It counts toward the two to three feature posts '
148
+ + 'a day and stops the same feature being pushed twice running. Leave it off for news, conversation and '
149
+ + 'every-day posts.';
150
+ /** A marker as recorded: trimmed, non-empty, short — or nothing. */
151
+ export function postMarker(v, max = 60) {
152
+ if (typeof v !== 'string')
153
+ return undefined;
154
+ const t = v.trim().slice(0, max);
155
+ return t || undefined;
156
+ }
138
157
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/social/index.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,EAAE;AACF,+EAA+E;AAC/E,6EAA6E;AAC7E,8EAA8E;AAC9E,0EAA0E;AAC1E,0EAA0E;AAC1E,+EAA+E;AAC/E,0EAA0E;AAkQ1E;+EAC+E;AAC/E;;;;GAIG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAC9B,8XAA8X;MAC5X,uRAAuR;MACvR,4UAA4U;MAC5U,4aAA4a,CAAC;AAEjb,MAAM,CAAC,MAAM,oBAAoB,GAAqC;IACpE,MAAM,EAAE,IAAI;IACZ,SAAS,EAAE,IAAI;IACf,OAAO,EAAE,IAAI;IACb,QAAQ,EAAE,KAAK;CAChB,CAAC;AAEF;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAqC;IACpE,yCAAyC;IACzC,QAAQ,EAAE,WAAW;IACrB,gBAAgB,EAAE,WAAW;IAC7B,iBAAiB,EAAE,WAAW;IAC9B,eAAe,EAAE,WAAW;IAC5B,eAAe,EAAE,WAAW;IAC5B,4E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,qmBAAqmB;CAC5mB,CAAC;AAuLF,+EAA+E;AAC/E,EAAE;AACF,4EAA4E;AAC5E,4EAA4E;AAC5E,mCAAmC;AAEnC,MAAM,CAAC,MAAM,uBAAuB,GAClC,oGAAoG;MAClG,oGAAoG;MACpG,kDAAkD,CAAC;AAEvD,MAAM,CAAC,MAAM,yBAAyB,GACpC,yGAAyG;MACvG,0GAA0G;MAC1G,uGAAuG;MACvG,kBAAkB,CAAC;AAEvB,oEAAoE;AACpE,MAAM,UAAU,UAAU,CAAC,CAAU,EAAE,GAAG,GAAG,EAAE;IAC7C,IAAI,OAAO,CAAC,KAAK,QAAQ;QAAE,OAAO,SAAS,CAAC;IAC5C,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;IACjC,OAAO,CAAC,IAAI,SAAS,CAAC;AACxB,CAAC"}
@@ -0,0 +1,52 @@
1
+ /**
2
+ * Design Studio 3D — Ava builds game assets in Blender with no window.
3
+ *
4
+ * design_build_model runs her Python inside Blender (`blender -b`), in the
5
+ * model's own folder under ~/.ava/creative/blender/<model>/, then saves the
6
+ * .blend, exports a .glb (always — the Library viewer reads it) and an .fbx
7
+ * when asked, renders a preview, and hands that preview back as an image so
8
+ * she SEES what she built before she says anything about it.
9
+ *
10
+ * How a model grows (his call, 3 Nov 2026): the first run starts from an empty
11
+ * scene; every later run OPENS the saved .blend — including anything he changed
12
+ * by hand in Blender — and works on top of it. A new canvas only after he says
13
+ * yes. Every run keeps the previous five versions in versions/. A run that
14
+ * fails saves nothing, so the model is exactly as it was.
15
+ *
16
+ * Safety (his call, 3 Nov 2026): a guard, not per-run approval. Two layers —
17
+ * this file refuses the obvious escape hatches in the script text, and the
18
+ * runner installs a Python audit hook inside Blender that refuses starting
19
+ * programs, network access, native code and any write outside the model
20
+ * folder. It is a guard, not a sandbox: Blender's own C code is not visible to
21
+ * the hook, which is why absolute paths are refused in the script itself.
22
+ *
23
+ * Runs here, in core, on purpose: the extension host and the IDE sidecar both
24
+ * run core in Node, so both surfaces get the same tool with no host wiring.
25
+ */
26
+ import type { Tool, ToolResult, ToolExecutionContext, ToolRiskLevel } from '../types.js';
27
+ import type { FunctionSchema } from '../../providers/types.js';
28
+ export { modelsDir, modelSlug } from './paths.js';
29
+ export declare function checkBlenderScript(script: string): string | null;
30
+ export declare class DesignBuildModelTool implements Tool {
31
+ readonly name = "design_build_model";
32
+ readonly description = "Build or change a 3D model in Blender with no window: run your Blender Python on the model, save it, export it and see a preview. Free \u2014 Blender runs on their own computer.";
33
+ readonly riskLevel: ToolRiskLevel;
34
+ readonly requiresConfirmation = false;
35
+ readonly schema: FunctionSchema;
36
+ /**
37
+ * Every real run shows in the sidebar's Studio rail, like an image or a clip
38
+ * being made (his ask, 4 Nov 2026). Registered only once Blender is about to
39
+ * start, so a refusal (no brief, a blocked script) never appears as a job.
40
+ */
41
+ execute(args: Record<string, unknown>, context: ToolExecutionContext): Promise<ToolResult>;
42
+ private step;
43
+ }
44
+ export declare class DesignDuplicateModelTool implements Tool {
45
+ readonly name = "design_duplicate_model";
46
+ readonly description = "Copy a 3D model to a new name, so an idea can be tried on the copy while the original stays untouched.";
47
+ readonly riskLevel: ToolRiskLevel;
48
+ readonly requiresConfirmation = false;
49
+ readonly schema: FunctionSchema;
50
+ execute(args: Record<string, unknown>): Promise<ToolResult>;
51
+ }
52
+ //# sourceMappingURL=build-model.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"build-model.d.ts","sourceRoot":"","sources":["../../../src/tools/blender/build-model.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAQH,OAAO,KAAK,EAAE,IAAI,EAAE,UAAU,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACzF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAO/D,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAsBlD,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAMhE;AA+FD,qBAAa,oBAAqB,YAAW,IAAI;IAC/C,QAAQ,CAAC,IAAI,wBAAwB;IACrC,QAAQ,CAAC,WAAW,uLAC6J;IACjL,QAAQ,CAAC,SAAS,EAAE,aAAa,CAAW;IAC5C,QAAQ,CAAC,oBAAoB,SAAS;IAEtC,QAAQ,CAAC,MAAM,EAAE,cAAc,CA+C7B;IAEF;;;;OAIG;IACG,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,UAAU,CAAC;YA0BlF,IAAI;CA4InB;AAID,qBAAa,wBAAyB,YAAW,IAAI;IACnD,QAAQ,CAAC,IAAI,4BAA4B;IACzC,QAAQ,CAAC,WAAW,4GACuF;IAC3G,QAAQ,CAAC,SAAS,EAAE,aAAa,CAAW;IAC5C,QAAQ,CAAC,oBAAoB,SAAS;IAEtC,QAAQ,CAAC,MAAM,EAAE,cAAc,CAa7B;IAEI,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,UAAU,CAAC;CA0ClE"}
@@ -0,0 +1,426 @@
1
+ /**
2
+ * Design Studio 3D — Ava builds game assets in Blender with no window.
3
+ *
4
+ * design_build_model runs her Python inside Blender (`blender -b`), in the
5
+ * model's own folder under ~/.ava/creative/blender/<model>/, then saves the
6
+ * .blend, exports a .glb (always — the Library viewer reads it) and an .fbx
7
+ * when asked, renders a preview, and hands that preview back as an image so
8
+ * she SEES what she built before she says anything about it.
9
+ *
10
+ * How a model grows (his call, 3 Nov 2026): the first run starts from an empty
11
+ * scene; every later run OPENS the saved .blend — including anything he changed
12
+ * by hand in Blender — and works on top of it. A new canvas only after he says
13
+ * yes. Every run keeps the previous five versions in versions/. A run that
14
+ * fails saves nothing, so the model is exactly as it was.
15
+ *
16
+ * Safety (his call, 3 Nov 2026): a guard, not per-run approval. Two layers —
17
+ * this file refuses the obvious escape hatches in the script text, and the
18
+ * runner installs a Python audit hook inside Blender that refuses starting
19
+ * programs, network access, native code and any write outside the model
20
+ * folder. It is a guard, not a sandbox: Blender's own C code is not visible to
21
+ * the hook, which is why absolute paths are refused in the script itself.
22
+ *
23
+ * Runs here, in core, on purpose: the extension host and the IDE sidecar both
24
+ * run core in Node, so both surfaces get the same tool with no host wiring.
25
+ */
26
+ import { spawn } from 'node:child_process';
27
+ import { existsSync } from 'node:fs';
28
+ import { mkdir, writeFile, readFile, readdir, stat, rm, cp, rename } from 'node:fs/promises';
29
+ import { join } from 'node:path';
30
+ import { tmpdir } from 'node:os';
31
+ import { randomUUID } from 'node:crypto';
32
+ import { designRunRefusal, recordDesignRun } from '../design-checkin.js';
33
+ import { creativeDir, modelsDir, metadataFile, modelSlug } from './paths.js';
34
+ import { kitForScripts } from '../../brand/brand-kits.js';
35
+ import { readModelBrief, formatModelBrief } from './model-brief.js';
36
+ export { modelsDir, modelSlug } from './paths.js';
37
+ import { findBlender, BLENDER_DOWNLOAD_URL } from './find-blender.js';
38
+ import { BLENDER_RUNNER_PY } from './runner-py.js';
39
+ const DEFAULT_TIMEOUT_S = 300;
40
+ const MAX_TIMEOUT_S = 900;
41
+ const MAX_OUTPUT = 400_000;
42
+ // ── The script check (layer one of the guard) ────────────────────────────────
43
+ // Each rule names WHY in words she can act on, so a refusal leads to a fix
44
+ // rather than a retry of the same thing.
45
+ const SCRIPT_RULES = [
46
+ { re: /\bsubprocess\b|\bos\.(system|popen|exec\w*|spawn\w*|startfile|kill)\b/, why: 'it starts other programs' },
47
+ { re: /\b(socket|urllib|requests|http\.client|ftplib|smtplib|asyncio\.open_connection)\b/, why: 'it uses the network' },
48
+ { re: /\b(ctypes|cffi|winreg|_winapi|msvcrt)\b/, why: 'it reaches native code or the registry' },
49
+ { re: /bpy\.ops\.wm\.(save_as_mainfile|save_mainfile|read_homefile|read_factory_settings|quit_blender|url_open)\b/, why: 'it saves, resets or closes Blender itself — the tool saves the model for you after your script runs' },
50
+ { re: /bpy\.ops\.(preferences|script)\.|addon_(install|enable|remove)|bpy\.utils\.execfile/, why: 'it changes Blender\'s own setup or runs another script' },
51
+ { re: /\blibraries\.write\b|\bexpanduser\b|Path\.home\b|\bos\.environ\b|\bgetenv\b/, why: 'it builds a path outside the model folder' },
52
+ { re: /["'](?:[A-Za-z]:[\\/]|\\\\|~[\\/]|\/(?:Users|home|etc|tmp|var|Applications|mnt|opt)\b)/, why: 'it contains an absolute path — build every path from ASSET_DIR, e.g. os.path.join(ASSET_DIR, "icon.png")' },
53
+ { re: /\.\.[\\/]/, why: 'it climbs out of the model folder with ".." — build every path from ASSET_DIR' },
54
+ ];
55
+ export function checkBlenderScript(script) {
56
+ for (const rule of SCRIPT_RULES) {
57
+ const m = rule.re.exec(script);
58
+ if (m)
59
+ return `The script was not run: ${rule.why} (found "${m[0]}"). Scripts here only build the model and write inside its own folder.`;
60
+ }
61
+ return null;
62
+ }
63
+ // ── Library entry (one asset, one folder) ────────────────────────────────────
64
+ // The same metadata.json the extension and the IDE both read. `path` points at
65
+ // the preview so the Library shows the model's picture; `folder` is the whole
66
+ // asset; `bytes` is the whole folder, re-measured after every run.
67
+ async function folderBytes(dir) {
68
+ let total = 0;
69
+ for (const entry of await readdir(dir, { withFileTypes: true }).catch(() => [])) {
70
+ const p = join(dir, entry.name);
71
+ if (entry.isDirectory())
72
+ total += await folderBytes(p);
73
+ else
74
+ total += (await stat(p).catch(() => ({ size: 0 }))).size;
75
+ }
76
+ return total;
77
+ }
78
+ async function upsertLibraryEntry(m) {
79
+ let items = [];
80
+ try {
81
+ const parsed = JSON.parse(await readFile(metadataFile(), 'utf-8'));
82
+ if (Array.isArray(parsed))
83
+ items = parsed;
84
+ }
85
+ catch { /* none yet */ }
86
+ const id = `model_${m.slug}`;
87
+ const existing = items.find((i) => i.id === id);
88
+ const folder = join(modelsDir(), m.slug);
89
+ const now = new Date().toISOString();
90
+ const entry = {
91
+ ...(existing ?? {}),
92
+ id,
93
+ kind: 'model',
94
+ designType: 'model',
95
+ path: `blender/${m.slug}/preview.png`,
96
+ absolutePath: join(folder, 'preview.png'),
97
+ folder: `blender/${m.slug}`,
98
+ absoluteFolder: folder,
99
+ glb: `blender/${m.slug}/${m.slug}.glb`,
100
+ files: m.files,
101
+ prompt: m.description ?? existing?.prompt ?? '',
102
+ title: m.name,
103
+ blenderVersion: m.blenderVersion,
104
+ triangles: m.triangles,
105
+ sizeM: m.sizeM,
106
+ createdAt: existing?.createdAt ?? now,
107
+ updatedAt: now,
108
+ bytes: await folderBytes(folder),
109
+ };
110
+ await mkdir(creativeDir(), { recursive: true });
111
+ await writeFile(metadataFile(), JSON.stringify([entry, ...items.filter((i) => i.id !== id)], null, 2), 'utf-8');
112
+ }
113
+ function runBlender(exe, args, cwd, timeoutMs, signal) {
114
+ return new Promise((resolve) => {
115
+ const child = spawn(exe, args, { cwd, windowsHide: true });
116
+ let stdout = '', stderr = '', timedOut = false, aborted = false;
117
+ child.stdout.on('data', (d) => { if (stdout.length < MAX_OUTPUT)
118
+ stdout += d; });
119
+ child.stderr.on('data', (d) => { if (stderr.length < MAX_OUTPUT)
120
+ stderr += d; });
121
+ const timer = setTimeout(() => { timedOut = true; child.kill(); }, timeoutMs);
122
+ const onAbort = () => { aborted = true; child.kill(); };
123
+ signal?.addEventListener('abort', onAbort, { once: true });
124
+ const done = () => {
125
+ clearTimeout(timer);
126
+ signal?.removeEventListener('abort', onAbort);
127
+ resolve({ stdout, stderr, timedOut, aborted });
128
+ };
129
+ child.on('close', done);
130
+ child.on('error', (err) => { stderr += String(err); done(); });
131
+ });
132
+ }
133
+ /** Her own print() lines, without Blender's start-up and render chatter. */
134
+ function scriptOutput(stdout) {
135
+ const noise = /^(Blender \d|Read prefs|Read blend|Fra:|Saved: |Time: |Info: |Warning: Unable|Blender quit|Color management|\s*$|@@AVA_RESULT@@|\d\d:\d\d\.\d{3}\s)/;
136
+ const lines = stdout.split(/\r?\n/).filter((l) => !noise.test(l));
137
+ return lines.slice(-30).join('\n').slice(-3000);
138
+ }
139
+ const fmtSize = (s) => (s && s.length === 3 ? `${s[0]} × ${s[1]} × ${s[2]} m` : 'unknown');
140
+ // ── design_build_model ───────────────────────────────────────────────────────
141
+ export class DesignBuildModelTool {
142
+ name = 'design_build_model';
143
+ description = 'Build or change a 3D model in Blender with no window: run your Blender Python on the model, save it, export it and see a preview. Free — Blender runs on their own computer.';
144
+ riskLevel = 'write';
145
+ requiresConfirmation = false;
146
+ schema = {
147
+ name: 'design_build_model',
148
+ description: 'Run YOUR Blender Python (bpy) on a 3D model and get back a preview image of the result. ' +
149
+ 'KIT is the brand kit for this project: KIT.rgba("primary") for a linear Base Color, KIT.colour("primary") for hex, KIT.logo("mark") for a real file path. If (not KIT) there is none: ask them. ' +
150
+ 'The FIRST run of a model starts from an EMPTY scene (no default cube, camera or light). EVERY LATER RUN OPENS THE SAVED MODEL — ' +
151
+ 'including anything the person changed by hand in Blender — so write ONLY the change for this step, never rebuild what is already there. ' +
152
+ 'Starting again on a new canvas (start_fresh) throws the current scene away for this run: ALWAYS ask the person first and only send it after they say yes. ' +
153
+ 'Never save, open or reset the file yourself: after your script runs, the tool saves the .blend, exports a .glb (and an .fbx if asked), and renders preview.png ' +
154
+ '(your own camera if the scene has one, otherwise a three-quarter view). If YOU write preview.png yourself, yours is used. ' +
155
+ 'ASSET_DIR is predefined: the model\'s own folder. Write every file inside it (os.path.join(ASSET_DIR, "icon.png")) — absolute paths, "..", ' +
156
+ 'other programs, network and native code are refused. Units are metres, Z is up. If the script errors, nothing is saved and you get the traceback: fix it and run again. ' +
157
+ 'TEXTURING: live shader nodes (noise, math, ramps, bump) do NOT export — engines and the Library viewer show the model flat until it is baked. ' +
158
+ 'Two helpers are predefined for that: ava_unwrap() packs every object\'s UVs into one shared, non-overlapping square (your old layout is kept as "LiveUV" and your shader keeps reading it, so the look does not change), ' +
159
+ 'and ava_bake(size=2048) bakes colour, roughness, metal and normal into textures/ and puts an export-ready material on the objects (your live material is kept for re-baking — change it and call ava_bake() again). ' +
160
+ 'Use them rather than writing your own bake. Cycles IS available for baking even though Blender\'s engine list only shows EEVEE. ' +
161
+ 'The Blender Python API changes between versions — the result tells you the installed version; check its API docs when unsure.',
162
+ parameters: {
163
+ type: 'object',
164
+ properties: {
165
+ name: {
166
+ type: 'string',
167
+ description: 'The model\'s name, e.g. "Worn Supply Crate". The same name continues the same model; its folder is named from it.',
168
+ },
169
+ script: {
170
+ type: 'string',
171
+ description: 'Blender Python for THIS step only. `bpy` and `ASSET_DIR` are already defined. On a later run the saved model is already open — change it, don\'t rebuild it.',
172
+ },
173
+ description: {
174
+ type: 'string',
175
+ description: 'One line on what the model is, for the Library card (e.g. "Worn wooden supply crate, ruined London dock, ~2k tris").',
176
+ },
177
+ start_fresh: {
178
+ type: 'boolean',
179
+ description: 'Start this run from an EMPTY scene instead of the saved model. ONLY after the person has said yes to a new canvas — always ask first. The previous version is kept in versions/.',
180
+ },
181
+ fbx: {
182
+ type: 'boolean',
183
+ description: 'Also export an .fbx (Unreal / Unity). A .glb is always exported.',
184
+ },
185
+ timeout_seconds: {
186
+ type: 'number',
187
+ description: `How long Blender may run before it is stopped. Default ${DEFAULT_TIMEOUT_S}, most ${MAX_TIMEOUT_S}. Raise it only for heavy renders or bakes.`,
188
+ },
189
+ },
190
+ required: ['name', 'script'],
191
+ },
192
+ };
193
+ /**
194
+ * Every real run shows in the sidebar's Studio rail, like an image or a clip
195
+ * being made (his ask, 4 Nov 2026). Registered only once Blender is about to
196
+ * start, so a refusal (no brief, a blocked script) never appears as a job.
197
+ */
198
+ async execute(args, context) {
199
+ const wait = designRunRefusal(context);
200
+ if (wait)
201
+ return { success: false, output: wait };
202
+ const jobs = context.sharedState?.generationManager;
203
+ let jobId;
204
+ const started = (name, slug, assetDir) => {
205
+ jobId = `blender_${randomUUID()}`;
206
+ jobs?.create({ id: jobId, type: 'blender', prompt: name, filename: slug, targetPath: assetDir });
207
+ jobs?.update(jobId, { status: 'generating' });
208
+ };
209
+ try {
210
+ const res = await this.step(args, context, started);
211
+ if (jobId) {
212
+ if (res.success)
213
+ jobs?.complete(jobId);
214
+ else
215
+ jobs?.fail(jobId, res.output.split('\n')[0]);
216
+ // Runs Blender/GIMP actually made. A refusal is not a run.
217
+ const checkIn = recordDesignRun(context, res.success);
218
+ if (checkIn)
219
+ res.output += `\n\n${checkIn}`;
220
+ }
221
+ return res;
222
+ }
223
+ catch (err) {
224
+ if (jobId)
225
+ jobs?.fail(jobId, err instanceof Error ? err.message : String(err));
226
+ throw err;
227
+ }
228
+ }
229
+ async step(args, context, started) {
230
+ const name = String(args.name ?? '').trim();
231
+ const script = String(args.script ?? '');
232
+ const slug = modelSlug(name);
233
+ if (!slug)
234
+ return { success: false, output: 'Missing `name` — the model\'s name, e.g. "Worn Supply Crate".' };
235
+ if (!script.trim())
236
+ return { success: false, output: 'Missing `script` — the Blender Python for this step.' };
237
+ // The brief comes first — enforced here, not only asked for in her prompt.
238
+ // Only the person agrees it (on the card), so this cannot be talked past.
239
+ const brief = await readModelBrief(slug);
240
+ if (!brief) {
241
+ return {
242
+ success: false,
243
+ output: `Nothing was built: "${name}" has no brief yet. Research it, then propose the brief with design_propose_model_brief — the person agrees it on the card before the first build.`,
244
+ };
245
+ }
246
+ if (brief.status !== 'agreed') {
247
+ return {
248
+ success: false,
249
+ output: `Nothing was built: the brief for "${name}" is still waiting for the person to agree it on the card` +
250
+ `${brief.editedByPerson ? ' (they edited it — read their changes in the room context and talk them through)' : ''}. Ask them to agree it, or change it with design_propose_model_brief if they want something different.`,
251
+ };
252
+ }
253
+ const refused = checkBlenderScript(script);
254
+ if (refused)
255
+ return { success: false, output: refused };
256
+ const blender = await findBlender();
257
+ if (!blender) {
258
+ return {
259
+ success: false,
260
+ output: `Blender isn't installed on this computer, or I can't find it. It's free from ${BLENDER_DOWNLOAD_URL} — ` +
261
+ 'once it is installed, try again. If it is installed somewhere unusual, its path can be set in Settings.',
262
+ };
263
+ }
264
+ const assetDir = join(modelsDir(), slug);
265
+ const blendPath = join(assetDir, `${slug}.blend`);
266
+ const hadModel = existsSync(blendPath);
267
+ const continuing = hadModel && args.start_fresh !== true;
268
+ await mkdir(assetDir, { recursive: true });
269
+ await writeFile(join(assetDir, 'script.py'), script, 'utf-8');
270
+ // Keep every step's script beside the model, so what ran is always visible.
271
+ const scriptsDir = join(assetDir, 'scripts');
272
+ await mkdir(scriptsDir, { recursive: true });
273
+ await writeFile(join(scriptsDir, `${new Date().toISOString().replace(/[:.]/g, '-')}.py`), script, 'utf-8');
274
+ const runId = randomUUID();
275
+ const runnerPath = join(tmpdir(), `ava-blender-runner-${runId}.py`);
276
+ const jobPath = join(tmpdir(), `ava-blender-job-${runId}.json`);
277
+ await writeFile(runnerPath, BLENDER_RUNNER_PY, 'utf-8');
278
+ await writeFile(jobPath, JSON.stringify({ assetDir, name: slug, continue: continuing, fbx: args.fbx === true, kit: await kitForScripts(context.sharedState?.designProject?.()) }), 'utf-8');
279
+ const timeoutS = Math.min(MAX_TIMEOUT_S, Math.max(30, Number(args.timeout_seconds) || DEFAULT_TIMEOUT_S));
280
+ const blenderArgs = [
281
+ '-b', ...(continuing ? [blendPath] : []),
282
+ '--factory-startup', '--disable-autoexec',
283
+ '--python', runnerPath, '--', jobPath,
284
+ ];
285
+ started(name, slug, assetDir);
286
+ let run;
287
+ try {
288
+ run = await runBlender(blender.path, blenderArgs, assetDir, timeoutS * 1000, context.signal);
289
+ }
290
+ finally {
291
+ await rm(runnerPath, { force: true }).catch(() => { });
292
+ await rm(jobPath, { force: true }).catch(() => { });
293
+ }
294
+ if (run.aborted)
295
+ return { success: false, output: 'Stopped before Blender finished. Nothing new was saved.' };
296
+ if (run.timedOut) {
297
+ return {
298
+ success: false,
299
+ output: `Blender was stopped after ${timeoutS}s and nothing new was saved. Make the step smaller, lower render samples, or raise timeout_seconds if it is a heavy bake.`,
300
+ };
301
+ }
302
+ const marker = run.stdout.lastIndexOf('@@AVA_RESULT@@');
303
+ if (marker < 0) {
304
+ const tail = (run.stderr || run.stdout).split(/\r?\n/).slice(-25).join('\n');
305
+ return { success: false, output: `Blender closed without finishing the run, so nothing new was saved. Its last output:\n${tail}` };
306
+ }
307
+ let result;
308
+ try {
309
+ result = JSON.parse(run.stdout.slice(marker + '@@AVA_RESULT@@'.length).split(/\r?\n/)[0]);
310
+ }
311
+ catch {
312
+ return { success: false, output: 'Blender finished, but its report could not be read. Nothing was changed by the tool.' };
313
+ }
314
+ const printed = scriptOutput(run.stdout);
315
+ if (!result.ok) {
316
+ return {
317
+ success: false,
318
+ output: `Your script stopped with an error in Blender ${blender.version}. Nothing was saved — "${name}" is exactly as it was before this run.\n\n` +
319
+ `${(result.error ?? '').trim()}` +
320
+ (printed ? `\n\nWhat the script printed:\n${printed}` : '') +
321
+ '\n\nFix it and run the step again.',
322
+ };
323
+ }
324
+ await upsertLibraryEntry({
325
+ slug, name, description: typeof args.description === 'string' ? args.description : undefined,
326
+ files: result.files, blenderVersion: blender.version, triangles: result.triangles, sizeM: result.size_m,
327
+ }).catch(() => { });
328
+ const how = continuing ? 'on top of the saved model' : hadModel ? 'on a new canvas (the previous version is in versions/)' : 'from an empty scene';
329
+ const lines = [
330
+ `Built "${name}" ${how} in ${result.seconds ?? '?'}s with Blender ${blender.version}.`,
331
+ `${result.objects ?? 0} mesh objects, ${result.triangles ?? 0} triangles, overall size ${fmtSize(result.size_m)} (X × Y × Z, Z is up).`,
332
+ `Files in ${assetDir}: ${result.files.join(', ')}.`,
333
+ ];
334
+ if (result.warnings?.length)
335
+ lines.push(`Warnings: ${result.warnings.join(' ')}`);
336
+ if (printed)
337
+ lines.push(`What the script printed:\n${printed}`);
338
+ let previewB64;
339
+ if (result.files.includes('preview.png')) {
340
+ try {
341
+ previewB64 = (await readFile(join(assetDir, 'preview.png'))).toString('base64');
342
+ }
343
+ catch { /* none */ }
344
+ }
345
+ lines.push(`The agreed brief:
346
+ ${formatModelBrief(brief)}`);
347
+ lines.push(previewB64
348
+ ? 'LOOK at the preview now and check it against the brief — shape, proportions, true scale, detail, condition. Say plainly what is off and fix it in the next step; the next run opens this saved model, so write only the change.'
349
+ : 'There is no preview image this time — say so rather than describing what you think it looks like.');
350
+ return {
351
+ success: true,
352
+ output: lines.join('\n'),
353
+ metadata: {
354
+ model: slug, folder: assetDir, files: result.files, triangles: result.triangles, sizeM: result.size_m,
355
+ blenderVersion: blender.version,
356
+ ...(previewB64 ? { base64_image: previewB64, mime_type: 'image/png' } : {}),
357
+ },
358
+ };
359
+ }
360
+ }
361
+ // ── design_duplicate_model ───────────────────────────────────────────────────
362
+ export class DesignDuplicateModelTool {
363
+ name = 'design_duplicate_model';
364
+ description = 'Copy a 3D model to a new name, so an idea can be tried on the copy while the original stays untouched.';
365
+ riskLevel = 'write';
366
+ requiresConfirmation = false;
367
+ schema = {
368
+ name: 'design_duplicate_model',
369
+ description: 'Duplicate a model made with design_build_model under a new name — for trying something without touching the original. ' +
370
+ 'Then build on the copy by calling design_build_model with the NEW name.',
371
+ parameters: {
372
+ type: 'object',
373
+ properties: {
374
+ from: { type: 'string', description: 'The existing model\'s name.' },
375
+ to: { type: 'string', description: 'The new model\'s name, e.g. "Worn Supply Crate — burnt".' },
376
+ },
377
+ required: ['from', 'to'],
378
+ },
379
+ };
380
+ async execute(args) {
381
+ const fromName = String(args.from ?? '').trim();
382
+ const toName = String(args.to ?? '').trim();
383
+ const from = modelSlug(fromName);
384
+ const to = modelSlug(toName);
385
+ if (!from || !to)
386
+ return { success: false, output: 'Give both names: `from` (the existing model) and `to` (the new one).' };
387
+ if (from === to)
388
+ return { success: false, output: 'The new name must be different from the original.' };
389
+ const src = join(modelsDir(), from);
390
+ const dst = join(modelsDir(), to);
391
+ if (!existsSync(join(src, `${from}.blend`)))
392
+ return { success: false, output: `There is no saved model called "${fromName}".` };
393
+ if (existsSync(dst))
394
+ return { success: false, output: `A model called "${toName}" already exists. Pick another name.` };
395
+ // The model as it stands now — not its history, which belongs to the original.
396
+ await cp(src, dst, { recursive: true, filter: (p) => !/[\\/](versions|scripts)([\\/]|$)/.test(p.slice(src.length)) });
397
+ for (const ext of ['blend', 'glb', 'fbx']) {
398
+ if (existsSync(join(dst, `${from}.${ext}`)))
399
+ await rename(join(dst, `${from}.${ext}`), join(dst, `${to}.${ext}`));
400
+ }
401
+ // The copy carries the original's brief (and its agreement) under its own name.
402
+ const brief = await readModelBrief(to);
403
+ if (brief) {
404
+ brief.name = toName;
405
+ await writeFile(join(dst, 'brief.json'), JSON.stringify(brief, null, 2), 'utf-8');
406
+ }
407
+ const files = (await readdir(dst, { withFileTypes: true })).filter((e) => e.isFile() && e.name !== 'brief.json').map((e) => e.name);
408
+ let original;
409
+ try {
410
+ const items = JSON.parse(await readFile(metadataFile(), 'utf-8'));
411
+ original = items.find((i) => i.id === `model_${from}`);
412
+ }
413
+ catch { /* no library yet */ }
414
+ await upsertLibraryEntry({
415
+ slug: to, name: toName, description: original?.prompt, files,
416
+ blenderVersion: original?.blenderVersion ?? '',
417
+ triangles: original?.triangles, sizeM: original?.sizeM,
418
+ }).catch(() => { });
419
+ return {
420
+ success: true,
421
+ output: `Copied "${fromName}" to "${toName}". The original is untouched. Build on the copy with design_build_model, name "${toName}".`,
422
+ metadata: { model: to, folder: dst },
423
+ };
424
+ }
425
+ }
426
+ //# sourceMappingURL=build-model.js.map