@scalequality/cli 0.4.35 → 0.4.37
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/dist/connect.build.json +2 -2
- package/dist/connect.cjs +47 -1
- package/package.json +1 -1
package/dist/connect.build.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
2
|
"sdkVersion": "0.3.281",
|
|
3
|
-
"sha256": "
|
|
4
|
-
"sourceCommit": "
|
|
3
|
+
"sha256": "6bb1c8406fc40dc891af4c44be6e0d70aecd82ba4315f4287aecb4ad4cfbe177",
|
|
4
|
+
"sourceCommit": "25187cf2fb824a3ba0b4e0dc3a4124af74eea77d"
|
|
5
5
|
}
|
package/dist/connect.cjs
CHANGED
|
@@ -13943,6 +13943,12 @@ var SdkEventMapper = class {
|
|
|
13943
13943
|
textByMessage = /* @__PURE__ */ new Map();
|
|
13944
13944
|
streamMessageId = null;
|
|
13945
13945
|
thinking = /* @__PURE__ */ new Map();
|
|
13946
|
+
/**
|
|
13947
|
+
* A file tool whose input is still streaming (Erik, 24/10/2026: 40 s of "Editando arquivos" while one file was written):
|
|
13948
|
+
* its path is said as soon as it is complete in the stream, not when the whole file has arrived. Only the start of the
|
|
13949
|
+
* input is kept; the path comes first.
|
|
13950
|
+
*/
|
|
13951
|
+
writing = /* @__PURE__ */ new Map();
|
|
13946
13952
|
model;
|
|
13947
13953
|
/** Gateway refusals already reported in this turn (the SDK can repeat one in the result). */
|
|
13948
13954
|
reported = /* @__PURE__ */ new Set();
|
|
@@ -13989,6 +13995,7 @@ var SdkEventMapper = class {
|
|
|
13989
13995
|
const message = ev.message;
|
|
13990
13996
|
this.streamMessageId = typeof message?.id === "string" ? message.id : null;
|
|
13991
13997
|
this.thinking.clear();
|
|
13998
|
+
this.writing.clear();
|
|
13992
13999
|
this.streamUsage = null;
|
|
13993
14000
|
this.takeStreamUsage(message?.usage);
|
|
13994
14001
|
return;
|
|
@@ -14000,7 +14007,10 @@ var SdkEventMapper = class {
|
|
|
14000
14007
|
case "content_block_start": {
|
|
14001
14008
|
const block = ev.content_block;
|
|
14002
14009
|
const index = Number(ev.index);
|
|
14003
|
-
if (block?.type === "tool_use" && typeof block.name === "string" && block.name)
|
|
14010
|
+
if (block?.type === "tool_use" && typeof block.name === "string" && block.name) {
|
|
14011
|
+
this.cb.emit({ type: "activity", data: { tool: block.name } });
|
|
14012
|
+
if (FILE_TOOLS.has(block.name)) this.writing.set(index, { name: block.name, json: "" });
|
|
14013
|
+
}
|
|
14004
14014
|
if (block?.type === "thinking" && this.streamMessageId) {
|
|
14005
14015
|
const id = `think-${this.streamMessageId}-${index}`;
|
|
14006
14016
|
const startedAt = this.now();
|
|
@@ -14014,10 +14024,12 @@ var SdkEventMapper = class {
|
|
|
14014
14024
|
if (delta?.type === "text_delta" && typeof delta.text === "string" && delta.text && this.streamMessageId) {
|
|
14015
14025
|
this.cb.emit({ type: "text", data: { messageId: this.streamMessageId, delta: delta.text } });
|
|
14016
14026
|
}
|
|
14027
|
+
if (delta?.type === "input_json_delta" && typeof delta.partial_json === "string") this.onToolInput(Number(ev.index), delta.partial_json);
|
|
14017
14028
|
return;
|
|
14018
14029
|
}
|
|
14019
14030
|
case "content_block_stop": {
|
|
14020
14031
|
const index = Number(ev.index);
|
|
14032
|
+
this.writing.delete(index);
|
|
14021
14033
|
const t = this.thinking.get(index);
|
|
14022
14034
|
if (t) {
|
|
14023
14035
|
this.thinking.delete(index);
|
|
@@ -14029,6 +14041,24 @@ var SdkEventMapper = class {
|
|
|
14029
14041
|
return;
|
|
14030
14042
|
}
|
|
14031
14043
|
}
|
|
14044
|
+
/** The streamed input of a file tool: once its path is complete, the live line names the file (once per call). */
|
|
14045
|
+
onToolInput(index, chunk) {
|
|
14046
|
+
const w = this.writing.get(index);
|
|
14047
|
+
if (!w) return;
|
|
14048
|
+
w.json += chunk;
|
|
14049
|
+
const found = /"(file_path|notebook_path)"\s*:\s*"((?:[^"\\]|\\.)*)"/.exec(w.json);
|
|
14050
|
+
if (!found && w.json.length < 4096) return;
|
|
14051
|
+
this.writing.delete(index);
|
|
14052
|
+
if (!found) return;
|
|
14053
|
+
let path;
|
|
14054
|
+
try {
|
|
14055
|
+
path = JSON.parse(`"${found[2]}"`);
|
|
14056
|
+
} catch {
|
|
14057
|
+
return;
|
|
14058
|
+
}
|
|
14059
|
+
const target = typeof path === "string" ? activityTarget(w.name, { [found[1]]: path }) : void 0;
|
|
14060
|
+
if (target) this.cb.emit({ type: "activity", data: { tool: w.name, target } });
|
|
14061
|
+
}
|
|
14032
14062
|
/** A subagent's frame: its tool calls update the card of the Agent call that runs it. */
|
|
14033
14063
|
onSubagent(parentId, m) {
|
|
14034
14064
|
const t = this.open.get(parentId);
|
|
@@ -14354,6 +14384,7 @@ function taskItems(todos) {
|
|
|
14354
14384
|
}
|
|
14355
14385
|
return items;
|
|
14356
14386
|
}
|
|
14387
|
+
var FILE_TOOLS = /* @__PURE__ */ new Set(["Write", "Edit", "MultiEdit", "NotebookEdit"]);
|
|
14357
14388
|
function activityTarget(name, input) {
|
|
14358
14389
|
const s = (k) => typeof input[k] === "string" ? input[k] : "";
|
|
14359
14390
|
if (name === "Edit" || name === "MultiEdit" || name === "Write" || name === "Read") {
|
|
@@ -14720,6 +14751,21 @@ function buildSystemAppend(c) {
|
|
|
14720
14751
|
"- Answer in the language the user writes in.",
|
|
14721
14752
|
"- Refer to the scope, teams, business areas, projects and repositories by their names, as the user sees them in ScaleQuality. Never show internal identifiers (ids, UUIDs) or internal kind names such as TEAM, PROJECTS or BUSINESS_AREA; tool results carry them for you, not for the user.",
|
|
14722
14753
|
"",
|
|
14754
|
+
"## While you work",
|
|
14755
|
+
// Erik, 25/10/2026, a prototype asked in staging: 1 min 45 s of commands and edits before the first word, then "Agora
|
|
14756
|
+
// vou corrigir..." with no hello. "fala alguma coisa ... tipo ok vou fazer pra vc ... tem que ter a conversa com o user
|
|
14757
|
+
// ... acatou a ordem direto de forma fria", as Claude Code and Cursor do.
|
|
14758
|
+
'- Answer first, then work: a turn that asks for work starts with one or two sentences to the user, in their language, before any tool call: take the request as a colleague would in a chat and say how you will go about it, for example "Bora! Vou montar a home do app de bebidas: ofertas no topo, as categorias e os mais vendidos, primeiro no celular." When the request leaves the direction open, that message also says the choices you are taking (who it is for, the style, what comes first) so the user can redirect you, or you ask first as Designs and prototypes says. Never open a turn with a tool call and no word to the user.',
|
|
14759
|
+
// Erik, 24/10/2026: a prototype took 79 s with 40 s of them writing one file and not a word on screen; "conversa mais
|
|
14760
|
+
// comigo ... pra ele não sentir a demora". Silence reads as slow, whatever the model.
|
|
14761
|
+
"- The user is watching while you work, and silence feels slow even when the work is fast. Talk to them as you go, like a colleague pairing in a chat: before a step that takes a while, one short sentence in the user's language saying what you are doing now; when something you found changes the plan, one sentence saying so.",
|
|
14762
|
+
'- Before writing a long file (a screen, a prototype, a large module), say in one sentence what goes in it, for example "Agora a tela principal: o resumo do estoque, a busca e a tabela de produtos".',
|
|
14763
|
+
// Measured that day: three single writes of 80, 39 and 73 s made most of a 4 min 23 s prototype, with the first token
|
|
14764
|
+
// of every call in about 2 s. The time was the size of one write, so the work grows in steps the user can watch.
|
|
14765
|
+
"- Build in small steps the user can watch: a screen, a page or a module starts as a short version that already works (show it at once when it can be shown), then grows one part at a time, each part its own edit with its sentence. Never write more than about 150 lines in one call; a longer file is written first in that size and completed with edits.",
|
|
14766
|
+
"- Each of these sentences goes in the same message as the tool call that starts the step, never in a turn of its own. One line each, no lists; never narrate a quick read or repeat what the screen already shows.",
|
|
14767
|
+
"- They do not replace the final answer: when the work is done, answer as How to answer says.",
|
|
14768
|
+
"",
|
|
14723
14769
|
"## How to answer",
|
|
14724
14770
|
"- Lead with the outcome in one or two sentences: what changed, what was found, or what you need from the user.",
|
|
14725
14771
|
"- The screen already shows every command you ran and every file you edited, with their output and diff. Do not list them again, and do not restate test counts or tool results the user can open; mention one only when it matters for what comes next (a test that still fails, a risk that remains).",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scalequality/cli",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.37",
|
|
4
4
|
"description": "ScaleQuality CLI. Connect your computer to the ScaleQuality AI Workspace (`scalequality login`), run its coding engine in any folder of your computer, and import your Claude Code and Codex conversations.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|