@herbertgao/pi-extensions 2026.11.15 → 2026.11.17
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/CHANGELOG.md +24 -0
- package/README.md +4 -4
- package/THIRD_PARTY_NOTICES.md +2 -2
- package/node_modules/@herbertgao/pi-agency/CHANGELOG.md +6 -0
- package/node_modules/@herbertgao/pi-agency/README.md +3 -1
- package/node_modules/@herbertgao/pi-agency/package.json +1 -1
- package/node_modules/@herbertgao/pi-agency/src/index.ts +151 -9
- package/node_modules/@herbertgao/pi-cc-extensions/CHANGELOG.md +6 -0
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/names.ts +7 -2
- package/node_modules/@herbertgao/pi-cc-extensions/package.json +1 -1
- package/node_modules/@herbertgao/pi-impeccable/CHANGELOG.md +6 -0
- package/node_modules/@herbertgao/pi-impeccable/README.md +2 -2
- package/node_modules/@herbertgao/pi-impeccable/package.json +4 -4
- package/node_modules/@herbertgao/pi-impeccable/skills/impeccable/SKILL.md +5 -5
- package/node_modules/@herbertgao/pi-impeccable/skills/impeccable/reference/audit.md +8 -1
- package/node_modules/@herbertgao/pi-impeccable/skills/impeccable/reference/audit.native.md +8 -1
- package/node_modules/@herbertgao/pi-impeccable/skills/impeccable/reference/craft-floor.md +3 -3
- package/node_modules/@herbertgao/pi-impeccable/skills/impeccable/reference/critique.md +8 -6
- package/node_modules/@herbertgao/pi-impeccable/skills/impeccable/reference/degraded/finish-reviewer.md +2 -2
- package/node_modules/@herbertgao/pi-impeccable/skills/impeccable/reference/doctor.md +5 -1
- package/node_modules/@herbertgao/pi-impeccable/skills/impeccable/reference/init.md +2 -0
- package/node_modules/@herbertgao/pi-impeccable/skills/impeccable/reference/live.md +1 -1
- package/node_modules/@herbertgao/pi-impeccable/skills/impeccable/reference/new-work.md +8 -9
- package/node_modules/@herbertgao/pi-impeccable/skills/impeccable/reference/polish.md +1 -1
- package/node_modules/@herbertgao/pi-impeccable/skills/impeccable/scripts/VERSION +1 -1
- package/node_modules/@herbertgao/pi-impeccable/skills/impeccable/scripts/engine-checksums.txt +5 -5
- package/node_modules/@herbertgao/pi-impeccable/skills/impeccable/scripts/live-browser.js +55 -32
- package/node_modules/@herbertgao/pi-subagents/CHANGELOG.md +6 -0
- package/node_modules/@herbertgao/pi-subagents/docs/rpc.md +7 -1
- package/node_modules/@herbertgao/pi-subagents/package.json +1 -1
- package/node_modules/@herbertgao/pi-subagents/src/agent-color.ts +6 -2
- package/node_modules/@herbertgao/pi-subagents/src/agent-types.ts +82 -1
- package/node_modules/@herbertgao/pi-subagents/src/cross-extension-rpc.ts +107 -2
- package/node_modules/@herbertgao/pi-subagents/src/index.ts +9 -2
- package/node_modules/pi-provider-qoder/dist/index.js +50 -10
- package/node_modules/pi-provider-qoder/package.json +1 -1
- package/package.json +9 -9
|
@@ -86,14 +86,95 @@ export function buildAgentRegistry(
|
|
|
86
86
|
|
|
87
87
|
/**
|
|
88
88
|
* Register agents into the unified registry.
|
|
89
|
-
* Starts with DEFAULT_AGENTS, then overlays user agents (overrides defaults with same name)
|
|
89
|
+
* Starts with DEFAULT_AGENTS, then overlays user agents (overrides defaults with same name),
|
|
90
|
+
* then the ephemeral overlay (see `registerEphemeralAgents`).
|
|
90
91
|
* Disabled agents (enabled === false) are kept in the registry but excluded from spawning.
|
|
91
92
|
*/
|
|
92
93
|
export function registerAgents(userAgents: Map<string, AgentConfig>): void {
|
|
93
94
|
agents.clear()
|
|
95
|
+
// The rebuilt registry is file/default-backed throughout, so no key in it
|
|
96
|
+
// is ours any more — drop ownership before the overlay re-applies.
|
|
97
|
+
ephemeralOwned.clear()
|
|
94
98
|
for (const [name, config] of buildAgentRegistry(userAgents)) {
|
|
95
99
|
agents.set(name, config)
|
|
96
100
|
}
|
|
101
|
+
overlayEphemeral(agents)
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Ephemeral agents: registered at runtime by another extension over the RPC
|
|
106
|
+
* bus (pi-agency seating a catalog persona), overlaid after every file load so
|
|
107
|
+
* they survive `reloadCustomAgents()` — which runs before every spawn and
|
|
108
|
+
* would otherwise wipe them. A file-loaded agent with the same name wins: user
|
|
109
|
+
* files are the authority and an ephemeral overlay never shadows them. The
|
|
110
|
+
* overlay is cleared on each session_start, so a type lives for the current
|
|
111
|
+
* session only.
|
|
112
|
+
*/
|
|
113
|
+
const ephemeralAgents = new Map<string, AgentConfig>()
|
|
114
|
+
/** Registry keys currently served by the ephemeral overlay (not file-backed). */
|
|
115
|
+
const ephemeralOwned = new Set<string>()
|
|
116
|
+
|
|
117
|
+
/** Overlay the ephemeral types onto a registry; returns the names applied. */
|
|
118
|
+
function overlayEphemeral(registry: Map<string, AgentConfig>): string[] {
|
|
119
|
+
const applied: string[] = []
|
|
120
|
+
for (const [name, config] of ephemeralAgents) {
|
|
121
|
+
const key = resolveKeyIn(registry, name)
|
|
122
|
+
// A key we do not own is file- or default-backed: the user's type wins
|
|
123
|
+
// and this registration is skipped — never a silent shadow. A key we own
|
|
124
|
+
// is our own previous entry, replaced in place. Both checks are
|
|
125
|
+
// case-insensitive, like spawn resolution.
|
|
126
|
+
if (key !== undefined && !ephemeralOwned.has(key)) continue
|
|
127
|
+
if (key !== undefined && key !== name) {
|
|
128
|
+
registry.delete(key)
|
|
129
|
+
ephemeralOwned.delete(key)
|
|
130
|
+
}
|
|
131
|
+
registry.set(name, config)
|
|
132
|
+
ephemeralOwned.add(name)
|
|
133
|
+
applied.push(name)
|
|
134
|
+
}
|
|
135
|
+
return applied
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
/** Register session-scoped agent types at runtime; spawnable immediately.
|
|
139
|
+
* Returns the names actually applied, so a caller can fail loudly when a name
|
|
140
|
+
* collides with a file-loaded or default type instead of shadowing it. */
|
|
141
|
+
export function registerEphemeralAgents(
|
|
142
|
+
entries: Map<string, AgentConfig>,
|
|
143
|
+
): string[] {
|
|
144
|
+
for (const [name, config] of entries) {
|
|
145
|
+
// A case-variant of an existing ephemeral key replaces it in place, so
|
|
146
|
+
// one persona cannot leave a second, unreachable entry behind.
|
|
147
|
+
const existing = resolveKeyIn(ephemeralAgents, name)
|
|
148
|
+
if (existing !== undefined && existing !== name)
|
|
149
|
+
ephemeralAgents.delete(existing)
|
|
150
|
+
ephemeralAgents.set(name, config)
|
|
151
|
+
}
|
|
152
|
+
const applied = overlayEphemeral(agents)
|
|
153
|
+
// A skipped name collided with a file/default type: drop it from the store
|
|
154
|
+
// as well, so it cannot silently apply later if that type disappears.
|
|
155
|
+
for (const name of entries.keys()) {
|
|
156
|
+
if (!applied.includes(name)) ephemeralAgents.delete(name)
|
|
157
|
+
}
|
|
158
|
+
// Report only this call's names: the overlay re-applies the whole store, so
|
|
159
|
+
// returning `applied` would list types the caller never sent.
|
|
160
|
+
return [...entries.keys()].filter((name) => applied.includes(name))
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
/** Remove ephemeral types by name (case-insensitive); file-backed types stay. */
|
|
164
|
+
export function unregisterEphemeralAgents(names: readonly string[]): void {
|
|
165
|
+
for (const name of names) {
|
|
166
|
+
const key = resolveKeyIn(ephemeralAgents, name)
|
|
167
|
+
if (!key) continue
|
|
168
|
+
ephemeralAgents.delete(key)
|
|
169
|
+
if (ephemeralOwned.delete(key)) agents.delete(key)
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
/** Drop every ephemeral type; file-backed types stay. Called on session_start. */
|
|
174
|
+
export function clearEphemeralAgents(): void {
|
|
175
|
+
for (const key of ephemeralOwned) agents.delete(key)
|
|
176
|
+
ephemeralOwned.clear()
|
|
177
|
+
ephemeralAgents.clear()
|
|
97
178
|
}
|
|
98
179
|
|
|
99
180
|
/** Case-insensitive key resolution within a registry. */
|
|
@@ -14,9 +14,13 @@
|
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
16
|
import { isTopLevelAgent } from "./agent-manager.js"
|
|
17
|
+
import {
|
|
18
|
+
registerEphemeralAgents,
|
|
19
|
+
unregisterEphemeralAgents,
|
|
20
|
+
} from "./agent-types.js"
|
|
17
21
|
import { type ModelRegistry, resolveModel } from "./model-resolver.js"
|
|
18
22
|
import { checkModelScope } from "./model-scope.js"
|
|
19
|
-
import type { AgentRecord } from "./types.js"
|
|
23
|
+
import type { AgentConfig, AgentRecord } from "./types.js"
|
|
20
24
|
|
|
21
25
|
/** Minimal event bus interface needed by the RPC handlers. */
|
|
22
26
|
export interface EventBus {
|
|
@@ -78,6 +82,8 @@ export interface RpcHandle {
|
|
|
78
82
|
unsubStop: () => void
|
|
79
83
|
unsubConsume: () => void
|
|
80
84
|
unsubSteer: () => void
|
|
85
|
+
unsubRegisterAgents: () => void
|
|
86
|
+
unsubUnregisterAgents: () => void
|
|
81
87
|
}
|
|
82
88
|
|
|
83
89
|
/**
|
|
@@ -105,6 +111,45 @@ function handleRpc<P extends { requestId: string }>(
|
|
|
105
111
|
})
|
|
106
112
|
}
|
|
107
113
|
|
|
114
|
+
/** Validate one register-agents payload entry into an AgentConfig. Narrow on
|
|
115
|
+
* purpose: no tool allowlist beyond none/builtin, no extension or skill access,
|
|
116
|
+
* replace-mode system prompt — a persona is role text, not an executable agent
|
|
117
|
+
* definition. */
|
|
118
|
+
export function ephemeralAgentConfig(
|
|
119
|
+
candidate: unknown,
|
|
120
|
+
index: number,
|
|
121
|
+
): [string, AgentConfig] {
|
|
122
|
+
if (typeof candidate !== "object" || candidate === null)
|
|
123
|
+
throw new Error(`agents[${index}] must be an object`)
|
|
124
|
+
const { name, description, systemPrompt, color } = candidate as Record<
|
|
125
|
+
string,
|
|
126
|
+
unknown
|
|
127
|
+
>
|
|
128
|
+
if (typeof name !== "string" || !name.trim() || name.length > 64)
|
|
129
|
+
throw new Error(`agents[${index}].name must be 1-64 characters`)
|
|
130
|
+
if (typeof description !== "string" || !description.trim())
|
|
131
|
+
throw new Error(`agents[${index}].description must be a non-empty string`)
|
|
132
|
+
if (typeof systemPrompt !== "string" || !systemPrompt.trim())
|
|
133
|
+
throw new Error(`agents[${index}].systemPrompt must be a non-empty string`)
|
|
134
|
+
if (color !== undefined && (typeof color !== "string" || !color))
|
|
135
|
+
throw new Error(
|
|
136
|
+
`agents[${index}].color must be a non-empty string when given`,
|
|
137
|
+
)
|
|
138
|
+
const trimmed = name.trim()
|
|
139
|
+
return [
|
|
140
|
+
trimmed,
|
|
141
|
+
{
|
|
142
|
+
name: trimmed,
|
|
143
|
+
description,
|
|
144
|
+
systemPrompt,
|
|
145
|
+
color: typeof color === "string" ? color : undefined,
|
|
146
|
+
promptMode: "replace",
|
|
147
|
+
extensions: false,
|
|
148
|
+
skills: false,
|
|
149
|
+
},
|
|
150
|
+
]
|
|
151
|
+
}
|
|
152
|
+
|
|
108
153
|
/**
|
|
109
154
|
* Register ping, spawn, stop, consume, and steer RPC handlers on the event bus.
|
|
110
155
|
* Returns unsub functions for cleanup.
|
|
@@ -247,5 +292,65 @@ export function registerRpcHandlers(deps: RpcDeps): RpcHandle {
|
|
|
247
292
|
throw new Error("Agent is not running")
|
|
248
293
|
})
|
|
249
294
|
|
|
250
|
-
|
|
295
|
+
// Register session-scoped agent types from another extension (pi-agency
|
|
296
|
+
// seating a catalog persona). Additive like consume/steer: outside the ping
|
|
297
|
+
// version handshake — an older pi-subagents simply never replies and the
|
|
298
|
+
// caller's timeout is the discovery signal.
|
|
299
|
+
const unsubRegisterAgents = handleRpc<{
|
|
300
|
+
requestId: string
|
|
301
|
+
agents: unknown[]
|
|
302
|
+
tools?: unknown
|
|
303
|
+
}>(events, "subagents:rpc:register-agents", ({ agents, tools }) => {
|
|
304
|
+
if (!Array.isArray(agents) || agents.length === 0)
|
|
305
|
+
throw new Error("register-agents requires a non-empty agents array")
|
|
306
|
+
if (tools !== undefined && tools !== "none" && tools !== "builtin")
|
|
307
|
+
throw new Error('tools must be "none" or "builtin"')
|
|
308
|
+
const builtinToolNames = tools === "none" ? [] : undefined
|
|
309
|
+
const entries = new Map<string, AgentConfig>()
|
|
310
|
+
const seen = new Map<string, number>()
|
|
311
|
+
agents.forEach((candidate, index) => {
|
|
312
|
+
const [name, config] = ephemeralAgentConfig(candidate, index)
|
|
313
|
+
const lower = name.toLowerCase()
|
|
314
|
+
const firstIndex = seen.get(lower)
|
|
315
|
+
if (firstIndex !== undefined)
|
|
316
|
+
throw new Error(
|
|
317
|
+
`agents[${index}].name "${name}" duplicates agents[${firstIndex}]`,
|
|
318
|
+
)
|
|
319
|
+
seen.set(lower, index)
|
|
320
|
+
entries.set(name, { ...config, builtinToolNames })
|
|
321
|
+
})
|
|
322
|
+
const applied = registerEphemeralAgents(entries)
|
|
323
|
+
// A skipped name collides with a file-loaded or default type: fail loudly
|
|
324
|
+
// rather than let the caller spawn that type believing it is the persona.
|
|
325
|
+
const skipped = [...entries.keys()].filter(
|
|
326
|
+
(name) => !applied.includes(name),
|
|
327
|
+
)
|
|
328
|
+
if (skipped.length > 0)
|
|
329
|
+
throw new Error(
|
|
330
|
+
`agent type already exists: ${skipped.map((name) => `"${name}"`).join(", ")}` +
|
|
331
|
+
(applied.length > 0
|
|
332
|
+
? ` (applied: ${applied.map((name) => `"${name}"`).join(", ")})`
|
|
333
|
+
: ""),
|
|
334
|
+
)
|
|
335
|
+
return { agents: applied }
|
|
336
|
+
})
|
|
337
|
+
|
|
338
|
+
const unsubUnregisterAgents = handleRpc<{
|
|
339
|
+
requestId: string
|
|
340
|
+
names: unknown
|
|
341
|
+
}>(events, "subagents:rpc:unregister-agents", ({ names }) => {
|
|
342
|
+
if (!Array.isArray(names) || names.some((n) => typeof n !== "string"))
|
|
343
|
+
throw new Error("unregister-agents requires an array of type names")
|
|
344
|
+
unregisterEphemeralAgents(names)
|
|
345
|
+
})
|
|
346
|
+
|
|
347
|
+
return {
|
|
348
|
+
unsubPing,
|
|
349
|
+
unsubSpawn,
|
|
350
|
+
unsubStop,
|
|
351
|
+
unsubConsume,
|
|
352
|
+
unsubSteer,
|
|
353
|
+
unsubRegisterAgents,
|
|
354
|
+
unsubUnregisterAgents,
|
|
355
|
+
}
|
|
251
356
|
}
|
|
@@ -54,6 +54,7 @@ import {
|
|
|
54
54
|
steerAgent,
|
|
55
55
|
} from "./agent-runner.js"
|
|
56
56
|
import {
|
|
57
|
+
clearEphemeralAgents,
|
|
57
58
|
formatAgentTypeList,
|
|
58
59
|
getAgentConfig,
|
|
59
60
|
getAvailableTypes,
|
|
@@ -1151,6 +1152,10 @@ export default function (pi: ExtensionAPI) {
|
|
|
1151
1152
|
// resumed session all land here, and any of them may follow a `pi install`
|
|
1152
1153
|
// that added a package the cached root list predates.
|
|
1153
1154
|
invalidatePackageCache()
|
|
1155
|
+
// Ephemeral types live for the current session only: a new or resumed
|
|
1156
|
+
// session starts clean, so a persona's registration never outlives the
|
|
1157
|
+
// run that seated it.
|
|
1158
|
+
clearEphemeralAgents()
|
|
1154
1159
|
reloadCustomAgents()
|
|
1155
1160
|
if (ctx.hasUI) {
|
|
1156
1161
|
widget.setUICtx(ctx.ui)
|
|
@@ -1501,6 +1506,8 @@ export default function (pi: ExtensionAPI) {
|
|
|
1501
1506
|
rpcHandle?.unsubPing()
|
|
1502
1507
|
rpcHandle?.unsubConsume()
|
|
1503
1508
|
rpcHandle?.unsubSteer()
|
|
1509
|
+
rpcHandle?.unsubRegisterAgents()
|
|
1510
|
+
rpcHandle?.unsubUnregisterAgents()
|
|
1504
1511
|
rpcHandle = undefined
|
|
1505
1512
|
currentCtx = undefined
|
|
1506
1513
|
// Only release the global slot if this activation claimed it — a child
|
|
@@ -2197,11 +2204,11 @@ Terse command-style prompts produce shallow, generic work.
|
|
|
2197
2204
|
name: Type.Optional(
|
|
2198
2205
|
Type.String({
|
|
2199
2206
|
description:
|
|
2200
|
-
'Optional memorable name for this agent, e.g. "auth-audit", so it can be addressed as `@name` at the prompt and by steer_subagent / get_subagent_result.
|
|
2207
|
+
'Optional memorable name for this agent, e.g. "auth-audit", so it can be addressed as `@name` at the prompt and by steer_subagent / get_subagent_result. Any characters are accepted; the `@handle` is slugged from it (lowercase letters, digits, `_`, `-`) while UI labels show it as given, spaces included. Worth setting when several agents of the same type run at once; omit for one-off work. The agent stays reachable by its type either way.',
|
|
2201
2208
|
}),
|
|
2202
2209
|
),
|
|
2203
2210
|
subagent_type: Type.String({
|
|
2204
|
-
description: `The type of specialized agent to use. Available types: ${getAvailableTypes().join(", ")}. Custom agents from .pi/agents/*.md (project) or ${getAgentDir()}/agents/*.md (global) are also available.`,
|
|
2211
|
+
description: `The type of specialized agent to use. Available types: ${getAvailableTypes().join(", ")}. Custom agents from .pi/agents/*.md (project) or ${getAgentDir()}/agents/*.md (global) are also available, as are types another tool registered for this session — a list outside this description is usable, not invalid.`,
|
|
2205
2212
|
}),
|
|
2206
2213
|
model: Type.Optional(
|
|
2207
2214
|
Type.String({
|
|
@@ -855,7 +855,7 @@ async function updateQoderModelsCache(authToken, userID, name, email, mode) {
|
|
|
855
855
|
const configs = {};
|
|
856
856
|
for (const entry of chatModels) {
|
|
857
857
|
const key = entry.key;
|
|
858
|
-
if (!key || !entry.
|
|
858
|
+
if (!key || !entry.display_name || !entry.enable && key === "auto") continue;
|
|
859
859
|
const display = entry.display_name;
|
|
860
860
|
const ctxLen = contextWindowFromCatalog(entry);
|
|
861
861
|
const isVL = !!entry.is_vl;
|
|
@@ -1263,23 +1263,33 @@ async function loginQoderForMode(callbacks, mode) {
|
|
|
1263
1263
|
if (pat) {
|
|
1264
1264
|
try {
|
|
1265
1265
|
const creds2 = await credentialsFromPat(pat, mode);
|
|
1266
|
-
const
|
|
1267
|
-
|
|
1268
|
-
});
|
|
1266
|
+
const qCreds2 = creds2;
|
|
1267
|
+
await awaitModelsCacheAfterLogin(qCreds2.access, qCreds2.userID, qCreds2.name, qCreds2.email, mode);
|
|
1269
1268
|
saveCredentialsToAuthFile(providerID, creds2);
|
|
1270
1269
|
return creds2;
|
|
1271
1270
|
} catch {
|
|
1272
1271
|
}
|
|
1273
1272
|
}
|
|
1274
1273
|
const creds = await interactiveLogin(callbacks, mode);
|
|
1274
|
+
const qCreds = creds;
|
|
1275
|
+
await awaitModelsCacheAfterLogin(qCreds.access, qCreds.userID, qCreds.name, qCreds.email, mode);
|
|
1276
|
+
saveCredentialsToAuthFile(providerID, creds);
|
|
1277
|
+
return creds;
|
|
1278
|
+
}
|
|
1279
|
+
var LOGIN_MODEL_CACHE_TIMEOUT_MS = 15e3;
|
|
1280
|
+
async function awaitModelsCacheAfterLogin(access, userID, name, email, mode) {
|
|
1281
|
+
let timeout;
|
|
1275
1282
|
try {
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1283
|
+
await Promise.race([
|
|
1284
|
+
updateQoderModelsCache(access, userID, name, email, mode),
|
|
1285
|
+
new Promise((resolve2) => {
|
|
1286
|
+
timeout = setTimeout(resolve2, LOGIN_MODEL_CACHE_TIMEOUT_MS);
|
|
1287
|
+
})
|
|
1288
|
+
]);
|
|
1279
1289
|
} catch {
|
|
1290
|
+
} finally {
|
|
1291
|
+
if (timeout !== void 0) clearTimeout(timeout);
|
|
1280
1292
|
}
|
|
1281
|
-
saveCredentialsToAuthFile(providerID, creds);
|
|
1282
|
-
return creds;
|
|
1283
1293
|
}
|
|
1284
1294
|
async function refreshQoderTokenForMode(credentials, mode) {
|
|
1285
1295
|
if (isPatRefresh(credentials.refresh)) {
|
|
@@ -11468,6 +11478,31 @@ function modelsForProvider(mode, providerID) {
|
|
|
11468
11478
|
baseUrl: getQoderBaseUrl(mode)
|
|
11469
11479
|
}));
|
|
11470
11480
|
}
|
|
11481
|
+
function resolveRefreshCredentials(context, providerID) {
|
|
11482
|
+
const credential = context.credential;
|
|
11483
|
+
if (credential?.type === "oauth") {
|
|
11484
|
+
const oauth = credential;
|
|
11485
|
+
if (oauth.access) return oauth;
|
|
11486
|
+
}
|
|
11487
|
+
return getCachedCredentials("", providerID);
|
|
11488
|
+
}
|
|
11489
|
+
async function refreshQoderModelsForMode(mode, context) {
|
|
11490
|
+
const providerID = getQoderRegionConfig(mode).providerID;
|
|
11491
|
+
if (context.allowNetwork && !context.signal.aborted) {
|
|
11492
|
+
const creds = resolveRefreshCredentials(context, providerID);
|
|
11493
|
+
if (creds?.access) {
|
|
11494
|
+
const region = getQoderRegionConfig(mode);
|
|
11495
|
+
await updateQoderModelsCache(
|
|
11496
|
+
creds.access,
|
|
11497
|
+
creds.userID || "qoder-user",
|
|
11498
|
+
creds.name || region.userNameFallback,
|
|
11499
|
+
creds.email || region.userEmailFallback,
|
|
11500
|
+
mode
|
|
11501
|
+
);
|
|
11502
|
+
}
|
|
11503
|
+
}
|
|
11504
|
+
return modelsForProvider(mode, providerID);
|
|
11505
|
+
}
|
|
11471
11506
|
function createQoderOAuth(mode) {
|
|
11472
11507
|
const region = getQoderRegionConfig(mode);
|
|
11473
11508
|
return {
|
|
@@ -11490,6 +11525,10 @@ function registerQoderProvider(pi, mode) {
|
|
|
11490
11525
|
baseUrl: getQoderBaseUrl(mode),
|
|
11491
11526
|
api: QODER_API,
|
|
11492
11527
|
models: modelsForProvider(mode, providerID),
|
|
11528
|
+
// Host-driven refresh (see refreshQoderModelsForMode): without this the
|
|
11529
|
+
// host's post-login refresh skips qoder entirely and the static fallback
|
|
11530
|
+
// list stays visible until the process restarts.
|
|
11531
|
+
refreshModels: (context) => refreshQoderModelsForMode(mode, context),
|
|
11493
11532
|
oauth,
|
|
11494
11533
|
// pi-coding-agent resolves its own nested @earendil-works/pi-ai copy, so the
|
|
11495
11534
|
// structurally identical Model/Context types are nominally distinct here.
|
|
@@ -11562,5 +11601,6 @@ async function index_default(pi) {
|
|
|
11562
11601
|
registerQoderCreditDisplay(pi);
|
|
11563
11602
|
}
|
|
11564
11603
|
export {
|
|
11565
|
-
index_default as default
|
|
11604
|
+
index_default as default,
|
|
11605
|
+
refreshQoderModelsForMode
|
|
11566
11606
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@herbertgao/pi-extensions",
|
|
3
|
-
"version": "2026.11.
|
|
3
|
+
"version": "2026.11.17",
|
|
4
4
|
"description": "Aggregate installer for HerbertGao-maintained Pi extensions.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"extensions",
|
|
@@ -39,12 +39,12 @@
|
|
|
39
39
|
"@ast-grep/cli": "0.51.1",
|
|
40
40
|
"@ast-grep/napi": "^0.51.0",
|
|
41
41
|
"@dietrichgebert/ponytail": "5.3.3",
|
|
42
|
-
"@herbertgao/pi-agency": "0.1.
|
|
42
|
+
"@herbertgao/pi-agency": "0.1.4",
|
|
43
43
|
"@herbertgao/pi-bark": "0.2.2",
|
|
44
|
-
"@herbertgao/pi-cc-extensions": "1.0.21-local.
|
|
45
|
-
"@herbertgao/pi-impeccable": "0.
|
|
44
|
+
"@herbertgao/pi-cc-extensions": "1.0.21-local.2",
|
|
45
|
+
"@herbertgao/pi-impeccable": "0.6.0",
|
|
46
46
|
"@herbertgao/pi-inline-skill-commands": "0.1.1",
|
|
47
|
-
"@herbertgao/pi-subagents": "0.26.1-local.
|
|
47
|
+
"@herbertgao/pi-subagents": "0.26.1-local.2",
|
|
48
48
|
"@herbertgao/sol-pi": "0.4.3",
|
|
49
49
|
"@juicesharp/rpiv-ask-user-question": "2.15.0",
|
|
50
50
|
"@juicesharp/rpiv-config": "^2.15.0",
|
|
@@ -73,21 +73,21 @@
|
|
|
73
73
|
"js-yaml": "^5.2.2",
|
|
74
74
|
"linkedom": "^0.16.0",
|
|
75
75
|
"minimatch": "^11.0.4",
|
|
76
|
-
"nanoid": "^5.
|
|
76
|
+
"nanoid": "^5.1.16",
|
|
77
77
|
"p-limit": "^6.1.0",
|
|
78
78
|
"pi-antigravity": "0.14.0",
|
|
79
79
|
"pi-commandcode-provider": "0.8.6",
|
|
80
80
|
"pi-lens": "4.5.1",
|
|
81
81
|
"pi-next-cue": "1.0.8",
|
|
82
|
-
"pi-provider-qoder": "0.6.
|
|
82
|
+
"pi-provider-qoder": "0.6.13",
|
|
83
83
|
"pi-typesafe": "0.14.0",
|
|
84
84
|
"pi-web-access": "0.48.0",
|
|
85
85
|
"pidusage": "^4.0.1",
|
|
86
86
|
"promise.try": "^2.0.1",
|
|
87
|
-
"turndown": "^7.2.
|
|
87
|
+
"turndown": "^7.2.4",
|
|
88
88
|
"turndown-plugin-gfm": "^1.0.2",
|
|
89
89
|
"unbash": "4.0.10",
|
|
90
|
-
"undici": "^8.
|
|
90
|
+
"undici": "^8.12.3",
|
|
91
91
|
"unpdf": "^1.6.2",
|
|
92
92
|
"vscode-jsonrpc": "^10.0.0",
|
|
93
93
|
"ws": "^8.21.0",
|