Skip to content
Open
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
1 change: 1 addition & 0 deletions .github/workflows/gitoxide-helper-admission.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ jobs:
- name: Build the helper invocation owner
run: >-
npm --workspace @maka/core run build &&
npm --workspace @maka/network run build &&
npm --workspace @maka/storage run build &&
npm --workspace @maka/runtime run build &&
npm --workspace @maka/runtime-host run build
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/windows-recovery.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ on:
- 'packages/storage/package.json'
- 'packages/storage/tsconfig.json'
- 'packages/storage/src/**'
- 'packages/network/package.json'
- 'packages/network/tsconfig.json'
- 'packages/network/src/**'
- 'packages/runtime/package.json'
- 'packages/runtime/tsconfig.json'
- 'packages/runtime/src/**'
Expand Down
6 changes: 6 additions & 0 deletions apps/desktop/e2e/streaming-remount.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,12 @@ test('keeps a completed reply after an interrupted turn and conversation remount
await expect(composer).toHaveText('');

await composer.fill(FAKE_HOLD_OPEN_PROMPT);
// An empty editor only proves that the draft moved to the new-task slot;
// wait for the Send gate before Enter so the submission is not attempted
// while sending is still disabled.
await expect(page.getByRole('button', { name: '发送' })).toBeEnabled({
timeout: 20_000,
});
await composer.press('Enter');
await expect(page.locator('.maka-bubble-streaming')).toContainText(
'Fake backend waiting',
Expand Down
4 changes: 3 additions & 1 deletion apps/desktop/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"build:preload": "esbuild src/preload/preload.ts --bundle --platform=node --format=cjs --outfile=dist/preload/preload.cjs --external:electron",
"build:overlay": "node ../../scripts/build-cursor-overlay.mjs",
"build:renderer": "vite build && node scripts/check-renderer-entry-output.mjs && node ../../scripts/check-third-party-notices.mjs",
"build:workspace-deps": "npm --workspace @maka/core run build && npm --workspace @maka/storage run build && npm --workspace @maka/mcp run build && npm --workspace @maka/runtime run build && npm --workspace @maka/runtime-host run build && npm --workspace @maka/computer-use run build && npm --workspace @maka/ui run build",
"build:workspace-deps": "npm --workspace @maka/core run build && npm --workspace @maka/network run build && npm --workspace @maka/bots run build && npm --workspace @maka/storage run build && npm --workspace @maka/mcp run build && npm --workspace @maka/runtime run build && npm --workspace @maka/runtime-host run build && npm --workspace @maka/computer-use run build && npm --workspace @maka/ui run build",
"package:macos-arm64": "electron-builder --config electron-builder.config.mjs --mac --arm64 --publish never",
"package:windows-x64": "electron-builder --config electron-builder.config.mjs --win --x64 --publish never",
"typecheck": "tsc -p tsconfig.preload.json --noEmit && tsc -p tsconfig.main.json --noEmit && tsc -p tsconfig.renderer.json --noEmit && tsc -p tsconfig.storybook.json --noEmit",
Expand All @@ -47,9 +47,11 @@
},
"dependencies": {
"@jackwener/opencli": "1.8.6",
"@maka/bots": "0.1.0",
"@maka/computer-use": "0.1.0",
"@maka/core": "0.1.0",
"@maka/mcp": "0.1.0",
"@maka/network": "0.1.0",
"@maka/runtime": "0.1.0",
"@maka/runtime-host": "0.1.0",
"@maka/storage": "0.1.0",
Expand Down
12 changes: 6 additions & 6 deletions apps/desktop/renderer-architecture.json
Original file line number Diff line number Diff line change
Expand Up @@ -2780,7 +2780,7 @@
"@maka/core/bot-chat-settings": 1,
"@maka/core/bot-onboarding": 1,
"@maka/core/settings": 1,
"@maka/runtime/bots": 1,
"@maka/bots": 1,
"@maka/ui": 2,
"@maka/ui/icons": 1,
"react": 1
Expand All @@ -2803,7 +2803,7 @@
"@astryxdesign/core": 1,
"@maka/core/bot-chat-settings": 1,
"@maka/core/settings": 1,
"@maka/runtime/bots": 1,
"@maka/bots": 1,
"@maka/ui": 2,
"@maka/ui/icons": 1,
"react": 1
Expand Down Expand Up @@ -2841,7 +2841,7 @@
"@maka/core/bot-chat-settings": 1,
"@maka/core/bot-onboarding": 1,
"@maka/core/settings": 1,
"@maka/runtime/bots": 1,
"@maka/bots": 1,
"@maka/ui": 1,
"react": 1
}
Expand All @@ -2857,7 +2857,7 @@
"../locales/settings-bot-copy": 1,
"@maka/core/bot-chat-settings": 1,
"@maka/core/ui-locale": 1,
"@maka/runtime/bots": 1,
"@maka/bots": 1,
"@maka/ui": 1
}
},
Expand Down Expand Up @@ -2905,7 +2905,7 @@
"dependencyPaths": {
"@maka/core/bot-chat-settings": 1,
"@maka/core/bot-events": 1,
"@maka/runtime/bots": 1
"@maka/bots": 1
}
},
"src/renderer/settings/bot-wechat-login.tsx": {
Expand Down Expand Up @@ -2933,7 +2933,7 @@
"@astryxdesign/core/Dialog": 1,
"@astryxdesign/core/Layout": 1,
"@maka/core/bot-chat-settings": 1,
"@maka/runtime/bots": 1,
"@maka/bots": 1,
"@maka/ui": 1,
"@maka/ui/icons": 1,
"react": 1
Expand Down
21 changes: 20 additions & 1 deletion apps/desktop/scripts/check-renderer-architecture.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2225,10 +2225,29 @@ function metricTotal(value) {
return Object.values(value).reduce((total, count) => total + count, 0);
}

function dependencyScope(dependency) {
const slash = dependency.indexOf('/');
return slash === -1 ? dependency : dependency.slice(0, slash);
}

function allowsDependencyRename({ base, current, dependency }) {
// An external package dependency may enter a legacy file only when the same
// file removes equal-count dependency debt from the same package scope: a
// count-neutral re-export/package migration does not grow the legacy surface.
const scope = dependencyScope(dependency);
const increase = (current[dependency] ?? 0) - (base[dependency] ?? 0);
let removed = 0;
for (const [key, baseCount] of Object.entries(base)) {
if (dependencyScope(key) !== scope) continue;
removed += Math.max(0, (baseCount ?? 0) - (current[key] ?? 0));
}
return increase > 0 && increase <= removed;
}

function allowsMigrationDependency({ base, current, dependency, desktopRoot, path, section }) {
if (metricTotal(current.dependencyPaths) > metricTotal(base.dependencyPaths)) return false;
const target = resolveDependency(desktopRoot, resolve(desktopRoot, path), dependency);
if (!target) return false;
if (!target) return allowsDependencyRename({ base: base.dependencyPaths, current: current.dependencyPaths, dependency });
const targetRelative = normalizePath(relative(desktopRoot, target));
const targetZone = zoneFor(targetRelative);
if (section === 'legacyAppShell' || section === 'legacyAppShellClosure') {
Expand Down
46 changes: 46 additions & 0 deletions apps/desktop/scripts/check-renderer-architecture.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -1218,6 +1218,52 @@ describe('renderer architecture checker fixtures', () => {
);
});

it('allows a count-neutral external dependency rename paid by removed dependency debt', async () => {
await withDesktopFixture(
transitiveAppShellFiles(`
import { botStatus } from '@maka/bots';
export const legacySessionHelper = botStatus;
`),
(desktopRoot) => {
const currentConfig = generateArchitectureConfig(
desktopRoot,
transitiveAppShellSeedConfig(),
);
const baseConfig = structuredClone(currentConfig);
baseConfig.legacyAppShell.closure[TRANSITIVE_LEGACY_HELPER_PATH].dependencyPaths = {
'@maka/runtime/bots': 1,
};

assert.deepEqual(violationsFor(desktopRoot, currentConfig, baseConfig), []);
},
);
});

it('rejects an external dependency migration not paid by same-scope removed debt', async () => {
await withDesktopFixture(
transitiveAppShellFiles(`
import { run } from '@slack/web-api';
export const legacySessionHelper = run;
`),
(desktopRoot) => {
const currentConfig = generateArchitectureConfig(
desktopRoot,
transitiveAppShellSeedConfig(),
);
const baseConfig = structuredClone(currentConfig);
baseConfig.legacyAppShell.closure[TRANSITIVE_LEGACY_HELPER_PATH].dependencyPaths = {
'@maka/runtime/bots': 1,
};

const violations = violationsFor(desktopRoot, currentConfig, baseConfig);
assertHasViolation(
violations,
/^src\/renderer\/legacy-session-helper\.ts: new dependency debt @slack\/web-api$/u,
);
},
);
});

it('rejects a stale AppShell closure ledger when another legacy file becomes reachable', async () => {
const newlyReachablePath = 'src/renderer/legacy-session-store.ts';
await withDesktopFixture(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

import { strict as assert } from 'node:assert';
import { describe, it } from 'node:test';
import type { BotIncomingMessage, BotRegistry } from '@maka/runtime/bots';
import type { BotIncomingMessage, BotRegistry } from '@maka/bots';
import { createBotIncomingMainService } from '../bot-incoming-main.js';

describe('bot incoming new-session cwd', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

import assert from 'node:assert/strict';
import { describe, test } from 'node:test';
import type { BotIncomingMessage, BotRegistry } from '@maka/runtime/bots';
import type { BotIncomingMessage, BotRegistry } from '@maka/bots';
import { createBotIncomingMainService } from '../bot-incoming-main.js';
import { BotSessionUnavailableError } from '../bot-session-adapter.js';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import assert from 'node:assert/strict';
import { getEventListeners } from 'node:events';
import { test } from 'node:test';
import type { BotIncomingMessage, BotRegistry } from '@maka/runtime/bots';
import type { BotIncomingMessage, BotRegistry } from '@maka/bots';
import { createBotIncomingMainService } from '../bot-incoming-main.js';

async function waitFor(predicate: () => boolean, message: string): Promise<void> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import {
type AppSettings,
type UpdateAppSettingsInput,
} from '@maka/core/settings';
import type { BotRegistry } from '@maka/runtime/bots';
import type { BotRegistry } from '@maka/bots';
import type { SettingsStore } from '@maka/storage/settings-store';
import {
BotOnboardingService,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import { tmpdir } from 'node:os';
import { join } from 'node:path';
import test from 'node:test';
import type { IpcMain } from 'electron';
import type { BotRegistry } from '@maka/runtime/bots';
import type { BotRegistry } from '@maka/bots';
import type { ComputerUseToolSet } from '@maka/runtime/computer-use-tools';
import type { MakaTool } from '@maka/runtime/tool-runtime';
import { connectRuntimeHost } from '@maka/runtime-host/client';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import assert from 'node:assert/strict';
import { EventEmitter } from 'node:events';
import test from 'node:test';
import type { IpcMain } from 'electron';
import type { BotIncomingMessage, BotRegistry } from '@maka/runtime/bots';
import type { BotIncomingMessage, BotRegistry } from '@maka/bots';
import type { ComputerUseToolSet } from '@maka/runtime/computer-use-tools';
import type { ShellRunUpdate } from '@maka/core/events';
import type { MakaTool } from '@maka/runtime/tool-runtime';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

import assert from 'node:assert/strict';
import test from 'node:test';
import type { BotIncomingMessage } from '@maka/runtime/bots';
import type { BotIncomingMessage } from '@maka/bots';
import {
RuntimeHostOperationError,
RuntimeHostRequestInterruptedError,
Expand Down
2 changes: 1 addition & 1 deletion apps/desktop/src/main/bot-incoming-main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import {
plaintextHelpReply,
} from '@maka/core/bot-events';
import { generalizedErrorMessage } from '@maka/core/redaction';
import type { BotIncomingMessage, BotRegistry, BotReplyStream } from '@maka/runtime/bots';
import type { BotIncomingMessage, BotRegistry, BotReplyStream } from '@maka/bots';
import type { BotSessionAdapter, BotSessionTurnResult } from './bot-session-adapter.js';
import { isBotSessionUnavailableError } from './bot-session-adapter.js';
import { isSessionWorkspaceUnavailableError } from './project-context-root.js';
Expand Down
4 changes: 2 additions & 2 deletions apps/desktop/src/main/bot-onboarding-main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ import type {
} from '@maka/core/bot-onboarding';
import { generalizedErrorMessageChinese, redactSecrets } from '@maka/core/redaction';
import { isBotOnboardingBrand, isBotOnboardingProvider } from '@maka/core/bot-onboarding';
import type { BotRegistry } from '@maka/runtime/bots';
import { proxiedFetch } from '@maka/runtime/bots';
import type { BotRegistry } from '@maka/bots';
import { proxiedFetch } from '@maka/network/proxied-fetch';
import type { SettingsStore } from '@maka/storage/settings-store';
import { createQQBindTask, pollQQBindTask } from './qq-bot-scan-login.js';
import { fetchWeChatQrcode, pollWeChatQrcodeStatus } from './wechat-scan-login.js';
Expand Down
2 changes: 1 addition & 1 deletion apps/desktop/src/main/capability-snapshot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import {
} from '@maka/core/capabilities';
import { type AppSettings } from '@maka/core/settings';
import type { CuBackendId } from '@maka/computer-use';
import type { BotStatus } from '@maka/runtime/bots';
import type { BotStatus } from '@maka/bots';
import type { computerUseServiceHealth } from './computer-use-host.js';
import {
mapMediaAccessStatus,
Expand Down
2 changes: 1 addition & 1 deletion apps/desktop/src/main/qq-bot-scan-login.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/

import { createDecipheriv, randomBytes } from 'node:crypto';
import { proxiedFetch } from '@maka/runtime/bots';
import { proxiedFetch } from '@maka/network/proxied-fetch';

const QQ_BIND_BASE_URL = 'https://q.qq.com';
const REQUEST_TIMEOUT_MS = 10_000;
Expand Down
2 changes: 1 addition & 1 deletion apps/desktop/src/main/runtime-host-boot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import {
PROVIDER_DEFAULTS,
providerAuthRequiresSecret,
} from "@maka/core/llm-connections";
import { BotRegistry, type BotIncomingMessage } from '@maka/runtime/bots';
import { BotRegistry, type BotIncomingMessage } from '@maka/bots';
import {
SCHEDULED_TASK_NATIVE_EFFECT_SERVICE_ID,
SCHEDULED_TASK_NATIVE_EFFECT_SERVICE_VERSION,
Expand Down
2 changes: 1 addition & 1 deletion apps/desktop/src/main/runtime-host-desktop-candidate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import { redactSecrets } from '@maka/core/redaction';
import type { CreateSessionRequestInput } from '@maka/core/runtime-inputs';
import { isSideConversationSession } from '@maka/core/side-conversation';
import type { SessionChangedEvent, SessionChangedReason } from '@maka/core/session';
import type { BotRegistry } from '@maka/runtime/bots';
import type { BotRegistry } from '@maka/bots';
import {
type RuntimeHostSshOperatorActivationInput,
connectOrSpawnRuntimeHost,
Expand Down
2 changes: 1 addition & 1 deletion apps/desktop/src/main/runtime-host-desktop-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/

import { randomUUID } from 'node:crypto';
import type { BotIncomingMessage } from '@maka/runtime/bots';
import type { BotIncomingMessage } from '@maka/bots';
import {
RuntimeHostOperationError,
RuntimeHostPermanentReconnectError,
Expand Down
2 changes: 1 addition & 1 deletion apps/desktop/src/main/runtime-host-permissions-ipc-main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import {
import { type AppSettings } from '@maka/core/settings';
import { type LlmConnection } from '@maka/core/llm-connections';
import type { UsageLogRow } from "@maka/core/usage-stats/types";
import type { BotRegistry } from '@maka/runtime/bots';
import type { BotRegistry } from '@maka/bots';
import {
buildCapabilitySnapshotCollection,
buildPermissionSnapshot,
Expand Down
2 changes: 1 addition & 1 deletion apps/desktop/src/main/settings-bots-ipc-main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import {
getWechatBridgeQrCode,
testBotChannel as testRuntimeBotChannel,
type BotRegistry,
} from '@maka/runtime/bots';
} from '@maka/bots';
import type { SettingsStore } from '@maka/storage/settings-store';
import {
BotOnboardingService,
Expand Down
2 changes: 1 addition & 1 deletion apps/desktop/src/main/settings-ipc-helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import {
maskSensitive,
type TestProxyResult,
} from "@maka/core/settings/network-settings";
import type { BotTestResult } from '@maka/runtime/bots';
import type { BotTestResult } from '@maka/bots';
import { collectPersonalizationWarnings } from '@maka/runtime/system-prompt/personalization-prompt';
import { getTavilyCredentialSource } from "./web-search/credentials.js";

Expand Down
2 changes: 1 addition & 1 deletion apps/desktop/src/preload/bridge-contract.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ import type {
AgentGraphClientSnapshotOptions,
AgentGraphOperatorInspection,
} from '@maka/runtime/stream-graph-read-model';
import type { BotStatus, WechatBridgeQrCodeResult } from '@maka/runtime/bots';
import type { BotStatus, WechatBridgeQrCodeResult } from '@maka/bots';
import type { ShellRunPtyDataEvent, ShellRunPtySnapshot } from '@maka/runtime/shell-run-contract';
import type { BundledSkillCatalogEntry, ManagedSkillSourceEntry, ManagedSkillUpdatePreview, SkillEntry } from '@maka/ui';
import type { ConfigCategory } from '@maka/storage/config-transfer';
Expand Down
2 changes: 1 addition & 1 deletion apps/desktop/src/preload/preload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ import type {
AgentGraphClientSnapshotOptions,
AgentGraphOperatorInspection,
} from '@maka/runtime/stream-graph-read-model';
import type { BotStatus, WechatBridgeQrCodeResult } from '@maka/runtime/bots';
import type { BotStatus, WechatBridgeQrCodeResult } from '@maka/bots';
import type { ShellRunPtyDataEvent, ShellRunPtySnapshot } from '@maka/runtime/shell-run-contract';
import type { GoalState } from '@maka/runtime/goal-state';
import type { BundledSkillCatalogEntry, ManagedSkillSourceEntry, ManagedSkillUpdatePreview, SkillEntry } from '@maka/ui';
Expand Down
2 changes: 1 addition & 1 deletion apps/desktop/src/renderer/settings/bot-chat-detail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import {
type BotOnboardingProvider,
} from '@maka/core/bot-onboarding';
import { type BotChannelSettings, type BotProvider, type BotReadinessState } from '@maka/core/bot-chat-settings';
import type { BotStatus } from '@maka/runtime/bots';
import type { BotStatus } from '@maka/bots';
import { MAX_ALLOWED_USER_IDS, parseAllowedUserIdsFromText } from '@maka/core/settings';
import { Card, MetadataList, MetadataListItem, SegmentedControl, SegmentedControlItem, StatusDot, Text, VStack } from '@astryxdesign/core';
import {
Expand Down
2 changes: 1 addition & 1 deletion apps/desktop/src/renderer/settings/bot-chat-overview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import type { ReactNode } from 'react';
import { ICON_SIZE, ChevronRight } from '@maka/ui/icons';
import type { BotChannelSettings, BotProvider } from '@maka/core/bot-chat-settings';
import type { BotStatus } from '@maka/runtime/bots';
import type { BotStatus } from '@maka/bots';
import { BOT_PROVIDERS } from '@maka/core/settings';
import { EmptyState, Item, StatusDot } from '@astryxdesign/core';
import { Button, RelativeTime, useUiLocale, Banner } from '@maka/ui';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { useEffect, useRef, useState } from "react";
import type { AppSettings, UpdateAppSettingsResult } from '@maka/core/settings';
import type { BotOnboardingProvider } from '@maka/core/bot-onboarding';
import type { BotProvider } from '@maka/core/bot-chat-settings';
import type { BotStatus } from '@maka/runtime/bots';
import type { BotStatus } from '@maka/bots';
import { useMountedRef, useToast, useUiLocale } from "@maka/ui";
import { settingsActionErrorMessage } from "./settings-error-copy";
import {
Expand Down
2 changes: 1 addition & 1 deletion apps/desktop/src/renderer/settings/bot-chat-shared.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

import type { BotProvider, BotReadinessState } from '@maka/core/bot-chat-settings';
import type { UiLocale } from '@maka/core/ui-locale';
import type { BotStatus } from '@maka/runtime/bots';
import type { BotStatus } from '@maka/bots';
import { BotBrandLogo as BotBrandMark } from '@maka/ui';
import { getBotSettingsCopy } from '../locales/settings-bot-copy';

Expand Down
Loading
Loading