clementine-agent 1.18.56 → 1.18.57

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.
@@ -25906,10 +25906,10 @@ function renderBuilderPreview(artifact, type) {
25906
25906
  + '<option value="2"' + (artifact.tier === 2 ? ' selected' : '') + '>2 — Read+Write</option>'
25907
25907
  + '<option value="3"' + (artifact.tier === 3 ? ' selected' : '') + '>3 — Full</option>'
25908
25908
  + '</select></div>'
25909
- + '<div class="preview-field"><label>Mode</label><select onchange="builderArtifact.mode=this.value">'
25910
- + '<option value="standard"' + (artifact.mode !== 'unleashed' ? ' selected' : '') + '>Standard</option>'
25911
- + '<option value="unleashed"' + (artifact.mode === 'unleashed' ? ' selected' : '') + '>Unleashed</option>'
25912
- + '</select></div>'
25909
+ + '<div class="preview-field"><label>Linked Tools</label>'
25910
+ + '<div id="builder-tools-panel" style="max-height:180px;overflow-y:auto;border:1px solid var(--border);border-radius:6px;padding:6px 8px;background:var(--bg-primary);margin-bottom:4px"></div>'
25911
+ + '<div style="font-size:10px;color:var(--text-muted)">Pick tools the cron should use. The chat sees these as a hint, and they steer how the prompt is written.</div>'
25912
+ + '</div>'
25913
25913
  + '<div class="preview-field"><label>Prompt</label><textarea rows="12" onchange="builderArtifact.prompt=this.value">' + esc(artifact.prompt || '') + '</textarea></div>'
25914
25914
  + '<div class="preview-field"><label>Reference Files</label>'
25915
25915
  + '<div id="builder-attachments-list"></div>'
@@ -25919,6 +25919,7 @@ function renderBuilderPreview(artifact, type) {
25919
25919
  + '</label>'
25920
25920
  + '<div style="font-size:10px;color:var(--text-muted);margin-top:4px">Files injected into the agent prompt at runtime</div>'
25921
25921
  + '</div>';
25922
+ setTimeout(function() { loadBuilderToolOptions(artifact.toolsUsed || _builderLinkedTools); }, 50);
25922
25923
  } else if (type === 'agent') {
25923
25924
  html = '<div class="preview-field"><label>Name</label><input type="text" value="' + esc(artifact.name || '') + '" onchange="builderArtifact.name=this.value"></div>'
25924
25925
  + '<div class="preview-field"><label>Description / Role</label><input type="text" value="' + esc(artifact.description || '') + '" onchange="builderArtifact.description=this.value"></div>'
@@ -25929,13 +25930,22 @@ function renderBuilderPreview(artifact, type) {
25929
25930
  + '<option value="opus"' + (artifact.model === 'opus' ? ' selected' : '') + '>Opus</option>'
25930
25931
  + '</select></div>'
25931
25932
  + '<div class="preview-field"><label>Personality / System Prompt</label><textarea rows="8" onchange="builderArtifact.personality=this.value">' + esc(artifact.personality || '') + '</textarea></div>'
25932
- + '<div class="preview-field"><label>Tools (comma-separated)</label><input type="text" value="' + esc((artifact.tools || []).join(', ')) + '" onchange="builderArtifact.tools=this.value.split(\\x27,\\x27).map(function(t){return t.trim()}).filter(Boolean)"></div>'
25933
+ + '<div class="preview-field"><label>Allowed Tools</label>'
25934
+ + '<div id="builder-tools-panel" style="max-height:180px;overflow-y:auto;border:1px solid var(--border);border-radius:6px;padding:6px 8px;background:var(--bg-primary);margin-bottom:4px"></div>'
25935
+ + '<div style="font-size:10px;color:var(--text-muted)">These become the agent\\x27s allowedTools — they\\x27re honored at the main-agent level when this agent runs as a profile.</div>'
25936
+ + '</div>'
25933
25937
  + '<div class="preview-field"><label>Channel</label><input type="text" value="' + esc(artifact.channel || '') + '" onchange="builderArtifact.channel=this.value" placeholder="e.g. discord, slack"></div>';
25938
+ setTimeout(function() { loadBuilderToolOptions(artifact.tools || _builderLinkedTools); }, 50);
25934
25939
  } else if (type === 'workflow') {
25935
25940
  html = '<div class="preview-field"><label>Workflow Name</label><input type="text" value="' + esc(artifact.name || '') + '" onchange="builderArtifact.name=this.value"></div>'
25936
25941
  + '<div class="preview-field"><label>Description</label><input type="text" value="' + esc(artifact.description || '') + '" onchange="builderArtifact.description=this.value"></div>'
25937
25942
  + '<div class="preview-field"><label>Trigger Schedule (cron, optional)</label><input type="text" value="' + esc(artifact.schedule || '') + '" onchange="builderArtifact.schedule=this.value" placeholder="e.g. 0 9 * * 1 (Mondays at 9am)"></div>'
25943
+ + '<div class="preview-field"><label>Linked Tools</label>'
25944
+ + '<div id="builder-tools-panel" style="max-height:180px;overflow-y:auto;border:1px solid var(--border);border-radius:6px;padding:6px 8px;background:var(--bg-primary);margin-bottom:4px"></div>'
25945
+ + '<div style="font-size:10px;color:var(--text-muted)">Tools the trick will use. The chat sees these as a hint and weaves them into the steps.</div>'
25946
+ + '</div>'
25938
25947
  + '<div class="preview-field"><label>Steps (YAML/Markdown)</label><textarea rows="14" onchange="builderArtifact.steps=this.value">' + esc(artifact.steps || '') + '</textarea></div>';
25948
+ setTimeout(function() { loadBuilderToolOptions(artifact.toolsUsed || _builderLinkedTools); }, 50);
25939
25949
  }
25940
25950
  preview.innerHTML = html;
25941
25951
  // Load existing attachments if editing
@@ -25993,8 +26003,13 @@ async function saveBuilderArtifact() {
25993
26003
  var type = document.getElementById('builder-type').value;
25994
26004
  try {
25995
26005
  var agentSlug = (document.getElementById('builder-agent') || {}).value || '';
25996
- // Sync linked tools into artifact before saving
25997
- if (type === 'skill') builderArtifact.toolsUsed = _builderLinkedTools;
26006
+ // Sync linked tools into artifact before saving — picker is shared
26007
+ // across types but the persisted field name differs.
26008
+ if (type === 'agent') {
26009
+ builderArtifact.tools = _builderLinkedTools;
26010
+ } else {
26011
+ builderArtifact.toolsUsed = _builderLinkedTools;
26012
+ }
25998
26013
  var r = await apiJson('POST', '/api/builder/save', {
25999
26014
  artifactType: type,
26000
26015
  artifact: builderArtifact,
@@ -26081,8 +26096,18 @@ async function loadBuilderToolOptions(selectedTools) {
26081
26096
 
26082
26097
  function syncBuilderLinkedTools() {
26083
26098
  _builderLinkedTools = Array.from(document.querySelectorAll('.builder-tool-cb:checked')).map(function(cb) { return cb.value; });
26084
- // Also sync into the artifact so it saves with toolsUsed
26085
- if (builderArtifact) builderArtifact.toolsUsed = _builderLinkedTools;
26099
+ if (!builderArtifact) return;
26100
+ // Field name differs per artifact type: agent stores into "tools"
26101
+ // (which becomes profile.team.allowedTools on save). Skill, cron and
26102
+ // workflow store into "toolsUsed" — carried for reference, since the
26103
+ // runtime LINKED TOOLS context block is rebuilt from picker state
26104
+ // each turn.
26105
+ var type = (document.getElementById('builder-type') || {}).value;
26106
+ if (type === 'agent') {
26107
+ builderArtifact.tools = _builderLinkedTools;
26108
+ } else {
26109
+ builderArtifact.toolsUsed = _builderLinkedTools;
26110
+ }
26086
26111
  }
26087
26112
 
26088
26113
  // ── Builder File Attachments ──────────────
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clementine-agent",
3
- "version": "1.18.56",
3
+ "version": "1.18.57",
4
4
  "description": "Clementine — Personal AI Assistant (TypeScript)",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",