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
6 changes: 6 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,16 @@ jobs:
with:
node-version: 20
cache: pnpm
- name: Install native build tools (Linux)
if: runner.os == 'Linux'
run: sudo apt-get update && sudo apt-get install -y build-essential python3
- run: pnpm install --frozen-lockfile
- run: pnpm run sync:versions -- --check
- run: pnpm run release:check-assets
- run: pnpm run typecheck
- run: pnpm run rebuild:node
- run: pnpm test
- run: pnpm run check:architecture
- run: pnpm run build:cli
- run: pnpm run build:vscode
- run: pnpm run benchmark:validate
6 changes: 5 additions & 1 deletion .github/workflows/native-binaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,13 @@ jobs:
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 24
node-version: 20
cache: pnpm
- name: Install native build tools (Linux)
if: runner.os == 'Linux'
run: sudo apt-get update && sudo apt-get install -y build-essential python3
- run: pnpm install --frozen-lockfile
- run: pnpm run sync:versions -- --check
- run: pnpm run typecheck
- run: pnpm run rebuild:native
env:
Expand Down
47 changes: 37 additions & 10 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,45 @@
# @mitii/v8, @mitii/sdk, and @mitii/cli ship with "private": true.
# Public npm publish is deferred until those flags are intentionally removed.
# Product releases today are VSIX artifacts via .github/workflows/release.yml.
name: npm publish (deferred)
# Publishes @mitii/v8@mitii/sdk @mitii/host → @mitii/cli to npm.
# Invoked from the Release workflow on v* tags, or manually via workflow_dispatch.
# Requires repository secret: NPM_TOKEN
name: npm publish

on:
workflow_dispatch:
workflow_call:

jobs:
deferred:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- name: Packages are private
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 20
registry-url: https://registry.npmjs.org
cache: pnpm
- name: Require NPM_TOKEN
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
echo "::notice::npm publish is deferred while packages remain private: true."
echo "Ship the VS Code extension via the Release workflow (VSIX)."
echo "To publish npm later: remove private flags, then restore a real publish job."
exit 1
if [ -z "$NPM_TOKEN" ]; then
echo "::error::NPM_TOKEN secret is missing. Add an npm automation token in repo Settings → Secrets → Actions."
exit 1
fi
- name: Install native build tools
run: sudo apt-get update && sudo apt-get install -y build-essential python3
- run: pnpm install --frozen-lockfile
- run: pnpm run sync:versions -- --check
- run: pnpm run rebuild:node
- run: pnpm run build:v8
- run: pnpm run build:sdk
- run: pnpm run build:host
- run: pnpm run build:cli
- run: pnpm run check:architecture
- name: Publish npm packages
run: node scripts/publish-npm.cjs
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
47 changes: 46 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Tag release: multi-platform VSIX + GitHub Release + Marketplace (+ Open VSX) + npm.
# Requires secrets: NPM_TOKEN, VSCE_PAT. Optional: OVSX_PAT.
name: Release

on:
Expand Down Expand Up @@ -28,10 +30,15 @@ jobs:
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 24
node-version: 20
cache: pnpm
- name: Install native build tools (Linux)
if: runner.os == 'Linux'
run: sudo apt-get update && sudo apt-get install -y build-essential python3
- run: pnpm install --frozen-lockfile
- run: pnpm run sync:versions -- --check
- run: pnpm run typecheck
- run: pnpm run rebuild:node
- run: pnpm test
- run: pnpm run rebuild:native
env:
Expand Down Expand Up @@ -61,3 +68,41 @@ jobs:
with:
body_path: release-notes.md
files: 'dist-vsix/*.vsix'

publish-marketplace:
needs: package
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: pnpm
- name: Require VSCE_PAT
env:
VSCE_PAT: ${{ secrets.VSCE_PAT }}
run: |
if [ -z "$VSCE_PAT" ]; then
echo "::error::VSCE_PAT secret is missing. Add an Azure DevOps PAT with Marketplace publish scope for publisher mitii."
exit 1
fi
- run: pnpm install --frozen-lockfile
- uses: actions/download-artifact@v4
with:
path: dist-vsix
merge-multiple: true
- name: Publish to VS Code Marketplace
run: node scripts/publish-vscode-vsix.cjs
env:
VSCE_PAT: ${{ secrets.VSCE_PAT }}
- name: Publish to Open VSX
run: node scripts/publish-ovsx-vsix.cjs
env:
OVSX_PAT: ${{ secrets.OVSX_PAT }}

npm:
uses: ./.github/workflows/npm-publish.yml
secrets: inherit
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,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.85+" src="https://img.shields.io/badge/VS%20Code-1.85%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.8.0" src="https://img.shields.io/badge/version-2.8.0-111111">
<img alt="Version 2.8.5" src="https://img.shields.io/badge/version-2.8.5-111111">
<a href="https://docs.mitii.dev"><img alt="Documentation" src="https://img.shields.io/badge/docs-docs.mitii.dev-5B5BFF"></a>
</p>

Expand Down Expand Up @@ -126,7 +126,7 @@ See [apps/cli/README.md](apps/cli/README.md) for `ask`, `session`, `index`, `sta

### SDK

`@mitii/sdk`, `@mitii/v8`, and `@mitii/cli` are **private workspace packages** today (not published to npm). Consume them from this monorepo, or wait until publish is intentionally enabled.
`@mitii/v8`, `@mitii/sdk`, `@mitii/host`, and `@mitii/cli` publish to npm on `v*` release tags (see [docs/RELEASE.md](docs/RELEASE.md)). For local development, consume them from this monorepo workspace.

```ts
import { createMitiiClient, EchoLlmPort } from '@mitii/sdk';
Expand Down
4 changes: 2 additions & 2 deletions apps/cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ npx @mitii/cli --help

