@moxxy/cli 0.13.2 → 0.14.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/bin.js +87 -55
- package/dist/bin.js.map +1 -1
- package/package.json +1 -1
package/dist/bin.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { z as z$1, createMutex, defineTunnelProvider, definePlugin, defineProvider, defineTool, MoxxyError, asTurnId, defineMode, asPluginId, defineCommand, defineChannel, defineWorkflowExecutor, toFriendlyError, estimateTextTokens, classifyHttpStatus, createStuckLoopDetector, runCompactionIfNeeded, runElisionIfNeeded, collectProviderStream, usageEventFields, isContextOverflowError, emitRequestsAndDetectStuck, executeToolUses, buildSystemPromptWithSkills, projectMessages, defineCompactor, defineCacheStrategy, denyByDefaultResolver, createAllowListResolver, zodToJsonSchema, fileDiffSummary, runSingleShotTurn, defineSurface, runManualCompaction, isFileDiffDisplay, renderFrontmatter, defineEmbedder, migrateModeName, skillFrontmatterSchema, asSkillId, getInstallHint, parseFrontmatterFile, createDeferredPermissionResolver, encodeLoginPrompt, defineTranscriber, summarizeTokensByModel, countNodes, moxxyPackageSchema, classifyNetworkError, addModelTotals, createJsonFileStore, ISOLATION_RANK, MOXXY_PCM16_24KHZ_MIME, fileDiffVerb, parseFrontmatter, createCallbackResolver, autoAllowResolver, asSessionId, asToolCallId, defineViewRenderer, DEFAULT_VIEW_TAGS,
|
|
3
|
+
import { z as z$1, createMutex, defineTunnelProvider, definePlugin, defineProvider, defineTool, MoxxyError, asTurnId, defineMode, asPluginId, defineCommand, defineChannel, defineWorkflowExecutor, toFriendlyError, estimateTextTokens, classifyHttpStatus, createStuckLoopDetector, runCompactionIfNeeded, runElisionIfNeeded, collectProviderStream, usageEventFields, isContextOverflowError, emitRequestsAndDetectStuck, executeToolUses, buildSystemPromptWithSkills, projectMessages, defineCompactor, defineCacheStrategy, denyByDefaultResolver, createAllowListResolver, zodToJsonSchema, fileDiffSummary, runSingleShotTurn, defineSurface, runManualCompaction, isFileDiffDisplay, renderFrontmatter, defineEmbedder, migrateModeName, skillFrontmatterSchema, asSkillId, getInstallHint, parseFrontmatterFile, createDeferredPermissionResolver, encodeLoginPrompt, defineTranscriber, summarizeTokensByModel, countNodes, moxxyPackageSchema, classifyNetworkError, addModelTotals, createJsonFileStore, ISOLATION_RANK, MOXXY_PCM16_24KHZ_MIME, fileDiffVerb, parseFrontmatter, createCallbackResolver, autoAllowResolver, asSessionId, asToolCallId, defineViewRenderer, DEFAULT_VIEW_TAGS, isSafeViewUrl, evaluateToolRule, summarizeSessionTokensFromEvents, toDiffRows, diffGutterNo, computeElisionState, toolResultStubbed, toolResultStub, toolResultBytes, conversationalStubbed, conversationalStub, asEventId } from '@moxxy/sdk';
|
|
4
4
|
import * as fs32 from 'fs';
|
|
5
5
|
import fs32__default, { existsSync, promises, ReadStream, mkdirSync, statSync, readdirSync, writeFileSync, readFileSync, unlinkSync, chmodSync, watch, createReadStream } from 'fs';
|
|
6
6
|
import * as path3 from 'path';
|
|
@@ -2967,6 +2967,8 @@ var init_workflow_executors = __esm({
|
|
|
2967
2967
|
};
|
|
2968
2968
|
}
|
|
2969
2969
|
});
|
|
2970
|
+
|
|
2971
|
+
// ../core/dist/requirements.js
|
|
2970
2972
|
function issue(requirement, code, message) {
|
|
2971
2973
|
return {
|
|
2972
2974
|
requirement,
|
|
@@ -2985,9 +2987,10 @@ function activeModeName(modes) {
|
|
|
2985
2987
|
return null;
|
|
2986
2988
|
}
|
|
2987
2989
|
}
|
|
2988
|
-
var RequirementRegistry;
|
|
2990
|
+
var ALWAYS_ACTIVE, RequirementRegistry, TARGET_DESCRIPTORS;
|
|
2989
2991
|
var init_requirements = __esm({
|
|
2990
2992
|
"../core/dist/requirements.js"() {
|
|
2993
|
+
ALWAYS_ACTIVE = () => true;
|
|
2991
2994
|
RequirementRegistry = class {
|
|
2992
2995
|
opts;
|
|
2993
2996
|
runtime = /* @__PURE__ */ new Map();
|
|
@@ -3050,52 +3053,54 @@ var init_requirements = __esm({
|
|
|
3050
3053
|
return null;
|
|
3051
3054
|
}
|
|
3052
3055
|
targetInfo(kind3, name) {
|
|
3053
|
-
|
|
3054
|
-
|
|
3055
|
-
|
|
3056
|
-
return plugin5 ? { kind: kind3, name, version: plugin5.version, active: true } : null;
|
|
3057
|
-
}
|
|
3058
|
-
case "provider": {
|
|
3059
|
-
const def = this.opts.providers.list().find((p3) => p3.name === name);
|
|
3060
|
-
return def ? { kind: kind3, name, active: this.opts.providers.getActiveName() === name } : null;
|
|
3061
|
-
}
|
|
3062
|
-
case "tool": {
|
|
3063
|
-
const def = this.opts.tools.get(name);
|
|
3064
|
-
return def ? { kind: kind3, name, active: true } : null;
|
|
3065
|
-
}
|
|
3066
|
-
case "transcriber": {
|
|
3067
|
-
const def = this.opts.transcribers.list().find((t2) => t2.name === name);
|
|
3068
|
-
return def ? { kind: kind3, name, active: this.opts.transcribers.getActiveName() === name } : null;
|
|
3069
|
-
}
|
|
3070
|
-
case "synthesizer": {
|
|
3071
|
-
const def = this.opts.synthesizers.list().find((s2) => s2.name === name);
|
|
3072
|
-
return def ? { kind: kind3, name, active: this.opts.synthesizers.getActiveName() === name } : null;
|
|
3073
|
-
}
|
|
3074
|
-
case "mode": {
|
|
3075
|
-
const def = this.opts.modes.list().find((m3) => m3.name === name);
|
|
3076
|
-
return def ? { kind: kind3, name, active: activeModeName(this.opts.modes) === name } : null;
|
|
3077
|
-
}
|
|
3078
|
-
case "compactor": {
|
|
3079
|
-
const def = this.opts.compactors.list().find((c2) => c2.name === name);
|
|
3080
|
-
return def ? { kind: kind3, name, active: this.opts.compactors.getActive()?.name === name } : null;
|
|
3081
|
-
}
|
|
3082
|
-
case "channel": {
|
|
3083
|
-
const def = this.opts.channels.get(name);
|
|
3084
|
-
return def ? { kind: kind3, name, active: true } : null;
|
|
3085
|
-
}
|
|
3086
|
-
case "agent": {
|
|
3087
|
-
const def = this.opts.agents.get(name);
|
|
3088
|
-
return def ? { kind: kind3, name, active: true } : null;
|
|
3089
|
-
}
|
|
3090
|
-
case "command": {
|
|
3091
|
-
const def = this.opts.commands.get(name);
|
|
3092
|
-
return def ? { kind: kind3, name, active: true } : null;
|
|
3093
|
-
}
|
|
3094
|
-
case "runtime":
|
|
3095
|
-
return null;
|
|
3096
|
-
default:
|
|
3097
|
-
return assertNever(kind3);
|
|
3056
|
+
if (kind3 === "plugin") {
|
|
3057
|
+
const plugin5 = this.plugins.get(name);
|
|
3058
|
+
return plugin5 ? { kind: kind3, name, version: plugin5.version, active: true } : null;
|
|
3098
3059
|
}
|
|
3060
|
+
if (kind3 === "runtime")
|
|
3061
|
+
return null;
|
|
3062
|
+
const descriptor = TARGET_DESCRIPTORS[kind3];
|
|
3063
|
+
if (!descriptor.present(this.opts, name))
|
|
3064
|
+
return null;
|
|
3065
|
+
return { kind: kind3, name, active: descriptor.active(this.opts, name) };
|
|
3066
|
+
}
|
|
3067
|
+
};
|
|
3068
|
+
TARGET_DESCRIPTORS = {
|
|
3069
|
+
provider: {
|
|
3070
|
+
present: (opts, name) => opts.providers.list().some((p3) => p3.name === name),
|
|
3071
|
+
active: (opts, name) => opts.providers.getActiveName() === name
|
|
3072
|
+
},
|
|
3073
|
+
tool: {
|
|
3074
|
+
present: (opts, name) => opts.tools.get(name) !== void 0,
|
|
3075
|
+
active: ALWAYS_ACTIVE
|
|
3076
|
+
},
|
|
3077
|
+
transcriber: {
|
|
3078
|
+
present: (opts, name) => opts.transcribers.list().some((t2) => t2.name === name),
|
|
3079
|
+
active: (opts, name) => opts.transcribers.getActiveName() === name
|
|
3080
|
+
},
|
|
3081
|
+
synthesizer: {
|
|
3082
|
+
present: (opts, name) => opts.synthesizers.list().some((s2) => s2.name === name),
|
|
3083
|
+
active: (opts, name) => opts.synthesizers.getActiveName() === name
|
|
3084
|
+
},
|
|
3085
|
+
mode: {
|
|
3086
|
+
present: (opts, name) => opts.modes.list().some((m3) => m3.name === name),
|
|
3087
|
+
active: (opts, name) => activeModeName(opts.modes) === name
|
|
3088
|
+
},
|
|
3089
|
+
compactor: {
|
|
3090
|
+
present: (opts, name) => opts.compactors.list().some((c2) => c2.name === name),
|
|
3091
|
+
active: (opts, name) => opts.compactors.getActive()?.name === name
|
|
3092
|
+
},
|
|
3093
|
+
channel: {
|
|
3094
|
+
present: (opts, name) => opts.channels.get(name) !== void 0,
|
|
3095
|
+
active: ALWAYS_ACTIVE
|
|
3096
|
+
},
|
|
3097
|
+
agent: {
|
|
3098
|
+
present: (opts, name) => opts.agents.get(name) !== void 0,
|
|
3099
|
+
active: ALWAYS_ACTIVE
|
|
3100
|
+
},
|
|
3101
|
+
command: {
|
|
3102
|
+
present: (opts, name) => opts.commands.get(name) !== void 0,
|
|
3103
|
+
active: ALWAYS_ACTIVE
|
|
3099
3104
|
}
|
|
3100
3105
|
};
|
|
3101
3106
|
}
|
|
@@ -128485,7 +128490,7 @@ var ChatCompletionStream = class _ChatCompletionStream extends AbstractChatCompl
|
|
|
128485
128490
|
arguments_delta: toolCallDelta.function?.arguments ?? ""
|
|
128486
128491
|
});
|
|
128487
128492
|
} else {
|
|
128488
|
-
|
|
128493
|
+
assertNever2(toolCallSnapshot?.type);
|
|
128489
128494
|
}
|
|
128490
128495
|
}
|
|
128491
128496
|
}
|
|
@@ -128510,7 +128515,7 @@ var ChatCompletionStream = class _ChatCompletionStream extends AbstractChatCompl
|
|
|
128510
128515
|
parsed_arguments: isAutoParsableTool(inputTool) ? inputTool.$parseRaw(toolCallSnapshot.function.arguments) : inputTool?.function.strict ? JSON.parse(toolCallSnapshot.function.arguments) : null
|
|
128511
128516
|
});
|
|
128512
128517
|
} else {
|
|
128513
|
-
|
|
128518
|
+
assertNever2(toolCallSnapshot.type);
|
|
128514
128519
|
}
|
|
128515
128520
|
}, _ChatCompletionStream_emitContentDoneEvents = function _ChatCompletionStream_emitContentDoneEvents2(choiceSnapshot) {
|
|
128516
128521
|
const state = __classPrivateFieldGet15(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_getChoiceEventState).call(this, choiceSnapshot);
|
|
@@ -128790,7 +128795,7 @@ ${str(snapshot)}`);
|
|
|
128790
128795
|
function str(x4) {
|
|
128791
128796
|
return JSON.stringify(x4);
|
|
128792
128797
|
}
|
|
128793
|
-
function
|
|
128798
|
+
function assertNever2(_x) {
|
|
128794
128799
|
}
|
|
128795
128800
|
|
|
128796
128801
|
// ../../node_modules/.pnpm/openai@4.104.0_encoding@0.1.13_ws@8.20.0_zod@3.25.76/node_modules/openai/lib/ChatCompletionStreamingRunner.mjs
|
|
@@ -136261,7 +136266,7 @@ async function reclaimStaleSocket(socketPath) {
|
|
|
136261
136266
|
|
|
136262
136267
|
// ../runner/dist/server.js
|
|
136263
136268
|
init_dist();
|
|
136264
|
-
var RUNNER_PROTOCOL_VERSION =
|
|
136269
|
+
var RUNNER_PROTOCOL_VERSION = 9;
|
|
136265
136270
|
var MIN_COMPATIBLE_PROTOCOL_VERSION = 1;
|
|
136266
136271
|
var RunnerMethod = {
|
|
136267
136272
|
/** client->server: handshake; returns the initial info snapshot. */
|
|
@@ -136284,6 +136289,8 @@ var RunnerMethod = {
|
|
|
136284
136289
|
SetResolver: "setResolver",
|
|
136285
136290
|
/** client->server: switch the active mode. */
|
|
136286
136291
|
ModeSetActive: "mode.setActive",
|
|
136292
|
+
/** client->server: set the session's reasoning/thinking effort (v9). */
|
|
136293
|
+
SessionSetReasoning: "session.setReasoning",
|
|
136287
136294
|
/** client->server: switch the active provider (server resolves credentials). */
|
|
136288
136295
|
ProviderSetActive: "provider.setActive",
|
|
136289
136296
|
/** client->server: enable/disable a provider (v7; persists to preferences). */
|
|
@@ -136400,6 +136407,9 @@ var setResolverParamsSchema = z.object({
|
|
|
136400
136407
|
approval: z.boolean().optional()
|
|
136401
136408
|
});
|
|
136402
136409
|
var modeSetActiveParamsSchema = z.object({ name: z.string() });
|
|
136410
|
+
var sessionSetReasoningParamsSchema = z.object({
|
|
136411
|
+
effort: z.enum(["off", "low", "medium", "high"])
|
|
136412
|
+
});
|
|
136403
136413
|
var providerSetActiveParamsSchema = z.object({
|
|
136404
136414
|
name: z.string(),
|
|
136405
136415
|
config: z.record(z.unknown()).optional()
|
|
@@ -136729,6 +136739,12 @@ function handleModeSetActive(ctx, raw) {
|
|
|
136729
136739
|
ctx.session.modes.setActive(name);
|
|
136730
136740
|
return {};
|
|
136731
136741
|
}
|
|
136742
|
+
function handleSessionSetReasoning(ctx, raw) {
|
|
136743
|
+
const { effort } = sessionSetReasoningParamsSchema.parse(raw);
|
|
136744
|
+
ctx.session.reasoning = effort === "off" ? void 0 : { effort };
|
|
136745
|
+
ctx.broadcastInfo();
|
|
136746
|
+
return {};
|
|
136747
|
+
}
|
|
136732
136748
|
async function handlePermissionAddAllow(ctx, raw) {
|
|
136733
136749
|
const { name, reason } = permissionAddAllowParamsSchema.parse(raw);
|
|
136734
136750
|
await ctx.session.permissions.addAllow({ name, ...reason ? { reason } : {} });
|
|
@@ -136849,6 +136865,7 @@ var RunnerServer = class {
|
|
|
136849
136865
|
peer.handle(RunnerMethod.SessionReset, () => this.handleSessionReset());
|
|
136850
136866
|
peer.handle(RunnerMethod.SetResolver, (raw) => this.handleSetResolver(client, raw));
|
|
136851
136867
|
peer.handle(RunnerMethod.ModeSetActive, (raw) => handleModeSetActive(ctx, raw));
|
|
136868
|
+
peer.handle(RunnerMethod.SessionSetReasoning, (raw) => handleSessionSetReasoning(ctx, raw));
|
|
136852
136869
|
peer.handle(RunnerMethod.ProviderSetActive, (raw) => handleProviderSetActive(ctx, raw));
|
|
136853
136870
|
peer.handle(RunnerMethod.ProviderSetEnabled, (raw) => handleProviderSetEnabled(ctx, raw));
|
|
136854
136871
|
peer.handle(RunnerMethod.ProviderRefreshReady, () => handleProviderRefreshReady(ctx));
|
|
@@ -137285,6 +137302,10 @@ function makeProviderAdminView(ctx) {
|
|
|
137285
137302
|
configure: async (name, patch) => {
|
|
137286
137303
|
requireServerProtocol(7, "Configuring a provider");
|
|
137287
137304
|
await peer.request(RunnerMethod.ProviderConfigure, { name, patch });
|
|
137305
|
+
},
|
|
137306
|
+
setReasoning: async (effort) => {
|
|
137307
|
+
requireServerProtocol(9, "Setting reasoning effort");
|
|
137308
|
+
await peer.request(RunnerMethod.SessionSetReasoning, { effort });
|
|
137288
137309
|
}
|
|
137289
137310
|
};
|
|
137290
137311
|
}
|
|
@@ -144236,6 +144257,12 @@ var ipcInputSchemas = {
|
|
|
144236
144257
|
path: z.string().max(4096).optional()
|
|
144237
144258
|
}),
|
|
144238
144259
|
"settings.fetchProviderModels": z.object({ provider: providerName }),
|
|
144260
|
+
// Session config mutation — pin the effort to the known enum so a renderer
|
|
144261
|
+
// can't push an arbitrary string through to the runner / provider request.
|
|
144262
|
+
"settings.setReasoning": z.object({
|
|
144263
|
+
workspaceId: optionalWorkspace,
|
|
144264
|
+
effort: z.enum(["off", "low", "medium", "high"])
|
|
144265
|
+
}),
|
|
144239
144266
|
"settings.writeSkill": z.object({ name: skillName, body: z.string().max(1e6) }),
|
|
144240
144267
|
"settings.readSkill": z.object({ name: skillName }),
|
|
144241
144268
|
"settings.deleteSkill": z.object({ name: skillName }),
|
|
@@ -144249,6 +144276,13 @@ var ipcInputSchemas = {
|
|
|
144249
144276
|
// takes nothing — pin it to "nothing" so no args can be smuggled across.
|
|
144250
144277
|
"anonymizer.pickDocument": z.undefined(),
|
|
144251
144278
|
"anonymizer.parseDocument": z.object({ path: z.string().min(1).max(4096) }),
|
|
144279
|
+
// A drag-dropped doc: the renderer sends the dropped file's BYTES (base64),
|
|
144280
|
+
// not a path — so there's no arbitrary-file-read to gate, only a size to cap.
|
|
144281
|
+
// ~67 MB of base64 ≈ 50 MB of file, matching the picker's practical ceiling.
|
|
144282
|
+
"anonymizer.parseDocumentBytes": z.object({
|
|
144283
|
+
name: z.string().min(1).max(255),
|
|
144284
|
+
dataBase64: z.string().min(1).max(67e6)
|
|
144285
|
+
}),
|
|
144252
144286
|
"anonymizer.saveRedacted": z.object({
|
|
144253
144287
|
suggestedName: z.string().min(1).max(255),
|
|
144254
144288
|
content: z.string().max(2e7)
|
|
@@ -147195,7 +147229,7 @@ var computerControlPlugin = definePlugin({
|
|
|
147195
147229
|
tools: [...computerControlTools]
|
|
147196
147230
|
});
|
|
147197
147231
|
|
|
147198
|
-
//
|
|
147232
|
+
// ../plugin-voice-admin/dist/index.js
|
|
147199
147233
|
init_dist();
|
|
147200
147234
|
function buildVoiceAdminPlugin(session) {
|
|
147201
147235
|
const voiceNames = () => [
|
|
@@ -147229,9 +147263,7 @@ function buildVoiceAdminPlugin(session) {
|
|
|
147229
147263
|
return { active: "system" };
|
|
147230
147264
|
}
|
|
147231
147265
|
if (!session.synthesizers.has(synthesizer)) {
|
|
147232
|
-
throw new Error(
|
|
147233
|
-
`No synthesizer named "${synthesizer}". Available: ${voiceNames().join(", ")}.`
|
|
147234
|
-
);
|
|
147266
|
+
throw new Error(`No synthesizer named "${synthesizer}". Available: ${voiceNames().join(", ")}.`);
|
|
147235
147267
|
}
|
|
147236
147268
|
session.synthesizers.setActive(synthesizer);
|
|
147237
147269
|
return { active: synthesizer };
|