Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,27 @@ jobs:
with:
path: dist-vsix
merge-multiple: true
- name: Resolve release tag from package.json
id: meta
run: |
version="$(node -p "require('./package.json').version")"
if [ -z "$version" ]; then
echo "::error::Could not read version from package.json"
exit 1
fi
echo "version=$version" >> "$GITHUB_OUTPUT"
echo "tag=v${version}" >> "$GITHUB_OUTPUT"
- name: Generate release notes
run: cp CHANGELOG.md release-notes.md
- uses: softprops/action-gh-release@v2
# workflow_dispatch has no tag ref; create/update the GitHub Release from package.json.
- uses: softprops/action-gh-release@v3
with:
tag_name: ${{ steps.meta.outputs.tag }}
name: ${{ steps.meta.outputs.tag }}
target_commitish: ${{ github.sha }}
body_path: release-notes.md
files: 'dist-vsix/*.vsix'
fail_on_unmatched_files: true

publish-marketplace:
needs: package
Expand Down
4 changes: 3 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,7 @@
"wasms",
"xenova"
],
"mitii.onboarding.completed": true
"mitii.onboarding.completed": true,
"mitii.provider.model": "my-qwen-64k:latest",
"mitii.provider.contextWindow": 45000
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<a href="LICENSE"><img alt="License: AGPL v3" src="https://img.shields.io/badge/License-AGPL_v3-blue.svg"></a>
<a href="https://code.visualstudio.com/"><img alt="VS Code 1.124+" src="https://img.shields.io/badge/VS%20Code-1.124%2B-007ACC?logo=visualstudiocode"></a>
<a href="https://nodejs.org/"><img alt="Node 20+" src="https://img.shields.io/badge/Node-20%2B-339933?logo=node.js"></a>
<img alt="Version 2.9.57" src="https://img.shields.io/badge/version-2.9.57-111111">
<img alt="Version 2.9.66" src="https://img.shields.io/badge/version-2.9.66-111111">
<a href="https://docs.mitii.dev"><img alt="Documentation" src="https://img.shields.io/badge/docs-docs.mitii.dev-ff751f"></a>
</p>

