@slopus/rig 0.0.3 → 0.0.4
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/agent/selectSystemPromptForModel.js +1 -1
- package/dist/app/createCodingAssistantAgent.js +2 -2
- package/dist/app/describeReasoningLevel.d.ts.map +1 -1
- package/dist/app/describeReasoningLevel.js +1 -0
- package/dist/app/humanizeReasoningLevel.d.ts.map +1 -1
- package/dist/app/humanizeReasoningLevel.js +3 -0
- package/dist/providers/codex.d.ts.map +1 -1
- package/dist/providers/codex.js +52 -6
- package/dist/providers/models.d.ts +3 -0
- package/dist/providers/models.d.ts.map +1 -1
- package/dist/providers/models.js +18 -0
- package/dist/server/createModelCatalog.js +2 -2
- package/package.json +1 -1
|
@@ -24,7 +24,7 @@ export function selectSystemPromptForModel(provider, model) {
|
|
|
24
24
|
providerId.includes("openai") ||
|
|
25
25
|
modelId.includes("openai/") ||
|
|
26
26
|
modelName.includes("gpt")) {
|
|
27
|
-
if (modelIdentity.includes("gpt-5.5")) {
|
|
27
|
+
if (modelIdentity.includes("gpt-5.6") || modelIdentity.includes("gpt-5.5")) {
|
|
28
28
|
return GPT_5_5_SYSTEM_PROMPT;
|
|
29
29
|
}
|
|
30
30
|
if (modelIdentity.includes("gpt-5.4")) {
|
|
@@ -4,7 +4,7 @@ import { createBedrockProvider } from "../providers/bedrock.js";
|
|
|
4
4
|
import { createClaudeSdkProvider } from "../providers/claude-sdk.js";
|
|
5
5
|
import { createCodexProvider } from "../providers/codex.js";
|
|
6
6
|
import { getBedrockModelRoute } from "../providers/getBedrockModelRoute.js";
|
|
7
|
-
import {
|
|
7
|
+
import { modelOpenaiGpt56Sol } from "../providers/models.js";
|
|
8
8
|
import { claudeCodeTools } from "../tools/claude/index.js";
|
|
9
9
|
import { codexTools } from "../tools/codex/index.js";
|
|
10
10
|
import { piTools } from "../tools/pi/index.js";
|
|
@@ -19,7 +19,7 @@ export function createCodingAssistantAgent(options) {
|
|
|
19
19
|
if (options.subagents !== undefined) {
|
|
20
20
|
context.subagents = options.subagents;
|
|
21
21
|
}
|
|
22
|
-
const modelId = options.modelId ??
|
|
22
|
+
const modelId = options.modelId ?? modelOpenaiGpt56Sol.id;
|
|
23
23
|
const providerId = options.providerId ??
|
|
24
24
|
(modelId.startsWith("anthropic/")
|
|
25
25
|
? "claude-sdk"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"describeReasoningLevel.d.ts","sourceRoot":"","sources":["../../sources/app/describeReasoningLevel.ts"],"names":[],"mappings":"AAEA,wBAAgB,sBAAsB,CAClC,KAAK,EAAE,MAAM,EACb,OAAO,EAAE;IAAE,SAAS,EAAE,OAAO,CAAC;IAAC,SAAS,EAAE,OAAO,CAAA;CAAE,GACpD,MAAM,
|
|
1
|
+
{"version":3,"file":"describeReasoningLevel.d.ts","sourceRoot":"","sources":["../../sources/app/describeReasoningLevel.ts"],"names":[],"mappings":"AAEA,wBAAgB,sBAAsB,CAClC,KAAK,EAAE,MAAM,EACb,OAAO,EAAE;IAAE,SAAS,EAAE,OAAO,CAAC;IAAC,SAAS,EAAE,OAAO,CAAA;CAAE,GACpD,MAAM,CAqBR"}
|
|
@@ -9,6 +9,7 @@ export function describeReasoningLevel(level, options) {
|
|
|
9
9
|
high: "Spend more time on harder changes.",
|
|
10
10
|
xhigh: "Think deeply through complex work.",
|
|
11
11
|
max: "Use the largest reasoning budget available.",
|
|
12
|
+
ultra: "Use maximum reasoning with task delegation.",
|
|
12
13
|
};
|
|
13
14
|
const parts = [descriptions[level] ?? `Use ${humanizeReasoningLevel(level)} reasoning.`];
|
|
14
15
|
if (options.isCurrent) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"humanizeReasoningLevel.d.ts","sourceRoot":"","sources":["../../sources/app/humanizeReasoningLevel.ts"],"names":[],"mappings":"AAAA,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"humanizeReasoningLevel.d.ts","sourceRoot":"","sources":["../../sources/app/humanizeReasoningLevel.ts"],"names":[],"mappings":"AAAA,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CA+B5D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codex.d.ts","sourceRoot":"","sources":["../../sources/providers/codex.ts"],"names":[],"mappings":"AAIA,OAAO,
|
|
1
|
+
{"version":3,"file":"codex.d.ts","sourceRoot":"","sources":["../../sources/providers/codex.ts"],"names":[],"mappings":"AAIA,OAAO,EAIH,KAAK,mBAAmB,EAC3B,MAAM,qBAAqB,CAAC;AAiB7B,OAAO,EAA8B,KAAK,QAAQ,EAAsB,MAAM,YAAY,CAAC;AAQ3F,MAAM,WAAW,oBAAoB;IACjC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,aAAa,CAAC,EAAE,MAAM,MAAM,GAAG,SAAS,CAAC;IACzC,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,mBAAmB,CAAC,WAAW,CAAC,CAAC;CAChD;AAWD,wBAAgB,mBAAmB,CAAC,OAAO,GAAE,oBAAyB,GAAG,QAAQ,CAmChF;AA2GD,MAAM,MAAM,aAAa,GAAG,UAAU,CAAC,OAAO,mBAAmB,CAAC,CAAC"}
|
package/dist/providers/codex.js
CHANGED
|
@@ -2,29 +2,43 @@ import { existsSync, readFileSync } from "node:fs";
|
|
|
2
2
|
import { homedir } from "node:os";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { clampThinkingLevel, getModels, } from "@mariozechner/pi-ai";
|
|
5
|
-
import {
|
|
5
|
+
import { streamOpenAICodexResponses, } from "@mariozechner/pi-ai/openai-codex-responses";
|
|
6
6
|
import { applyCodexImageDetailsToPayload } from "./applyCodexImageDetailsToPayload.js";
|
|
7
7
|
import { classifyCodexErrorCode } from "./classifyCodexErrorCode.js";
|
|
8
8
|
import { collectImageDetails } from "./collectImageDetails.js";
|
|
9
|
-
import { modelOpenaiGpt54, modelOpenaiGpt55 } from "./models.js";
|
|
9
|
+
import { modelOpenaiGpt54, modelOpenaiGpt55, modelOpenaiGpt56Luna, modelOpenaiGpt56Sol, modelOpenaiGpt56Terra, } from "./models.js";
|
|
10
10
|
import { toPiContext, wrapPiStream } from "./pi-bridge.js";
|
|
11
11
|
import { defineProvider } from "./types.js";
|
|
12
12
|
const CODEX_PROVIDER_ID = "openai-codex";
|
|
13
13
|
function toPiCodexModelId(id) {
|
|
14
14
|
return id.startsWith("openai/") ? id.slice("openai/".length) : id;
|
|
15
15
|
}
|
|
16
|
+
const codexModels = [
|
|
17
|
+
modelOpenaiGpt56Sol,
|
|
18
|
+
modelOpenaiGpt56Terra,
|
|
19
|
+
modelOpenaiGpt56Luna,
|
|
20
|
+
modelOpenaiGpt55,
|
|
21
|
+
modelOpenaiGpt54,
|
|
22
|
+
];
|
|
23
|
+
const codexThinkingLevels = ["minimal", "low", "medium", "high", "xhigh", "max", "ultra"];
|
|
16
24
|
export function createCodexProvider(options = {}) {
|
|
17
25
|
const piModelById = new Map(getModels(CODEX_PROVIDER_ID).map((model) => [model.id, model]));
|
|
26
|
+
for (const model of codexModels) {
|
|
27
|
+
const piModelId = toPiCodexModelId(model.id);
|
|
28
|
+
if (!piModelById.has(piModelId)) {
|
|
29
|
+
piModelById.set(piModelId, createPiCodexModel(model));
|
|
30
|
+
}
|
|
31
|
+
}
|
|
18
32
|
const resolveApiKey = buildApiKeyResolver(options);
|
|
19
33
|
return defineProvider({
|
|
20
34
|
id: "codex",
|
|
21
|
-
models:
|
|
35
|
+
models: codexModels,
|
|
22
36
|
stream(model, context, streamOptions) {
|
|
23
37
|
const piModel = piModelById.get(toPiCodexModelId(model.id));
|
|
24
38
|
if (!piModel) {
|
|
25
39
|
throw new Error(`Unknown codex model: ${model.id}`);
|
|
26
40
|
}
|
|
27
|
-
return wrapPiStream(
|
|
41
|
+
return wrapPiStream(streamOpenAICodexResponses(piModel, toPiContext(context), toPiStreamOptions(piModel, streamOptions, resolveApiKey(), options.transport, collectImageDetails(context))), { classifyError: classifyCodexErrorCode });
|
|
28
42
|
},
|
|
29
43
|
});
|
|
30
44
|
}
|
|
@@ -54,6 +68,29 @@ function readLocalCodexAccessToken(authPath) {
|
|
|
54
68
|
return undefined;
|
|
55
69
|
}
|
|
56
70
|
}
|
|
71
|
+
function createPiCodexModel(model) {
|
|
72
|
+
return {
|
|
73
|
+
id: toPiCodexModelId(model.id),
|
|
74
|
+
name: model.name,
|
|
75
|
+
api: "openai-codex-responses",
|
|
76
|
+
provider: CODEX_PROVIDER_ID,
|
|
77
|
+
baseUrl: "https://chatgpt.com/backend-api",
|
|
78
|
+
reasoning: true,
|
|
79
|
+
thinkingLevelMap: Object.fromEntries(codexThinkingLevels.map((level) => [
|
|
80
|
+
level,
|
|
81
|
+
model.thinkingLevels.includes(level) ? level : null,
|
|
82
|
+
])),
|
|
83
|
+
input: ["text", "image"],
|
|
84
|
+
cost: {
|
|
85
|
+
input: 5,
|
|
86
|
+
output: 30,
|
|
87
|
+
cacheRead: 0.5,
|
|
88
|
+
cacheWrite: 0,
|
|
89
|
+
},
|
|
90
|
+
contextWindow: 372000,
|
|
91
|
+
maxTokens: 128000,
|
|
92
|
+
};
|
|
93
|
+
}
|
|
57
94
|
function toPiStreamOptions(piModel, options, apiKey, transport, imageDetails) {
|
|
58
95
|
const piOptions = {
|
|
59
96
|
...(options?.signal !== undefined ? { signal: options.signal } : {}),
|
|
@@ -67,10 +104,19 @@ function toPiStreamOptions(piModel, options, apiKey, transport, imageDetails) {
|
|
|
67
104
|
: {}),
|
|
68
105
|
};
|
|
69
106
|
if (options?.thinking !== undefined && options.thinking !== "off") {
|
|
70
|
-
const level =
|
|
107
|
+
const level = isKnownPiThinkingLevel(options.thinking)
|
|
108
|
+
? clampThinkingLevel(piModel, options.thinking)
|
|
109
|
+
: options.thinking;
|
|
71
110
|
if (level !== "off") {
|
|
72
|
-
piOptions.
|
|
111
|
+
piOptions.reasoningEffort = level;
|
|
73
112
|
}
|
|
74
113
|
}
|
|
75
114
|
return piOptions;
|
|
76
115
|
}
|
|
116
|
+
function isKnownPiThinkingLevel(level) {
|
|
117
|
+
return (level === "minimal" ||
|
|
118
|
+
level === "low" ||
|
|
119
|
+
level === "medium" ||
|
|
120
|
+
level === "high" ||
|
|
121
|
+
level === "xhigh");
|
|
122
|
+
}
|
|
@@ -12,6 +12,9 @@ export declare const modelAnthropicSonnet461m: import("./types.js").Model<"high"
|
|
|
12
12
|
export declare const modelAnthropicSonnet46: import("./types.js").Model<"high" | "off" | "low" | "medium" | "max">;
|
|
13
13
|
export declare const modelAnthropicHaiku45: import("./types.js").Model<"off">;
|
|
14
14
|
export declare const modelOpenaiGpt55: import("./types.js").Model<"high" | "off" | "low" | "medium" | "xhigh" | "minimal">;
|
|
15
|
+
export declare const modelOpenaiGpt56Sol: import("./types.js").Model<"high" | "off" | "low" | "medium" | "xhigh" | "max" | "ultra">;
|
|
16
|
+
export declare const modelOpenaiGpt56Terra: import("./types.js").Model<"high" | "off" | "low" | "medium" | "xhigh" | "max" | "ultra">;
|
|
17
|
+
export declare const modelOpenaiGpt56Luna: import("./types.js").Model<"high" | "off" | "low" | "medium" | "xhigh" | "max">;
|
|
15
18
|
export declare const modelOpenaiGpt54: import("./types.js").Model<"high" | "off" | "low" | "medium" | "xhigh" | "minimal">;
|
|
16
19
|
export declare const modelMoonshotKimiK25: import("./types.js").Model<"on" | "off">;
|
|
17
20
|
export declare const modelMoonshotKimiK2Thinking: import("./types.js").Model<"on">;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../sources/providers/models.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,eAAO,MAAM,oBAAoB,iFAK/B,CAAC;AAEH,eAAO,MAAM,oBAAoB,iFAK/B,CAAC;AAEH,eAAO,MAAM,oBAAoB,i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,oDAKvB,CAAC;AAEH,eAAO,MAAM,aAAa,0CAKxB,CAAC;AAEH,eAAO,MAAM,kBAAkB,0CAK7B,CAAC"}
|
package/dist/providers/models.js
CHANGED
|
@@ -58,6 +58,24 @@ export const modelOpenaiGpt55 = defineModel({
|
|
|
58
58
|
thinkingLevels: ["off", "minimal", "low", "medium", "high", "xhigh"],
|
|
59
59
|
defaultThinkingLevel: "medium",
|
|
60
60
|
});
|
|
61
|
+
export const modelOpenaiGpt56Sol = defineModel({
|
|
62
|
+
id: "openai/gpt-5.6-sol",
|
|
63
|
+
name: "GPT-5.6 Sol",
|
|
64
|
+
thinkingLevels: ["off", "low", "medium", "high", "xhigh", "max", "ultra"],
|
|
65
|
+
defaultThinkingLevel: "low",
|
|
66
|
+
});
|
|
67
|
+
export const modelOpenaiGpt56Terra = defineModel({
|
|
68
|
+
id: "openai/gpt-5.6-terra",
|
|
69
|
+
name: "GPT-5.6 Terra",
|
|
70
|
+
thinkingLevels: ["off", "low", "medium", "high", "xhigh", "max", "ultra"],
|
|
71
|
+
defaultThinkingLevel: "medium",
|
|
72
|
+
});
|
|
73
|
+
export const modelOpenaiGpt56Luna = defineModel({
|
|
74
|
+
id: "openai/gpt-5.6-luna",
|
|
75
|
+
name: "GPT-5.6 Luna",
|
|
76
|
+
thinkingLevels: ["off", "low", "medium", "high", "xhigh", "max"],
|
|
77
|
+
defaultThinkingLevel: "medium",
|
|
78
|
+
});
|
|
61
79
|
export const modelOpenaiGpt54 = defineModel({
|
|
62
80
|
id: "openai/gpt-5.4",
|
|
63
81
|
name: "GPT-5.4",
|
|
@@ -3,7 +3,7 @@ import { NativeProxessManager } from "../processes/index.js";
|
|
|
3
3
|
import { createBedrockProvider } from "../providers/bedrock.js";
|
|
4
4
|
import { createClaudeSdkProvider } from "../providers/claude-sdk.js";
|
|
5
5
|
import { createCodexProvider } from "../providers/codex.js";
|
|
6
|
-
import {
|
|
6
|
+
import { modelOpenaiGpt56Sol } from "../providers/models.js";
|
|
7
7
|
import { readBedrockBearerToken } from "../providers/readBedrockBearerToken.js";
|
|
8
8
|
import { claudeCodeTools } from "../tools/claude/index.js";
|
|
9
9
|
import { uniqueModelsById } from "./uniqueModelsById.js";
|
|
@@ -29,7 +29,7 @@ export function createModelCatalog(options = {}) {
|
|
|
29
29
|
}));
|
|
30
30
|
}
|
|
31
31
|
return {
|
|
32
|
-
defaultModelId:
|
|
32
|
+
defaultModelId: modelOpenaiGpt56Sol.id,
|
|
33
33
|
defaultProviderId: "codex",
|
|
34
34
|
models: uniqueModelsById(providers.flatMap((provider) => provider.models)),
|
|
35
35
|
providers: providers.map((provider) => ({
|