@theokit/sdk-tools 0.22.1 → 0.23.0
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/index.cjs +4 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +18 -0
- package/dist/index.d.ts +18 -0
- package/dist/index.js +4 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -217,6 +217,14 @@ interface CreateGitStatusToolOptions {
|
|
|
217
217
|
name?: string;
|
|
218
218
|
/** M76 — descrição exposta ao modelo. Omitida ⇒ o literal abaixo (aditivo). */
|
|
219
219
|
description?: string;
|
|
220
|
+
/**
|
|
221
|
+
* Incluir a linha de branch (`-b`) no início da saída. Default `true`.
|
|
222
|
+
*
|
|
223
|
+
* Sem ela o agente vê o que mudou mas não ONDE — e "estou na branch certa?" é a pergunta que
|
|
224
|
+
* precede qualquer commit. O consumidor (agent-builder) já dependia disso; omiti-la faria a
|
|
225
|
+
* migração perder comportamento em silêncio, que é o que a deleção de código local não pode custar.
|
|
226
|
+
*/
|
|
227
|
+
includeBranch?: boolean;
|
|
220
228
|
}
|
|
221
229
|
declare function createGitStatusTool(opts: CreateGitStatusToolOptions): CustomTool;
|
|
222
230
|
|
|
@@ -681,6 +689,16 @@ interface QuestionToolOptions {
|
|
|
681
689
|
askUser?: (question: string) => Promise<string>;
|
|
682
690
|
/** Maximum time to wait for user response in ms. Default: 300_000 (5 min). */
|
|
683
691
|
timeoutMs?: number;
|
|
692
|
+
/**
|
|
693
|
+
* M76 — nome exposto ao modelo. Omitido ⇒ `"question"` (aditivo).
|
|
694
|
+
*
|
|
695
|
+
* O consumidor precisava disto: o Codex chama a tool de `request_user_input`, e sem a opção ele
|
|
696
|
+
* era obrigado a reconstruir o objeto inteiro à mão — o adaptador com dois casts que a T3.3
|
|
697
|
+
* eliminou.
|
|
698
|
+
*/
|
|
699
|
+
name?: string;
|
|
700
|
+
/** M76 — descrição exposta ao modelo. Omitida ⇒ o literal de hoje (aditivo). */
|
|
701
|
+
description?: string;
|
|
684
702
|
}
|
|
685
703
|
/**
|
|
686
704
|
* M76 — alinhado ao `CustomTool` do SDK. Era uma interface própria com `inputSchema: unknown`, o que
|
package/dist/index.d.ts
CHANGED
|
@@ -217,6 +217,14 @@ interface CreateGitStatusToolOptions {
|
|
|
217
217
|
name?: string;
|
|
218
218
|
/** M76 — descrição exposta ao modelo. Omitida ⇒ o literal abaixo (aditivo). */
|
|
219
219
|
description?: string;
|
|
220
|
+
/**
|
|
221
|
+
* Incluir a linha de branch (`-b`) no início da saída. Default `true`.
|
|
222
|
+
*
|
|
223
|
+
* Sem ela o agente vê o que mudou mas não ONDE — e "estou na branch certa?" é a pergunta que
|
|
224
|
+
* precede qualquer commit. O consumidor (agent-builder) já dependia disso; omiti-la faria a
|
|
225
|
+
* migração perder comportamento em silêncio, que é o que a deleção de código local não pode custar.
|
|
226
|
+
*/
|
|
227
|
+
includeBranch?: boolean;
|
|
220
228
|
}
|
|
221
229
|
declare function createGitStatusTool(opts: CreateGitStatusToolOptions): CustomTool;
|
|
222
230
|
|
|
@@ -681,6 +689,16 @@ interface QuestionToolOptions {
|
|
|
681
689
|
askUser?: (question: string) => Promise<string>;
|
|
682
690
|
/** Maximum time to wait for user response in ms. Default: 300_000 (5 min). */
|
|
683
691
|
timeoutMs?: number;
|
|
692
|
+
/**
|
|
693
|
+
* M76 — nome exposto ao modelo. Omitido ⇒ `"question"` (aditivo).
|
|
694
|
+
*
|
|
695
|
+
* O consumidor precisava disto: o Codex chama a tool de `request_user_input`, e sem a opção ele
|
|
696
|
+
* era obrigado a reconstruir o objeto inteiro à mão — o adaptador com dois casts que a T3.3
|
|
697
|
+
* eliminou.
|
|
698
|
+
*/
|
|
699
|
+
name?: string;
|
|
700
|
+
/** M76 — descrição exposta ao modelo. Omitida ⇒ o literal de hoje (aditivo). */
|
|
701
|
+
description?: string;
|
|
684
702
|
}
|
|
685
703
|
/**
|
|
686
704
|
* M76 — alinhado ao `CustomTool` do SDK. Era uma interface própria com `inputSchema: unknown`, o que
|
package/dist/index.js
CHANGED
|
@@ -863,7 +863,8 @@ function createGitStatusTool(opts) {
|
|
|
863
863
|
}
|
|
864
864
|
const scopeCheck = checkPathScope(path, projectRoot);
|
|
865
865
|
if (scopeCheck !== null) return scopeCheck;
|
|
866
|
-
const args = ["status", "--porcelain"];
|
|
866
|
+
const args = ["status", "--porcelain=v1"];
|
|
867
|
+
if (opts.includeBranch !== false) args.push("-b");
|
|
867
868
|
if (path !== void 0 && path !== "") args.push("--", path);
|
|
868
869
|
const result = await runGitProcess(projectRoot, args, timeoutMs, maxStdoutBytes);
|
|
869
870
|
return formatGitResult(result, timeoutMs);
|
|
@@ -1737,8 +1738,8 @@ function askerDoContexto(context) {
|
|
|
1737
1738
|
function createQuestionTool(opts) {
|
|
1738
1739
|
const timeoutMs = opts.timeoutMs ?? 3e5;
|
|
1739
1740
|
return {
|
|
1740
|
-
name: "question",
|
|
1741
|
-
description: "Ask the user a question and wait for their response. Use when you need clarification or confirmation before proceeding. Returns { ok, answer } or { ok: false, error: 'timeout' }.",
|
|
1741
|
+
name: opts.name ?? "question",
|
|
1742
|
+
description: opts.description ?? "Ask the user a question and wait for their response. Use when you need clarification or confirmation before proceeding. Returns { ok, answer } or { ok: false, error: 'timeout' }.",
|
|
1742
1743
|
inputSchema: {
|
|
1743
1744
|
type: "object",
|
|
1744
1745
|
properties: {
|