Expand Down
2 changes: 1 addition & 1 deletion apps/acp/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mitii/acp",
"version": "2.9.57",
"version": "2.9.66",
"description": "Mitii ACP-lite stdio bridge (Phase 3). Decision Policy remains authority; V8 does not import ACP.",
"license": "AGPL-3.0-or-later",
"type": "module",
Expand Down
2 changes: 1 addition & 1 deletion apps/cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ mitii export-session "Summarize this repo" --out session.json --echo
| `run --auto "<task>"` | Unattended CI run (agent + apply autonomy; no prompts) |
| `session` | Interactive prompt loop with MITII banner |
| `index` | Full workspace index + publish repository state |
| `review` | Deterministic review prep / SARIF (`--preview`, `--from`/`--to`, `--commit`, `--format`, `--output`). For LLM findings use `mitii ask … --skill code-review-and-quality` or VS Code **Review** mode |
| `review` | Deterministic review prep / SARIF (`--preview`, `--from`/`--to`, `--commit`, `--format`, `--output`). For LLM findings use `mitii ask … --skill code-review-and-quality` (recipe/skill) or the VS Code **Review** button for working-tree changes |
| `status` | Show latest persisted repository state |
| `export-session` | Run ask and write secret-free JSON export |
| `connect` | Bridge Mitii into Telegram, Discord, or Slack |
Expand Down
2 changes: 1 addition & 1 deletion apps/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mitii/cli",
"version": "2.9.57",
"version": "2.9.66",
"description": "Mitii headless CLI over @mitii/sdk. Phase 0: --origin/--autonomy/--agent for CI automation.",
"license": "AGPL-3.0-or-later",
"publishConfig": {
Expand Down
2 changes: 1 addition & 1 deletion apps/cli/src/help.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Commands:
--format json|sarif Output shape (default json)
--output <path> Write result to file
--effort low|medium|high Prep effort band
Full LLM review: VS Code Review mode, or:
Full LLM review: VS Code Review button (git changes), or:
mitii ask "review these changes" --mode ask --skill code-review-and-quality
status Show latest persisted repository state
export-session Run ask and write secret-free JSON export
Expand Down
2 changes: 1 addition & 1 deletion apps/daemon/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mitii/daemon",
"version": "2.9.57",
"version": "2.9.66",
"description": "Mitii automation daemon process entry (Phase 1). Long-lived schedule runner.",
"license": "AGPL-3.0-or-later",
"type": "module",
Expand Down
4 changes: 2 additions & 2 deletions apps/vscode/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ For cloud providers, run **Mitii: Set Provider API Key** (stored in VS Code Secr

- **Repository-aware context** - SQLite FTS5, symbols, optional vectors, repo map, diagnostics, Git state, and `@` attachments
- **Skills** - force-attach playbooks with `/` or `@skill:id` in chat (up to 3 per message); workspace skills in `.mitii/skills/`
- **Ask / Plan / Agent** - read-only Q&A, structured plans, and controlled edits. Use the collapsible **Review** bar above chat (file count → Review) for structured working-tree findings via `emit_review_finding` — not a fourth mode. After findings appear, use **Dismiss**, **Fix**, or **Fix all** (Agent + `fix-review-findings` recipe).
- **Ask / Plan / Agent** - read-only Q&A, structured plans, and controlled edits. The composer **Review** strip lists **this chat’s** Mitii file changes (expand with **Review**). Enable **Settings → Features → Code Review** to add **Code Review (N)** over the full git working tree, then severity-tagged findings with **Fix** / **Fix all**. Free-form “code review” chat is not a structured review run.
- **FIM autocomplete** - optional inline ghost text from a low-latency OpenAI-compatible `prompt` + `suffix` endpoint
- **Safety** - configurable approvals, path containment, command policy, pre-write checkpoints, workspace trust
- **Providers** - Echo, Anthropic (Claude), Gemini, and OpenAI-compatible endpoints (DeepSeek, OpenRouter, Azure, Ollama, custom `/v1`)
Expand All @@ -45,7 +45,7 @@ For cloud providers, run **Mitii: Set Provider API Key** (stored in VS Code Secr
| Command | Purpose |
|---|---|
| **Mitii: Open Chat** | Open the sidebar |
| **Mitii: Review Working Tree Changes** | Switch to Review mode and run a structured review |
| **Mitii: Review Working Tree Changes** | Expand the chat review strip. **Review** = this-chat Mitii edits. With Settings → Features → Code Review on, **Code Review (N)** runs LLM analysis over all `N` git changes |
| **Mitii: Index Workspace** | Rebuild repository index |
| **Mitii: Show Settings** | Provider, index, MCP, workspace |
| **Mitii: Toggle Autocomplete** | Enable or disable FIM inline suggestions |
Expand Down
34 changes: 33 additions & 1 deletion apps/vscode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "mitii-ai-agent",
"displayName": "Mitii AI Agent",
"description": "Local-first VS Code AI coding agent with repository-aware context and controlled execution",
"version": "2.9.57",
"version": "2.9.66",
"publisher": "mitii",
"license": "AGPL-3.0-or-later",
"icon": "media/mitii-logo.png",
Expand Down Expand Up @@ -1028,6 +1028,11 @@
"default": true,
"description": "Show live reasoning / thinking activity in the Mitii chat UI"
},
"mitii.ui.features.codeReviewButton": {
"type": "boolean",
"default": false,
"description": "Show the Code Review button on the working-tree bar. Review always lists git changes; Code Review runs an LLM analysis. Enable under Settings → Features."
},
"mitii.ui.reasoningPreviewMaxChars": {
"type": "number",
"default": 8000,
Expand Down Expand Up @@ -1365,6 +1370,33 @@
}
}
}
},
"mitii.tokenBudget.visiblePlanMinUsableRatio": {
"type": "number",
"default": 0.35,
"minimum": 0,
"maximum": 1,
"description": "Visible-plan affordability threshold as a fraction of the context window."
},
"mitii.tokenBudget.changeImpactMinUsableRatio": {
"type": "number",
"default": 0.35,
"minimum": 0,
"maximum": 1,
"description": "Change-impact affordability threshold as a fraction of the context window."
},
"mitii.tokenBudget.maxPatchesPerCallCap": {
"type": "number",
"default": 96,
"minimum": 1,
"description": "Maximum patches allowed in one mutation call."
},
"mitii.loopPolicy.maxStructuredReviewRecoveries": {
"type": "number",
"default": 2,
"minimum": 0,
"maximum": 8,
"description": "Recovery attempts when a structured review ends without findings (0 disables)."
}
}
}
Expand Down
7 changes: 6 additions & 1 deletion apps/vscode/src/automationHost.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { AutomationService } from '@mitii/automation';

