@nick3/copilot-api 1.6.9 → 1.7.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/main.js +1 -1
- package/dist/{server-BhOhCgni.js → server-D4_KW4V9.js} +11 -4
- package/dist/server-D4_KW4V9.js.map +1 -0
- package/dist/{start-DRl19gqI.js → start-C45MX44a.js} +2 -2
- package/dist/{start-DRl19gqI.js.map → start-C45MX44a.js.map} +1 -1
- package/package.json +1 -1
- package/dist/server-BhOhCgni.js.map +0 -1
package/dist/main.js
CHANGED
|
@@ -23,7 +23,7 @@ if (typeof args["enterprise-url"] === "string") process.env.COPILOT_API_ENTERPRI
|
|
|
23
23
|
const { auth } = await import("./auth-xiepl3lk.js");
|
|
24
24
|
const { checkUsage } = await import("./check-usage-3sFXqP0F.js");
|
|
25
25
|
const { debug } = await import("./debug-BJfZVBB7.js");
|
|
26
|
-
const { start } = await import("./start-
|
|
26
|
+
const { start } = await import("./start-C45MX44a.js");
|
|
27
27
|
await runMain(defineCommand({
|
|
28
28
|
meta: {
|
|
29
29
|
name: "copilot-api",
|
|
@@ -675,11 +675,18 @@ const getTokenCount = async (payload, model) => {
|
|
|
675
675
|
const COMPACT_REQUEST = 1;
|
|
676
676
|
const COMPACT_AUTO_CONTINUE = 2;
|
|
677
677
|
const compactSystemPromptStart = "You are a helpful AI assistant tasked with summarizing conversations";
|
|
678
|
+
const compactOpenCodeSystemPromptStart = "You are an anchored context summarization assistant for coding sessions.";
|
|
679
|
+
const compactSystemPromptStarts = [compactSystemPromptStart, compactOpenCodeSystemPromptStart];
|
|
678
680
|
const compactTextOnlyGuard = "CRITICAL: Respond with TEXT ONLY. Do NOT call any tools.";
|
|
679
681
|
const compactSummaryPromptStart = "Your task is to create a detailed summary of the conversation so far";
|
|
680
682
|
const compactAutoContinueClaudeCodePromptStart = "This session is being continued from a previous conversation that ran out of context. The summary below covers the earlier portion of the conversation.";
|
|
681
683
|
const compactAutoContinueOpenCodePromptStart = "Continue if you have next steps, or stop and ask for clarification if you are unsure how to proceed.";
|
|
682
|
-
const
|
|
684
|
+
const compactAutoContinueOpenCodePromptStart2 = "The previous request exceeded the provider's size limit due to large media attachments. The conversation was compacted and media files were removed from context.";
|
|
685
|
+
const compactAutoContinuePromptStarts = [
|
|
686
|
+
compactAutoContinueClaudeCodePromptStart,
|
|
687
|
+
compactAutoContinueOpenCodePromptStart,
|
|
688
|
+
compactAutoContinueOpenCodePromptStart2
|
|
689
|
+
];
|
|
683
690
|
const compactMessageSections = ["Pending Tasks:", "Current Work:"];
|
|
684
691
|
|
|
685
692
|
//#endregion
|
|
@@ -708,9 +715,9 @@ const getCompactType = (anthropicPayload) => {
|
|
|
708
715
|
if (lastMessage && isCompactMessage(lastMessage)) return COMPACT_REQUEST;
|
|
709
716
|
if (lastMessage && isCompactAutoContinueMessage(lastMessage)) return COMPACT_AUTO_CONTINUE;
|
|
710
717
|
const system = anthropicPayload.system;
|
|
711
|
-
if (typeof system === "string") return system.startsWith(
|
|
718
|
+
if (typeof system === "string") return compactSystemPromptStarts.some((promptStart) => system.startsWith(promptStart)) ? COMPACT_REQUEST : 0;
|
|
712
719
|
if (!Array.isArray(system)) return 0;
|
|
713
|
-
if (system.some((msg) => typeof msg.text === "string" && msg.text.startsWith(
|
|
720
|
+
if (system.some((msg) => typeof msg.text === "string" && compactSystemPromptStarts.some((promptStart) => msg.text.startsWith(promptStart)))) return COMPACT_REQUEST;
|
|
714
721
|
return 0;
|
|
715
722
|
};
|
|
716
723
|
const mergeContentWithText = (tr, textBlock) => {
|
|
@@ -7534,4 +7541,4 @@ server.route("/:provider/v1/models", providerModelRoutes);
|
|
|
7534
7541
|
|
|
7535
7542
|
//#endregion
|
|
7536
7543
|
export { server };
|
|
7537
|
-
//# sourceMappingURL=server-
|
|
7544
|
+
//# sourceMappingURL=server-D4_KW4V9.js.map
|