@estebanforge/pi-ask-antigravity 1.2.4 → 1.2.5
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/extensions/index.ts +70 -3
- package/package.json +5 -4
package/extensions/index.ts
CHANGED
|
@@ -77,6 +77,24 @@ const FAMILY_DEFAULT_TIER: Record<Family, ThinkingTier> = {
|
|
|
77
77
|
|
|
78
78
|
const TIER_RANK: Record<ThinkingTier, number> = { low: 0, medium: 1, high: 2 };
|
|
79
79
|
|
|
80
|
+
/** pi thinking-level vocabulary -> agy tier, for the thinking/effort tool
|
|
81
|
+
* params. Unknown values fall to low (agy always thinks something). */
|
|
82
|
+
function levelToTier(level: string): ThinkingTier {
|
|
83
|
+
switch (level) {
|
|
84
|
+
case "minimal":
|
|
85
|
+
case "low":
|
|
86
|
+
return "low";
|
|
87
|
+
case "medium":
|
|
88
|
+
return "medium";
|
|
89
|
+
case "high":
|
|
90
|
+
case "xhigh":
|
|
91
|
+
case "max":
|
|
92
|
+
return "high";
|
|
93
|
+
default:
|
|
94
|
+
return "low";
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
80
98
|
// Mode = which agy tool-loop policy to apply. Distinct from the alias layer.
|
|
81
99
|
// "plan" → --mode plan (no edits; review-only)
|
|
82
100
|
// "accept-edits" → --mode accept-edits (agy applies edits)
|
|
@@ -140,7 +158,12 @@ EXECUTION MODES (param: mode):
|
|
|
140
158
|
- **accept-edits** (default): agy applies edits directly inside the workspace.
|
|
141
159
|
- For agy's orthogonal \`--sandbox\` shell-containment flag, set the \`AGY_EXTRA_ARGS=--sandbox\` env var.
|
|
142
160
|
|
|
143
|
-
COMPACT OUTPUT (param: digest): when true, the prompt is prefixed to request compact digests instead of full file contents. Defaults on for plan, off for accept-edits. Use true whenever you do not need full file payloads (review, exploration, planning)
|
|
161
|
+
COMPACT OUTPUT (param: digest): when true, the prompt is prefixed to request compact digests instead of full file contents. Defaults on for plan, off for accept-edits. Use true whenever you do not need full file payloads (review, exploration, planning).
|
|
162
|
+
|
|
163
|
+
THINKING LEVEL (params: thinking, effort - SYNONYMS for one knob):
|
|
164
|
+
- pi calls it thinking, agy calls it effort. Same thing. Pass ONE of the two.
|
|
165
|
+
- Values (pi vocabulary): minimal|low|medium|high|xhigh|max. Clamped to agy's low|medium|high; unknown values fall back to low. "peer review on high thinking" -> thinking: "high".
|
|
166
|
+
- An explicit level beats a tier embedded in model ("flash high") and the configured default. Omit both for the configured default.`;
|
|
144
167
|
|
|
145
168
|
// --- Types -----------------------------------------------------------------
|
|
146
169
|
|
|
@@ -318,6 +341,10 @@ export function resolveModel(
|
|
|
318
341
|
input: string,
|
|
319
342
|
entries: ModelEntry[],
|
|
320
343
|
defaultThinking: ThinkingTier,
|
|
344
|
+
/** Explicit thinking param (thinking/effort). Beats a tier embedded in
|
|
345
|
+
* the alias ("flash high") and the configured default; clamped to the
|
|
346
|
+
* family's real tiers, ignored for fixed-thinking families. */
|
|
347
|
+
preferredTier?: ThinkingTier,
|
|
321
348
|
): ResolvedModel | null {
|
|
322
349
|
const lower = input.toLowerCase().trim();
|
|
323
350
|
|
|
@@ -400,6 +427,7 @@ export function resolveModel(
|
|
|
400
427
|
if (familyTiers.size === 0) return toResolved(candidates[0].full, null); // no tiers on any entry
|
|
401
428
|
|
|
402
429
|
const preferred =
|
|
430
|
+
preferredTier ??
|
|
403
431
|
tier ??
|
|
404
432
|
(familyTiers.has(defaultThinking) ? defaultThinking : FAMILY_DEFAULT_TIER[family]);
|
|
405
433
|
const chosenTier = nearestTier([...familyTiers], preferred);
|
|
@@ -901,6 +929,18 @@ export default async function (pi: ExtensionAPI) {
|
|
|
901
929
|
}),
|
|
902
930
|
),
|
|
903
931
|
model: modelParam,
|
|
932
|
+
thinking: Type.Optional(
|
|
933
|
+
Type.String({
|
|
934
|
+
description:
|
|
935
|
+
"Thinking level (= agy effort tier). pi vocabulary: minimal|low|medium|high|xhigh|max, clamped to agy's low|medium|high. Overrides a tier embedded in `model`. Omit for the configured default.",
|
|
936
|
+
}),
|
|
937
|
+
),
|
|
938
|
+
effort: Type.Optional(
|
|
939
|
+
Type.String({
|
|
940
|
+
description:
|
|
941
|
+
"Alias for `thinking` (agy's own name for the same knob). Pass ONE of the two; different values on both is an error.",
|
|
942
|
+
}),
|
|
943
|
+
),
|
|
904
944
|
mode: Type.Optional(
|
|
905
945
|
Type.Union(
|
|
906
946
|
[
|
|
@@ -945,8 +985,14 @@ export default async function (pi: ExtensionAPI) {
|
|
|
945
985
|
// surface the resolved tier separately for identification.
|
|
946
986
|
const cfg = loadConfig();
|
|
947
987
|
const requestedModel = (args.model as string | undefined)?.trim() || cfg.defaultModel;
|
|
988
|
+
const thinkingArg = (args.thinking as string | undefined) ?? (args.effort as string | undefined);
|
|
948
989
|
const resolved =
|
|
949
|
-
resolveModel(
|
|
990
|
+
resolveModel(
|
|
991
|
+
requestedModel,
|
|
992
|
+
discovered,
|
|
993
|
+
cfg.defaultThinking,
|
|
994
|
+
thinkingArg ? levelToTier(thinkingArg) : undefined,
|
|
995
|
+
) ?? { model: requestedModel };
|
|
950
996
|
const thinking: ThinkingTier = resolved.effort ?? cfg.defaultThinking;
|
|
951
997
|
const mode: Mode = (args.mode as Mode | undefined) ?? "accept-edits";
|
|
952
998
|
const useDigest = typeof args.digest === "boolean" ? args.digest : mode === "plan";
|
|
@@ -1050,8 +1096,29 @@ export default async function (pi: ExtensionAPI) {
|
|
|
1050
1096
|
details: emptyDetails(requestedModel, null),
|
|
1051
1097
|
};
|
|
1052
1098
|
}
|
|
1099
|
+
if (
|
|
1100
|
+
typeof params.thinking === "string" &&
|
|
1101
|
+
typeof params.effort === "string" &&
|
|
1102
|
+
params.thinking !== params.effort
|
|
1103
|
+
) {
|
|
1104
|
+
return {
|
|
1105
|
+
content: [
|
|
1106
|
+
{
|
|
1107
|
+
type: "text",
|
|
1108
|
+
text: "thinking and effort are synonyms for the same knob - pass one, not both with different values.",
|
|
1109
|
+
},
|
|
1110
|
+
],
|
|
1111
|
+
details: emptyDetails(requestedModel, null),
|
|
1112
|
+
};
|
|
1113
|
+
}
|
|
1114
|
+
const thinkingArg = (params.thinking as string | undefined) ?? (params.effort as string | undefined);
|
|
1053
1115
|
const resolved =
|
|
1054
|
-
resolveModel(
|
|
1116
|
+
resolveModel(
|
|
1117
|
+
requestedModel,
|
|
1118
|
+
discovered,
|
|
1119
|
+
config.defaultThinking,
|
|
1120
|
+
thinkingArg ? levelToTier(thinkingArg) : undefined,
|
|
1121
|
+
) ?? {
|
|
1055
1122
|
model: requestedModel,
|
|
1056
1123
|
};
|
|
1057
1124
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@estebanforge/pi-ask-antigravity",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.5",
|
|
4
4
|
"description": "Pi tool that delegates a self-contained sub-task to Google Antigravity's agy CLI (the CLI for Gemini). Friendly model aliases (flash/pro/gemini), configurable default model + thinking, and the AskAntigravity delegation tool.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pi-package",
|
|
@@ -49,9 +49,10 @@
|
|
|
49
49
|
}
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
|
-
"@earendil-works/pi-
|
|
53
|
-
"@earendil-works/pi-
|
|
54
|
-
"@earendil-works/pi-
|
|
52
|
+
"@earendil-works/pi-ai": "^0.85.0",
|
|
53
|
+
"@earendil-works/pi-coding-agent": "^0.85.0",
|
|
54
|
+
"@earendil-works/pi-server": "^0.85.0",
|
|
55
|
+
"@earendil-works/pi-tui": "^0.85.0",
|
|
55
56
|
"@types/node": "^22.0.0",
|
|
56
57
|
"typebox": "^1.1.38",
|
|
57
58
|
"typescript": "^5.8.0",
|