dsh-github-copilot 0.4.0-alpha.85 → 0.4.0-alpha.87
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/AGENTS.md +8 -6
- package/CHANGELOG.md +12 -0
- package/README.md +9 -9
- package/README.zh.md +9 -9
- package/deployment-baseline.json +8 -5
- package/docs/auto-task-routing.md +15 -9
- package/docs/automatic-model-routing.md +3 -2
- package/docs/copilot-usage.md +8 -2
- package/lib/client.js.map +1 -1
- package/lib/index.js +6 -22
- package/lib/types/config.d.ts +1 -1
- package/lib/types/context-usage.d.ts +4 -0
- package/package.json +1 -1
- package/lib/types/context-usage-guard.d.ts +0 -10
package/lib/index.js
CHANGED
|
@@ -1646,27 +1646,11 @@ let GitHubCopilotUsageController = (() => {
|
|
|
1646
1646
|
};
|
|
1647
1647
|
})();
|
|
1648
1648
|
//#endregion
|
|
1649
|
-
//#region lib/types/context-usage
|
|
1649
|
+
//#region lib/types/context-usage.js
|
|
1650
1650
|
/** All observed counters are zero, not proof that an attempted prompt was empty. */
|
|
1651
1651
|
function isZeroContextUsage(usage) {
|
|
1652
1652
|
return usage.inputTokens === 0 && usage.outputTokens === 0 && (usage.cacheReadTokens ?? 0) === 0 && (usage.cacheWriteTokens ?? 0) === 0 && (usage.totalTokens ?? 0) === 0 && (usage.reasoningTokens ?? 0) === 0;
|
|
1653
1653
|
}
|
|
1654
|
-
/**
|
|
1655
|
-
* Native pi-ai emits terminal usage immediately before finish, including a
|
|
1656
|
-
* default zero sample when no provider usage arrived. Delay only that sample;
|
|
1657
|
-
* failed, cancelled or truncated attempts must not reset Core's last reading.
|
|
1658
|
-
*/
|
|
1659
|
-
async function* guardContextUsage(stream) {
|
|
1660
|
-
let pending;
|
|
1661
|
-
for await (const chunk of stream) {
|
|
1662
|
-
if (pending !== void 0) {
|
|
1663
|
-
if (chunk.type !== "finish" || chunk.reason.kind !== "error" && chunk.reason.kind !== "aborted") yield pending;
|
|
1664
|
-
pending = void 0;
|
|
1665
|
-
}
|
|
1666
|
-
if (chunk.type === "usage" && isZeroContextUsage(chunk.usage)) pending = chunk;
|
|
1667
|
-
else yield chunk;
|
|
1668
|
-
}
|
|
1669
|
-
}
|
|
1670
1654
|
//#endregion
|
|
1671
1655
|
//#region lib/types/context-evidence.js
|
|
1672
1656
|
const COPILOT_CONTEXT_EVIDENCE = "githubCopilotContextEvidence";
|
|
@@ -1847,7 +1831,7 @@ function installContextEvidence(ctx) {
|
|
|
1847
1831
|
//#endregion
|
|
1848
1832
|
//#region package.json
|
|
1849
1833
|
var name$1 = "dsh-github-copilot";
|
|
1850
|
-
var version = "0.4.0-alpha.
|
|
1834
|
+
var version = "0.4.0-alpha.87";
|
|
1851
1835
|
//#endregion
|
|
1852
1836
|
//#region lib/types/probe.js
|
|
1853
1837
|
/**
|
|
@@ -2214,7 +2198,7 @@ const Config = z.object({
|
|
|
2214
2198
|
accountModelFailureCooldownMs: z.number().step(1).min(0).max(MAX_TIMEOUT_MS).default(3e5),
|
|
2215
2199
|
excludedModelIds: z.array(z.string()).default([]).hidden().volatile(),
|
|
2216
2200
|
followParentModel: z.boolean().default(false).volatile(),
|
|
2217
|
-
autoSemanticAssessment: z.boolean().default(
|
|
2201
|
+
autoSemanticAssessment: z.boolean().default(true),
|
|
2218
2202
|
parentModelFollow: z.array(z.object({
|
|
2219
2203
|
childSessionId: z.string().min(1),
|
|
2220
2204
|
parentSessionId: z.string().min(1)
|
|
@@ -8478,7 +8462,7 @@ var PreviewAdapter = class extends PiAiAdapter {
|
|
|
8478
8462
|
}
|
|
8479
8463
|
guardedStream(lease, options) {
|
|
8480
8464
|
const owner = this;
|
|
8481
|
-
return
|
|
8465
|
+
return (async function* () {
|
|
8482
8466
|
owner.lifetime.start(lease);
|
|
8483
8467
|
owned(options.provider);
|
|
8484
8468
|
if (options.model !== lease.descriptor.id) throw failure("COPILOT_PREVIEW_MODEL_MISMATCH");
|
|
@@ -8578,7 +8562,7 @@ var PreviewAdapter = class extends PiAiAdapter {
|
|
|
8578
8562
|
if (cause instanceof LlmError && cause.code === "UNKNOWN_MODEL") await owner.refreshRejected(lease.snapshot, signal);
|
|
8579
8563
|
throw requestFailure ?? cause;
|
|
8580
8564
|
}
|
|
8581
|
-
})()
|
|
8565
|
+
})();
|
|
8582
8566
|
}
|
|
8583
8567
|
excludedModels() {
|
|
8584
8568
|
return excludedModelSet(this.accountModelSettings().excludedModelIds);
|
|
@@ -8857,7 +8841,7 @@ function apply$1(ctx, config = {}) {
|
|
|
8857
8841
|
budgetPolicy: () => budgetSettings(),
|
|
8858
8842
|
parentModelBindings: () => cacheSettings().parentModelFollow ?? [],
|
|
8859
8843
|
followParentModel: () => cacheSettings().followParentModel === true,
|
|
8860
|
-
semanticAssessment: () => cacheSettings().autoSemanticAssessment
|
|
8844
|
+
semanticAssessment: () => cacheSettings().autoSemanticAssessment ?? true,
|
|
8861
8845
|
assessmentDiagnostic: (code) => ctx.logger.warn(code),
|
|
8862
8846
|
async classifyTask(input, signal) {
|
|
8863
8847
|
const snapshot = await discoverSnapshot({ signal });
|
package/lib/types/config.d.ts
CHANGED
|
@@ -43,7 +43,7 @@ export interface InlineConfig {
|
|
|
43
43
|
parentModelFollow?: ParentModelBinding[];
|
|
44
44
|
/** Profile-wide next-turn policy for supported native children. */
|
|
45
45
|
followParentModel?: boolean;
|
|
46
|
-
/**
|
|
46
|
+
/** Default-on bounded task assessment; explicit false opts out of auxiliary inference. */
|
|
47
47
|
autoSemanticAssessment?: boolean;
|
|
48
48
|
/** Estimated managed-route input headroom, separate from truthful catalog capacities. */
|
|
49
49
|
requestBudgetSafetyTokens?: number;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-github-copilot",
|
|
3
3
|
"description": "DSH companion for GitHub Copilot sign-in, account-aware model profiles, tool compatibility, and provider-hosted search.",
|
|
4
|
-
"version": "0.4.0-alpha.
|
|
4
|
+
"version": "0.4.0-alpha.87",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public",
|
|
7
7
|
"registry": "https://registry.npmjs.org/",
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { StreamChunk, TokenUsage } from '@deepseek-ai/dsh-llm';
|
|
2
|
-
/** All observed counters are zero, not proof that an attempted prompt was empty. */
|
|
3
|
-
export declare function isZeroContextUsage(usage: TokenUsage): boolean;
|
|
4
|
-
/**
|
|
5
|
-
* Native pi-ai emits terminal usage immediately before finish, including a
|
|
6
|
-
* default zero sample when no provider usage arrived. Delay only that sample;
|
|
7
|
-
* failed, cancelled or truncated attempts must not reset Core's last reading.
|
|
8
|
-
*/
|
|
9
|
-
export declare function guardContextUsage(stream: AsyncIterable<StreamChunk>): AsyncGenerator<StreamChunk>;
|
|
10
|
-
//# sourceMappingURL=context-usage-guard.d.ts.map
|