moderado 0.4.33 → 0.4.46
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 +14 -9
- package/dist/commands/chat.d.ts +7 -70
- package/dist/commands/chat.d.ts.map +1 -1
- package/dist/commands/chat.js +305 -456
- package/dist/commands/chat.js.map +1 -1
- package/dist/commands/chat_meta.d.ts +36 -0
- package/dist/commands/chat_meta.d.ts.map +1 -0
- package/dist/commands/chat_meta.js +102 -0
- package/dist/commands/chat_meta.js.map +1 -0
- package/dist/commands/chat_outcome.d.ts +31 -0
- package/dist/commands/chat_outcome.d.ts.map +1 -0
- package/dist/commands/chat_outcome.js +70 -0
- package/dist/commands/chat_outcome.js.map +1 -0
- package/dist/commands/chat_search.d.ts +24 -0
- package/dist/commands/chat_search.d.ts.map +1 -0
- package/dist/commands/chat_search.js +61 -0
- package/dist/commands/chat_search.js.map +1 -0
- package/dist/commands/chat_slash.d.ts +17 -0
- package/dist/commands/chat_slash.d.ts.map +1 -0
- package/dist/commands/chat_slash.js +108 -0
- package/dist/commands/chat_slash.js.map +1 -0
- package/dist/commands/run.d.ts.map +1 -1
- package/dist/commands/run.js +25 -1
- package/dist/commands/run.js.map +1 -1
- package/dist/config.d.ts +1 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +18 -2
- package/dist/config.js.map +1 -1
- package/dist/diagnostic_log.d.ts.map +1 -1
- package/dist/diagnostic_log.js +1 -0
- package/dist/diagnostic_log.js.map +1 -1
- package/dist/http_shutdown.d.ts +22 -0
- package/dist/http_shutdown.d.ts.map +1 -0
- package/dist/http_shutdown.js +36 -0
- package/dist/http_shutdown.js.map +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +16 -1
- package/dist/index.js.map +1 -1
- package/dist/self_update.d.ts +6 -0
- package/dist/self_update.d.ts.map +1 -1
- package/dist/self_update.js +17 -1
- package/dist/self_update.js.map +1 -1
- package/dist/sessions.d.ts.map +1 -1
- package/dist/sessions.js +5 -1
- package/dist/sessions.js.map +1 -1
- package/dist/transcript.d.ts +19 -0
- package/dist/transcript.d.ts.map +1 -0
- package/dist/transcript.js +76 -0
- package/dist/transcript.js.map +1 -0
- package/dist/turn_summary.d.ts +76 -0
- package/dist/turn_summary.d.ts.map +1 -0
- package/dist/turn_summary.js +305 -0
- package/dist/turn_summary.js.map +1 -0
- package/dist/ui/box.d.ts +19 -0
- package/dist/ui/box.d.ts.map +1 -1
- package/dist/ui/box.js +119 -12
- package/dist/ui/box.js.map +1 -1
- package/dist/ui/chart.d.ts +2 -0
- package/dist/ui/chart.d.ts.map +1 -0
- package/dist/ui/chart.js +97 -0
- package/dist/ui/chart.js.map +1 -0
- package/dist/ui/composer.d.ts +80 -0
- package/dist/ui/composer.d.ts.map +1 -0
- package/dist/ui/composer.js +762 -0
- package/dist/ui/composer.js.map +1 -0
- package/dist/ui/help_content.d.ts +1 -1
- package/dist/ui/help_content.d.ts.map +1 -1
- package/dist/ui/help_content.js +4 -2
- package/dist/ui/help_content.js.map +1 -1
- package/dist/ui/model_selector.d.ts +1 -0
- package/dist/ui/model_selector.d.ts.map +1 -1
- package/dist/ui/model_selector.js +61 -18
- package/dist/ui/model_selector.js.map +1 -1
- package/dist/ui/popup.d.ts.map +1 -1
- package/dist/ui/popup.js +13 -0
- package/dist/ui/popup.js.map +1 -1
- package/dist/ui/provider_connect.d.ts +8 -0
- package/dist/ui/provider_connect.d.ts.map +1 -1
- package/dist/ui/provider_connect.js +81 -23
- package/dist/ui/provider_connect.js.map +1 -1
- package/dist/ui/renderer.d.ts +49 -4
- package/dist/ui/renderer.d.ts.map +1 -1
- package/dist/ui/renderer.js +167 -31
- package/dist/ui/renderer.js.map +1 -1
- package/dist/ui/terminal_approval.d.ts +21 -0
- package/dist/ui/terminal_approval.d.ts.map +1 -1
- package/dist/ui/terminal_approval.js +145 -47
- package/dist/ui/terminal_approval.js.map +1 -1
- package/dist/ui/welcome.d.ts +234 -69
- package/dist/ui/welcome.d.ts.map +1 -1
- package/dist/ui/welcome.js +588 -693
- package/dist/ui/welcome.js.map +1 -1
- package/dist/vendor/providers/presets.d.ts +16 -0
- package/dist/vendor/providers/presets.d.ts.map +1 -1
- package/dist/vendor/providers/presets.js +13 -0
- package/dist/vendor/providers/presets.js.map +1 -1
- package/dist/vendor/tools/checkpoints.js +5 -5
- package/dist/vendor/tools/checkpoints.js.map +1 -1
- package/dist/vendor/tools/jail.d.ts +8 -0
- package/dist/vendor/tools/jail.d.ts.map +1 -1
- package/dist/vendor/tools/jail.js +13 -2
- package/dist/vendor/tools/jail.js.map +1 -1
- package/dist/vendor/tools/tools/apply_patch.d.ts.map +1 -1
- package/dist/vendor/tools/tools/apply_patch.js +6 -3
- package/dist/vendor/tools/tools/apply_patch.js.map +1 -1
- package/dist/vendor/tools/tools/git_diff.d.ts.map +1 -1
- package/dist/vendor/tools/tools/git_diff.js +5 -3
- package/dist/vendor/tools/tools/git_diff.js.map +1 -1
- package/package.json +24 -7
package/README.md
CHANGED
|
@@ -94,13 +94,18 @@ npm install -g moderado
|
|
|
94
94
|
moderado --help
|
|
95
95
|
```
|
|
96
96
|
|
|
97
|
-
The 0.4.
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
97
|
+
The 0.4.34 release fixes the frozen CLI: Ctrl+C always has a way out. Popups
|
|
98
|
+
cancel on the first press instead of swallowing the key, and a turn that ignores
|
|
99
|
+
the abort (a stalled provider stream or a hung tool) force-exits on a second
|
|
100
|
+
press — draining undici sockets first so Node 24 never hits the libuv
|
|
101
|
+
`UV_HANDLE_CLOSING` assertion. The 0.4.33 release restores the approval boundary
|
|
102
|
+
in `moderado run`, fixes `@file` mention replacement, aligns boxes and wrapped
|
|
103
|
+
text for CJK and emoji, and makes the offline suite deterministic on Windows. It
|
|
104
|
+
also ships the `modr` command alias, Gateway authorization recovery with key
|
|
105
|
+
re-entry, a live progress row, and the canonical `moderado` provider identity.
|
|
106
|
+
`/connect` handles the Gateway and direct providers; earlier releases used
|
|
107
|
+
`/login` for the Gateway. The 0.3.10 release is self-contained and works without
|
|
108
|
+
the Gateway.
|
|
104
109
|
|
|
105
110
|
Install the latest release with `npm install -g moderado`. To install a specific
|
|
106
111
|
version, run `npm install -g moderado@<version>`. Prebuilt binaries and the curl
|
|
@@ -109,7 +114,7 @@ npm and Scoop. See `docs/DISTRIBUTION.md` for package-manager details.
|
|
|
109
114
|
|
|
110
115
|
### Update an existing installation
|
|
111
116
|
|
|
112
|
-
These commands are available
|
|
117
|
+
These commands are available in the current release.
|
|
113
118
|
|
|
114
119
|
```bash
|
|
115
120
|
moderado update # latest release within the installed major version
|
|
@@ -159,7 +164,7 @@ routing, while selecting a route pins requests to it. Existing BYOK and local
|
|
|
159
164
|
provider profiles remain independent.
|
|
160
165
|
|
|
161
166
|
The same `/connect` menu offers OpenRouter, NVIDIA NIM, Ollama,
|
|
162
|
-
LM Studio, and custom OpenAI-compatible providers.
|
|
167
|
+
LM Studio, and custom OpenAI-compatible providers. Earlier releases used
|
|
163
168
|
`/login` for the Gateway.
|
|
164
169
|
|
|
165
170
|
Moderado OAuth credentials last 30 days and have no refresh token; authorize again
|
package/dist/commands/chat.d.ts
CHANGED
|
@@ -1,55 +1,21 @@
|
|
|
1
1
|
import { NvidiaAdapter } from '@moderado/providers';
|
|
2
2
|
import { discoverMcpServers } from '@moderado/tools';
|
|
3
|
-
import type {
|
|
4
|
-
import { ApprovalDecision, ApprovalRequest,
|
|
3
|
+
import type { WebSearchToolOptions } from '@moderado/tools';
|
|
4
|
+
import { ApprovalDecision, ApprovalRequest, IToolRegistry, McpServerConfig } from '@moderado/contracts';
|
|
5
5
|
import { CliParsedArgs } from '../args.js';
|
|
6
|
-
import {
|
|
6
|
+
import { ProviderConnection } from '../config.js';
|
|
7
7
|
import { StoredSession } from '../sessions.js';
|
|
8
8
|
import { selectConfirmPopup, selectListPopup } from '../ui/popup.js';
|
|
9
|
+
export * from './chat_slash.js';
|
|
10
|
+
export * from './chat_meta.js';
|
|
11
|
+
export * from './chat_search.js';
|
|
12
|
+
export * from './chat_outcome.js';
|
|
9
13
|
export declare function createConnectionProvider(connection: ProviderConnection): NvidiaAdapter;
|
|
10
14
|
export declare function getProviderStatusName(connection?: Pick<ProviderConnection, 'id' | 'displayName'>): string | undefined;
|
|
11
15
|
export declare function formatSessionExitSummary(session: StoredSession, modelId?: string): string;
|
|
12
16
|
export declare function createAgentTask(request: string, mode: 'Plan' | 'Execute'): string;
|
|
13
17
|
export declare function createReviewTask(changedFiles: string[]): string;
|
|
14
18
|
export declare function createReviewToolRegistry(): IToolRegistry;
|
|
15
|
-
export declare const STANDARD_SLASH_COMMANDS: readonly ["/connect", "/model", "/init", "/btw", "/mcp", "/session", "/queue", "/workflow", "/review", "/map", "/budget", "/skills", "/clear", "/help", "/exit", "/quit"];
|
|
16
|
-
export declare function levenshteinDistance(a: string, b: string): number;
|
|
17
|
-
export interface SlashCommandAdvice {
|
|
18
|
-
isSlashCommand: boolean;
|
|
19
|
-
isValid: boolean;
|
|
20
|
-
suggestion?: string;
|
|
21
|
-
advice?: string;
|
|
22
|
-
}
|
|
23
|
-
export declare function findSlashCommandAdvice(rawInput: string): SlashCommandAdvice;
|
|
24
|
-
export declare function formatTurnFailureAnswer(status: string, errorEvent: {
|
|
25
|
-
code?: string;
|
|
26
|
-
message: string;
|
|
27
|
-
} | undefined, modelId: string, otherConnections?: string[]): string;
|
|
28
|
-
/** A turn whose provider rejected its credential may recover by re-entering a key once. */
|
|
29
|
-
export declare function turnFailedAuthentication(status: string, errorEvent: {
|
|
30
|
-
code?: string;
|
|
31
|
-
message: string;
|
|
32
|
-
} | undefined): boolean;
|
|
33
|
-
export declare function resolveTurnAssistantAnswer(result: {
|
|
34
|
-
status: string;
|
|
35
|
-
messages: ChatMessage[];
|
|
36
|
-
selectedModel?: {
|
|
37
|
-
id: string;
|
|
38
|
-
};
|
|
39
|
-
}, previousHistoryLength: number, lastErrorEvent?: {
|
|
40
|
-
code?: string;
|
|
41
|
-
message: string;
|
|
42
|
-
}, streamedAnswer?: string, currentModel?: string, otherConnections?: string[]): {
|
|
43
|
-
answer: string;
|
|
44
|
-
isError: boolean;
|
|
45
|
-
};
|
|
46
|
-
export declare function saveFailedTurnPrompt(history: ChatMessage[], prompt: string, partialResponse?: string): ChatMessage[];
|
|
47
|
-
export declare function isBareExitCommand(input: string): boolean;
|
|
48
|
-
/** Resolve the required, explicit local destination for `/session share`. */
|
|
49
|
-
export declare function resolveSessionSharePath(workspaceRoot: string, outputPath: string): string;
|
|
50
|
-
export declare function isGenerationCancelKey(key: {
|
|
51
|
-
name?: string;
|
|
52
|
-
} | undefined, str?: string): boolean;
|
|
53
19
|
export declare class TurnCommandQueue {
|
|
54
20
|
private queue;
|
|
55
21
|
private draft;
|
|
@@ -75,35 +41,6 @@ export declare function handleGenerationKeypress(str: string, key: {
|
|
|
75
41
|
onQueueAdd: (item: string) => void;
|
|
76
42
|
onBtw?: (command: string) => void;
|
|
77
43
|
}): void;
|
|
78
|
-
export declare function isNetworkCommand(request: Pick<ApprovalRequest, 'toolName' | 'exactPayload'>): boolean;
|
|
79
|
-
export declare function isLocalModelQuery(input: string): boolean;
|
|
80
|
-
export declare function isLocalProviderQuery(input: string): boolean;
|
|
81
|
-
export declare function isLocalIdentityQuery(input: string): boolean;
|
|
82
|
-
export declare function isLocalTokenQuery(input: string): boolean;
|
|
83
|
-
export declare function isLocalVersionQuery(input: string): boolean;
|
|
84
|
-
export declare function isLocalWorkspaceQuery(input: string): boolean;
|
|
85
|
-
export interface LocalMetaQueryContext {
|
|
86
|
-
currentModel?: string;
|
|
87
|
-
providerName?: string;
|
|
88
|
-
activeMode: 'Plan' | 'Execute';
|
|
89
|
-
workspace: string;
|
|
90
|
-
version?: string;
|
|
91
|
-
sessionTokens?: number;
|
|
92
|
-
sessionCost?: string;
|
|
93
|
-
}
|
|
94
|
-
export declare function resolveLocalMetaQuery(input: string, context: LocalMetaQueryContext): string | undefined;
|
|
95
|
-
/** Detect questions whose answer depends on changing public information. */
|
|
96
|
-
export declare function shouldFastRouteWebSearch(input: string): boolean;
|
|
97
|
-
/** Environment configuration overrides the optional persistent search endpoint. */
|
|
98
|
-
export declare function resolveWebSearchEndpoint(config: ModeradoConfig): string | undefined;
|
|
99
|
-
export declare function formatDirectWebSearchAnswer(result: ToolResult, modelConnected?: boolean): string;
|
|
100
|
-
/** Environment configuration overrides the persistent search provider preference. */
|
|
101
|
-
export declare function resolveWebSearchProvider(config: ModeradoConfig): WebSearchProviderName | undefined;
|
|
102
|
-
export declare function resolveWebSearchOptions(config: ModeradoConfig): WebSearchToolOptions;
|
|
103
|
-
/** Feed completed search evidence into a single model turn instead of paying for a second tool round trip. */
|
|
104
|
-
export declare function buildSearchAnswerTask(question: string, result: ToolResult): string;
|
|
105
|
-
/** Keep the transcript honest: the injected evidence turn becomes the question the user actually asked. */
|
|
106
|
-
export declare function replaceEvidenceTurn(messages: ChatMessage[], evidenceTask: string, question: string): ChatMessage[];
|
|
107
44
|
export interface ApprovalPolicyOptions {
|
|
108
45
|
autoApprove: boolean;
|
|
109
46
|
requestInteractiveApproval: (request: ApprovalRequest, signal?: AbortSignal) => Promise<ApprovalDecision>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat.d.ts","sourceRoot":"","sources":["../../src/commands/chat.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAkG,kBAAkB,
|
|
1
|
+
{"version":3,"file":"chat.d.ts","sourceRoot":"","sources":["../../src/commands/chat.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAkG,kBAAkB,EAA2C,MAAM,iBAAiB,CAAC;AAC9L,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,eAAe,E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