import { openSqliteDatabase } from './nativeSqlite.js';
import type {
AutomationRunView,
AutomationSpecView,
Expand Down Expand Up @@ -56,7 +57,11 @@ export function handleAutomationHostMessage(input: {
post: (msg: HostToWebviewMessage) => void;
workspaceRoot: string | undefined;
}): void {
const service = new AutomationService({});
const service = new AutomationService({
// Bundled better-sqlite3 has no default .node next to extension.js; use the
// Electron-staged binding under dist/native (same path as workspace index).
openDatabase: openSqliteDatabase,
});
try {
if (input.message.type === 'requestAutomations') {
// Reconcile workspace file specs so the panel mirrors `mitii serve`.
Expand Down
9 changes: 8 additions & 1 deletion apps/vscode/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
unwrapRecipeAnswer,
type MitiiWritingRecipeId,
IndexLockedError,
resolveMaximumIndexFiles,
} from '@mitii/host';
import { isSecurityConcern, WorkspaceIgnorePolicy } from '@mitii/v8';

Expand Down Expand Up @@ -378,6 +379,11 @@ export function activate(context: ExtensionContext): void {
const snapshot = await buildWorkspaceSnapshot({
workspaceRoot: root,
workspaceId,
maxFiles: resolveMaximumIndexFiles(
vscode.workspace
.getConfiguration('mitii')
.get<number>('workspace.maximumIndexFiles'),
),
});
fileCount = snapshot.fileCount;
truncated = snapshot.truncated;
Expand Down Expand Up @@ -424,7 +430,8 @@ export function activate(context: ExtensionContext): void {

const reviewChanges = async (): Promise<void> => {
await vscode.commands.executeCommand('mitii.sidebar.focus');
sidebar?.post({ type: 'startReview', autoRun: true });
// Show git changes only — LLM Code Review is the separate bar button.
sidebar?.post({ type: 'startReview', autoRun: false });
};

const runWritingRecipe = async (
Expand Down
12 changes: 11 additions & 1 deletion apps/vscode/src/hostAsk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
type RunEvent,
type TaskList,
} from '@mitii/sdk';
import { loadUserSafetyRules } from '@mitii/host';
import { loadUserSafetyRules, resolveMaximumIndexFiles } from '@mitii/host';
import type * as vscode from 'vscode';

import { formatDiagnosticsPromptBlock } from './context/diagnosticsContext.js';
Expand Down Expand Up @@ -166,6 +166,8 @@ export async function runAskInOutputChannel(options: {
approvalMode?: string;
pinnedPaths?: string[];
requiredSkillIds?: string[];
/** Skills that must not be auto-matched for this run. */
excludedSkillIds?: string[];
/** Attached MCP server ids for this turn (@mcp: / host pin). */
requiredMcpServerIds?: string[];
workspaceId?: string;
Expand Down Expand Up @@ -475,6 +477,9 @@ export async function runAskInOutputChannel(options: {
...(options.requiredSkillIds && options.requiredSkillIds.length > 0
? { requiredSkillIds: [...options.requiredSkillIds] }
: {}),
...(options.excludedSkillIds && options.excludedSkillIds.length > 0
? { excludedSkillIds: [...options.excludedSkillIds] }
: {}),
...(options.requiredMcpServerIds &&
options.requiredMcpServerIds.length > 0
? { requiredMcpServerIds: [...options.requiredMcpServerIds] }
Expand Down Expand Up @@ -739,6 +744,11 @@ async function autoPublishFullOrSnapshot(options: {
const snap = await buildWorkspaceSnapshot({
workspaceRoot: options.workspaceRoot,
workspaceId: options.workspaceId,
maxFiles: resolveMaximumIndexFiles(
options.vs.workspace
.getConfiguration('mitii')
.get<number>('workspace.maximumIndexFiles'),
),
});
await options.client.publishRepositoryState(snap.candidate);
options.channel.appendLine(
Expand Down
85 changes: 85 additions & 0 deletions apps/vscode/src/liveSandboxProcess.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
import type * as vscode from 'vscode';
import type { ProcessPort, ProcessExecRequest } from '@mitii/v8';
import {
createSandboxedProcessPort,
resolveSandboxPolicy,
resolveSandboxSettingsFromPreset,
type SandboxBackend,
type SandboxNetworkMode,
} from '@mitii/host';

type ResolvedSandboxSettings = {
enabled: boolean;
network: SandboxNetworkMode;
};

function readSandboxSettings(vs: typeof vscode): ResolvedSandboxSettings {
const cfg = vs.workspace.getConfiguration('mitii');
const configured = (key: string): boolean => {
const value = cfg.inspect(key);
return (
value?.globalValue !== undefined ||
value?.workspaceValue !== undefined ||
value?.workspaceFolderValue !== undefined
);
};
return resolveSandboxSettingsFromPreset({
approvalMode: cfg.get<string>('safety.approvalMode') ?? 'guided',
...(configured('safety.sandbox.enabled')
? { enabled: cfg.get<boolean>('safety.sandbox.enabled') === true }
: {}),
...(configured('safety.sandbox.network')
? { network: cfg.get<string>('safety.sandbox.network') ?? 'deny' }
: {}),
});
}

function settingsKey(settings: ResolvedSandboxSettings): string {
return `${settings.enabled ? 1 : 0}:${settings.network}`;
}

/**
* Process port that refreshes access policy when settings change, without
* rebuilding a wrapper on every exec.
*
* Once sandbox has been enabled for this port, it cannot be disabled through
* live settings (fail closed). Network may still tighten/loosen with approval
* mode so Guided ↔ Full access keeps working mid-session.
*/
export function createLiveSandboxedProcessPort(
vs: typeof vscode,
inner: ProcessPort,
workspaceRoot: string,
backend: SandboxBackend,
): ProcessPort {
let cachedKey: string | undefined;
let cachedPort: ProcessPort | undefined;
let sandboxLatchedOn = false;

const resolvePort = (): ProcessPort => {
const raw = readSandboxSettings(vs);
const settings: ResolvedSandboxSettings = {
// Latch: after sandbox has run enabled, ignore live disable.
enabled: raw.enabled || sandboxLatchedOn,
network: raw.network,
};
if (settings.enabled) sandboxLatchedOn = true;

const key = settingsKey(settings);
if (cachedPort && cachedKey === key) return cachedPort;

cachedKey = key;
cachedPort = createSandboxedProcessPort(
inner,
resolveSandboxPolicy({ ...settings, workspaceRoot }),
backend,
);
return cachedPort;
};

return {
execFile(request: ProcessExecRequest) {
return resolvePort().execFile(request);
},
};
}
Loading
Loading