terminal-smart-cli 0.97.13 → 0.97.15
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.
- package/bin/ts.js +33 -1
- package/lib/agent.js +602 -32
- package/lib/audit-packs.js +56 -0
- package/lib/evolution-telemetry.js +45 -0
- package/lib/i18n.js +2 -0
- package/lib/image-job.js +31 -0
- package/lib/intelligence-core.js +1 -1
- package/lib/office-editors.js +88 -14
- package/lib/office-readers.js +14 -1
- package/lib/recovery.js +9 -1
- package/lib/tools.js +52 -4
- package/lib/xlsx-compat-editor.js +78 -2
- package/package.json +2 -2
package/bin/ts.js
CHANGED
|
@@ -125,6 +125,26 @@ function privacyCmd() {
|
|
|
125
125
|
}
|
|
126
126
|
|
|
127
127
|
// ── Login por código (device-code) ───────────────────────────────────────────
|
|
128
|
+
function diagnosticsCmd(args) {
|
|
129
|
+
const action = String((args && args[0]) || 'status').toLowerCase();
|
|
130
|
+
const en = (cfg.lang || 'pt') === 'en';
|
|
131
|
+
if (['on', 'ativar', 'ligar'].includes(action)) {
|
|
132
|
+
cfg = config.save({ diagnosticsEnabled: true });
|
|
133
|
+
console.log(ui.okLine(en ? 'Sanitized reliability diagnostics enabled.' : 'Diagnosticos sanitizados de confiabilidade ativados.'));
|
|
134
|
+
return;
|
|
135
|
+
}
|
|
136
|
+
if (['off', 'desativar', 'desligar'].includes(action)) {
|
|
137
|
+
cfg = config.save({ diagnosticsEnabled: false });
|
|
138
|
+
console.log(ui.okLine(en ? 'Sanitized reliability diagnostics disabled.' : 'Diagnosticos sanitizados de confiabilidade desativados.'));
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
const active = require('../lib/evolution-telemetry').enabled(cfg);
|
|
142
|
+
console.log(ui.infoLine(en
|
|
143
|
+
? `Reliability diagnostics: ${active ? 'enabled' : 'disabled'}. Sends only sanitized error signatures, tool, stage, version and recovery status; never prompts, file contents, e-mails, paths, tokens or secrets.`
|
|
144
|
+
: `Diagnosticos de confiabilidade: ${active ? 'ativados' : 'desativados'}. Enviam somente assinatura sanitizada do erro, ferramenta, etapa, versao e recuperacao; nunca prompts, conteudo de arquivos, e-mails, caminhos, tokens ou segredos.`));
|
|
145
|
+
console.log(C.dim(en ? ' Use: ts diagnostics on|off' : ' Use: ts diagnosticos ativar|desativar'));
|
|
146
|
+
}
|
|
147
|
+
|
|
128
148
|
async function accountCmd(args) {
|
|
129
149
|
const action = String((args && args[0]) || '').toLowerCase();
|
|
130
150
|
const accountUrl = base() + '/minha-conta';
|
|
@@ -269,6 +289,17 @@ async function imageCmd(args) {
|
|
|
269
289
|
confirmed: true,
|
|
270
290
|
},
|
|
271
291
|
});
|
|
292
|
+
if (result && result.jobId && (result.async || result.status === 'processing')) {
|
|
293
|
+
const { waitForImageJob } = require('../lib/image-job');
|
|
294
|
+
result = await waitForImageJob(result.jobId, {
|
|
295
|
+
request: route => api(route, { token, timeoutMs: 30000, retry: true }),
|
|
296
|
+
onProgress: ({ attempt }) => {
|
|
297
|
+
if (attempt === 5 && sp && typeof sp.text === 'function') sp.text(en
|
|
298
|
+
? 'generating Premium image — this may take a few minutes…'
|
|
299
|
+
: 'gerando imagem Premium — isso pode levar alguns minutos…');
|
|
300
|
+
},
|
|
301
|
+
});
|
|
302
|
+
}
|
|
272
303
|
} finally { sp.stop(); }
|
|
273
304
|
if (!result || !result.url) throw new Error(en ? 'Image provider returned no image.' : 'O provedor não retornou uma imagem.');
|
|
274
305
|
const fs = require('fs'), os = require('os'), path = require('path');
|
|
@@ -1335,7 +1366,7 @@ async function agentCmd(words, { askFn, cwd: cwdIn = null, onCwd = null, maxIter
|
|
|
1335
1366
|
const _maxDurationMs = 1000 * (_ti >= 0 ? Number(process.argv[_ti + 1]) : (_inlineMaxSeconds || 0));
|
|
1336
1367
|
const _maxTokens = _tki >= 0 ? Number(process.argv[_tki + 1]) : _inlineMaxTokens;
|
|
1337
1368
|
out = await agent.run(task, {
|
|
1338
|
-
token, lang: cfg.lang || 'pt', yes: YES, autoAll: (YOLO || _inlineYolo || autoAllIn), model, priorMessages, cwd: startCwd, readOnly, plan, browser: useBrowser, allowedTools, maxIter: _maxPassos,
|
|
1369
|
+
token, lang: cfg.lang || 'pt', yes: YES, autoAll: (YOLO || _inlineYolo || autoAllIn), model, priorMessages, cwd: startCwd, readOnly, plan, accountPlan: cfg.plan || 'free', browser: useBrowser, allowedTools, maxIter: _maxPassos,
|
|
1339
1370
|
maxCredits: _maxCredits, maxDurationMs: _maxDurationMs || undefined, maxTokens: _maxTokens,
|
|
1340
1371
|
onThinking: (p) => {
|
|
1341
1372
|
if (p && typeof p === 'object') {
|
|
@@ -3178,6 +3209,7 @@ function recallCmd(args) {
|
|
|
3178
3209
|
case 'doctor': case 'diagnostico-ambiente': case 'checkup': return doctorCmd();
|
|
3179
3210
|
case 'privacidade': case 'privacy': return privacyCmd();
|
|
3180
3211
|
case 'conta': case 'account': return accountCmd(POS.slice(1));
|
|
3212
|
+
case 'diagnosticos': case 'diagnostics': return diagnosticsCmd(POS.slice(1));
|
|
3181
3213
|
case 'integracoes': case 'integrações': case 'integrations': return integracoesCmd(POS.slice(1));
|
|
3182
3214
|
case 'meta': case 'missao': case 'mission': return metaCmd();
|
|
3183
3215
|
case 'runs': return runsCmd();
|