@project-ava-supernova/core 0.2.176 → 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 +36 -11
  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
@@ -0,0 +1,442 @@
1
+ /**
2
+ * The Python that runs inside Blender for design_build_model.
3
+ *
4
+ * Kept as a file-in-a-string so core stays a single bundle (the extension and
5
+ * the IDE sidecar both ship core without loose resource files). Written to
6
+ * the OS temp folder before each run. Proven on Blender 5.2.2 LTS, 3 Nov 2026:
7
+ * a crate built, continued (lid added on top of the saved file), and every
8
+ * guard refusal confirmed — programs, network, native code, writes outside
9
+ * the model folder.
10
+ */
11
+ import { KIT_PY } from '../../brand/kit-py.js';
12
+ // prettier-ignore
13
+ export const BLENDER_RUNNER_PY = String.raw `# Ava's Blender runner. Started by design_build_model as:
14
+ # blender -b [model.blend] --factory-startup --disable-autoexec --python runner.py -- job.json
15
+ # It prepares the scene, installs the guard, runs Ava's script, then saves,
16
+ # exports and renders a preview. The last line it prints is the result.
17
+ import sys, os, json, time, traceback, tempfile, shutil, math
18
+
19
+ JOB = json.load(open(sys.argv[sys.argv.index('--') + 1], encoding='utf-8'))
20
+ ASSET_DIR = os.path.realpath(JOB['assetDir'])
21
+ NAME = JOB['name']
22
+ BLEND = os.path.join(ASSET_DIR, NAME + '.blend')
23
+ STARTED = time.time()
24
+ result = {'ok': False, 'files': [], 'warnings': []}
25
+ ${KIT_PY}
26
+
27
+ def emit():
28
+ sys.stdout.write('\n@@AVA_RESULT@@' + json.dumps(result) + '\n')
29
+ sys.stdout.flush()
30
+
31
+ import bpy
32
+ sys.dont_write_bytecode = True
33
+ bpy.context.preferences.filepaths.save_version = 0 # no .blend1 clutter beside the model
34
+
35
+ if not JOB['continue']:
36
+ bpy.ops.wm.read_factory_settings(use_empty=True) # a new canvas: nothing in it
37
+ for sc in bpy.data.scenes:
38
+ sc.render.filepath = os.path.join(ASSET_DIR, 'render_')
39
+
40
+ # ── The guard ────────────────────────────────────────────────────────────────
41
+ # Python audit hooks see every file write, process start and network call made
42
+ # from Python, and cannot be removed once installed. A guard, not a sandbox:
43
+ # Blender's own C code (saving a .blend, writing a render) is not seen here,
44
+ # which is why the tool also refuses absolute paths in the script itself.
45
+ # Writes are allowed in the model folder and in Blender's OWN per-run temp
46
+ # folder (blender_xxxx), not the whole system temp. Python's tempfile is
47
+ # pointed there too, so any library that needs scratch space stays inside it.
48
+ _BTMP = bpy.app.tempdir or os.path.join(ASSET_DIR, '.tmp')
49
+ os.makedirs(_BTMP, exist_ok=True)
50
+ tempfile.tempdir = _BTMP
51
+ _ALLOWED = [os.path.normcase(os.path.realpath(p)) for p in {ASSET_DIR, _BTMP}]
52
+
53
+ def _inside(p):
54
+ try:
55
+ rp = os.path.normcase(os.path.realpath(os.fsdecode(p)))
56
+ except Exception:
57
+ return False
58
+ return any(rp == a or rp.startswith(a.rstrip(os.sep) + os.sep) for a in _ALLOWED)
59
+
60
+ _BLOCKED = {
61
+ 'subprocess.Popen': 'starting other programs', 'os.system': 'starting other programs',
62
+ 'os.exec': 'starting other programs', 'os.posix_spawn': 'starting other programs',
63
+ 'os.spawn': 'starting other programs', 'os.startfile': 'opening files in other programs',
64
+ 'os.kill': 'stopping other programs', 'webbrowser.open': 'opening a browser',
65
+ 'socket.connect': 'network access', 'socket.bind': 'network access',
66
+ 'socket.getaddrinfo': 'network access', 'socket.gethostbyname': 'network access',
67
+ 'urllib.Request': 'network access', 'ctypes.dlopen': 'loading native code',
68
+ 'ctypes.dlsym': 'calling native code', 'ctypes.call_function': 'calling native code',
69
+ 'winreg.CreateKey': 'changing the registry', 'winreg.SetValue': 'changing the registry',
70
+ 'winreg.DeleteKey': 'changing the registry', 'winreg.DeleteValue': 'changing the registry',
71
+ }
72
+ _WRITE_ARGS = { # event -> indexes of the paths it writes or removes
73
+ 'os.remove': (0,), 'os.rmdir': (0,), 'os.mkdir': (0,), 'os.chmod': (0,),
74
+ 'os.truncate': (0,), 'os.utime': (0,), 'shutil.rmtree': (0,),
75
+ 'os.rename': (0, 1), 'shutil.move': (0, 1), 'shutil.copyfile': (1,),
76
+ 'shutil.copytree': (1,), 'os.symlink': (1,), 'os.link': (1,),
77
+ }
78
+ _WRITE_FLAGS = os.O_WRONLY | os.O_RDWR | os.O_CREAT | os.O_APPEND | os.O_TRUNC
79
+
80
+ def _refuse(why):
81
+ raise PermissionError(f'Blocked by the Design Studio guard: {why}. '
82
+ f'Scripts here may only build the model and write inside its own folder (ASSET_DIR).')
83
+
84
+ def _hook(event, args):
85
+ if event in _BLOCKED:
86
+ _refuse(_BLOCKED[event])
87
+ if event == 'open':
88
+ path, mode, flags = (list(args) + [None, None, 0])[:3]
89
+ if path is None or isinstance(path, int):
90
+ return
91
+ writing = (isinstance(mode, str) and any(c in mode for c in 'wax+')) or \
92
+ (mode is None and isinstance(flags, int) and flags & _WRITE_FLAGS)
93
+ if writing and not _inside(path):
94
+ _refuse(f'writing outside the model folder ({os.fsdecode(path)})')
95
+ elif event in _WRITE_ARGS:
96
+ for i in _WRITE_ARGS[event]:
97
+ if i < len(args) and args[i] is not None and not isinstance(args[i], int) and not _inside(args[i]):
98
+ _refuse(f'changing files outside the model folder ({os.fsdecode(args[i])})')
99
+
100
+ # Blender's own exporters load native code when first imported (the glTF one
101
+ # pulls in ctypes for Draco). Import them BEFORE the guard goes up, so the guard
102
+ # only ever sees what Ava's script does.
103
+ import ctypes # noqa: F401
104
+ for _mod in ('io_scene_gltf2.blender.exp.export', 'io_scene_fbx.export_fbx_bin'):
105
+ try:
106
+ __import__(_mod)
107
+ except Exception as e:
108
+ result['warnings'].append(f'Could not preload {_mod}: {e}')
109
+
110
+ sys.addaudithook(_hook)
111
+
112
+ # ── Helpers Ava calls from her script ────────────────────────────────────────
113
+ # Texturing is where she lost twenty minutes on the first real model (3 Nov
114
+ # 2026): a beautiful live shader that exports as nothing, a dozen runs on UV
115
+ # layout, and Blender reporting only EEVEE when asked which engines exist —
116
+ # so she concluded Cycles (which baking needs) was missing. It is not. These
117
+ # do the known-good versions of both steps in one line each.
118
+
119
+ import math as _math
120
+
121
+ def _meshes(objects):
122
+ if objects is None:
123
+ return [o for o in bpy.context.scene.objects if o.type == 'MESH' and o.visible_get()]
124
+ return [bpy.data.objects[o] if isinstance(o, str) else o for o in objects]
125
+
126
+ def _select_only(obs):
127
+ if bpy.context.object and bpy.context.object.mode != 'OBJECT':
128
+ bpy.ops.object.mode_set(mode='OBJECT')
129
+ for o in bpy.context.scene.objects:
130
+ o.select_set(False)
131
+ for o in obs:
132
+ o.select_set(True)
133
+ bpy.context.view_layer.objects.active = obs[0]
134
+
135
+ def _keep_live_uvs(obs):
136
+ """Before a new layout goes in, keep the one the live shader was written
137
+ against. A shader can READ its UVs (her barrel told wood from iron by
138
+ position on the layout), so replacing them silently scrambles the look —
139
+ found the first time this ran on a real model, 3 Nov 2026. The old layout
140
+ is copied to 'LiveUV' and every material pointed at it explicitly; the new
141
+ packed layout then takes the FIRST slot, the one game engines read."""
142
+ mats = set()
143
+ for o in obs:
144
+ uvs = o.data.uv_layers
145
+ if not uvs:
146
+ uvs.new(name='UVMap')
147
+ continue
148
+ if 'LiveUV' not in uvs:
149
+ uvs.active = uvs[0]
150
+ uvs.new(name='LiveUV', do_init=True) # copies the current layout
151
+ uvs.active = uvs[0]
152
+ for sl in o.material_slots:
153
+ if sl.material and sl.material.use_nodes and not sl.material.get('ava_baked'):
154
+ mats.add(sl.material)
155
+ for m in mats:
156
+ nt = m.node_tree
157
+ for n in list(nt.nodes):
158
+ if n.bl_idname == 'ShaderNodeTexCoord' and n.outputs['UV'].links:
159
+ uvn = nt.nodes.new('ShaderNodeUVMap'); uvn.uv_map = 'LiveUV'
160
+ uvn.location = (n.location.x, n.location.y - 180)
161
+ for l in list(n.outputs['UV'].links):
162
+ nt.links.new(uvn.outputs['UV'], l.to_socket)
163
+ elif n.bl_idname == 'ShaderNodeUVMap' and n.uv_map in ('', 'UVMap'):
164
+ n.uv_map = 'LiveUV'
165
+ elif n.bl_idname == 'ShaderNodeTexImage' and not n.inputs['Vector'].links:
166
+ uvn = nt.nodes.new('ShaderNodeUVMap'); uvn.uv_map = 'LiveUV'
167
+ nt.links.new(uvn.outputs['UV'], n.inputs['Vector'])
168
+ return mats
169
+
170
+ def ava_unwrap(objects=None, margin=0.004, angle=66):
171
+ """Unwrap every mesh (or the ones named) and pack ALL their UV islands into
172
+ one shared 0-1 square with no overlaps — what one texture set for the
173
+ whole asset needs. Safe for a shader that reads its UVs: the old layout is
174
+ kept as 'LiveUV' and the materials keep reading it, so the look does not
175
+ change. Returns the number of objects unwrapped."""
176
+ obs = _meshes(objects)
177
+ if not obs:
178
+ raise ValueError('ava_unwrap: no mesh objects to unwrap')
179
+ _keep_live_uvs(obs)
180
+ _select_only(obs)
181
+ bpy.ops.object.mode_set(mode='EDIT')
182
+ bpy.ops.mesh.select_all(action='SELECT')
183
+ bpy.ops.uv.smart_project(angle_limit=_math.radians(angle), island_margin=margin)
184
+ bpy.ops.uv.select_all(action='SELECT')
185
+ bpy.ops.uv.pack_islands(margin=margin, rotate=True)
186
+ bpy.ops.object.mode_set(mode='OBJECT')
187
+ print(f'AVA_UNWRAP: {len(obs)} objects packed into one UV square (old layout kept as LiveUV)')
188
+ return len(obs)
189
+
190
+ def _principled(mat):
191
+ out = next((n for n in mat.node_tree.nodes if n.type == 'OUTPUT_MATERIAL' and n.is_active_output), None) \
192
+ or next((n for n in mat.node_tree.nodes if n.type == 'OUTPUT_MATERIAL'), None)
193
+ if not out or not out.inputs['Surface'].links:
194
+ return None, None
195
+ node = out.inputs['Surface'].links[0].from_node
196
+ return (node if node.type == 'BSDF_PRINCIPLED' else None), out
197
+
198
+ def ava_bake(objects=None, size=2048, maps=('base_color', 'roughness', 'metallic', 'normal'), samples=16):
199
+ """Bake the live materials into image textures in ASSET_DIR/textures and
200
+ put a clean, export-ready material on the objects — the step procedural
201
+ shaders need before FBX/glTF, because live nodes do not export.
202
+
203
+ Works per channel the proven way: colour, roughness and metal are baked
204
+ through an emission pass (a plain diffuse bake turns metal black); the
205
+ normal pass keeps bumps and carved detail. The live materials stay in the
206
+ file, so changing the look and calling ava_bake() again re-bakes from them.
207
+ Needs non-overlapping UVs across the objects — ava_unwrap() gives that."""
208
+ import os as _os
209
+ obs = _meshes(objects)
210
+ if not obs:
211
+ raise ValueError('ava_bake: no mesh objects to bake')
212
+ for o in obs:
213
+ if not o.data.uv_layers:
214
+ raise ValueError(f'ava_bake: "{o.name}" has no UVs — call ava_unwrap() first')
215
+ o.data.uv_layers.active = o.data.uv_layers[0] # the bake lands on the first map
216
+ # Re-baking: put the live materials back on first.
217
+ src = o.get('ava_live_materials')
218
+ if src:
219
+ for i, nm in enumerate(src):
220
+ if nm in bpy.data.materials and i < len(o.material_slots):
221
+ o.material_slots[i].material = bpy.data.materials[nm]
222
+
223
+ mats = []
224
+ for o in obs:
225
+ for slot in o.material_slots:
226
+ if slot.material and slot.material not in mats:
227
+ mats.append(slot.material)
228
+ if not mats:
229
+ raise ValueError('ava_bake: the objects have no materials to bake')
230
+ for m in mats:
231
+ m.use_nodes = True
232
+ if _principled(m)[0] is None:
233
+ raise ValueError(f'ava_bake: material "{m.name}" does not end in a Principled BSDF')
234
+
235
+ sc = bpy.context.scene
236
+ prev_engine = sc.render.engine
237
+ sc.render.engine = 'CYCLES' # baking is Cycles-only; it IS available
238
+ sc.cycles.device = 'CPU'
239
+ sc.cycles.samples = samples
240
+ sc.render.bake.margin = 8
241
+ _select_only(obs)
242
+
243
+ asset = _os.path.basename(ASSET_DIR.rstrip('\\/'))
244
+ tex_dir = _os.path.join(ASSET_DIR, 'textures')
245
+ _os.makedirs(tex_dir, exist_ok=True)
246
+ SPEC = {
247
+ 'base_color': ('Base Color', 'BaseColor', False),
248
+ 'roughness': ('Roughness', 'Roughness', True),
249
+ 'metallic': ('Metallic', 'Metallic', True),
250
+ 'normal': (None, 'Normal', True),
251
+ }
252
+ images = {}
253
+ for key in maps:
254
+ if key not in SPEC:
255
+ raise ValueError(f'ava_bake: unknown map "{key}" — use base_color, roughness, metallic, normal')
256
+ socket_name, label, data = SPEC[key]
257
+ img = bpy.data.images.new(f'{asset}_{label}', size, size, alpha=False)
258
+ if data:
259
+ img.colorspace_settings.name = 'Non-Color'
260
+ temp = [] # (material, nodes added, links to restore)
261
+ for m in mats:
262
+ nt = m.node_tree
263
+ bsdf, out = _principled(m)
264
+ tn = nt.nodes.new('ShaderNodeTexImage'); tn.image = img
265
+ nt.nodes.active = tn
266
+ added = [tn]; restore = None
267
+ if socket_name:
268
+ # Route this channel into an emission shader and bake EMIT:
269
+ # exact values, metal included.
270
+ sock = bsdf.inputs[socket_name]
271
+ em = nt.nodes.new('ShaderNodeEmission'); added.append(em)
272
+ if sock.links:
273
+ nt.links.new(sock.links[0].from_socket, em.inputs['Color'])
274
+ else:
275
+ v = sock.default_value
276
+ em.inputs['Color'].default_value = tuple(v) if hasattr(v, '__len__') else (v, v, v, 1.0)
277
+ restore = out.inputs['Surface'].links[0].from_socket
278
+ nt.links.new(em.outputs['Emission'], out.inputs['Surface'])
279
+ temp.append((m, added, restore, out))
280
+ if socket_name:
281
+ bpy.ops.object.bake(type='EMIT')
282
+ else:
283
+ bpy.ops.object.bake(type='NORMAL', normal_space='TANGENT')
284
+ for m, added, restore, out in temp:
285
+ if restore is not None:
286
+ m.node_tree.links.new(restore, out.inputs['Surface'])
287
+ for n in added:
288
+ m.node_tree.nodes.remove(n)
289
+ img.filepath_raw = _os.path.join(tex_dir, f'{asset}_{label}.png')
290
+ img.file_format = 'PNG'
291
+ img.save()
292
+ images[key] = img
293
+
294
+ # The export-ready material: the baked images, nothing live.
295
+ baked = bpy.data.materials.get(f'M_{asset}_Baked') or bpy.data.materials.new(f'M_{asset}_Baked')
296
+ baked.use_nodes = True
297
+ nt = baked.node_tree; nt.nodes.clear()
298
+ bsdf = nt.nodes.new('ShaderNodeBsdfPrincipled'); bsdf.location = (300, 0)
299
+ out = nt.nodes.new('ShaderNodeOutputMaterial'); out.location = (600, 0)
300
+ nt.links.new(bsdf.outputs['BSDF'], out.inputs['Surface'])
301
+ y = 300
302
+ for key, img in images.items():
303
+ tn = nt.nodes.new('ShaderNodeTexImage'); tn.image = img; tn.location = (-300, y); y -= 280
304
+ if key == 'normal':
305
+ nm = nt.nodes.new('ShaderNodeNormalMap'); nm.location = (0, -500)
306
+ nt.links.new(tn.outputs['Color'], nm.inputs['Color'])
307
+ nt.links.new(nm.outputs['Normal'], bsdf.inputs['Normal'])
308
+ else:
309
+ nt.links.new(tn.outputs['Color'], bsdf.inputs[SPEC[key][0]])
310
+ baked['ava_baked'] = True
311
+
312
+ for o in obs:
313
+ live = [s.material.name if s.material else '' for s in o.material_slots]
314
+ for nm in live:
315
+ if nm in bpy.data.materials:
316
+ bpy.data.materials[nm].use_fake_user = True # kept for re-baking
317
+ o['ava_live_materials'] = live
318
+ for slot in o.material_slots:
319
+ slot.material = baked
320
+
321
+ sc.render.engine = prev_engine
322
+ files = [f'textures/{_os.path.basename(i.filepath_raw)}' for i in images.values()]
323
+ print(f'AVA_BAKE: {len(obs)} objects, {len(mats)} live material(s) -> {", ".join(files)} on {baked.name}')
324
+ return files
325
+
326
+ # ── Ava's script ─────────────────────────────────────────────────────────────
327
+ script_path = os.path.join(ASSET_DIR, 'script.py')
328
+ ns = {'__name__': '__main__', '__file__': script_path, 'ASSET_DIR': ASSET_DIR, 'bpy': bpy, 'KIT': KIT,
329
+ 'ava_unwrap': ava_unwrap, 'ava_bake': ava_bake}
330
+ try:
331
+ with open(script_path, encoding='utf-8') as f:
332
+ code = compile(f.read(), 'script.py', 'exec')
333
+ exec(code, ns)
334
+ except BaseException as e: # SystemExit included: the saved model must stay as it was
335
+ result['error'] = ''.join(traceback.format_exception(type(e), e, e.__traceback__)[-12:])
336
+ emit()
337
+ sys.exit(0)
338
+
339
+ # ── Save, export, measure ────────────────────────────────────────────────────
340
+ try:
341
+ if os.path.exists(BLEND): # keep the last 5 versions so a bad run can be undone
342
+ vdir = os.path.join(ASSET_DIR, 'versions')
343
+ os.makedirs(vdir, exist_ok=True)
344
+ shutil.copy2(BLEND, os.path.join(vdir, time.strftime('%Y%m%d-%H%M%S') + '.blend'))
345
+ for old in sorted(os.listdir(vdir))[:-5]:
346
+ os.remove(os.path.join(vdir, old))
347
+ bpy.ops.wm.save_as_mainfile(filepath=BLEND)
348
+ result['files'].append(NAME + '.blend')
349
+
350
+ meshes = [o for o in bpy.context.scene.objects if o.type == 'MESH' and o.visible_get()]
351
+ deps = bpy.context.evaluated_depsgraph_get()
352
+ tris = 0
353
+ lo = [math.inf] * 3; hi = [-math.inf] * 3
354
+ for o in meshes:
355
+ ev = o.evaluated_get(deps)
356
+ m = ev.to_mesh()
357
+ m.calc_loop_triangles()
358
+ tris += len(m.loop_triangles)
359
+ for v in m.vertices:
360
+ w = ev.matrix_world @ v.co
361
+ for i in range(3):
362
+ lo[i] = min(lo[i], w[i]); hi[i] = max(hi[i], w[i])
363
+ ev.to_mesh_clear()
364
+ result['objects'] = len(meshes)
365
+ result['triangles'] = tris
366
+ if meshes:
367
+ result['size_m'] = [round(hi[i] - lo[i], 3) for i in range(3)]
368
+ result['center'] = [(hi[i] + lo[i]) / 2 for i in range(3)]
369
+
370
+ glb = os.path.join(ASSET_DIR, NAME + '.glb')
371
+ bpy.ops.export_scene.gltf(filepath=glb, export_format='GLB', use_selection=False, export_apply=True)
372
+ result['files'].append(NAME + '.glb')
373
+ if JOB.get('fbx'):
374
+ fbx = os.path.join(ASSET_DIR, NAME + '.fbx')
375
+ bpy.ops.export_scene.fbx(filepath=fbx, use_selection=False, apply_scale_options='FBX_SCALE_ALL', path_mode='COPY', embed_textures=True)
376
+ result['files'].append(NAME + '.fbx')
377
+ # Live shaders do not export. Say so whenever the export will reach an
378
+ # engine bare — the gap she lost twenty minutes in on the first model.
379
+ _PROC = ('ShaderNodeTexNoise', 'ShaderNodeTexVoronoi', 'ShaderNodeTexWave', 'ShaderNodeTexMusgrave',
380
+ 'ShaderNodeTexGradient', 'ShaderNodeTexMagic', 'ShaderNodeTexChecker', 'ShaderNodeTexBrick',
381
+ 'ShaderNodeMath', 'ShaderNodeVectorMath', 'ShaderNodeValToRGB', 'ShaderNodeBump', 'ShaderNodeMix')
382
+ _live = sorted({sl.material.name for o in meshes for sl in o.material_slots
383
+ if sl.material and sl.material.use_nodes and not sl.material.get('ava_baked')
384
+ and any(n.bl_idname in _PROC for n in sl.material.node_tree.nodes)})
385
+ if _live:
386
+ result['warnings'].append(
387
+ 'The exported model carries NONE of the live shader detail in ' + ', '.join(_live) +
388
+ ' — game engines and the Library viewer will show it flat. Bake it: ava_unwrap() if the UVs overlap, then ava_bake().')
389
+ _tex = os.path.join(ASSET_DIR, 'textures')
390
+ if os.path.isdir(_tex):
391
+ result['files'] += ['textures/' + f for f in sorted(os.listdir(_tex))]
392
+ except BaseException as e:
393
+ result['error'] = 'The script ran, but saving or exporting failed:\n' + \
394
+ ''.join(traceback.format_exception(type(e), e, e.__traceback__)[-8:])
395
+ emit()
396
+ sys.exit(0)
397
+
398
+ # ── Preview ──────────────────────────────────────────────────────────────────
399
+ # Her own render wins. Otherwise use her camera, or frame the model from a
400
+ # three-quarter view. Temporary camera/lights are added AFTER saving, so they
401
+ # never end up in the model.
402
+ preview = os.path.join(ASSET_DIR, 'preview.png')
403
+ try:
404
+ if os.path.exists(preview) and os.path.getmtime(preview) >= STARTED:
405
+ result['preview'] = 'hers'
406
+ elif meshes:
407
+ scene = bpy.context.scene
408
+ if scene.camera is None:
409
+ from mathutils import Vector
410
+ c = Vector(result['center']); size = max(result['size_m']) or 1.0
411
+ cam_data = bpy.data.cameras.new('AvaPreviewCam'); cam_data.lens = 50
412
+ cam = bpy.data.objects.new('AvaPreviewCam', cam_data)
413
+ scene.collection.objects.link(cam)
414
+ cam.location = c + Vector((1.0, -1.25, 0.8)).normalized() * size * 2.6
415
+ cam.rotation_euler = (c - cam.location).to_track_quat('-Z', 'Y').to_euler()
416
+ cam_data.clip_end = size * 100
417
+ scene.camera = cam
418
+ result['preview_camera'] = 'auto'
419
+ if not any(o.type == 'LIGHT' for o in scene.objects):
420
+ for nm, rot, energy in (('AvaKey', (0.9, 0.2, 0.8), 4.0), ('AvaFill', (1.1, -0.3, -2.4), 1.5)):
421
+ ld = bpy.data.lights.new(nm, 'SUN'); ld.energy = energy
422
+ lo_ = bpy.data.objects.new(nm, ld); lo_.rotation_euler = rot
423
+ scene.collection.objects.link(lo_)
424
+ if scene.world is None:
425
+ scene.world = bpy.data.worlds.new('AvaPreviewWorld')
426
+ r = scene.render
427
+ r.resolution_x = r.resolution_y = 1024; r.resolution_percentage = 100
428
+ r.film_transparent = True
429
+ r.image_settings.file_format = 'PNG'; r.image_settings.color_mode = 'RGBA'
430
+ r.filepath = preview
431
+ bpy.ops.render.render(write_still=True)
432
+ result['preview'] = 'auto'
433
+ if os.path.exists(preview):
434
+ result['files'].append('preview.png')
435
+ except BaseException as e:
436
+ result['warnings'].append('Preview render failed: ' + str(e))
437
+
438
+ result['ok'] = True
439
+ result['seconds'] = round(time.time() - STARTED, 1)
440
+ emit()
441
+ `;
442
+ //# sourceMappingURL=runner-py.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runner-py.js","sourceRoot":"","sources":["../../../src/tools/blender/runner-py.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE/C,kBAAkB;AAClB,MAAM,CAAC,MAAM,iBAAiB,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;;;;;;EAYzC,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgaP,CAAC"}
@@ -0,0 +1,25 @@
1
+ /**
2
+ * The brief file both making rooms share: brief.json in the work's own folder.
3
+ *
4
+ * Blender and GIMP ask different questions, but the rules are one rule: Ava
5
+ * proposes, the person edits and agrees, and nothing is built before that.
6
+ * Only `agree` makes a brief agreed, and the surfaces call it from his button.
7
+ * A change by him puts it back to proposed: a changed brief is a new agreement.
8
+ */
9
+ export interface BriefRecord {
10
+ name: string;
11
+ reasoning: string;
12
+ status: 'proposed' | 'agreed';
13
+ proposedAt: string;
14
+ agreedAt?: string;
15
+ /** Set when the person edited it on the card — Ava sees what he changed. */
16
+ editedByPerson?: boolean;
17
+ }
18
+ export declare function briefStore<B extends BriefRecord>(root: () => string, fieldKeys: () => string[]): {
19
+ path: (slug: string) => string;
20
+ read: (slug: string) => Promise<B | null>;
21
+ write: (slug: string, brief: B) => Promise<void>;
22
+ agree: (slug: string) => Promise<B | null>;
23
+ saveEdits: (slug: string, fields: Record<string, string | undefined>) => Promise<B | null>;
24
+ };
25
+ //# sourceMappingURL=brief-store.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"brief-store.d.ts","sourceRoot":"","sources":["../../src/tools/brief-store.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAKH,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,UAAU,GAAG,QAAQ,CAAC;IAC9B,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,4EAA4E;IAC5E,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED,wBAAgB,UAAU,CAAC,CAAC,SAAS,WAAW,EAAE,IAAI,EAAE,MAAM,MAAM,EAAE,SAAS,EAAE,MAAM,MAAM,EAAE;iBACzE,MAAM;iBAEA,MAAM,KAAG,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC;kBAIzB,MAAM,SAAS,CAAC,KAAG,OAAO,CAAC,IAAI,CAAC;kBAMhC,MAAM,KAAG,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC;sBAUtB,MAAM,UAAU,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,KAAG,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC;EAmBtG"}
@@ -0,0 +1,59 @@
1
+ /**
2
+ * The brief file both making rooms share: brief.json in the work's own folder.
3
+ *
4
+ * Blender and GIMP ask different questions, but the rules are one rule: Ava
5
+ * proposes, the person edits and agrees, and nothing is built before that.
6
+ * Only `agree` makes a brief agreed, and the surfaces call it from his button.
7
+ * A change by him puts it back to proposed: a changed brief is a new agreement.
8
+ */
9
+ import { mkdir, readFile, writeFile } from 'node:fs/promises';
10
+ import { join } from 'node:path';
11
+ export function briefStore(root, fieldKeys) {
12
+ const path = (slug) => join(root(), slug, 'brief.json');
13
+ async function read(slug) {
14
+ try {
15
+ return JSON.parse(await readFile(path(slug), 'utf-8'));
16
+ }
17
+ catch {
18
+ return null;
19
+ }
20
+ }
21
+ async function write(slug, brief) {
22
+ await mkdir(join(root(), slug), { recursive: true });
23
+ await writeFile(path(slug), JSON.stringify(brief, null, 2), 'utf-8');
24
+ }
25
+ /** His button on the card. The ONLY way a brief becomes agreed. */
26
+ async function agree(slug) {
27
+ const brief = await read(slug);
28
+ if (!brief)
29
+ return null;
30
+ brief.status = 'agreed';
31
+ brief.agreedAt = new Date().toISOString();
32
+ await write(slug, brief);
33
+ return brief;
34
+ }
35
+ /** His edits on the card. Saving keeps it agreed only if nothing moved. */
36
+ async function saveEdits(slug, fields) {
37
+ const brief = await read(slug);
38
+ if (!brief)
39
+ return null;
40
+ const record = brief;
41
+ let changed = false;
42
+ for (const k of fieldKeys()) {
43
+ const v = typeof fields[k] === 'string' ? fields[k].trim() : undefined;
44
+ if (v !== undefined && v !== record[k]) {
45
+ record[k] = v;
46
+ changed = true;
47
+ }
48
+ }
49
+ if (changed) {
50
+ brief.editedByPerson = true;
51
+ brief.status = 'proposed';
52
+ delete brief.agreedAt;
53
+ await write(slug, brief);
54
+ }
55
+ return brief;
56
+ }
57
+ return { path, read, write, agree, saveEdits };
58
+ }
59
+ //# sourceMappingURL=brief-store.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"brief-store.js","sourceRoot":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,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AACxF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAG5D,qBAAa,cAAe,YAAW,IAAI;IACzC,IAAI,SAAiB;IACrB,WAAW,SAAqF;IAChG,SAAS,EAAE,aAAa,CAAU;IAClC,oBAAoB,UAAS;IAE7B,IAAI,MAAM,IAAI,cAAc,CAuB3B;IAEK,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,UAAU,CAAC;CAkEjG"}
1
+ {"version":3,"file":"check-posts.d.ts","sourceRoot":"","sources":["../../src/tools/check-posts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;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,IAAI,SAAiB;IACrB,WAAW,SAAqF;IAChG,SAAS,EAAE,aAAa,CAAU;IAClC,oBAAoB,UAAS;IAE7B,IAAI,MAAM,IAAI,cAAc,CAwB3B;IAEK,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,UAAU,CAAC;CAoFjG"}
@@ -31,7 +31,8 @@ export class CheckPostsTool {
31
31
  description: 'Look at the posts that ACTUALLY EXIST, rather than the ones you meant to write. '
32
32
  + 'Call it whenever the answer depends on what was really created: when the operator asks '
33
33
  + 'whether something went out, when he says a post is missing, before telling him a piece '
34
- + 'of work is done, and before planning a day so you know what has already been said. '
34
+ + 'of work is done, and before suggesting anything so you know what has already been said today. '
35
+ + 'Each post shows its every-day marker and the feature it promoted, his Landed mark and your verdict. '
35
36
  + 'If a post you tried to write is not in the list, it was NOT written — say so plainly and '
36
37
  + 'do not explain it away. Being wrong about this is worse than being slow: he is learning '
37
38
  + 'marketing from you, so a confident wrong answer becomes something he believes for months.',
@@ -88,13 +89,30 @@ export class CheckPostsTool {
88
89
  }
89
90
  const text = posts.filter(p => p.kind === 'text');
90
91
  const video = posts.filter(p => p.kind === 'video');
91
- const line = (p) => ` • ${p.platform}${p.title ? ` — ${p.title}` : ''}${p.subject ? ` (about: ${p.subject})` : ''}`
92
- + `${p.status && p.status !== 'draft' ? ` [${p.status}]` : ''}`;
92
+ const line = (p) => {
93
+ const marks = [
94
+ sinceDays > 1 ? (p.localDay || p.createdAt.slice(0, 10)) : null,
95
+ p.daily ? `every day: ${p.daily}` : null,
96
+ p.feature ? `feature: ${p.feature}` : null,
97
+ p.status && p.status !== 'draft' ? p.status : null,
98
+ p.landed === true ? 'he marked it LANDED' : p.landed === false ? 'he marked it DID NOT LAND' : null,
99
+ ].filter(Boolean);
100
+ return ` • ${p.platform}${p.title ? ` — ${p.title}` : ''}${p.subject ? ` (about: ${p.subject})` : ''}`
101
+ + `${marks.length ? ` [${marks.join(' · ')}]` : ''}`
102
+ + `${p.verdict ? `\n your verdict: ${p.verdict}` : ''}`
103
+ + `\n id: ${p.id}`;
104
+ };
93
105
  const parts = [`${posts.length} post${posts.length === 1 ? '' : 's'} exist ${window}:`];
94
106
  if (text.length)
95
107
  parts.push(`\nText (${text.length}):\n${text.map(line).join('\n')}`);
96
108
  if (video.length)
97
109
  parts.push(`\nVideo (${video.length}):\n${video.map(line).join('\n')}`);
110
+ // The two counts the room runs on (8 Nov 2026) — read off the markers the
111
+ // posts carry, never estimated from their titles.
112
+ const dailies = [...new Set(posts.map(p => p.daily).filter((d) => !!d))];
113
+ const features = [...new Set(posts.map(p => p.feature).filter((f) => !!f))];
114
+ parts.push(`\nEvery-day posts in this window: ${dailies.length ? dailies.join(', ') : 'none'}.`
115
+ + ` Features promoted in this window: ${features.length ? features.join(', ') : 'none'}.`);
98
116
  parts.push('\nThis is the whole list. Anything you expected that is not here was not written — '
99
117
  + 'say that plainly rather than accounting for it.');
100
118
  return {
@@ -1 +1 @@
1
- {"version":3,"file":"check-posts.js","sourceRoot":"","sources":["../../src/tools/check-posts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAMH,MAAM,OAAO,cAAc;IACzB,IAAI,GAAG,aAAa,CAAC;IACrB,WAAW,GAAG,iFAAiF,CAAC;IAChG,SAAS,GAAkB,MAAM,CAAC;IAClC,oBAAoB,GAAG,KAAK,CAAC;IAE7B,IAAI,MAAM;QACR,OAAO;YACL,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,WAAW,EACT,kFAAkF;kBAChF,yFAAyF;kBACzF,yFAAyF;kBACzF,qFAAqF;kBACrF,2FAA2F;kBAC3F,0FAA0F;kBAC1F,2FAA2F;YAC/F,UAAU,EAAE;gBACV,IAAI,EAAE,QAAQ;gBACd,UAAU,EAAE;oBACV,UAAU,EAAE;wBACV,IAAI,EAAE,QAAQ;wBACd,WAAW,EACT,oFAAoF;8BAClF,kCAAkC;qBACvC;iBACF;aACF;SACF,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,IAA6B,EAAE,OAA6B;QACxE,MAAM,KAAK,GAAG,OAAO,CAAC,WAAW,EAAE,SAAkC,CAAC;QAEtE,IAAI,CAAC,KAAK,EAAE,CAAC;YACX,OAAO;gBACL,OAAO,EAAE,KAAK;gBACd,MAAM,EAAE,sFAAsF;aAC/F,CAAC;QACJ,CAAC;QACD,uEAAuE;QACvE,oEAAoE;QACpE,2BAA2B;QAC3B,IAAI,OAAO,KAAK,CAAC,IAAI,KAAK,UAAU,EAAE,CAAC;YACrC,OAAO;gBACL,OAAO,EAAE,KAAK;gBACd,MAAM,EACJ,yFAAyF;sBACvF,+DAA+D;aACpE,CAAC;QACJ,CAAC;QAED,MAAM,GAAG,GAAG,IAAI,CAAC,UAAU,CAAC;QA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iD,CACpD,CAAC;QAEF,OAAO;YACL,OAAO,EAAE,IAAI;YACb,MAAM,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC;YACxB,QAAQ,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC,MAAM,EAAE,SAAS,EAAE;SACrF,CAAC;IACJ,CAAC;CACF"}
@@ -0,0 +1,28 @@
1
+ /**
2
+ * When Ava has to stop and talk.
3
+ *
4
+ * The making rooms are powerful because she iterates: build, look, judge, fix.
5
+ * Left alone she grinds: the first barrel took 15 runs, a title logo 12, with
6
+ * nobody asked. She can't know what they think until they say, and they can't
7
+ * steer what they aren't shown.
8
+ *
9
+ * This began as a nudge after six runs (4 Nov 2026), and she carried on past it.
10
+ * His call, 7 Nov: a real stop. After three good runs since they last spoke, the
11
+ * next run is refused until they answer, so this can't be argued with. Saying
12
+ * anything starts the count again. Each person's message is a new turn, and so
13
+ * is an answer to ask_user. "Keep going" gives her a longer stretch.
14
+ */
15
+ import type { ToolExecutionContext } from './types.js';
16
+ /** Good runs since they last spoke before she has to stop and show them. */
17
+ export declare const RUNS_BEFORE_CHECK_IN = 3;
18
+ /** The same, when they've told her to carry on without them. */
19
+ export declare const RUNS_WHEN_TOLD_TO_KEEP_GOING = 10;
20
+ /** Failures in a row before she has to stop and say what's wrong. */
21
+ export declare const FAILS_BEFORE_STOP = 3;
22
+ /** Did they tell her to carry on? Only their words count, not the room's prefix. */
23
+ export declare function toldToKeepGoing(message: string): boolean;
24
+ /** Before a run: why it can't happen yet, or null. */
25
+ export declare function designRunRefusal(context: ToolExecutionContext): string | null;
26
+ /** After a run that really happened. Returns a line for the report, or null. */
27
+ export declare function recordDesignRun(context: ToolExecutionContext, ok: boolean): string | null;
28
+ //# sourceMappingURL=design-checkin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"design-checkin.d.ts","sourceRoot":"","sources":["../../src/tools/design-checkin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAEvD,4EAA4E;AAC5E,eAAO,MAAM,oBAAoB,IAAI,CAAC;AACtC,gEAAgE;AAChE,eAAO,MAAM,4BAA4B,KAAK,CAAC;AAC/C,qEAAqE;AACrE,eAAO,MAAM,iBAAiB,IAAI,CAAC;AAInC,oFAAoF;AACpF,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAGxD;AAqBD,sDAAsD;AACtD,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,oBAAoB,GAAG,MAAM,GAAG,IAAI,CAU7E;AAED,gFAAgF;AAChF,wBAAgB,eAAe,CAAC,OAAO,EAAE,oBAAoB,EAAE,EAAE,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAYzF"}