Requires **Node.js 20+**. Native dependency: `better-sqlite3` (optional LanceDB for vectors). License: **AGPL-3.0-or-later**.

> Until published from this monorepo, build from source:
Published from this monorepo on `v*` release tags. For local development:

```bash
pnpm --filter @mitii/cli build
node apps/cli/bin/mitii.js --help
```

Legacy npm `@mitii/cli@2.7.x` is a different binary stack — do not mix with this tree until publish replaces it.
Legacy npm `@mitii/cli@2.7.x` is a different binary stack — prefer versions published from this tree.

## Quick start

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.8.0",
"version": "2.8.5",
"description": "Mitii headless CLI over @mitii/sdk.",
"license": "AGPL-3.0-or-later",
"publishConfig": {
Expand Down
13 changes: 11 additions & 2 deletions apps/cli/scripts/build-cli.cjs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
const { build } = require('esbuild');
const { createRequire } = require('node:module');
const { builtinModules } = require('node:module');
const { mkdirSync } = require('node:fs');
const { dirname, join } = require('node:path');
const { cpSync, mkdirSync, rmSync } = require('node:fs');
const { dirname, join, resolve } = require('node:path');

const root = join(__dirname, '..');
const outfile = join(root, 'dist/cli.js');
Expand All @@ -20,6 +20,14 @@ const externals = new Set([

mkdirSync(dirname(outfile), { recursive: true });

function stageBundledSkills() {
const source = resolve(__dirname, '../../../packages/sdk/skills');
const target = join(root, 'dist/skills');
rmSync(target, { recursive: true, force: true });
cpSync(source, target, { recursive: true });
console.log(`staged ${target}`);
}

build({
absWorkingDir: root,
entryPoints: [join(root, 'src/cli.ts')],
Expand Down Expand Up @@ -53,6 +61,7 @@ build({
logLevel: 'info',
})
.then(() => {
stageBundledSkills();
console.log(`built ${outfile}`);
})
.catch((error) => {
Expand Down
9 changes: 5 additions & 4 deletions 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.8.0",
"version": "2.8.5",
"publisher": "mitii",
"license": "AGPL-3.0-or-later",
"icon": "media/mitii-short-logo.png",
Expand Down Expand Up @@ -81,6 +81,7 @@
"files": [
"dist/extension.js",
"dist/native/better_sqlite3.node",
"dist/skills/**/*",
"dist/webview/**/*",
"media/**/*",
"README.md",
Expand Down Expand Up @@ -257,9 +258,9 @@
},
"mitii.provider.contextWindow": {
"type": "number",
"default": 32768,
"minimum": 1024,
"description": "Model context window in tokens. Used for prompt budgeting, max output reserve, and the token meter. Prefer the real window for your model (or leave unset to use the model preset)."
"default": 0,
"minimum": 0,
"description": "Model context window in tokens. Set 0 to use the model preset; use a positive value only when your runtime has a different limit."
},
"mitii.provider.maximumOutputTokens": {
"type": "number",
Expand Down
8 changes: 8 additions & 0 deletions apps/vscode/scripts/audit-package.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,14 @@ assertFile(join(dist, 'webview', 'index.html'), 'webview index');
assertFile(join(dist, 'webview', 'main.js'), 'webview script');
assertFile(join(dist, 'webview', 'main.css'), 'webview style');
assertFile(join(dist, 'native', 'better_sqlite3.node'), 'SQLite native binding');
assertFile(
join(dist, 'skills', 'planning-default', 'SKILL.md'),
'bundled planning skill',
);
assertFile(
join(dist, 'skills', 'safety-always', 'SKILL.md'),
'bundled safety skill',
);

const bundlePath = join(dist, 'extension.js');
if (existsSync(bundlePath)) {
Expand Down
20 changes: 18 additions & 2 deletions apps/vscode/scripts/build-extension.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,13 @@ const { build } = require('esbuild');
const { spawnSync } = require('node:child_process');
const { createRequire } = require('node:module');
const { builtinModules } = require('node:module');
const { existsSync, mkdirSync, rmSync, writeFileSync } = require('node:fs');
const {
cpSync,
existsSync,
mkdirSync,
rmSync,
writeFileSync,
} = require('node:fs');
const { dirname, join, resolve } = require('node:path');
const {
stageNativeSqliteBinding,
Expand All @@ -13,7 +19,8 @@ const distDir = join(root, 'dist');
const outfile = join(root, 'dist/extension.js');
const webviewDir = join(root, 'webview-ui');
const requireFromApp = createRequire(join(root, 'package.json'));
const production = process.argv.includes('--production') || process.env.NODE_ENV === 'production';
const production =
process.argv.includes('--production') || process.env.NODE_ENV === 'production';
const builtins = new Set([
...builtinModules,
...builtinModules.map((name) => `node:${name}`),
Expand Down Expand Up @@ -42,6 +49,14 @@ function buildWebview() {
console.log(`built ${join(root, 'dist/webview')}`);
}

function stageBundledSkills() {
const source = resolve(__dirname, '../../../packages/sdk/skills');
const target = join(distDir, 'skills');
rmSync(target, { recursive: true, force: true });
cpSync(source, target, { recursive: true });
console.log(`staged ${target}`);
}

rmSync(distDir, { recursive: true, force: true });
mkdirSync(dirname(outfile), { recursive: true });

Expand Down Expand Up @@ -88,6 +103,7 @@ build({
);
}
stageNativeSqliteBinding();
stageBundledSkills();
console.log(`built ${outfile}`);
})
.catch((error) => {
Expand Down
Loading
Loading