This website requires JavaScript.
0
Issues
Pull Requests
Milestones
Explore
0
Create…
New Repository
New Migration
New Organization
public
Signed in as
public
Profile
Starred
Subscriptions
Settings
Help
Sign Out
yws
/
lc-mcp
Watch
1
Star
0
Fork
0
Code
Issues
Pull Requests
Actions
Packages
Projects
Releases
Wiki
Activity
Files
lc-mcp
/
scripts
/
or
Cancel
Edit File
Preview
Preview Changes
Spaces
Tabs
2
4
8
Wrap
No wrap
// Only send a concise game-state description and explicit permitted choices. // Credentials are supplied in memory or OPENCODE_API_KEY, never stored here. export async function decide(state, criteria, options = {}) { const apiKey = options.apiKey ?? process.env.OPENCODE_API_KEY; if (!apiKey) throw new Error('OPENCODE_API_KEY is required'); if (typeof state !== 'string' || !state.trim()) throw new Error('State text is required'); if (!criteria || Object.keys(criteria).length < 2) throw new Error('At least two choices are required'); const started = performance.now(); const response = await fetch('https://opencode.ai/zen/v1/systemone', { method: 'POST', redirect: 'error', headers: { Authorization: `Bearer ${apiKey}`, 'Content-Type': 'application/json' }, signal: AbortSignal.timeout(options.timeoutMs ?? 7000), body: JSON.stringify({ model: options.model ?? 'jev-1.13-free', state, questions: { action: { type: 'choice', instructions: 'Choose the action that respects the stated user rules and completes the Limbus Company Mirror Dungeon fastest. Use only the supplied choices.', criteria, }, }, }), }); if (!response.ok) throw new Error(`Jev HTTP ${response.status}`); const body = await response.json(); const answer = body.answers?.action; if (answer?.type !== 'choice' || !Object.hasOwn(criteria, answer.choice)) { throw new Error('Jev returned an unsupported choice'); } return { choice: answer.choice, confidence: answer.confidence, probabilities: answer.probabilities, latencyMs: Math.round(performance.now() - started), model: body.model, }; }
Commit Changes
Add a Signed-off-by trailer by the committer at the end of the commit log message.
Commit directly to the
codex/local-wip-20261022
branch.
Create a
new branch
for this commit and start a pull request.
Commit Changes
Cancel