contracts: move Claude schemas out of core
Co-authored-by: codex <[email protected]>
This commit is contained in:
1 parent
8d9bc7c2cf
commit
0789b38663
3 files changed
-36
No files matched your search
@@ -13,11 +13,6 @@ export const CodexModelOptions = Schema.Struct({
|
||||
});
|
||||
export type CodexModelOptions = typeof CodexModelOptions.Type;
|
||||
|
||||
export const ClaudeCodeModelOptions = Schema.Struct({
|
||||
thinking: Schema.optional(Schema.Boolean),
|
||||
});
|
||||
export type ClaudeCodeModelOptions = typeof ClaudeCodeModelOptions.Type;
|
||||
|
||||
export const CursorModelOptions = Schema.Struct({
|
||||
reasoning: Schema.optional(Schema.Literals(CURSOR_REASONING_OPTIONS)),
|
||||
fastMode: Schema.optional(Schema.Boolean),
|
||||
@@ -27,7 +22,6 @@ export type CursorModelOptions = typeof CursorModelOptions.Type;
|
||||
|
||||
export const ProviderModelOptions = Schema.Struct({
|
||||
codex: Schema.optional(CodexModelOptions),
|
||||
claudeCode: Schema.optional(ClaudeCodeModelOptions),
|
||||
cursor: Schema.optional(CursorModelOptions),
|
||||
});
|
||||
export type ProviderModelOptions = typeof ProviderModelOptions.Type;
|
||||
|
||||
@@ -43,28 +43,6 @@ describe("ProviderSessionStartInput", () => {
|
||||
).toThrow();
|
||||
});
|
||||
|
||||
it("accepts claude runtime knobs", () => {
|
||||
const parsed = decodeProviderSessionStartInput({
|
||||
threadId: "thread-1",
|
||||
provider: "claudeCode",
|
||||
cwd: "/tmp/workspace",
|
||||
model: "claude-sonnet-4-6",
|
||||
providerOptions: {
|
||||
claudeCode: {
|
||||
binaryPath: "/usr/local/bin/claude",
|
||||
permissionMode: "plan",
|
||||
maxThinkingTokens: 12_000,
|
||||
},
|
||||
},
|
||||
runtimeMode: "full-access",
|
||||
});
|
||||
expect(parsed.provider).toBe("claudeCode");
|
||||
expect(parsed.providerOptions?.claudeCode?.binaryPath).toBe("/usr/local/bin/claude");
|
||||
expect(parsed.providerOptions?.claudeCode?.permissionMode).toBe("plan");
|
||||
expect(parsed.providerOptions?.claudeCode?.maxThinkingTokens).toBe(12_000);
|
||||
expect(parsed.runtimeMode).toBe("full-access");
|
||||
});
|
||||
|
||||
it("accepts cursor provider payloads", () => {
|
||||
const parsed = decodeProviderSessionStartInput({
|
||||
threadId: "thread-1",
|
||||
|
||||
@@ -5,7 +5,6 @@ import {
|
||||
ApprovalRequestId,
|
||||
EventId,
|
||||
IsoDateTime,
|
||||
NonNegativeInt,
|
||||
ProviderItemId,
|
||||
ThreadId,
|
||||
TurnId,
|
||||
@@ -51,19 +50,12 @@ const CodexProviderStartOptions = Schema.Struct({
|
||||
homePath: Schema.optional(TrimmedNonEmptyStringSchema),
|
||||
});
|
||||
|
||||
const ClaudeCodeProviderStartOptions = Schema.Struct({
|
||||
binaryPath: Schema.optional(TrimmedNonEmptyStringSchema),
|
||||
permissionMode: Schema.optional(TrimmedNonEmptyStringSchema),
|
||||
maxThinkingTokens: Schema.optional(NonNegativeInt),
|
||||
});
|
||||
|
||||
const CursorProviderStartOptions = Schema.Struct({
|
||||
binaryPath: Schema.optional(TrimmedNonEmptyStringSchema),
|
||||
});
|
||||
|
||||
const ProviderStartOptions = Schema.Struct({
|
||||
codex: Schema.optional(CodexProviderStartOptions),
|
||||
claudeCode: Schema.optional(ClaudeCodeProviderStartOptions),
|
||||
cursor: Schema.optional(CursorProviderStartOptions),
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user