@kenkaiiii/ggcoder 5.50.0 → 5.51.1
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/app-sidecar.js +65 -2
- package/dist/app-sidecar.js.map +1 -1
- package/dist/core/ask-user.d.ts +57 -0
- package/dist/core/ask-user.d.ts.map +1 -0
- package/dist/core/ask-user.js +36 -0
- package/dist/core/ask-user.js.map +1 -0
- package/dist/core/mcp/elicitation-bridge.d.ts.map +1 -1
- package/dist/core/mcp/elicitation-bridge.js +12 -28
- package/dist/core/mcp/elicitation-bridge.js.map +1 -1
- package/dist/core/parked-requests.d.ts +40 -0
- package/dist/core/parked-requests.d.ts.map +1 -0
- package/dist/core/parked-requests.js +34 -0
- package/dist/core/parked-requests.js.map +1 -0
- package/dist/core/prompt-commands.d.ts.map +1 -1
- package/dist/core/prompt-commands.js +13 -12
- package/dist/core/prompt-commands.js.map +1 -1
- package/dist/system-prompt.d.ts.map +1 -1
- package/dist/system-prompt.js +12 -3
- package/dist/system-prompt.js.map +1 -1
- package/dist/tools/ask-user.d.ts +35 -0
- package/dist/tools/ask-user.d.ts.map +1 -0
- package/dist/tools/ask-user.js +157 -0
- package/dist/tools/ask-user.js.map +1 -0
- package/dist/tools/prompt-hints.d.ts.map +1 -1
- package/dist/tools/prompt-hints.js +4 -0
- package/dist/tools/prompt-hints.js.map +1 -1
- package/dist/tools/tool-tiers.d.ts.map +1 -1
- package/dist/tools/tool-tiers.js +4 -0
- package/dist/tools/tool-tiers.js.map +1 -1
- package/package.json +4 -4
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { ASK_USER_TIMEOUT_MS, formatAskResult, } from "../core/ask-user.js";
|
|
3
|
+
/** Beyond this the band stops being a question and becomes a form. */
|
|
4
|
+
const MAX_QUESTIONS = 5;
|
|
5
|
+
const MAX_OPTIONS = 6;
|
|
6
|
+
const Option = z.object({
|
|
7
|
+
label: z
|
|
8
|
+
.string()
|
|
9
|
+
.min(1)
|
|
10
|
+
.describe("A COMPLETE decision you can act on immediately, in plain words — what the user GETS, " +
|
|
11
|
+
"not the technical thing you do. Clicking sends this option and NOTHING else, so it " +
|
|
12
|
+
"must never ask the user to specify, describe, choose or clarify anything further: " +
|
|
13
|
+
"there is no text box behind a button. Bad: 'Fix something specific', 'Tell me more', " +
|
|
14
|
+
"'Something else', 'Other'. Good: 'Fix the failing upload test', 'Roll back the last " +
|
|
15
|
+
"deploy'. Under ~24 chars renders as a chip. Never a bare file path or jargon term."),
|
|
16
|
+
value: z.string().optional().describe("What you receive if picked. Defaults to the label."),
|
|
17
|
+
hint: z
|
|
18
|
+
.string()
|
|
19
|
+
.optional()
|
|
20
|
+
.describe("One short line under the label saying what this choice costs or trades off, in " +
|
|
21
|
+
"everyday language. Use it whenever the difference is not obvious from the label."),
|
|
22
|
+
recommended: z
|
|
23
|
+
.boolean()
|
|
24
|
+
.optional()
|
|
25
|
+
.describe("Marks your recommendation. Tagged in the UI, never preselected. Max one per question."),
|
|
26
|
+
});
|
|
27
|
+
const Question = z.object({
|
|
28
|
+
id: z.string().min(1).describe("Stable key your answer comes back under, e.g. `store`."),
|
|
29
|
+
question: z
|
|
30
|
+
.string()
|
|
31
|
+
.min(1)
|
|
32
|
+
.describe("The question in one plain line a non-technical person can answer without opening the " +
|
|
33
|
+
"code. Ask about the outcome they want, not the implementation. Define any term you " +
|
|
34
|
+
"cannot avoid. It must be answerable by a single click — never an open-ended prompt " +
|
|
35
|
+
"like 'What would you like me to do?', which a button cannot answer."),
|
|
36
|
+
kind: z
|
|
37
|
+
.enum(["confirm", "choice", "multi", "text"])
|
|
38
|
+
.describe("confirm = yes/no · choice = pick one of `options` · multi = pick any of `options` · text = free text only."),
|
|
39
|
+
detail: z
|
|
40
|
+
.string()
|
|
41
|
+
.optional()
|
|
42
|
+
.describe("One optional line of context under the question — the background they need to choose, " +
|
|
43
|
+
"in the same plain language."),
|
|
44
|
+
options: z.array(Option).max(MAX_OPTIONS).optional().describe("Required for choice/multi."),
|
|
45
|
+
allowOther: z
|
|
46
|
+
.boolean()
|
|
47
|
+
.optional()
|
|
48
|
+
.describe("Offer the free-text escape alongside the options. Default true."),
|
|
49
|
+
});
|
|
50
|
+
const AskUserParams = z.object({
|
|
51
|
+
questions: z
|
|
52
|
+
.array(Question)
|
|
53
|
+
.min(1)
|
|
54
|
+
.max(MAX_QUESTIONS)
|
|
55
|
+
.describe("One question, or the few that block you. Never pad the list."),
|
|
56
|
+
});
|
|
57
|
+
/** Yes/No is implied by `confirm`, so the model never has to spell it out. */
|
|
58
|
+
const CONFIRM_OPTIONS = [
|
|
59
|
+
{ label: "Yes", value: "yes" },
|
|
60
|
+
{ label: "No", value: "no" },
|
|
61
|
+
];
|
|
62
|
+
/**
|
|
63
|
+
* Options that hand the decision straight back to the user.
|
|
64
|
+
*
|
|
65
|
+
* A click carries no payload beyond the option itself, so "Fix something
|
|
66
|
+
* specific" reaches the agent as literally that — an instruction it cannot
|
|
67
|
+
* act on. Catching it here turns a dead-end question into a tool error the
|
|
68
|
+
* model can immediately correct, instead of a button that wastes a turn.
|
|
69
|
+
*/
|
|
70
|
+
const DEFERRING = [
|
|
71
|
+
/\bsomething specific\b/i,
|
|
72
|
+
/\bsomething else\b/i,
|
|
73
|
+
/^(other|tell me more|you (choose|decide)|let me (specify|decide|explain))\b/i,
|
|
74
|
+
/\b(specify|describe|clarify|choose|pick|select|name)\b.*\b(it|one|which|what|something|a file|the file)\b/i,
|
|
75
|
+
];
|
|
76
|
+
function defersBack(option) {
|
|
77
|
+
return DEFERRING.some((re) => re.test(option.label.trim()));
|
|
78
|
+
}
|
|
79
|
+
function normalize(question) {
|
|
80
|
+
const options = question.kind === "confirm" && !question.options?.length ? CONFIRM_OPTIONS : question.options;
|
|
81
|
+
return {
|
|
82
|
+
id: question.id,
|
|
83
|
+
question: question.question,
|
|
84
|
+
kind: question.kind,
|
|
85
|
+
...(question.detail ? { detail: question.detail } : {}),
|
|
86
|
+
...(options ? { options } : {}),
|
|
87
|
+
...(question.allowOther !== undefined ? { allowOther: question.allowOther } : {}),
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Ask the user a question and block the turn until they answer.
|
|
92
|
+
*
|
|
93
|
+
* Registered only by hosts that can actually render it (the gg-app sidecar).
|
|
94
|
+
* A subagent, a headless run or the TUI has nobody to answer, so the tool is
|
|
95
|
+
* simply absent there and the agent falls back to asking in prose.
|
|
96
|
+
*/
|
|
97
|
+
export function createAskUserTool(ask) {
|
|
98
|
+
return {
|
|
99
|
+
name: "ask_user",
|
|
100
|
+
description: "Ask the user a question and wait for their answer, rendered as clickable options in the " +
|
|
101
|
+
"chat. THIS IS HOW YOU ASK — if a reply would otherwise end by asking them anything, ask " +
|
|
102
|
+
"it here instead. That covers the decision you are blocked on (a product or taste call, a " +
|
|
103
|
+
"destructive or irreversible action, a real tradeoff) AND the softer closer offering " +
|
|
104
|
+
'optional follow-up work ("want me to also…?", "should I do X next?"): both are ' +
|
|
105
|
+
"questions, so both belong on a clickable card rather than in prose. Do NOT use it for " +
|
|
106
|
+
"anything the code, docs or a command can answer, to confirm work you were already asked " +
|
|
107
|
+
"to do, or to check in on progress mid-task. No question to ask? Then do not call it — " +
|
|
108
|
+
"just end the reply.\n\n" +
|
|
109
|
+
"Write every question and option so a non-technical person can answer it confidently " +
|
|
110
|
+
"without reading the code: plain words, no jargon, no bare file paths or symbol names, " +
|
|
111
|
+
"each option describing the OUTCOME they get rather than the change you make. If two " +
|
|
112
|
+
"options could look the same to someone who has not seen the code, add a `hint` saying " +
|
|
113
|
+
"what each one costs. Always mark the option you would pick with `recommended`, so an " +
|
|
114
|
+
"unsure user can accept your judgment in one click.\n\n" +
|
|
115
|
+
"CRITICAL — every option must be a COMPLETE instruction you can act on the moment it is " +
|
|
116
|
+
"clicked. A click sends that option and nothing else: the user cannot type, elaborate or " +
|
|
117
|
+
"narrow it down. So never offer an option that only defers the decision back to them " +
|
|
118
|
+
"('Fix something specific', 'Choose a file', 'Tell me more', 'Something else'). If you " +
|
|
119
|
+
"need specifics you do not have, either find them yourself first, or list the actual " +
|
|
120
|
+
"candidates as separate options. The free-text escape already exists in the UI — you do " +
|
|
121
|
+
"not need to add an option for it.\n\n" +
|
|
122
|
+
"This REPLACES writing the question in your reply — do not also end the message with an " +
|
|
123
|
+
"asking line, and do not restate the options as text.\n\n" +
|
|
124
|
+
'Good: question "Where should people\'s login sessions be stored?", options "Keep it ' +
|
|
125
|
+
'simple (one file)" [recommended, hint "No extra setup, fine to a few thousand users"] ' +
|
|
126
|
+
'and "Use a real database" [hint "More setup now, handles far more users"].\n' +
|
|
127
|
+
'Bad: question "SQLite or Postgres for the session store?", options "SQLite", ' +
|
|
128
|
+
'"Postgres" — the user cannot tell what either choice costs them.',
|
|
129
|
+
parameters: AskUserParams,
|
|
130
|
+
// The turn is blocked on a human; nothing else in the batch may run first.
|
|
131
|
+
executionMode: "sequential",
|
|
132
|
+
// The host's own timeout is the real bound. Without this the loop's 5-min
|
|
133
|
+
// default would abort the call while the user is still reading the
|
|
134
|
+
// question, and the answer would land on a tool call that no longer exists.
|
|
135
|
+
timeoutMs: ASK_USER_TIMEOUT_MS + 30_000,
|
|
136
|
+
async execute({ questions }) {
|
|
137
|
+
const ids = new Set(questions.map((q) => q.id));
|
|
138
|
+
if (ids.size !== questions.length) {
|
|
139
|
+
return "Error: every question needs a unique `id`.";
|
|
140
|
+
}
|
|
141
|
+
const missing = questions.find((q) => (q.kind === "choice" || q.kind === "multi") && (q.options?.length ?? 0) < 2);
|
|
142
|
+
if (missing) {
|
|
143
|
+
return `Error: question "${missing.id}" is kind "${missing.kind}" and needs at least 2 options.`;
|
|
144
|
+
}
|
|
145
|
+
const deferring = questions.flatMap((q) => q.options ?? []).find(defersBack);
|
|
146
|
+
if (deferring) {
|
|
147
|
+
return (`Error: the option "${deferring.label}" asks the user to specify something, but a ` +
|
|
148
|
+
"click sends only that option — they cannot type or elaborate. Replace it with the " +
|
|
149
|
+
"actual choices, or find the specifics yourself first. (The free-text escape is " +
|
|
150
|
+
"already built into the UI.)");
|
|
151
|
+
}
|
|
152
|
+
const normalized = questions.map(normalize);
|
|
153
|
+
return formatAskResult(normalized, await ask({ questions: normalized }));
|
|
154
|
+
},
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
//# sourceMappingURL=ask-user.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ask-user.js","sourceRoot":"","sources":["../../src/tools/ask-user.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EACL,mBAAmB,EACnB,eAAe,GAIhB,MAAM,qBAAqB,CAAC;AAK7B,sEAAsE;AACtE,MAAM,aAAa,GAAG,CAAC,CAAC;AACxB,MAAM,WAAW,GAAG,CAAC,CAAC;AAEtB,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC;IACtB,KAAK,EAAE,CAAC;SACL,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,CAAC;SACN,QAAQ,CACP,uFAAuF;QACrF,qFAAqF;QACrF,oFAAoF;QACpF,uFAAuF;QACvF,sFAAsF;QACtF,oFAAoF,CACvF;IACH,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,oDAAoD,CAAC;IAC3F,IAAI,EAAE,CAAC;SACJ,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CACP,iFAAiF;QAC/E,kFAAkF,CACrF;IACH,WAAW,EAAE,CAAC;SACX,OAAO,EAAE;SACT,QAAQ,EAAE;SACV,QAAQ,CACP,uFAAuF,CACxF;CACJ,CAAC,CAAC;AAEH,MAAM,QAAQ,GAAG,CAAC,CAAC,MAAM,CAAC;IACxB,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,wD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,SAAS,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;YAC5C,OAAO,eAAe,CAAC,UAAU,EAAE,MAAM,GAAG,CAAC,EAAE,SAAS,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC;QAC3E,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompt-hints.d.ts","sourceRoot":"","sources":["../../src/tools/prompt-hints.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"prompt-hints.d.ts","sourceRoot":"","sources":["../../src/tools/prompt-hints.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CA+CpD,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,qBAAqB,EAAE,aAAa,CAAC;IAChD,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IACzB,IAAI,EAAE,MAAM,CAAC;CACd,CAqBA,CAAC;AAEF,gFAAgF;AAChF,wBAAgB,iBAAiB,CAAC,WAAW,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,CAKxE;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,kBAAkB,EAAE,SAAS,MAAM,EA+B/C,CAAC;AAEF,oEAAoE;AACpE,eAAO,MAAM,kBAAkB,EAAE,SAAS,MAAM,EAsB/C,CAAC"}
|
|
@@ -28,6 +28,9 @@ export const TOOL_PROMPT_HINTS = {
|
|
|
28
28
|
list_agents: "List child agent IDs, states, turns and token totals.",
|
|
29
29
|
interrupt_agent: "Interrupt a child agent's current turn, keeping its context for a follow-up.",
|
|
30
30
|
tasks: "Manage the project task list. Never proactively — only on explicit request, or at a slash-command's task-handoff step.",
|
|
31
|
+
ask_user: "Any question ending a reply — blocker or optional next step — goes here as clickable " +
|
|
32
|
+
"options, never prose. Plain words; mark your pick `recommended`. A click sends only that " +
|
|
33
|
+
"option, so each must be a complete instruction, not one asking them to specify.",
|
|
31
34
|
enter_plan: "Enter read-only plan mode for complex/risky tasks before implementation; draft a plan under .gg/plans/.",
|
|
32
35
|
exit_plan: "Submit a .gg/plans/ markdown plan for user approval and leave plan mode.",
|
|
33
36
|
subagent: "Delegate focused, isolated subtasks (research, parallel exploration).",
|
|
@@ -86,6 +89,7 @@ export function buildToolSteering(activeTools) {
|
|
|
86
89
|
* would otherwise cost the agent a capability with no signal at all.
|
|
87
90
|
*/
|
|
88
91
|
export const BUILTIN_TOOL_NAMES = [
|
|
92
|
+
"ask_user",
|
|
89
93
|
"bash",
|
|
90
94
|
"code_nav",
|
|
91
95
|
"code_search",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompt-hints.js","sourceRoot":"","sources":["../../src/tools/prompt-hints.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAA2B;IACvD,QAAQ,EACN,4FAA4F;QAC5F,6DAA6D;IAC/D,WAAW,EACT,qFAAqF;QACrF,4FAA4F;QAC5F,qEAAqE;IACvE,WAAW,EACT,uIAAuI;IACzI,UAAU,EACR,uHAAuH;IACzH,SAAS,EACP,gKAAgK;IAClK,WAAW,EAAE,kDAAkD;IAC/D,SAAS,EAAE,kCAAkC;IAC7C,UAAU,EACR,6IAA6I;IAC/I,YAAY,EAAE,0EAA0E;IACxF,aAAa,EAAE,oEAAoE;IACnF,UAAU,EAAE,0EAA0E;IACtF,WAAW,EAAE,uDAAuD;IACpE,eAAe,EAAE,8EAA8E;IAC/F,KAAK,EACH,wHAAwH;IAC1H,UAAU,EACR,yGAAyG;IAC3G,SAAS,EAAE,0EAA0E;IACrF,QAAQ,EAAE,uEAAuE;IACjF,KAAK,EAAE,oDAAoD;IAC3D,WAAW,EACT,4EAA4E;QAC5E,sFAAsF;QACtF,qFAA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ACX,MAAM;IACN,eAAe;IACf,gBAAgB;IAChB,MAAM;IACN,iBAAiB;IACjB,aAAa;IACb,IAAI;IACJ,MAAM;IACN,YAAY;IACZ,cAAc;IACd,OAAO;IACP,aAAa;IACb,aAAa;IACb,UAAU;IACV,aAAa;IACb,WAAW;IACX,WAAW;IACX,OAAO;IACP,aAAa;IACb,YAAY;IACZ,WAAW;IACX,YAAY;IACZ,OAAO;CACR,CAAC;AAEF,oEAAoE;AACpE,MAAM,CAAC,MAAM,kBAAkB,GAAsB;IACnD,MAAM;IACN,OAAO;IACP,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,UAAU;IACV,aAAa;IACb,IAAI;IACJ,aAAa;IACb,WAAW;IACX,aAAa;IACb,WAAW;IACX,YAAY;IACZ,WAAW;IACX,UAAU;IACV,OAAO;IACP,gBAAgB;IAChB,uCAAuC;IACvC,oCAAoC;IACpC,iCAAiC;CAClC,CAAC"}
|
|
1
|
+
{"version":3,"file":"prompt-hints.js","sourceRoot":"","sources":["../../src/tools/prompt-hints.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAA2B;IACvD,QAAQ,EACN,4FAA4F;QAC5F,6DAA6D;IAC/D,WAAW,EACT,qFAAqF;QACrF,4FAA4F;QAC5F,qEAAqE;IACvE,WAAW,EACT,uIAAuI;IACzI,UAAU,EACR,uHAAuH;IACzH,SAAS,EACP,gKAAgK;IAClK,WAAW,EAAE,kDAAkD;IAC/D,SAAS,EAAE,kCAAkC;IAC7C,UAAU,EACR,6IAA6I;IAC/I,YAAY,EAAE,0EAA0E;IACxF,aAAa,EAAE,oEAAoE;IACnF,UAAU,EAAE,0EAA0E;IACtF,WAAW,EAAE,uDAAuD;IACpE,eAAe,EAAE,8EAA8E;IAC/F,KAAK,EACH,wHAAwH;IAC1H,QAAQ,EACN,uFAAuF;QACvF,2FAA2F;QAC3F,iFAAiF;IACnF,UAAU,EACR,yGAAyG;IA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,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAsB;IACnD,UAAU;IACV,MAAM;IACN,UAAU;IACV,aAAa;IACb,MAAM;IACN,YAAY;IACZ,WAAW;IACX,MAAM;IACN,eAAe;IACf,gBAAgB;IAChB,MAAM;IACN,iBAAiB;IACjB,aAAa;IACb,IAAI;IACJ,MAAM;IACN,YAAY;IACZ,cAAc;IACd,OAAO;IACP,aAAa;IACb,aAAa;IACb,UAAU;IACV,aAAa;IACb,WAAW;IACX,WAAW;IACX,OAAO;IACP,aAAa;IACb,YAAY;IACZ,WAAW;IACX,YAAY;IACZ,OAAO;CACR,CAAC;AAEF,oEAAoE;AACpE,MAAM,CAAC,MAAM,kBAAkB,GAAsB;IACnD,MAAM;IACN,OAAO;IACP,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,UAAU;IACV,aAAa;IACb,IAAI;IACJ,aAAa;IACb,WAAW;IACX,aAAa;IACb,WAAW;IACX,YAAY;IACZ,WAAW;IACX,UAAU;IACV,OAAO;IACP,gBAAgB;IAChB,uCAAuC;IACvC,oCAAoC;IACpC,iCAAiC;CAClC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-tiers.d.ts","sourceRoot":"","sources":["../../src/tools/tool-tiers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAErD;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,eAAe,EAAE,SAAS,MAAM,
|
|
1
|
+
{"version":3,"file":"tool-tiers.d.ts","sourceRoot":"","sources":["../../src/tools/tool-tiers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAErD;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,eAAe,EAAE,SAAS,MAAM,EAyB5C,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,EAAE,SAAS,MAAM,EAUhD,CAAC;AAIF,MAAM,WAAW,iBAAiB;IAChC,sDAAsD;IACtD,IAAI,EAAE,SAAS,EAAE,CAAC;IAClB,4EAA4E;IAC5E,QAAQ,EAAE,SAAS,EAAE,CAAC;CACvB;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,SAAS,SAAS,EAAE,GAAG,iBAAiB,CAQnF"}
|
package/dist/tools/tool-tiers.js
CHANGED
|
@@ -18,6 +18,10 @@
|
|
|
18
18
|
* rates hold: measure that, not just the token saving, before moving a name.
|
|
19
19
|
*/
|
|
20
20
|
export const CORE_TOOL_NAMES = [
|
|
21
|
+
// Core wherever it is registered at all (the app sidecar): a question the
|
|
22
|
+
// model must `tool_search` for first is a question it writes in prose
|
|
23
|
+
// instead. Hosts with nobody to answer never build it, so they pay nothing.
|
|
24
|
+
"ask_user",
|
|
21
25
|
"read",
|
|
22
26
|
"write",
|
|
23
27
|
"edit",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-tiers.js","sourceRoot":"","sources":["../../src/tools/tool-tiers.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAC,MAAM,eAAe,GAAsB;IAChD,MAAM;IACN,OAAO;IACP,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,IAAI;IACJ,aAAa;IACb,UAAU;IACV,YAAY;IACZ,WAAW;IACX,aAAa;IACb,WAAW;IACX,WAAW;IACX,UAAU;IACV,aAAa;IACb,OAAO;IACP,YAAY;IACZ,WAAW;IACX,aAAa;CACd,CAAC;AAEF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAsB;IACpD,aAAa;IACb,YAAY;IACZ,gBAAgB;IAChB,OAAO;IACP,cAAc;IACd,eAAe;IACf,YAAY;IACZ,aAAa;IACb,iBAAiB;CAClB,CAAC;AAEF,MAAM,YAAY,GAAwB,IAA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B,MAAM,QAAQ,GAAgB,EAAE,CAAC;IACjC,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,IAAI,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC;YAAE,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;;YAChD,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACvB,CAAC;IACD,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;AAC5B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kenkaiiii/ggcoder",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.51.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "CLI coding agent with OAuth authentication for Anthropic, OpenAI, and Gemini",
|
|
6
6
|
"license": "MIT",
|
|
@@ -115,9 +115,9 @@
|
|
|
115
115
|
"typescript-language-server": "^5.3.0",
|
|
116
116
|
"wrap-ansi": "^10.0.0",
|
|
117
117
|
"zod": "^4.4.3",
|
|
118
|
-
"@kenkaiiii/gg-
|
|
119
|
-
"@kenkaiiii/gg-
|
|
120
|
-
"@kenkaiiii/gg-core": "5.
|
|
118
|
+
"@kenkaiiii/gg-ai": "5.51.1",
|
|
119
|
+
"@kenkaiiii/gg-agent": "5.51.1",
|
|
120
|
+
"@kenkaiiii/gg-core": "5.51.1"
|
|
121
121
|
},
|
|
122
122
|
"optionalDependencies": {
|
|
123
123
|
"@huggingface/transformers": "^3.6.0",
|