@cjhyy/code-shell 0.1.0-alpha.1 → 0.1.0-alpha.2
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/README.md +8 -0
- package/dist/anthropic-P5VETAFI.cjs +10 -0
- package/dist/{anthropic-NENYS535.js → anthropic-W2GU3D76.js} +3 -2
- package/dist/arena/context/context-tools.d.ts +1 -1
- package/dist/arena/index.cjs +4 -4
- package/dist/arena/index.js +3 -3
- package/dist/arena/providers/index.d.ts +19 -3
- package/dist/arena/strategies/utils.d.ts +6 -1
- package/dist/arena/types.d.ts +10 -1
- package/dist/{arena-46QQ6BZQ.js → arena-ENHBHB2W.js} +5 -7
- package/dist/{arena-HZZZ2GJH.cjs → arena-HHDYYVHJ.cjs} +19 -21
- package/dist/{chunk-BE6IPRDM.js → chunk-2EUAE7AY.js} +1 -1
- package/dist/{chunk-WYKNZ54E.cjs → chunk-3CAZIWUA.cjs} +6 -6
- package/dist/{chunk-J5XW6UYL.js → chunk-5C5HIOML.js} +63 -4
- package/dist/chunk-75E4BBFC.js +224 -0
- package/dist/{chunk-ZJV3YSY3.cjs → chunk-BUJ5KYCI.cjs} +53 -11
- package/dist/{chunk-BMH65OVB.cjs → chunk-C7C7ZZY4.cjs} +8 -8
- package/dist/{chunk-KO2FPF7G.js → chunk-F5BS3GUC.js} +20 -2
- package/dist/chunk-FA5KD34T.js +54 -0
- package/dist/chunk-FV2ARONZ.cjs +224 -0
- package/dist/chunk-G76E5FOB.cjs +54 -0
- package/dist/{chunk-DICG4AB7.cjs → chunk-GZBD6QRS.cjs} +42 -3
- package/dist/{chunk-FVP7XJGS.cjs → chunk-HOXQLX5R.cjs} +406 -196
- package/dist/{chunk-4PKZPFCD.js → chunk-I57ZD5IQ.js} +47 -14
- package/dist/{chunk-JUHRV2XF.js → chunk-ID6EJUHP.js} +1703 -438
- package/dist/chunk-JHNCK7JP.cjs +202 -0
- package/dist/{chunk-MOILS4WE.cjs → chunk-JHXNOB5G.cjs} +3 -3
- package/dist/{chunk-UK2SU23S.cjs → chunk-KOGV6PDQ.cjs} +20 -2
- package/dist/{chunk-VKGNCYRL.js → chunk-LMEKCQX4.js} +95 -13
- package/dist/{chunk-3EAEC566.cjs → chunk-M2QI5X3X.cjs} +51 -18
- package/dist/{chunk-YZ25SSWJ.js → chunk-M2SVOKC6.js} +46 -4
- package/dist/chunk-OMRGA6TI.js +4753 -0
- package/dist/{chunk-NG73UR3L.cjs → chunk-OP57WUWQ.cjs} +23 -1
- package/dist/{chunk-ZXYDDJEJ.js → chunk-OUC2DFA7.js} +2 -2
- package/dist/{chunk-AP5F6VYE.js → chunk-REFCCVDM.js} +1 -1
- package/dist/{chunk-O6F2EF2Z.js → chunk-SCDKLTN3.js} +41 -2
- package/dist/{chunk-FECTK5KJ.js → chunk-SW3L7HIM.js} +1 -1
- package/dist/chunk-TATCTZSB.cjs +4753 -0
- package/dist/{chunk-Q6BYFYGD.cjs → chunk-VWFET3MG.cjs} +1886 -621
- package/dist/{chunk-3EUDE77E.cjs → chunk-X2DNIMPC.cjs} +19 -19
- package/dist/{chunk-SQZHPD3S.js → chunk-Y7TSCDF6.js} +297 -87
- package/dist/{chunk-WHRTARDJ.cjs → chunk-YAFCN7ZW.cjs} +112 -30
- package/dist/{chunk-LRAY5IYC.cjs → chunk-YD7XTI7T.cjs} +65 -6
- package/dist/{chunk-S74VVJBF.js → chunk-ZLPJJZUW.js} +23 -1
- package/dist/chunk-ZRVPCXI7.js +202 -0
- package/dist/cli/commands/builtin/advanced-commands.d.ts +1 -1
- package/dist/cli/commands/builtin/extra-commands.d.ts +2 -2
- package/dist/cli/commands/builtin/more-commands.d.ts +1 -3
- package/dist/cli/commands/registry.d.ts +8 -0
- package/dist/cli/cost-tracker.d.ts +6 -0
- package/dist/cli/main.cjs +3534 -1996
- package/dist/cli/main.js +3646 -2108
- package/dist/cli/onboarding.d.ts +67 -14
- package/dist/client-base-TOVE25FA.js +9 -0
- package/dist/client-base-VDDIADAC.cjs +9 -0
- package/dist/compaction-D3KV2NWY.cjs +31 -0
- package/dist/{compaction-CCHWA4G6.js → compaction-YNWCEF7B.js} +1 -2
- package/dist/context/manager.d.ts +9 -0
- package/dist/data/openrouter-models.d.ts +35 -0
- package/dist/data/openrouter-sync.d.ts +16 -0
- package/dist/{devtools-KIY3LWQJ.js → devtools-IRQQPIRY.js} +1 -1
- package/dist/{devtools-LRP47DDV.cjs → devtools-WTC3NFNE.cjs} +1 -1
- package/dist/engine/engine.d.ts +29 -6
- package/dist/engine/turn-loop.d.ts +7 -0
- package/dist/engine/turn-state.d.ts +6 -0
- package/dist/index.cjs +19 -28
- package/dist/index.js +28 -37
- package/dist/llm/client-base.d.ts +7 -0
- package/dist/llm/model-pool.d.ts +4 -0
- package/dist/logging/logger.d.ts +69 -8
- package/dist/manager-FWLOVEEK.cjs +7 -0
- package/dist/manager-GEXJLOIS.js +7 -0
- package/dist/{mcp-manager-OKXHHWYR.js → mcp-manager-37GQLFGX.js} +2 -2
- package/dist/mcp-manager-U77NEXBY.cjs +8 -0
- package/dist/memory-ADGOWADP.cjs +9 -0
- package/dist/memory-EPFDBPII.js +9 -0
- package/dist/native-ts/yoga-layout/index.d.ts +2 -2
- package/dist/{openai-5HQGBL4L.js → openai-RXU5URYI.js} +3 -2
- package/dist/openai-SQW4H2K4.cjs +10 -0
- package/dist/openrouter-models-OL725CL6.js +15 -0
- package/dist/openrouter-models-UM3AOGZ4.cjs +15 -0
- package/dist/openrouter-sync-CWD5VNW2.js +11 -0
- package/dist/openrouter-sync-HYZZC6RX.cjs +11 -0
- package/dist/product/index.cjs +12 -16
- package/dist/product/index.js +11 -15
- package/dist/protocol/types.d.ts +11 -3
- package/dist/{ink → render}/hooks/use-input.d.ts +1 -1
- package/dist/run/index.cjs +12 -16
- package/dist/run/index.js +11 -15
- package/dist/session/memory.d.ts +23 -3
- package/dist/session/session-manager.d.ts +4 -1
- package/dist/{session-manager-UQKB564H.cjs → session-manager-HRSKENKB.cjs} +2 -2
- package/dist/{session-manager-JIIBCFTC.js → session-manager-NEKFEHF3.js} +1 -1
- package/dist/settings/manager.d.ts +9 -0
- package/dist/settings/schema.d.ts +48 -39
- package/dist/{tool-summary-J2ICNMWP.js → tool-summary-2RUFL5QK.js} +1 -1
- package/dist/{tool-summary-5P2GKRA4.cjs → tool-summary-RYNR4DDB.cjs} +2 -2
- package/dist/tool-system/builtin/agent.d.ts +3 -26
- package/dist/tool-system/builtin/apply-patch/applier.d.ts +26 -0
- package/dist/tool-system/builtin/apply-patch/index.d.ts +19 -0
- package/dist/tool-system/builtin/apply-patch/parser.d.ts +17 -0
- package/dist/tool-system/builtin/apply-patch/seek-sequence.d.ts +18 -0
- package/dist/tool-system/builtin/apply-patch/types.d.ts +49 -0
- package/dist/tool-system/builtin/arena.d.ts +18 -5
- package/dist/tool-system/builtin/ask-user.d.ts +6 -6
- package/dist/tool-system/builtin/index.d.ts +11 -1
- package/dist/tool-system/builtin/tool-search.d.ts +2 -3
- package/dist/tool-system/context.d.ts +74 -0
- package/dist/tool-system/executor.d.ts +16 -0
- package/dist/tool-system/permission.d.ts +40 -5
- package/dist/tool-system/registry.d.ts +2 -0
- package/dist/types.d.ts +28 -1
- package/dist/ui/App.d.ts +1 -1
- package/dist/ui/components/AgentBlock.d.ts +1 -1
- package/dist/ui/components/AskUserPrompt.d.ts +7 -0
- package/dist/ui/components/MessageContent.d.ts +7 -3
- package/dist/ui/components/ModelManager.d.ts +35 -0
- package/dist/ui/components/ModelSelector.d.ts +10 -0
- package/dist/ui/components/OnboardingPrompt.d.ts +7 -0
- package/dist/ui/components/PermissionPrompt.d.ts +5 -2
- package/dist/ui/components/SessionPicker.d.ts +14 -0
- package/dist/ui/components/StatusLine.d.ts +4 -2
- package/dist/ui/components/ThemedBox.d.ts +1 -1
- package/dist/ui/components/ToolCall.d.ts +8 -1
- package/dist/ui/components/WelcomeTips.d.ts +5 -0
- package/dist/ui/onboarding-runner.d.ts +2 -0
- package/dist/ui/store.d.ts +1 -0
- package/dist/{updater-2N6745WR.cjs → updater-M7L42ASZ.cjs} +4 -4
- package/dist/{updater-PV7FKSUI.js → updater-ZRTONIR4.js} +4 -4
- package/dist/utils/debug.d.ts +17 -33
- package/package.json +4 -4
- package/dist/anthropic-XMTTVNSH.cjs +0 -9
- package/dist/bridge-4ZRXVWBN.js +0 -98
- package/dist/bridge-W476QDFH.cjs +0 -98
- package/dist/chunk-4RRUP4MM.js +0 -86
- package/dist/chunk-4SFPFHMG.js +0 -132
- package/dist/chunk-5LHVI777.cjs +0 -246
- package/dist/chunk-6ZIROYXX.js +0 -207
- package/dist/chunk-C7JBCO5V.js +0 -80
- package/dist/chunk-CSO5EOEP.cjs +0 -132
- package/dist/chunk-FGZGCFJX.cjs +0 -207
- package/dist/chunk-HD7MT5XU.cjs +0 -86
- package/dist/chunk-IMMTBZ33.cjs +0 -63
- package/dist/chunk-JT2WSQSR.cjs +0 -335
- package/dist/chunk-NZ4DQ72D.cjs +0 -664
- package/dist/chunk-OG4MIQJ6.js +0 -335
- package/dist/chunk-WRZJUQ5Z.js +0 -664
- package/dist/chunk-X4HAERTQ.js +0 -63
- package/dist/chunk-XHC2JMEC.cjs +0 -80
- package/dist/chunk-ZRSSGYA5.js +0 -246
- package/dist/compaction-44I55TLI.cjs +0 -32
- package/dist/coordinator-5HY7ALO2.js +0 -7
- package/dist/coordinator-INDLPVMF.cjs +0 -7
- package/dist/cost-tracker-IWYAUPXH.js +0 -9
- package/dist/cost-tracker-JXTJQQWE.cjs +0 -9
- package/dist/loader-DXFSUB4R.cjs +0 -91
- package/dist/loader-J5UID6CV.js +0 -91
- package/dist/manager-ETWDOCHN.cjs +0 -9
- package/dist/manager-HGMQNEJB.cjs +0 -11
- package/dist/manager-HUAQOORS.js +0 -9
- package/dist/manager-VJIZ2CQC.js +0 -11
- package/dist/mcp-manager-G4G2QASE.cjs +0 -8
- package/dist/memory-AP747G5H.js +0 -7
- package/dist/memory-BH3BYUN5.cjs +0 -7
- package/dist/onboarding-6WEPV7C2.js +0 -11
- package/dist/onboarding-QM5DY2TU.cjs +0 -11
- package/dist/openai-656VWUQW.cjs +0 -9
- package/dist/skills-63RBYQRX.js +0 -13
- package/dist/skills-V3BPLW3D.cjs +0 -13
- package/dist/token-counter-CHAXW5O7.cjs +0 -13
- package/dist/token-counter-DSOZGZ5Q.js +0 -13
- package/dist/utils/log.d.ts +0 -56
- package/dist/voice-KTZ7PAGO.js +0 -80
- package/dist/voice-KZE25GKB.cjs +0 -80
- /package/dist/{ink → render}/Ansi.d.ts +0 -0
- /package/dist/{ink → render}/bidi.d.ts +0 -0
- /package/dist/{ink → render}/clearTerminal.d.ts +0 -0
- /package/dist/{ink → render}/colorize.d.ts +0 -0
- /package/dist/{ink → render}/components/AlternateScreen.d.ts +0 -0
- /package/dist/{ink → render}/components/App.d.ts +0 -0
- /package/dist/{ink → render}/components/AppContext.d.ts +0 -0
- /package/dist/{ink → render}/components/Box.d.ts +0 -0
- /package/dist/{ink → render}/components/Button.d.ts +0 -0
- /package/dist/{ink → render}/components/ClockContext.d.ts +0 -0
- /package/dist/{ink → render}/components/CursorDeclarationContext.d.ts +0 -0
- /package/dist/{ink → render}/components/ErrorOverview.d.ts +0 -0
- /package/dist/{ink → render}/components/Link.d.ts +0 -0
- /package/dist/{ink → render}/components/Newline.d.ts +0 -0
- /package/dist/{ink → render}/components/NoSelect.d.ts +0 -0
- /package/dist/{ink → render}/components/RawAnsi.d.ts +0 -0
- /package/dist/{ink → render}/components/ScrollBox.d.ts +0 -0
- /package/dist/{ink → render}/components/Spacer.d.ts +0 -0
- /package/dist/{ink → render}/components/StdinContext.d.ts +0 -0
- /package/dist/{ink → render}/components/TerminalFocusContext.d.ts +0 -0
- /package/dist/{ink → render}/components/TerminalSizeContext.d.ts +0 -0
- /package/dist/{ink → render}/components/Text.d.ts +0 -0
- /package/dist/{ink → render}/constants.d.ts +0 -0
- /package/dist/{ink → render}/cursor.d.ts +0 -0
- /package/dist/{ink → render}/devtools.d.ts +0 -0
- /package/dist/{ink → render}/dom.d.ts +0 -0
- /package/dist/{ink → render}/events/click-event.d.ts +0 -0
- /package/dist/{ink → render}/events/dispatcher.d.ts +0 -0
- /package/dist/{ink → render}/events/emitter.d.ts +0 -0
- /package/dist/{ink → render}/events/event-handlers.d.ts +0 -0
- /package/dist/{ink → render}/events/event.d.ts +0 -0
- /package/dist/{ink → render}/events/focus-event.d.ts +0 -0
- /package/dist/{ink → render}/events/input-event.d.ts +0 -0
- /package/dist/{ink → render}/events/keyboard-event.d.ts +0 -0
- /package/dist/{ink → render}/events/paste-event.d.ts +0 -0
- /package/dist/{ink → render}/events/resize-event.d.ts +0 -0
- /package/dist/{ink → render}/events/terminal-event.d.ts +0 -0
- /package/dist/{ink → render}/events/terminal-focus-event.d.ts +0 -0
- /package/dist/{ink → render}/focus.d.ts +0 -0
- /package/dist/{ink → render}/frame.d.ts +0 -0
- /package/dist/{ink → render}/get-max-width.d.ts +0 -0
- /package/dist/{ink → render}/hit-test.d.ts +0 -0
- /package/dist/{ink → render}/hooks/use-animation-frame.d.ts +0 -0
- /package/dist/{ink → render}/hooks/use-app.d.ts +0 -0
- /package/dist/{ink → render}/hooks/use-declared-cursor.d.ts +0 -0
- /package/dist/{ink → render}/hooks/use-interval.d.ts +0 -0
- /package/dist/{ink → render}/hooks/use-search-highlight.d.ts +0 -0
- /package/dist/{ink → render}/hooks/use-selection.d.ts +0 -0
- /package/dist/{ink → render}/hooks/use-stdin.d.ts +0 -0
- /package/dist/{ink → render}/hooks/use-tab-status.d.ts +0 -0
- /package/dist/{ink → render}/hooks/use-terminal-focus.d.ts +0 -0
- /package/dist/{ink → render}/hooks/use-terminal-title.d.ts +0 -0
- /package/dist/{ink → render}/hooks/use-terminal-viewport.d.ts +0 -0
- /package/dist/{ink → render}/index.d.ts +0 -0
- /package/dist/{ink → render}/ink.d.ts +0 -0
- /package/dist/{ink → render}/instances.d.ts +0 -0
- /package/dist/{ink → render}/layout/engine.d.ts +0 -0
- /package/dist/{ink → render}/layout/geometry.d.ts +0 -0
- /package/dist/{ink → render}/layout/node.d.ts +0 -0
- /package/dist/{ink → render}/layout/yoga.d.ts +0 -0
- /package/dist/{ink → render}/line-width-cache.d.ts +0 -0
- /package/dist/{ink → render}/log-update.d.ts +0 -0
- /package/dist/{ink → render}/measure-element.d.ts +0 -0
- /package/dist/{ink → render}/measure-text.d.ts +0 -0
- /package/dist/{ink → render}/node-cache.d.ts +0 -0
- /package/dist/{ink → render}/optimizer.d.ts +0 -0
- /package/dist/{ink → render}/output.d.ts +0 -0
- /package/dist/{ink → render}/parse-keypress.d.ts +0 -0
- /package/dist/{ink → render}/reconciler.d.ts +0 -0
- /package/dist/{ink → render}/render-border.d.ts +0 -0
- /package/dist/{ink → render}/render-node-to-output.d.ts +0 -0
- /package/dist/{ink → render}/render-to-screen.d.ts +0 -0
- /package/dist/{ink → render}/renderer.d.ts +0 -0
- /package/dist/{ink → render}/root.d.ts +0 -0
- /package/dist/{ink → render}/screen.d.ts +0 -0
- /package/dist/{ink → render}/searchHighlight.d.ts +0 -0
- /package/dist/{ink → render}/selection.d.ts +0 -0
- /package/dist/{ink → render}/squash-text-nodes.d.ts +0 -0
- /package/dist/{ink → render}/stringWidth.d.ts +0 -0
- /package/dist/{ink → render}/styles.d.ts +0 -0
- /package/dist/{ink → render}/supports-hyperlinks.d.ts +0 -0
- /package/dist/{ink → render}/tabstops.d.ts +0 -0
- /package/dist/{ink → render}/terminal-focus-state.d.ts +0 -0
- /package/dist/{ink → render}/terminal-querier.d.ts +0 -0
- /package/dist/{ink → render}/terminal.d.ts +0 -0
- /package/dist/{ink → render}/termio/ansi.d.ts +0 -0
- /package/dist/{ink → render}/termio/csi.d.ts +0 -0
- /package/dist/{ink → render}/termio/dec.d.ts +0 -0
- /package/dist/{ink → render}/termio/esc.d.ts +0 -0
- /package/dist/{ink → render}/termio/osc.d.ts +0 -0
- /package/dist/{ink → render}/termio/parser.d.ts +0 -0
- /package/dist/{ink → render}/termio/sgr.d.ts +0 -0
- /package/dist/{ink → render}/termio/tokenize.d.ts +0 -0
- /package/dist/{ink → render}/termio/types.d.ts +0 -0
- /package/dist/{ink → render}/termio.d.ts +0 -0
- /package/dist/{ink → render}/useTerminalNotification.d.ts +0 -0
- /package/dist/{ink → render}/warn.d.ts +0 -0
- /package/dist/{ink → render}/widest-line.d.ts +0 -0
- /package/dist/{ink → render}/wrap-text.d.ts +0 -0
- /package/dist/{ink → render}/wrapAnsi.d.ts +0 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkHOXQLX5Rcjs = require('./chunk-HOXQLX5R.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkJHNCK7JPcjs = require('./chunk-JHNCK7JP.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
var _chunkIJSHQGMPcjs = require('./chunk-IJSHQGMP.cjs');
|
|
@@ -744,7 +744,7 @@ async function runArgueRound(args) {
|
|
|
744
744
|
const wantWeb = Boolean(enableWebSearch);
|
|
745
745
|
const webAvailable = wantWeb && hasWebSearchProvider();
|
|
746
746
|
if (wantWeb && !webAvailable) {
|
|
747
|
-
|
|
747
|
+
_chunkJHNCK7JPcjs.logger.warn("arena.iterate.argue_web_unavailable", {
|
|
748
748
|
reason: "No SERPER_API_KEY / TAVILY_API_KEY / SEARXNG_URL configured"
|
|
749
749
|
});
|
|
750
750
|
}
|
|
@@ -765,7 +765,7 @@ async function runArgueRound(args) {
|
|
|
765
765
|
}
|
|
766
766
|
return await argueSingleShot({ critic: c, subject, format, draft, idPrefix, signal });
|
|
767
767
|
} catch (err) {
|
|
768
|
-
|
|
768
|
+
_chunkJHNCK7JPcjs.logger.warn("arena.iterate.argue_failed", {
|
|
769
769
|
round,
|
|
770
770
|
critic: c.name,
|
|
771
771
|
error: err.message
|
|
@@ -784,7 +784,7 @@ async function runArgueRound(args) {
|
|
|
784
784
|
}
|
|
785
785
|
async function argueSingleShot(args) {
|
|
786
786
|
const { critic, subject, format, draft, idPrefix, signal } = args;
|
|
787
|
-
const client = await
|
|
787
|
+
const client = await _chunkHOXQLX5Rcjs.createLLMClient.call(void 0, { ...critic.llm, enableStreaming: false });
|
|
788
788
|
const resp = await client.createMessage({
|
|
789
789
|
systemPrompt: format.argueSystem(format.format),
|
|
790
790
|
messages: [{ role: "user", content: format.argueUser(subject, draft) }],
|
|
@@ -792,7 +792,7 @@ async function argueSingleShot(args) {
|
|
|
792
792
|
signal
|
|
793
793
|
});
|
|
794
794
|
const critiques = parseCritiquesResponse(resp.text, critic.name, idPrefix);
|
|
795
|
-
|
|
795
|
+
_chunkJHNCK7JPcjs.logger.info("arena.iterate.argue_singleshot", {
|
|
796
796
|
critic: critic.name,
|
|
797
797
|
critiqueCount: critiques.length
|
|
798
798
|
});
|
|
@@ -800,7 +800,7 @@ async function argueSingleShot(args) {
|
|
|
800
800
|
}
|
|
801
801
|
async function argueWithToolLoop(args) {
|
|
802
802
|
const { critic, subject, format, draft, idPrefix, maxToolRounds, signal } = args;
|
|
803
|
-
const client = await
|
|
803
|
+
const client = await _chunkHOXQLX5Rcjs.createLLMClient.call(void 0, { ...critic.llm, enableStreaming: false });
|
|
804
804
|
const messages = [
|
|
805
805
|
{ role: "user", content: format.argueUser(subject, draft) }
|
|
806
806
|
];
|
|
@@ -866,7 +866,7 @@ async function argueWithToolLoop(args) {
|
|
|
866
866
|
finalText = resp.text;
|
|
867
867
|
}
|
|
868
868
|
const critiques = parseCritiquesResponse(finalText, critic.name, idPrefix);
|
|
869
|
-
|
|
869
|
+
_chunkJHNCK7JPcjs.logger.info("arena.iterate.argue_toolloop", {
|
|
870
870
|
critic: critic.name,
|
|
871
871
|
critiqueCount: critiques.length,
|
|
872
872
|
toolRounds
|
|
@@ -879,7 +879,7 @@ _chunkIJSHQGMPcjs.init_cjs_shims.call(void 0, );
|
|
|
879
879
|
async function runRevise(args) {
|
|
880
880
|
const { subject, format, previous, critiques, author, minDraftLength, signal, onProgress } = args;
|
|
881
881
|
_optionalChain([onProgress, 'optionalCall', _12 => _12({ type: "revise_start", round: previous.version + 1, participant: author.name })]);
|
|
882
|
-
const client = await
|
|
882
|
+
const client = await _chunkHOXQLX5Rcjs.createLLMClient.call(void 0, { ...author.llm, enableStreaming: false });
|
|
883
883
|
const prompt = format.revisePrompt(subject, previous, critiques, minDraftLength);
|
|
884
884
|
const resp = await client.createMessage({
|
|
885
885
|
systemPrompt: prompt,
|
|
@@ -892,7 +892,7 @@ async function runRevise(args) {
|
|
|
892
892
|
let acceptedContent = content;
|
|
893
893
|
const shrinkage = previous.content.length > 0 ? 1 - acceptedContent.length / previous.content.length : 0;
|
|
894
894
|
if (shrinkage > 0.3 && acceptedContent.length < minDraftLength) {
|
|
895
|
-
|
|
895
|
+
_chunkJHNCK7JPcjs.logger.warn("arena.iterate.revise_too_short", {
|
|
896
896
|
version: previous.version + 1,
|
|
897
897
|
previousLength: previous.content.length,
|
|
898
898
|
newLength: acceptedContent.length,
|
|
@@ -917,7 +917,7 @@ async function runRevise(args) {
|
|
|
917
917
|
participant: author.name,
|
|
918
918
|
data: { length: acceptedContent.length, accepted: _nullishCoalesce(_optionalChain([meta, 'access', _14 => _14.acceptedCritiques, 'optionalAccess', _15 => _15.length]), () => ( 0)) }
|
|
919
919
|
})]);
|
|
920
|
-
|
|
920
|
+
_chunkJHNCK7JPcjs.logger.info("arena.iterate.revise", {
|
|
921
921
|
version: next.version,
|
|
922
922
|
author: author.name,
|
|
923
923
|
length: acceptedContent.length,
|
|
@@ -934,7 +934,7 @@ async function runTournamentCandidates(args) {
|
|
|
934
934
|
_optionalChain([onProgress, 'optionalCall', _20 => _20({ type: "v1_tournament_start", data: { count: participants.length } })]);
|
|
935
935
|
const tasks = participants.map(async (p, idx) => {
|
|
936
936
|
_optionalChain([signal, 'optionalAccess', _21 => _21.throwIfAborted, 'call', _22 => _22()]);
|
|
937
|
-
const client = await
|
|
937
|
+
const client = await _chunkHOXQLX5Rcjs.createLLMClient.call(void 0, { ...p.llm, enableStreaming: false });
|
|
938
938
|
const prompt = format.draftPrompt(subject, minDraftLength);
|
|
939
939
|
const resp = await client.createMessage({
|
|
940
940
|
systemPrompt: prompt,
|
|
@@ -955,7 +955,7 @@ async function runTournamentCandidates(args) {
|
|
|
955
955
|
participant: p.name,
|
|
956
956
|
data: { length: content.length, anonymousLabel: candidate.anonymousLabel }
|
|
957
957
|
})]);
|
|
958
|
-
|
|
958
|
+
_chunkJHNCK7JPcjs.logger.info("arena.iterate.v1_candidate", {
|
|
959
959
|
participant: p.name,
|
|
960
960
|
anonymousLabel: candidate.anonymousLabel,
|
|
961
961
|
length: content.length
|
|
@@ -966,7 +966,7 @@ async function runTournamentCandidates(args) {
|
|
|
966
966
|
const candidates = [];
|
|
967
967
|
for (const s of settled) {
|
|
968
968
|
if (s.status === "fulfilled") candidates.push(s.value);
|
|
969
|
-
else
|
|
969
|
+
else _chunkJHNCK7JPcjs.logger.warn("arena.iterate.v1_candidate_failed", { error: _optionalChain([s, 'access', _24 => _24.reason, 'optionalAccess', _25 => _25.message]) });
|
|
970
970
|
}
|
|
971
971
|
if (candidates.length === 0) {
|
|
972
972
|
throw new Error("All v1 tournament candidates failed");
|
|
@@ -982,7 +982,7 @@ async function runTournamentCandidates(args) {
|
|
|
982
982
|
async function mergeCandidatesToV1(args) {
|
|
983
983
|
const { subject, format, author, candidates, minDraftLength, signal, onProgress } = args;
|
|
984
984
|
_optionalChain([onProgress, 'optionalCall', _26 => _26({ type: "v1_merge_start", participant: author.name })]);
|
|
985
|
-
const client = await
|
|
985
|
+
const client = await _chunkHOXQLX5Rcjs.createLLMClient.call(void 0, { ...author.llm, enableStreaming: false });
|
|
986
986
|
const prompt = format.mergePrompt(subject, candidates, minDraftLength);
|
|
987
987
|
const resp = await client.createMessage({
|
|
988
988
|
systemPrompt: prompt,
|
|
@@ -1001,7 +1001,7 @@ async function mergeCandidatesToV1(args) {
|
|
|
1001
1001
|
mergeRationale: rationale
|
|
1002
1002
|
};
|
|
1003
1003
|
_optionalChain([onProgress, 'optionalCall', _27 => _27({ type: "v1_merge_done", participant: author.name, data: { length: content.length } })]);
|
|
1004
|
-
|
|
1004
|
+
_chunkJHNCK7JPcjs.logger.info("arena.iterate.v1_merge", {
|
|
1005
1005
|
author: author.name,
|
|
1006
1006
|
candidateCount: candidates.length,
|
|
1007
1007
|
length: content.length
|
|
@@ -1010,7 +1010,7 @@ async function mergeCandidatesToV1(args) {
|
|
|
1010
1010
|
}
|
|
1011
1011
|
async function singleAuthorV1(args) {
|
|
1012
1012
|
const { subject, format, author, minDraftLength, signal } = args;
|
|
1013
|
-
const client = await
|
|
1013
|
+
const client = await _chunkHOXQLX5Rcjs.createLLMClient.call(void 0, { ...author.llm, enableStreaming: false });
|
|
1014
1014
|
const prompt = format.draftPrompt(subject, minDraftLength);
|
|
1015
1015
|
const resp = await client.createMessage({
|
|
1016
1016
|
systemPrompt: prompt,
|
|
@@ -1082,7 +1082,7 @@ var IterativeArena = class {
|
|
|
1082
1082
|
});
|
|
1083
1083
|
}
|
|
1084
1084
|
} catch (err) {
|
|
1085
|
-
|
|
1085
|
+
_chunkJHNCK7JPcjs.logger.error("arena.iterate.v1_failed", { error: err.message });
|
|
1086
1086
|
throw err;
|
|
1087
1087
|
}
|
|
1088
1088
|
let currentAuthor = config.author;
|
|
@@ -1228,7 +1228,7 @@ var IterativeArena = class {
|
|
|
1228
1228
|
finalLength: finalDraft.content.length
|
|
1229
1229
|
}
|
|
1230
1230
|
})]);
|
|
1231
|
-
|
|
1231
|
+
_chunkJHNCK7JPcjs.logger.info("arena.iterate.complete", {
|
|
1232
1232
|
stoppedAt,
|
|
1233
1233
|
rounds: rounds.length,
|
|
1234
1234
|
finalVersion: finalDraft.version,
|