Skip to content

Beautiful, AI-native markdown IDE and LLM wiki

feat(ok): show each ACP agent's real capabilities (PRD-7843) (#3364)

mike-inkeepb079160d2747
diff --git a/.changeset/acp-agent-capabilities.md b/.changeset/acp-agent-capabilities.md
new file mode 100644
index 000000000..e5e5d9c45
--- /dev/null
+++ b/.changeset/acp-agent-capabilities.md
@@ -0,0 +1,5 @@
+---
+"@inkeep/open-knowledge": patch
+---
+
+In-app agents now show what they actually support instead of silently hiding the difference. Switching agents no longer makes the settings control vanish: an agent that advertises no settings shows the same trigger disabled, with a one-line reason ("doesn't offer any settings to adjust" — or "hasn't reported its settings yet" while it's still starting). The thread header warns when an agent is verified to act fully autonomously — it never asks before editing files or running commands, and OpenKnowledge can't add permission prompts for it (pi today); agents that ask first or govern themselves through their own modes need no badge, since those signals already show as permission prompts and in the agent settings. The prompt-capability handshake (images, audio, embedded context) is now captured per thread and sent to the client, so upcoming attachment features can gate honestly on what each agent accepts. Agent pickers now lead the never-used tail with the featured shortlist instead of an accident of insertion order.
diff --git a/knip.config.ts b/knip.config.ts
index 78162ec09..f9179f2d4 100644
--- a/knip.config.ts
+++ b/knip.config.ts
@@ -123,7 +123,9 @@ export default {
'packages/server': {
entry: ['src/**/*.test.ts', 'src/parse-worker.ts'],
project: 'src/**',
- ignoreDependencies: ['@types/shell-quote'],
+ ignoreDependencies: [
+ '@types/shell-quote',
+ ],
},
'packages/cli': {
entry: ['src/**/*.test.ts', 'scripts/*.ts', 'tests/**/*.ts', 'src/parse-worker.ts'],
diff --git a/packages/app/src/components/acp/AcpHarnessAgentDetection.tsx b/packages/app/src/components/acp/AcpHarnessAgentDetection.tsx
index 5e2143033..6e6babfb7 100644
--- a/packages/app/src/components/acp/AcpHarnessAgentDetection.tsx
+++ b/packages/app/src/components/acp/AcpHarnessAgentDetection.tsx
@@ -19,6 +19,7 @@ export function AcpHarnessAgentDetection() {
source: agent.source,
id: agent.id,
name: agent.name,
+ featured: agent.featured,
...(agent.iconUrl !== undefined ? { iconUrl: agent.iconUrl } : {}),
}));
setDetectedRegisteredAgentSuggestions(suggestions);
diff --git a/packages/app/src/components/acp/ThreadView.dom.test.tsx b/packages/app/src/components/acp/ThreadView.dom.test.tsx
index 0eafdd3f5..f606140f7 100644
--- a/packages/app/src/components/acp/ThreadView.dom.test.tsx
+++ b/packages/app/src/components/acp/ThreadView.dom.test.tsx
@@ -484,6 +484,81 @@ describe('ThreadView agent settings (modes)', () => {
});
});
+describe('ThreadView agent settings (disable, not hide)', () => {
+ test('an agent with nothing to configure keeps the trigger, disabled with the reason', () => {
+ render(<ThreadView info={makeInfo({ status: 'ready' })} />);
+ const trigger = screen.getByTestId('agent-thread-settings');
+ expect(trigger.getAttribute('aria-disabled')).toBe('true');
+ expect(trigger.getAttribute('aria-describedby')).toBeTruthy();
+ expect(screen.getByText("Claude Agent doesn't offer any settings to adjust")).toBeTruthy();
+ fireEvent.click(trigger);
+ expect(screen.queryByTestId('agent-thread-settings-popover')).toBeNull();
+ });
+
+ test("before the session settles the reason says 'not yet', not 'none'", () => {
+ render(<ThreadView info={makeInfo({ status: 'spawning' })} />);
+ const trigger = screen.getByTestId('agent-thread-settings');
+ expect(trigger.getAttribute('aria-disabled')).toBe('true');
+ expect(screen.getByText("Claude Agent hasn't reported its settings yet")).toBeTruthy();
+ });
+
+ test("an exited thread that never advertised settings reads 'none', not 'not yet'", () => {
+ // The session ran to completion — "hasn't reported yet" would imply an
+ // answer is still coming.
+ render(<ThreadView info={makeInfo({ status: 'exited' })} />);
+ expect(screen.getByText("Claude Agent doesn't offer any settings to adjust")).toBeTruthy();
+ });
+});
+
+describe('ThreadView permission posture badge', () => {
+ test('a verified autonomous agent warns that prompts cannot be added', () => {
+ render(
+ <ThreadView
+ info={makeInfo({ agent: { id: 'pi-acp', name: 'pi ACP', source: 'registry' } })}
+ />,
+ );
+ const badge = screen.getByTestId('agent-thread-posture');
+ expect(badge.closest('[role="img"]')?.getAttribute('aria-label')).toContain(
+ 'acts without asking',
+ );
+ });
+
+ test('every milder posture renders no badge — those signals live elsewhere', () => {
+ // Asks-first (Claude): the permission prompts themselves are the signal.
+ const { unmount: unmountAsks } = render(
+ <ThreadView
+ info={makeInfo({ agent: { id: 'claude-acp', name: 'Claude Agent', source: 'registry' } })}
+ />,
+ );
+ expect(screen.queryByTestId('agent-thread-posture')).toBeNull();
+ unmountAsks();
+
+ // Self-managed (declared modes): the settings trigger names the mode and
+ // the permissive-mode accent flags the dangerous ones.
+ const { unmount: unmountModes } = render(
+ <ThreadView
+ info={makeInfo({
+ agent: { id: 'someagent', name: 'Some Agent', source: 'registry' },
+ modes: {
+ currentModeId: 'agent',
+ availableModes: [
+ { id: 'agent', name: 'Agent (full access)' },
+ { id: 'plan', name: 'Plan' },
+ ],
+ },
+ })}
+ />,
+ );
+ expect(screen.queryByTestId('agent-thread-posture')).toBeNull();
+ unmountModes();
+
+ // Unverified with no modes: "can't tell" must never render as the
+ // autonomous warning.
+ render(<ThreadView info={makeInfo()} />);
+ expect(screen.queryByTestId('agent-thread-posture')).toBeNull();
+ });
+});
+
describe('ThreadView terminal card', () => {
const terminal = (overrides?: Partial<RenderedTerminal>): RenderedTerminal => ({
terminalId: 't1',
diff --git a/packages/app/src/components/acp/ThreadView.tsx b/packages/app/src/components/acp/ThreadView.tsx
index 630e9d82b..158432c1c 100644
--- a/packages/app/src/components/acp/ThreadView.tsx
+++ b/packages/app/src/components/acp/ThreadView.tsx
@@ -10,6 +10,7 @@
// biome-ignore-all lint/plugin/no-physical-direction-utility: pre-rule backlog — physical margin/padding/inset utilities predate the rule; drain by swapping ml/mr → ms/me, pl/pr → ps/pe, left/right → start/end, then deleting this line. See https://github.com/inkeep/open-knowledge/blob/main/biome-plugins/README.md#no-physical-direction-utilitygrit
+import { deriveAgentPosture } from '@inkeep/open-knowledge-core/acp/agent-posture';
import type {
QueuedMessage,
SessionConfigOption,
@@ -36,6 +37,7 @@ import {
Search,
Settings2,
Share2,
+ ShieldAlert,
Shuffle,
Sparkles,
Square,
@@ -52,6 +54,7 @@ import {
type RefObject,
useEffect,
useEffectEvent,
+ useId,
useRef,
useState,
} from 'react';
@@ -859,6 +862,43 @@ export function ThreadView({
);
}
+/**
+ * Warns when the agent is verified to act without ever asking — the one
+ * posture with no signal anywhere else in the UI: no permission prompts
+ * will appear, and without declared modes the settings trigger has no
+ * permissive-mode accent to show. Milder postures (asks-first, governed by
+ * the agent's own mode) stay badge-free on purpose — those are already
+ * legible from the permission prompts and the settings trigger, and a
+ * badge repeating them would be noise.
+ */
+function PermissionPostureBadge({ info }: { info: ThreadInfo }): ReactNode {
+ const { t } = useLingui();
+ if (deriveAgentPosture(info.agent.id, info.modes) !== 'autonomous') return null;
+ const label = t`${info.agent.name} acts without asking — OpenKnowledge can't add permission prompts for it`;
+ // Short name so the focusable span below stays on one line — the biome
+ // suppression only reaches the line directly after it.
+ const focusRing =
+ 'inline-flex rounded-sm outline-none focus-visible:ring-2 focus-visible:ring-ring/50';
+ return (
+ <Tooltip>
+ <TooltipTrigger asChild>
+ {/* biome-ignore lint/a11y/noNoninteractiveTabindex: a status indicator whose detail lives in its tooltip must be focusable or keyboard users can never surface it — same rationale as the tooltip-on-disabled-button span wrapper. */}
+ <span tabIndex={0} role="img" aria-label={label} className={focusRing}>
+ <span
+ className="inline-flex shrink-0 text-amber-500 dark:text-amber-400"
+ data-testid="agent-thread-posture"
+ >
+ <ShieldAlert className="size-3.5" aria-hidden="true" />
+ </span>
+ </span>
+ </TooltipTrigger>
+ <TooltipContent side="bottom" className="max-w-64">
+ {label}
+ </TooltipContent>
+ </Tooltip>
+ );
+}
+
function ThreadHeader({
info,
followFile,
@@ -885,6 +925,7 @@ function ThreadHeader({
</span>
) : null}
<div className="ml-auto flex shrink-0 items-center gap-1.5">
+ <PermissionPostureBadge info={info} />
<Tooltip>
<TooltipTrigger asChild>
<Button
@@ -1023,9 +1064,15 @@ function deriveModeSurface(info: ThreadInfo): ModeSurface | null {
return null;
}
-/** One stable trigger for every setting an ACP agent advertises. */
+/**
+ * One stable trigger for every setting an ACP agent advertises. Renders for
+ * every agent: when this one advertises nothing the trigger stays visible
+ * but disabled, with the reason on it — a control that silently vanishes on
+ * an agent switch reads as breakage, not as a capability difference.
+ */
function AgentSettingsPopover({ info }: { info: ThreadInfo }): ReactNode {
const { t } = useLingui();
+ const reasonId = useId();
const client = getAgentThreadClient();
const settingsKey = agentSettingsKey(info.agent);
const applyConfig = (option: SessionConfigOption, value: string | boolean): void => {
@@ -1040,7 +1087,57 @@ function AgentSettingsPopover({ info }: { info: ThreadInfo }): ReactNode {
);
const modeSurface = deriveModeSurface(info);
const showLegacyModes = modeSurface !== null && modeSurface.configId === null;
- if (configOptions.length === 0 && !showLegacyModes) return null;
+ if (configOptions.length === 0 && !showLegacyModes) {
+ // Options arrive with `session/new`; until the thread has been ready
+ // once, "none yet" is indistinguishable from "none ever", and the reason
+ // must not claim the agent said no before it answered. An exited thread
+ // (archived ones rehydrate as exited) DID answer — its session ran to
+ // completion without advertising anything. `error` stays unsettled: a
+ // crash before `session/new` really did leave the question unanswered.
+ const settled =
+ info.status === 'ready' ||
+ info.status === 'running' ||
+ info.status === 'awaiting_permission' ||
+ info.status === 'exited';
+ const reason = settled
+ ? t`${info.agent.name} doesn't offer any settings to adjust`
+ : t`${info.agent.name} hasn't reported its settings yet`;
+ return (
+ <Tooltip>
+ <TooltipTrigger asChild>
+ {/* The trigger sits on a wrapping span so Radix puts its own
+ `aria-describedby` there while the button keeps pointing at the
+ reason below. */}
+ <span className="inline-flex cursor-not-allowed">
+ <Button
+ type="button"
+ variant="ghost"
+ className="h-6 max-w-48 gap-1 rounded-md pl-1.5 pr-1! text-xs"
+ aria-label={t`Agent settings`}
+ // `aria-disabled` rather than `disabled`: a natively disabled
+ // button leaves the tab order, so a keyboard user could never
+ // reach the tooltip or this description explaining why it
+ // won't act.
+ aria-disabled
+ aria-describedby={reasonId}
+ data-testid="agent-thread-settings"
+ >
+ <span className="truncate text-muted-foreground/50">{t`Settings`}</span>
+ <ChevronDown
+ className="size-3.5 text-muted-foreground/50"
+ data-icon="inline-end"
+ aria-hidden="true"
+ />
+ </Button>
+ <span id={reasonId} className="sr-only">
+ {reason}
+ </span>
+ </span>
+ </TooltipTrigger>
+ <TooltipContent side="bottom">{reason}</TooltipContent>
+ </Tooltip>
+ );
+ }
const legacyModeName = showLegacyModes ? modeSurface.currentName : undefined;
// Modes carry across threads like everything else, so the thing worth
@@ -2842,10 +2939,9 @@ function ThreadComposer({
/>
{/* Action bar: model/agent settings on the left, context ring + send/stop
on the right. The send cluster uses `ml-auto` (not the row's
- justify-between) so it stays hard-right even when the settings popover
- renders nothing — while the agent is loading / errored / auth-required
- it exposes no config options, and justify-between would then float the
- lone send button to the left. */}
+ justify-between) so it stays hard-right independent of what the
+ settings popover renders (it stays mounted even for agents with no
+ options, showing a disabled trigger instead of vanishing). */}
<div className="flex items-center gap-2 px-1.5 pt-1 pb-1.5">
<AgentSettingsPopover info={info} />
<div className="ml-auto flex items-center gap-1.5">
diff --git a/packages/app/src/components/settings/ConfigureAgentsSection.tsx b/packages/app/src/components/settings/ConfigureAgentsSection.tsx
index 92ccc85a5..93bfdcd00 100644
--- a/packages/app/src/components/settings/ConfigureAgentsSection.tsx
+++ b/packages/app/src/components/settings/ConfigureAgentsSection.tsx
@@ -318,6 +318,7 @@ export function ConfigureAgentsSection(): ReactNode {
id: agent.id,
name: agent.name,
supported: agent.supported,
+ featured: agent.featured,
...(agent.iconUrl !== undefined ? { iconUrl: agent.iconUrl } : {}),
},
{ makeDefault: false },
diff --git a/packages/app/src/lib/acp/catalog.ts b/packages/app/src/lib/acp/catalog.ts
index c710ef5d4..0c32b954b 100644
--- a/packages/app/src/lib/acp/catalog.ts
+++ b/packages/app/src/lib/acp/catalog.ts
@@ -89,6 +89,7 @@ export function useHydrateRegisteredAgentMeta(): void {
id: agent.id,
name: agent.name,
supported: agent.supported,
+ featured: agent.featured,
...(agent.iconUrl !== undefined ? { iconUrl: agent.iconUrl } : {}),
})),
);
diff --git a/packages/app/src/lib/acp/permissive-mode.ts b/packages/app/src/lib/acp/permissive-mode.ts
index bfc488328..6a903a0a6 100644
--- a/packages/app/src/lib/acp/permissive-mode.ts
+++ b/packages/app/src/lib/acp/permissive-mode.ts
@@ -1,94 +1,9 @@
/**
- * Best-effort detection of agent modes that let the agent act without asking.
- *
- * ACP hands the client an opaque `{id, name}` mode list with no "affects
- * permissions" flag, so OK cannot know what a mode does. What it CAN do is
- * recognise the vocabulary the common harnesses use for their permissive modes
- * — Claude Code's `bypassPermissions` / `acceptEdits`, Gemini's YOLO, Codex's
- * full-auto and danger-full-access, and the auto-approve / skip-permissions
- * naming everyone converges on.
- *
- * This drives a visual warning only (the amber accent on the settings trigger).
- * It never gates, blocks, or rewrites a mode, so the failure modes are mild in
- * both directions: a miss loses a hint, a false positive shows one too many.
- * Deliberately biased toward matching — an unflagged bypass mode is the worse
- * error — but not so loose that ordinary modes (`plan`, `ask`, `architect`,
- * `code`, `default`) trip it.
+ * Moved to `@inkeep/open-knowledge-core/acp/permissive-mode` so the
+ * permission-posture derivation (core) and this app share one detector —
+ * the header badge and the composer's amber accent must never disagree
+ * about the same mode. Re-exported here so app-side imports keep their
+ * path.
*/
-/**
- * Matched against the id and name with everything but letters removed, so
- * `accept-edits`, `acceptEdits`, and "Accept Edits" all reduce to
- * `acceptedits`. Keep the alternatives letters-only for the same reason.
- *
- * The first group is what the adapters in the ACP registry actually advertise
- * over `session/new` — read out of the shipped adapters, not from their CLI
- * flags, which differ (Codex's mode id is `agent-full-access`; the
- * `danger-full-access` you see in its docs is the sandbox policy behind it):
- *
- * claude-agent-acp default · plan · acceptEdits · bypassPermissions
- * codex-acp read-only · agent · agent-full-access
- * gemini-cli default · plan · auto_edit · yolo
- * cursor-agent agent · plan · ask (none permissive)
- * goose auto · approve · smart_approve · chat
- * pi-acp off · minimal · … · xhigh (see note below)
- *
- * The second group is naming seen in these tools' flags and elsewhere in their
- * binaries (opencode carries `unrestricted` / `autoApprove` / `dangerously`,
- * amp carries `dangerously`) but not yet observed as a mode id. Cheap to
- * carry: matching one costs a dot the user can ignore.
- *
- * `agent` must never be added — Codex and Cursor both call their ordinary
- * mode that, so it would flag what almost everyone runs. `smart_approve` is
- * likewise left alone: it still prompts for the risky operations.
- *
- * Not every agent uses modes for permissions at all — pi-acp exposes reasoning
- * effort through the same surface. Matching on permission vocabulary rather
- * than on "is a non-default mode" is what keeps those quiet.
- */
-const PERMISSIVE = new RegExp(
- [
- // Observed in shipped adapters.
- 'bypass', // claude-agent-acp `bypassPermissions`
- 'acceptedits', // claude-agent-acp `acceptEdits`
- 'fullaccess', // codex-acp `agent-full-access`
- 'autoedit', // gemini-cli `auto_edit`
- 'yolo', // gemini-cli `yolo`
- // Speculative: seen in these tools' flags/docs, not (yet) as mode ids.
- 'danger', // `--dangerously-skip-permissions`, codex `danger-full-access`
- 'fullauto', // codex `--full-auto`
- 'autoaccept',
- 'autoapprove',
- 'autorun',
- 'skippermission',
- 'noconfirm',
- 'noprompt',
- 'unrestricted',
- 'allowall',
- ].join('|'),
-);
-
-/**
- * Words that mean "no approval" as a WHOLE mode, but are too common to match
- * as a substring: goose names its full-autonomy mode exactly `auto`, while
- * `auto` inside a longer word says nothing on its own (an "Autocomplete" mode
- * is not a permission grant). The specific `auto*` compounds that DO carry the
- * meaning — `auto_edit`, `autoApprove` — are in `PERMISSIVE` above.
- */
-const PERMISSIVE_EXACT = new Set(['auto']);
-
-/** Letters only, lowercased — separators and casing vary per harness. */
-function normalize(value: string): string {
- return value.toLowerCase().replace(/[^a-z]/g, '');
-}
-
-/**
- * True when a mode's id or name reads as "act without asking". See the module
- * header for why this is a hint rather than a guarantee.
- */
-export function isPermissiveMode(mode: { id: string; name?: string }): boolean {
- const id = normalize(mode.id);
- const name = normalize(mode.name ?? '');
- if (PERMISSIVE_EXACT.has(id) || PERMISSIVE_EXACT.has(name)) return true;
- return PERMISSIVE.test(id) || PERMISSIVE.test(name);
-}
+export { isPermissiveMode } from '@inkeep/open-knowledge-core/acp/permissive-mode';
diff --git a/packages/app/src/lib/acp/registered-agents.test.ts b/packages/app/src/lib/acp/registered-agents.test.ts
index c65412e21..c9b73c40b 100644
--- a/packages/app/src/lib/acp/registered-agents.test.ts
+++ b/packages/app/src/lib/acp/registered-agents.test.ts
@@ -169,6 +169,24 @@ describe('registered-agents store', () => {
'gemini',
]);
});
+
+ test('presented order: featured agents lead the never-picked tail', () => {
+ // No picks at all — the whole list is the tail. Featured (catalog
+ // shortlist) beats alphabetical; alphabetical breaks ties within a tier.
+ registerAgent({ source: 'registry', id: 'auggie', name: 'Auggie CLI' }, { makeDefault: false });
+ registerAgent(
+ { source: 'registry', id: 'gemini', name: 'Gemini CLI', featured: true },
+ { makeDefault: false },
+ );
+ registerAgent(
+ { source: 'registry', id: 'cursor', name: 'Cursor', featured: true },
+ { makeDefault: false },
+ );
+ expect(getRegisteredAgentOptions().map((a) => a.id)).toEqual(['cursor', 'gemini', 'auggie']);
+ // An explicit pick still beats featured: recency is the top sort key.
+ registerAgent({ source: 'registry', id: 'auggie', name: 'Auggie CLI' });
+ expect(getRegisteredAgentOptions().map((a) => a.id)).toEqual(['auggie', 'cursor', 'gemini']);
+ });
});
describe('hydrateRegisteredAgentMeta', () => {
@@ -206,6 +224,14 @@ describe('hydrateRegisteredAgentMeta', () => {
hydrateRegisteredAgentMeta([{ source: 'registry', id: 'codex-acp', supported: false }]);
expect(storedAgents().find((a) => a.id === 'codex-acp')?.supported).toBe(false);
});
+
+ test('stores the featured flag so the picker order survives a reload', () => {
+ registerAgent(codex);
+ hydrateRegisteredAgentMeta([{ source: 'registry', id: 'codex-acp', featured: true }]);
+ expect(storedAgents().find((a) => a.id === 'codex-acp')?.featured).toBe(true);
+ reloadRegisteredAgentsFromStorage();
+ expect(getRegisteredAgentOptions().find((a) => a.id === 'codex-acp')?.featured).toBe(true);
+ });
});
describe('pickEffectiveDefaultAgent', () => {
diff --git a/packages/app/src/lib/acp/registered-agents.ts b/packages/app/src/lib/acp/registered-agents.ts
index ee6429898..d98a7dd14 100644
--- a/packages/app/src/lib/acp/registered-agents.ts
+++ b/packages/app/src/lib/acp/registered-agents.ts
@@ -32,6 +32,13 @@ export interface RegisteredAgent {
* field existed) — those sort after every stamped agent.
*/
readonly lastUsedAt?: number;
+ /**
+ * The server marks the first-party shortlist (`FEATURED_AGENT_IDS`) in the
+ * catalog; hydrated like `supported`. Orders the never-picked tail —
+ * featured before the long tail — so a fresh install leads with the agents
+ * the team actually supports rather than an accident of insertion order.
+ */
+ readonly featured?: boolean;
}
interface RegisteredAgentsState {
@@ -56,7 +63,8 @@ function isRegisteredAgent(value: unknown): value is RegisteredAgent {
typeof a.name === 'string' &&
a.name !== '' &&
(a.iconUrl === undefined || typeof a.iconUrl === 'string') &&
- (a.lastUsedAt === undefined || typeof a.lastUsedAt === 'number')
+ (a.lastUsedAt === undefined || typeof a.lastUsedAt === 'number') &&
+ (a.featured === undefined || typeof a.featured === 'boolean')
);
}
@@ -186,14 +194,19 @@ export function registerAgent(
}
/**
- * Recently used first (explicit picks stamp `lastUsedAt`), alphanumeric for
- * the never-picked tail — one predictable order instead of three concatenated
- * insertion histories (picks, Settings toggles, detected suggestions).
+ * Recently used first (explicit picks stamp `lastUsedAt`), then the featured
+ * shortlist, alphanumeric within each tier — one predictable order instead of
+ * three concatenated insertion histories (picks, Settings toggles, detected
+ * suggestions). Recency stays the top key on purpose: "the agent you chose
+ * last is your agent" beats any editorial ranking.
*/
function compareAgentsForDisplay(a: RegisteredAgent, b: RegisteredAgent): number {
const aUsed = a.lastUsedAt ?? 0;
const bUsed = b.lastUsedAt ?? 0;
if (aUsed !== bUsed) return bUsed - aUsed;
+ const aFeatured = a.featured === true ? 0 : 1;
+ const bFeatured = b.featured === true ? 0 : 1;
+ if (aFeatured !== bFeatured) return aFeatured - bFeatured;
return a.name.localeCompare(b.name, undefined, { numeric: true, sensitivity: 'base' });
}
@@ -298,10 +311,12 @@ export function hydrateRegisteredAgentMeta(
const nextName = patch.name ?? agent.name;
const nextIconUrl = patch.iconUrl ?? agent.iconUrl;
const nextSupported = patch.supported ?? agent.supported;
+ const nextFeatured = patch.featured ?? agent.featured;
if (
nextName === agent.name &&
nextIconUrl === agent.iconUrl &&
- nextSupported === agent.supported
+ nextSupported === agent.supported &&
+ nextFeatured === agent.featured
)
return agent;
changed = true;
@@ -310,6 +325,7 @@ export function hydrateRegisteredAgentMeta(
name: nextName,
...(nextIconUrl !== undefined ? { iconUrl: nextIconUrl } : {}),
...(nextSupported !== undefined ? { supported: nextSupported } : {}),
+ ...(nextFeatured !== undefined ? { featured: nextFeatured } : {}),
};
});
if (!changed) return;
diff --git a/packages/app/src/locales/ar/messages.json b/packages/app/src/locales/ar/messages.json
index bc56328c2..3afba1178 100644
--- a/packages/app/src/locales/ar/messages.json
+++ b/packages/app/src/locales/ar/messages.json
@@ -1940,6 +1940,7 @@
"PIMM5l": ["تم اشتراكك!"],
"PKLY-1": ["يجري الفتح..."],
"PKjGhT": ["العناوين"],
+ "PMxZyQ": ["لم يبلغ ", ["0"], " عن إعداداته بعد"],
"PMyJ9C": ["لا توجد جلسة تحرير بعد"],
"PPFQ3o": ["تم تثبيت «", ["0"], "» في ", ["1"]],
"PQCdtv": ["«", ["docName"], "» غير موجود."],
@@ -2184,6 +2185,7 @@
"SkTkKV": ["الوكيل لا يتوقف. الإيقاف القسري يغلق هذه المحادثة وينهي الوكيل."],
"Skr_7L": ["البحث في أشجار العمل"],
"SlfejT": ["خطأ"],
+ "Soy_80": [["0"], " يتصرف دون سؤال — لا يمكن لـ OpenKnowledge إضافة طلبات أذونات له"],
"SqIoy_": ["الإصلاح التلقائي — لا توجد هنا مشكلات لها إصلاح تلقائي"],
"SrOuyg": ["لوحات المستند"],
"SvBFYA": ["لا توجد مشاريع حديثة"],
@@ -2373,6 +2375,7 @@
"VNgKZz": ["إعدادات متقدمة"],
"VTulZj": ["الفتح في شجرة عمل"],
"VUijjF": ["ضمّن صورة مع نص بديل اختياري."],
+ "VVRrPk": [["0"], " لا يوفر أي إعدادات للضبط"],
"VXGFMg": ["تراجع أو إعادة في حقل الكود"],
"VYd_YA": ["افتح مجلد مشروع موجودًا من القرص."],
"VZGh8G": ["اطوِ نطاقات المصدر أو ابسطها، أو اطوِ الكل أو ابسط الكل."],
diff --git a/packages/app/src/locales/ar/messages.po b/packages/app/src/locales/ar/messages.po
index 8aaef383c..77885044b 100644
--- a/packages/app/src/locales/ar/messages.po
+++ b/packages/app/src/locales/ar/messages.po
@@ -251,6 +251,11 @@ msgstr "{0, plural, zero {مهارات} one {مهارة} two {مهارتان} fe
msgid "{0} · default"
msgstr "{0} · افتراضي"
+#. placeholder {0}: info.agent.name
+#: src/components/acp/ThreadView.tsx
+msgid "{0} acts without asking — OpenKnowledge can't add permission prompts for it"
+msgstr "{0} يتصرف دون سؤال — لا يمكن لـ OpenKnowledge إضافة طلبات أذونات له"
+
#. placeholder {0}: result.additions
#. placeholder {0}: stat.additions
#. placeholder {1}: result.deletions
@@ -270,6 +275,16 @@ msgstr "{0} في السطر {displayLine}"
msgid "{0} can't continue this chat — the transcript is kept, but the agent session is gone."
msgstr "{0} لا يمكنه متابعة هذه المحادثة — النص محفوظ، لكن جلسة الوكيل لم تعد موجودة."
+#. placeholder {0}: info.agent.name
+#: src/components/acp/ThreadView.tsx
+msgid "{0} doesn't offer any settings to adjust"
+msgstr "{0} لا يوفر أي إعدادات للضبط"
+
+#. placeholder {0}: info.agent.name
+#: src/components/acp/ThreadView.tsx
+msgid "{0} hasn't reported its settings yet"
+msgstr "لم يبلغ {0} عن إعداداته بعد"
+
#. placeholder {0}: activeData.label
#: src/components/EditorWorkspace.tsx
msgid "{0} is over {destination}."
diff --git a/packages/app/src/locales/bn/messages.json b/packages/app/src/locales/bn/messages.json
index 99e74e8ec..c5c685ced 100644
--- a/packages/app/src/locales/bn/messages.json
+++ b/packages/app/src/locales/bn/messages.json
@@ -1666,6 +1666,7 @@
"PIMM5l": ["আপনি সদস্য হয়েছেন!"],
"PKLY-1": ["খোলা হচ্ছে…"],
"PKjGhT": ["শিরোনাম"],
+ "PMxZyQ": [["0"], " এখনও তার সেটিং জানায়নি"],
"PMyJ9C": ["এখনও কোনো সম্পাদনা সেশন নেই"],
"PPFQ3o": ["\"", ["0"], "\" ", ["1"], "-এ ইনস্টল করা হয়েছে"],
"PQCdtv": ["\"", ["docName"], "\" নেই।"],
@@ -1892,6 +1893,7 @@
"SkTkKV": ["এজেন্ট থামছে না। ফোর্স স্টপ এই চ্যাট বন্ধ করবে এবং এজেন্ট থেকে বেরিয়ে যাবে।"],
"Skr_7L": ["ওয়ার্কট্রি খুঁজুন"],
"SlfejT": ["ত্রুটি"],
+ "Soy_80": [["0"], " জিজ্ঞাসা না করেই কাজ করে — OpenKnowledge এর জন্য অনুমতির অনুরোধ যোগ করতে পারে না"],
"SqIoy_": ["স্বয়ংক্রিয় সংশোধন — এখানকার কোনো সমস্যার স্বয়ংক্রিয় সমাধান নেই"],
"SrOuyg": ["নথি প্যানেল"],
"SvBFYA": ["কোনো সাম্প্রতিক প্রকল্প নেই"],
@@ -2059,6 +2061,7 @@
"VNgKZz": ["উন্নত সেটিং"],
"VTulZj": ["ওয়ার্কট্রিতে খুলুন"],
"VUijjF": ["ঐচ্ছিক বিকল্প-লেখাসহ একটি ছবি এমবেড করুন।"],
+ "VVRrPk": [["0"], " সমন্বয় করার মতো কোনো সেটিং দেয় না"],
"VXGFMg": ["কোড ফিল্ডে পূর্বাবস্থা বা পুনরায়"],
"VYd_YA": ["ডিস্ক থেকে একটি বিদ্যমান প্রকল্প ফোল্ডার খুলুন।"],
"VZGh8G": ["সোর্সের পরিসর ভাঁজ করুন, খুলুন, সব ভাঁজ করুন, বা সব খুলুন।"],
diff --git a/packages/app/src/locales/bn/messages.po b/packages/app/src/locales/bn/messages.po
index b1005f543..bb12c9b6a 100644
--- a/packages/app/src/locales/bn/messages.po
+++ b/packages/app/src/locales/bn/messages.po
@@ -251,6 +251,11 @@ msgstr "{0, plural, one {স্কিল} other {স্কিল}}"
msgid "{0} · default"
msgstr "{0} · ডিফল্ট"
+#. placeholder {0}: info.agent.name
+#: src/components/acp/ThreadView.tsx
+msgid "{0} acts without asking — OpenKnowledge can't add permission prompts for it"
+msgstr "{0} জিজ্ঞাসা না করেই কাজ করে — OpenKnowledge এর জন্য অনুমতির অনুরোধ যোগ করতে পারে না"
+
#. placeholder {0}: result.additions
#. placeholder {0}: stat.additions
#. placeholder {1}: result.deletions
@@ -270,6 +275,16 @@ msgstr "{displayLine} নম্বর লাইনে {0}"
msgid "{0} can't continue this chat — the transcript is kept, but the agent session is gone."
msgstr "{0} এই চ্যাট চালিয়ে যেতে পারছে না — ট্রান্সক্রিপ্ট সংরক্ষিত আছে, কিন্তু এজেন্ট সেশনটি আর নেই।"
+#. placeholder {0}: info.agent.name
+#: src/components/acp/ThreadView.tsx
+msgid "{0} doesn't offer any settings to adjust"
+msgstr "{0} সমন্বয় করার মতো কোনো সেটিং দেয় না"
+
+#. placeholder {0}: info.agent.name
+#: src/components/acp/ThreadView.tsx
+msgid "{0} hasn't reported its settings yet"
+msgstr "{0} এখনও তার সেটিং জানায়নি"
+
#. placeholder {0}: activeData.label
#: src/components/EditorWorkspace.tsx
msgid "{0} is over {destination}."
diff --git a/packages/app/src/locales/en/messages.json b/packages/app/src/locales/en/messages.json
index 02fe8d020..ee7274655 100644
--- a/packages/app/src/locales/en/messages.json
+++ b/packages/app/src/locales/en/messages.json
@@ -1728,6 +1728,7 @@
"PIMM5l": ["You're subscribed!"],
"PKLY-1": ["Opening..."],
"PKjGhT": ["Headings"],
+ "PMxZyQ": [["0"], " hasn't reported its settings yet"],
"PMyJ9C": ["No edit session yet"],
"PPFQ3o": ["Installed \"", ["0"], "\" into ", ["1"]],
"PQCdtv": ["\"", ["docName"], "\" doesn't exist."],
@@ -1949,6 +1950,7 @@
"SkTkKV": ["The agent isn't stopping. Force stop closes this chat and quits the agent."],
"Skr_7L": ["Search worktrees"],
"SlfejT": ["Error"],
+ "Soy_80": [["0"], " acts without asking — OpenKnowledge can't add permission prompts for it"],
"SqIoy_": ["Auto-fix — no problems here have an automatic fix"],
"SrOuyg": ["Document panels"],
"SvBFYA": ["No recent projects"],
@@ -2122,6 +2124,7 @@
"VNgKZz": ["Advanced settings"],
"VTulZj": ["Open in worktree"],
"VUijjF": ["Embed an image with optional alt text."],
+ "VVRrPk": [["0"], " doesn't offer any settings to adjust"],
"VXGFMg": ["Code field undo or redo"],
"VYd_YA": ["Open an existing project folder from disk."],
"VZGh8G": ["Fold, unfold, fold all, or unfold all source ranges."],
diff --git a/packages/app/src/locales/en/messages.po b/packages/app/src/locales/en/messages.po
index 62eba69bf..9bb4305e7 100644
--- a/packages/app/src/locales/en/messages.po
+++ b/packages/app/src/locales/en/messages.po
@@ -251,6 +251,11 @@ msgstr "{0, plural, one {Skill} other {Skills}}"
msgid "{0} · default"
msgstr "{0} · default"
+#. placeholder {0}: info.agent.name
+#: src/components/acp/ThreadView.tsx
+msgid "{0} acts without asking — OpenKnowledge can't add permission prompts for it"
+msgstr "{0} acts without asking — OpenKnowledge can't add permission prompts for it"
+
#. placeholder {0}: result.additions
#. placeholder {0}: stat.additions
#. placeholder {1}: result.deletions
@@ -270,6 +275,16 @@ msgstr "{0} at line {displayLine}"
msgid "{0} can't continue this chat — the transcript is kept, but the agent session is gone."
msgstr "{0} can't continue this chat — the transcript is kept, but the agent session is gone."
+#. placeholder {0}: info.agent.name
+#: src/components/acp/ThreadView.tsx
+msgid "{0} doesn't offer any settings to adjust"
+msgstr "{0} doesn't offer any settings to adjust"
+
+#. placeholder {0}: info.agent.name
+#: src/components/acp/ThreadView.tsx
+msgid "{0} hasn't reported its settings yet"
+msgstr "{0} hasn't reported its settings yet"
+
#. placeholder {0}: activeData.label
#: src/components/EditorWorkspace.tsx
msgid "{0} is over {destination}."
diff --git a/packages/app/src/locales/es/messages.json b/packages/app/src/locales/es/messages.json
index ed0b569b6..df0154aac 100644
--- a/packages/app/src/locales/es/messages.json
+++ b/packages/app/src/locales/es/messages.json
@@ -1984,6 +1984,7 @@
"PIMM5l": ["¡Te has suscrito!"],
"PKLY-1": ["Abriendo..."],
"PKjGhT": ["Encabezados"],
+ "PMxZyQ": [["0"], " aún no ha comunicado sus ajustes"],
"PMyJ9C": ["Todavía no hay sesión de edición"],
"PPFQ3o": ["Se instaló \"", ["0"], "\" en ", ["1"]],
"PQCdtv": ["\"", ["docName"], "\" no existe."],
@@ -2227,6 +2228,10 @@
"SkTkKV": ["El agente no se detiene. La detención forzada cierra este chat y sale del agente."],
"Skr_7L": ["Buscar worktrees"],
"SlfejT": ["Error"],
+ "Soy_80": [
+ ["0"],
+ " actúa sin preguntar — OpenKnowledge no puede añadirle solicitudes de permiso"
+ ],
"SqIoy_": ["Arreglo automático: ningún problema de aquí tiene arreglo automático"],
"SrOuyg": ["Paneles del documento"],
"SvBFYA": ["No hay proyectos recientes"],
@@ -2422,6 +2427,7 @@
"VNgKZz": ["Ajustes avanzados"],
"VTulZj": ["Abrir en un worktree"],
"VUijjF": ["Incrusta una imagen con texto alternativo opcional."],
+ "VVRrPk": [["0"], " no ofrece ajustes que configurar"],
"VXGFMg": ["Deshacer o rehacer en el campo de código"],
"VYd_YA": ["Abre desde el disco una carpeta de proyecto existente."],
"VZGh8G": ["Pliega, despliega, pliega todo o despliega todos los rangos del código."],
diff --git a/packages/app/src/locales/es/messages.po b/packages/app/src/locales/es/messages.po
index 9ea4e8c07..59ad7a99e 100644
--- a/packages/app/src/locales/es/messages.po
+++ b/packages/app/src/locales/es/messages.po
@@ -251,6 +251,11 @@ msgstr "{0, plural, one {Habilidad} many {Habilidades} other {Habilidades}}"
msgid "{0} · default"
msgstr "{0} · predeterminado"
+#. placeholder {0}: info.agent.name
+#: src/components/acp/ThreadView.tsx
+msgid "{0} acts without asking — OpenKnowledge can't add permission prompts for it"
+msgstr "{0} actúa sin preguntar — OpenKnowledge no puede añadirle solicitudes de permiso"
+
#. placeholder {0}: result.additions
#. placeholder {0}: stat.additions
#. placeholder {1}: result.deletions
@@ -270,6 +275,16 @@ msgstr "{0} en la línea {displayLine}"
msgid "{0} can't continue this chat — the transcript is kept, but the agent session is gone."
msgstr "{0} no puede continuar este chat — la transcripción se conserva, pero la sesión del agente ya no existe."
+#. placeholder {0}: info.agent.name
+#: src/components/acp/ThreadView.tsx
+msgid "{0} doesn't offer any settings to adjust"
+msgstr "{0} no ofrece ajustes que configurar"
+
+#. placeholder {0}: info.agent.name
+#: src/components/acp/ThreadView.tsx
+msgid "{0} hasn't reported its settings yet"
+msgstr "{0} aún no ha comunicado sus ajustes"
+
#. placeholder {0}: activeData.label
#: src/components/EditorWorkspace.tsx
msgid "{0} is over {destination}."
diff --git a/packages/app/src/locales/fr/messages.json b/packages/app/src/locales/fr/messages.json
index 9668d0f05..ed5ac74d3 100644
--- a/packages/app/src/locales/fr/messages.json
+++ b/packages/app/src/locales/fr/messages.json
@@ -2010,6 +2010,7 @@
"PIMM5l": ["Vous êtes abonné !"],
"PKLY-1": ["Ouverture…"],
"PKjGhT": ["Titres"],
+ "PMxZyQ": [["0"], " n'a pas encore communiqué ses paramètres"],
"PMyJ9C": ["Pas encore de session de modification"],
"PPFQ3o": ["« ", ["0"], " » installé dans ", ["1"]],
"PQCdtv": ["« ", ["docName"], " » n'existe pas."],
@@ -2257,6 +2258,10 @@
"SkTkKV": ["L'agent ne s'arrête pas. L'arrêt forcé ferme ce chat et quitte l'agent."],
"Skr_7L": ["Rechercher des worktrees"],
"SlfejT": ["Erreur"],
+ "Soy_80": [
+ ["0"],
+ " agit sans demander — OpenKnowledge ne peut pas lui ajouter de demandes de permission"
+ ],
"SqIoy_": ["Correction automatique — aucun problème ici n'a de correction automatique"],
"SrOuyg": ["Panneaux du document"],
"SvBFYA": ["Aucun projet récent"],
@@ -2460,6 +2465,7 @@
"VNgKZz": ["Paramètres avancés"],
"VTulZj": ["Ouvrir dans un worktree"],
"VUijjF": ["Intègre une image avec un texte alternatif facultatif."],
+ "VVRrPk": [["0"], " ne propose aucun paramètre à ajuster"],
"VXGFMg": ["Annuler ou rétablir dans un champ de code"],
"VYd_YA": ["Ouvrez un dossier de projet existant depuis le disque."],
"VZGh8G": ["Replier, déplier, tout replier ou tout déplier les plages de la source."],
diff --git a/packages/app/src/locales/fr/messages.po b/packages/app/src/locales/fr/messages.po
index 0c4aabeff..1d095f5cf 100644
--- a/packages/app/src/locales/fr/messages.po
+++ b/packages/app/src/locales/fr/messages.po
@@ -251,6 +251,11 @@ msgstr "{0, plural, one {Compétence} many {Compétences} other {Compétences}}"
msgid "{0} · default"
msgstr "{0} · par défaut"
+#. placeholder {0}: info.agent.name
+#: src/components/acp/ThreadView.tsx
+msgid "{0} acts without asking — OpenKnowledge can't add permission prompts for it"
+msgstr "{0} agit sans demander — OpenKnowledge ne peut pas lui ajouter de demandes de permission"
+
#. placeholder {0}: result.additions
#. placeholder {0}: stat.additions
#. placeholder {1}: result.deletions
@@ -270,6 +275,16 @@ msgstr "{0} à la ligne {displayLine}"
msgid "{0} can't continue this chat — the transcript is kept, but the agent session is gone."
msgstr "{0} ne peut pas poursuivre ce chat — la transcription est conservée, mais la session de l'agent n'existe plus."
+#. placeholder {0}: info.agent.name
+#: src/components/acp/ThreadView.tsx
+msgid "{0} doesn't offer any settings to adjust"
+msgstr "{0} ne propose aucun paramètre à ajuster"
+
+#. placeholder {0}: info.agent.name
+#: src/components/acp/ThreadView.tsx
+msgid "{0} hasn't reported its settings yet"
+msgstr "{0} n'a pas encore communiqué ses paramètres"
+
#. placeholder {0}: activeData.label
#: src/components/EditorWorkspace.tsx
msgid "{0} is over {destination}."
diff --git a/packages/app/src/locales/hi/messages.json b/packages/app/src/locales/hi/messages.json
index 15e8f4531..1baae67f7 100644
--- a/packages/app/src/locales/hi/messages.json
+++ b/packages/app/src/locales/hi/messages.json
@@ -1662,6 +1662,7 @@
"PIMM5l": ["आपने सदस्यता ले ली!"],
"PKLY-1": ["खोला जा रहा है…"],
"PKjGhT": ["शीर्षक"],
+ "PMxZyQ": [["0"], " ने अभी तक अपनी सेटिंग नहीं बताई हैं"],
"PMyJ9C": ["अभी कोई संपादन सत्र नहीं"],
"PPFQ3o": ["\"", ["0"], "\" को ", ["1"], " में इंस्टॉल किया गया"],
"PQCdtv": ["\"", ["docName"], "\" मौजूद नहीं है।"],
@@ -1880,6 +1881,7 @@
"SkTkKV": ["एजेंट रुक नहीं रहा है। फ़ोर्स स्टॉप इस चैट को बंद कर देगा और एजेंट से बाहर निकल जाएगा।"],
"Skr_7L": ["वर्कट्री खोजें"],
"SlfejT": ["त्रुटि"],
+ "Soy_80": [["0"], " बिना पूछे काम करता है — OpenKnowledge इसके लिए अनुमति संकेत नहीं जोड़ सकता"],
"SqIoy_": ["स्वत: सुधार — यहाँ किसी भी समस्या का स्वचालित समाधान नहीं है"],
"SrOuyg": ["दस्तावेज़ पैनल"],
"SvBFYA": ["कोई हाल का प्रोजेक्ट नहीं"],
@@ -2043,6 +2045,7 @@
"VNgKZz": ["उन्नत सेटिंग"],
"VTulZj": ["वर्कट्री में खोलें"],
"VUijjF": ["वैकल्पिक वैकल्पिक-पाठ के साथ एक छवि एम्बेड करें।"],
+ "VVRrPk": [["0"], " समायोजित करने के लिए कोई सेटिंग नहीं देता"],
"VXGFMg": ["कोड फ़ील्ड में पूर्ववत या पुनः करें"],
"VYd_YA": ["डिस्क से कोई मौजूदा प्रोजेक्ट फ़ोल्डर खोलें।"],
"VZGh8G": ["स्रोत की श्रेणियाँ मोड़ें, खोलें, सब मोड़ें, या सब खोलें।"],
diff --git a/packages/app/src/locales/hi/messages.po b/packages/app/src/locales/hi/messages.po
index b184aae94..c4f2012a2 100644
--- a/packages/app/src/locales/hi/messages.po
+++ b/packages/app/src/locales/hi/messages.po
@@ -251,6 +251,11 @@ msgstr "{0, plural, one {स्किल} other {स्किल}}"
msgid "{0} · default"
msgstr "{0} · डिफ़ॉल्ट"
+#. placeholder {0}: info.agent.name
+#: src/components/acp/ThreadView.tsx
+msgid "{0} acts without asking — OpenKnowledge can't add permission prompts for it"
+msgstr "{0} बिना पूछे काम करता है — OpenKnowledge इसके लिए अनुमति संकेत नहीं जोड़ सकता"
+
#. placeholder {0}: result.additions
#. placeholder {0}: stat.additions
#. placeholder {1}: result.deletions
@@ -270,6 +275,16 @@ msgstr "पंक्ति {displayLine} पर {0}"
msgid "{0} can't continue this chat — the transcript is kept, but the agent session is gone."
msgstr "{0} इस चैट को जारी नहीं रख सकता — ट्रांसक्रिप्ट सुरक्षित है, लेकिन एजेंट सत्र समाप्त हो गया है।"
+#. placeholder {0}: info.agent.name
+#: src/components/acp/ThreadView.tsx
+msgid "{0} doesn't offer any settings to adjust"
+msgstr "{0} समायोजित करने के लिए कोई सेटिंग नहीं देता"
+
+#. placeholder {0}: info.agent.name
+#: src/components/acp/ThreadView.tsx
+msgid "{0} hasn't reported its settings yet"
+msgstr "{0} ने अभी तक अपनी सेटिंग नहीं बताई हैं"
+
#. placeholder {0}: activeData.label
#: src/components/EditorWorkspace.tsx
msgid "{0} is over {destination}."
diff --git a/packages/app/src/locales/id/messages.json b/packages/app/src/locales/id/messages.json
index 9ab177988..95a03584b 100644
--- a/packages/app/src/locales/id/messages.json
+++ b/packages/app/src/locales/id/messages.json
@@ -1726,6 +1726,7 @@
"PIMM5l": ["Anda sudah berlangganan!"],
"PKLY-1": ["Membuka..."],
"PKjGhT": ["Judul"],
+ "PMxZyQ": [["0"], " belum melaporkan pengaturannya"],
"PMyJ9C": ["Belum ada sesi penyuntingan"],
"PPFQ3o": ["\"", ["0"], "\" dipasang ke ", ["1"]],
"PQCdtv": ["\"", ["docName"], "\" tidak ada."],
@@ -1941,6 +1942,10 @@
"SkTkKV": ["Agen tidak berhenti. Hentikan paksa menutup obrolan ini dan keluar dari agen."],
"Skr_7L": ["Cari worktree"],
"SlfejT": ["Galat"],
+ "Soy_80": [
+ ["0"],
+ " bertindak tanpa bertanya — OpenKnowledge tidak dapat menambahkan permintaan izin untuknya"
+ ],
"SqIoy_": ["Perbaikan otomatis — tidak ada masalah di sini yang punya perbaikan otomatis"],
"SrOuyg": ["Panel dokumen"],
"SvBFYA": ["Tidak ada proyek terbaru"],
@@ -2118,6 +2123,7 @@
"VNgKZz": ["Pengaturan lanjutan"],
"VTulZj": ["Buka di worktree"],
"VUijjF": ["Menyematkan gambar dengan teks alternatif opsional."],
+ "VVRrPk": [["0"], " tidak menawarkan pengaturan untuk disesuaikan"],
"VXGFMg": ["Batalkan atau ulangi di bidang kode"],
"VYd_YA": ["Membuka folder proyek yang sudah ada dari disk."],
"VZGh8G": [
diff --git a/packages/app/src/locales/id/messages.po b/packages/app/src/locales/id/messages.po
index ac8a8451e..b8c5765b5 100644
--- a/packages/app/src/locales/id/messages.po
+++ b/packages/app/src/locales/id/messages.po
@@ -251,6 +251,11 @@ msgstr "{0, plural, other {Keterampilan}}"
msgid "{0} · default"
msgstr "{0} · bawaan"
+#. placeholder {0}: info.agent.name
+#: src/components/acp/ThreadView.tsx
+msgid "{0} acts without asking — OpenKnowledge can't add permission prompts for it"
+msgstr "{0} bertindak tanpa bertanya — OpenKnowledge tidak dapat menambahkan permintaan izin untuknya"
+
#. placeholder {0}: result.additions
#. placeholder {0}: stat.additions
#. placeholder {1}: result.deletions
@@ -270,6 +275,16 @@ msgstr "{0} di baris {displayLine}"
msgid "{0} can't continue this chat — the transcript is kept, but the agent session is gone."
msgstr "{0} tidak dapat melanjutkan obrolan ini — transkrip tetap tersimpan, tetapi sesi agen sudah hilang."
+#. placeholder {0}: info.agent.name
+#: src/components/acp/ThreadView.tsx
+msgid "{0} doesn't offer any settings to adjust"
+msgstr "{0} tidak menawarkan pengaturan untuk disesuaikan"
+
+#. placeholder {0}: info.agent.name
+#: src/components/acp/ThreadView.tsx
+msgid "{0} hasn't reported its settings yet"
+msgstr "{0} belum melaporkan pengaturannya"
+
#. placeholder {0}: activeData.label
#: src/components/EditorWorkspace.tsx
msgid "{0} is over {destination}."
diff --git a/packages/app/src/locales/pseudo/messages.json b/packages/app/src/locales/pseudo/messages.json
index 40168c5f8..016bd6480 100644
--- a/packages/app/src/locales/pseudo/messages.json
+++ b/packages/app/src/locales/pseudo/messages.json
@@ -1728,6 +1728,7 @@
"PIMM5l": ["Ŷōũ'ŕē śũƀśćŕĩƀēď!"],
"PKLY-1": ["Ōƥēńĩńĝ..."],
"PKjGhT": ["Ĥēàďĩńĝś"],
+ "PMxZyQ": [["0"], " ĥàśń'ţ ŕēƥōŕţēď ĩţś śēţţĩńĝś ŷēţ"],
"PMyJ9C": ["Ńō ēďĩţ śēśśĩōń ŷēţ"],
"PPFQ3o": ["Ĩńśţàĺĺēď \"", ["0"], "\" ĩńţō ", ["1"]],
"PQCdtv": ["\"", ["docName"], "\" ďōēśń'ţ ēxĩśţ."],
@@ -1949,6 +1950,7 @@
"SkTkKV": ["Ţĥē àĝēńţ ĩśń'ţ śţōƥƥĩńĝ. Ƒōŕćē śţōƥ ćĺōśēś ţĥĩś ćĥàţ àńď ǫũĩţś ţĥē àĝēńţ."],
"Skr_7L": ["Śēàŕćĥ ŵōŕķţŕēēś"],
"SlfejT": ["Ēŕŕōŕ"],
+ "Soy_80": [["0"], " àćţś ŵĩţĥōũţ àśķĩńĝ — ŌƥēńĶńōŵĺēďĝē ćàń'ţ àďď ƥēŕḿĩśśĩōń ƥŕōḿƥţś ƒōŕ ĩţ"],
"SqIoy_": ["Àũţō-ƒĩx — ńō ƥŕōƀĺēḿś ĥēŕē ĥàvē àń àũţōḿàţĩć ƒĩx"],
"SrOuyg": ["Ďōćũḿēńţ ƥàńēĺś"],
"SvBFYA": ["Ńō ŕēćēńţ ƥŕōĴēćţś"],
@@ -2122,6 +2124,7 @@
"VNgKZz": ["Àďvàńćēď śēţţĩńĝś"],
"VTulZj": ["Ōƥēń ĩń ŵōŕķţŕēē"],
"VUijjF": ["Ēḿƀēď àń ĩḿàĝē ŵĩţĥ ōƥţĩōńàĺ àĺţ ţēxţ."],
+ "VVRrPk": [["0"], " ďōēśń'ţ ōƒƒēŕ àńŷ śēţţĩńĝś ţō àďĴũśţ"],
"VXGFMg": ["Ćōďē ƒĩēĺď ũńďō ōŕ ŕēďō"],
"VYd_YA": ["Ōƥēń àń ēxĩśţĩńĝ ƥŕōĴēćţ ƒōĺďēŕ ƒŕōḿ ďĩśķ."],
"VZGh8G": ["Ƒōĺď, ũńƒōĺď, ƒōĺď àĺĺ, ōŕ ũńƒōĺď àĺĺ śōũŕćē ŕàńĝēś."],
diff --git a/packages/app/src/locales/pseudo/messages.po b/packages/app/src/locales/pseudo/messages.po
index afc35975a..95751080f 100644
--- a/packages/app/src/locales/pseudo/messages.po
+++ b/packages/app/src/locales/pseudo/messages.po
@@ -251,6 +251,11 @@ msgstr ""
msgid "{0} · default"
msgstr ""
+#. placeholder {0}: info.agent.name
+#: src/components/acp/ThreadView.tsx
+msgid "{0} acts without asking — OpenKnowledge can't add permission prompts for it"
+msgstr ""
+
#. placeholder {0}: result.additions
#. placeholder {0}: stat.additions
#. placeholder {1}: result.deletions
@@ -270,6 +275,16 @@ msgstr ""
msgid "{0} can't continue this chat — the transcript is kept, but the agent session is gone."
msgstr ""
+#. placeholder {0}: info.agent.name
+#: src/components/acp/ThreadView.tsx
+msgid "{0} doesn't offer any settings to adjust"
+msgstr ""
+
+#. placeholder {0}: info.agent.name
+#: src/components/acp/ThreadView.tsx
+msgid "{0} hasn't reported its settings yet"
+msgstr ""
+
#. placeholder {0}: activeData.label
#: src/components/EditorWorkspace.tsx
msgid "{0} is over {destination}."
diff --git a/packages/app/src/locales/pt-BR/messages.json b/packages/app/src/locales/pt-BR/messages.json
index 0d4484a59..477e9393b 100644
--- a/packages/app/src/locales/pt-BR/messages.json
+++ b/packages/app/src/locales/pt-BR/messages.json
@@ -1962,6 +1962,7 @@
"PIMM5l": ["Assinatura confirmada!"],
"PKLY-1": ["Abrindo..."],
"PKjGhT": ["Títulos"],
+ "PMxZyQ": [["0"], " ainda não informou suas configurações"],
"PMyJ9C": ["Ainda não há sessão de edição"],
"PPFQ3o": ["\"", ["0"], "\" instalado em ", ["1"]],
"PQCdtv": ["\"", ["docName"], "\" não existe."],
@@ -2203,6 +2204,10 @@
"SkTkKV": ["O agente não está parando. A parada forçada fecha este chat e encerra o agente."],
"Skr_7L": ["Buscar worktrees"],
"SlfejT": ["Erro"],
+ "Soy_80": [
+ ["0"],
+ " age sem perguntar — o OpenKnowledge não consegue adicionar pedidos de permissão para ele"
+ ],
"SqIoy_": ["Correção automática — nenhum problema aqui tem correção automática"],
"SrOuyg": ["Painéis do documento"],
"SvBFYA": ["Nenhum projeto recente"],
@@ -2396,6 +2401,7 @@
"VNgKZz": ["Configurações avançadas"],
"VTulZj": ["Abrir em um worktree"],
"VUijjF": ["Incorpora uma imagem com texto alternativo opcional."],
+ "VVRrPk": [["0"], " não oferece configurações para ajustar"],
"VXGFMg": ["Desfazer ou refazer no campo de código"],
"VYd_YA": ["Abre do disco uma pasta de projeto existente."],
"VZGh8G": ["Dobra, desdobra, dobra tudo ou desdobra todos os trechos do código."],
diff --git a/packages/app/src/locales/pt-BR/messages.po b/packages/app/src/locales/pt-BR/messages.po
index 1f21cb5c3..a8c7a85e6 100644
--- a/packages/app/src/locales/pt-BR/messages.po
+++ b/packages/app/src/locales/pt-BR/messages.po
@@ -251,6 +251,11 @@ msgstr "{0, plural, one {Habilidade} many {Habilidades} other {Habilidades}}"
msgid "{0} · default"
msgstr "{0} · padrão"
+#. placeholder {0}: info.agent.name
+#: src/components/acp/ThreadView.tsx
+msgid "{0} acts without asking — OpenKnowledge can't add permission prompts for it"
+msgstr "{0} age sem perguntar — o OpenKnowledge não consegue adicionar pedidos de permissão para ele"
+
#. placeholder {0}: result.additions
#. placeholder {0}: stat.additions
#. placeholder {1}: result.deletions
@@ -270,6 +275,16 @@ msgstr "{0} na linha {displayLine}"
msgid "{0} can't continue this chat — the transcript is kept, but the agent session is gone."
msgstr "{0} não pode continuar este chat — a transcrição foi mantida, mas a sessão do agente não existe mais."
+#. placeholder {0}: info.agent.name
+#: src/components/acp/ThreadView.tsx
+msgid "{0} doesn't offer any settings to adjust"
+msgstr "{0} não oferece configurações para ajustar"
+
+#. placeholder {0}: info.agent.name
+#: src/components/acp/ThreadView.tsx
+msgid "{0} hasn't reported its settings yet"
+msgstr "{0} ainda não informou suas configurações"
+
#. placeholder {0}: activeData.label
#: src/components/EditorWorkspace.tsx
msgid "{0} is over {destination}."
diff --git a/packages/app/src/locales/ur/messages.json b/packages/app/src/locales/ur/messages.json
index 5fb4a0917..87691f536 100644
--- a/packages/app/src/locales/ur/messages.json
+++ b/packages/app/src/locales/ur/messages.json
@@ -1761,6 +1761,7 @@
"PIMM5l": ["آپ رکن بن گئے!"],
"PKLY-1": ["کھولا جا رہا ہے..."],
"PKjGhT": ["عنوانات"],
+ "PMxZyQ": [["0"], " نے ابھی تک اپنی ترتیبات نہیں بتائیں"],
"PMyJ9C": ["ابھی کوئی ترمیمی سیشن نہیں"],
"PPFQ3o": ["«", ["0"], "» کو ", ["1"], " میں نصب کر دیا گیا"],
"PQCdtv": ["«", ["docName"], "» موجود نہیں ہے۔"],
@@ -1993,6 +1994,10 @@
],
"Skr_7L": ["ورک ٹریز تلاش کریں"],
"SlfejT": ["خرابی"],
+ "Soy_80": [
+ ["0"],
+ " پوچھے بغیر عمل کرتا ہے — OpenKnowledge اس کے لیے اجازت کے پرامپٹ شامل نہیں کر سکتا"
+ ],
"SqIoy_": ["خودکار اصلاح — یہاں کسی مسئلے کا خودکار حل نہیں ہے"],
"SrOuyg": ["دستاویز کے پینلز"],
"SvBFYA": ["کوئی حالیہ پروجیکٹ نہیں"],
@@ -2168,6 +2173,7 @@
"VNgKZz": ["اعلیٰ ترتیبات"],
"VTulZj": ["ورک ٹری میں کھولیں"],
"VUijjF": ["اختیاری متبادل متن کے ساتھ تصویر شامل کریں۔"],
+ "VVRrPk": [["0"], " ایڈجسٹ کرنے کے لیے کوئی ترتیبات فراہم نہیں کرتا"],
"VXGFMg": ["کوڈ فیلڈ میں واپسی یا دوبارہ"],
"VYd_YA": ["ڈسک سے موجودہ پروجیکٹ کا فولڈر کھولیں۔"],
"VZGh8G": ["سورس کے حصے تہ کریں، کھولیں، سب تہ کریں، یا سب کھولیں۔"],
diff --git a/packages/app/src/locales/ur/messages.po b/packages/app/src/locales/ur/messages.po
index 1abec8a4a..2423aad46 100644
--- a/packages/app/src/locales/ur/messages.po
+++ b/packages/app/src/locales/ur/messages.po
@@ -251,6 +251,11 @@ msgstr "{0, plural, one {مہارت} other {مہارتیں}}"
msgid "{0} · default"
msgstr "{0} · ڈیفالٹ"
+#. placeholder {0}: info.agent.name
+#: src/components/acp/ThreadView.tsx
+msgid "{0} acts without asking — OpenKnowledge can't add permission prompts for it"
+msgstr "{0} پوچھے بغیر عمل کرتا ہے — OpenKnowledge اس کے لیے اجازت کے پرامپٹ شامل نہیں کر سکتا"
+
#. placeholder {0}: result.additions
#. placeholder {0}: stat.additions
#. placeholder {1}: result.deletions
@@ -270,6 +275,16 @@ msgstr "{0} سطر {displayLine} پر"
msgid "{0} can't continue this chat — the transcript is kept, but the agent session is gone."
msgstr "{0} اس چیٹ کو جاری نہیں رکھ سکتا — ٹرانسکرپٹ محفوظ ہے، لیکن ایجنٹ سیشن ختم ہو گیا ہے۔"
+#. placeholder {0}: info.agent.name
+#: src/components/acp/ThreadView.tsx
+msgid "{0} doesn't offer any settings to adjust"
+msgstr "{0} ایڈجسٹ کرنے کے لیے کوئی ترتیبات فراہم نہیں کرتا"
+
+#. placeholder {0}: info.agent.name
+#: src/components/acp/ThreadView.tsx
+msgid "{0} hasn't reported its settings yet"
+msgstr "{0} نے ابھی تک اپنی ترتیبات نہیں بتائیں"
+
#. placeholder {0}: activeData.label
#: src/components/EditorWorkspace.tsx
msgid "{0} is over {destination}."
diff --git a/packages/app/src/locales/zh-Hans/messages.json b/packages/app/src/locales/zh-Hans/messages.json
index 42924de9f..999677ddf 100644
--- a/packages/app/src/locales/zh-Hans/messages.json
+++ b/packages/app/src/locales/zh-Hans/messages.json
@@ -1514,6 +1514,7 @@
"PIMM5l": ["订阅成功!"],
"PKLY-1": ["正在打开…"],
"PKjGhT": ["标题"],
+ "PMxZyQ": [["0"], " 尚未报告其设置"],
"PMyJ9C": ["还没有编辑会话"],
"PPFQ3o": ["已把“", ["0"], "”安装到 ", ["1"]],
"PQCdtv": ["“", ["docName"], "”不存在。"],
@@ -1707,6 +1708,7 @@
"SkTkKV": ["智能体没有停止。强制停止将关闭此对话并退出智能体。"],
"Skr_7L": ["搜索 worktree"],
"SlfejT": ["错误"],
+ "Soy_80": [["0"], " 不经询问即执行操作 — OpenKnowledge 无法为其添加权限确认"],
"SqIoy_": ["自动修复——这里的问题都没有自动修复方案"],
"SrOuyg": ["文档面板"],
"SvBFYA": ["没有最近的项目"],
@@ -1866,6 +1868,7 @@
"VNgKZz": ["高级设置"],
"VTulZj": ["在 worktree 中打开"],
"VUijjF": ["嵌入一张图片,可选填替代文本。"],
+ "VVRrPk": [["0"], " 没有可调整的设置"],
"VXGFMg": ["代码字段的撤销或重做"],
"VYd_YA": ["从磁盘打开一个已有的项目文件夹。"],
"VZGh8G": ["折叠、展开、全部折叠或全部展开源码区域。"],
diff --git a/packages/app/src/locales/zh-Hans/messages.po b/packages/app/src/locales/zh-Hans/messages.po
index 54c71a9e0..1d65660f5 100644
--- a/packages/app/src/locales/zh-Hans/messages.po
+++ b/packages/app/src/locales/zh-Hans/messages.po
@@ -251,6 +251,11 @@ msgstr "{0, plural, other {技能}}"
msgid "{0} · default"
msgstr "{0} · 默认"
+#. placeholder {0}: info.agent.name
+#: src/components/acp/ThreadView.tsx
+msgid "{0} acts without asking — OpenKnowledge can't add permission prompts for it"
+msgstr "{0} 不经询问即执行操作 — OpenKnowledge 无法为其添加权限确认"
+
#. placeholder {0}: result.additions
#. placeholder {0}: stat.additions
#. placeholder {1}: result.deletions
@@ -270,6 +275,16 @@ msgstr "{0},第 {displayLine} 行"
msgid "{0} can't continue this chat — the transcript is kept, but the agent session is gone."
msgstr "{0} 无法继续此对话 — 聊天记录已保留,但智能体会话已丢失。"
+#. placeholder {0}: info.agent.name
+#: src/components/acp/ThreadView.tsx
+msgid "{0} doesn't offer any settings to adjust"
+msgstr "{0} 没有可调整的设置"
+
+#. placeholder {0}: info.agent.name
+#: src/components/acp/ThreadView.tsx
+msgid "{0} hasn't reported its settings yet"
+msgstr "{0} 尚未报告其设置"
+
#. placeholder {0}: activeData.label
#: src/components/EditorWorkspace.tsx
msgid "{0} is over {destination}."
diff --git a/packages/app/src/locales/zh-Hant/messages.json b/packages/app/src/locales/zh-Hant/messages.json
index 57eda3167..a270fcac4 100644
--- a/packages/app/src/locales/zh-Hant/messages.json
+++ b/packages/app/src/locales/zh-Hant/messages.json
@@ -1534,6 +1534,7 @@
"PIMM5l": ["訂閱成功!"],
"PKLY-1": ["正在開啟…"],
"PKjGhT": ["標題"],
+ "PMxZyQ": [["0"], " 尚未回報其設定"],
"PMyJ9C": ["還沒有編輯工作階段"],
"PPFQ3o": ["已把「", ["0"], "」安裝到 ", ["1"]],
"PQCdtv": ["「", ["docName"], "」不存在。"],
@@ -1727,6 +1728,7 @@
"SkTkKV": ["智慧代理沒有停止。強制停止將關閉此對話並結束智慧代理。"],
"Skr_7L": ["搜尋 worktree"],
"SlfejT": ["錯誤"],
+ "Soy_80": [["0"], " 不經詢問即執行操作 — OpenKnowledge 無法為其加入權限確認"],
"SqIoy_": ["自動修正——這裡的問題都沒有自動修正方式"],
"SrOuyg": ["文件面板"],
"SvBFYA": ["沒有最近的專案"],
@@ -1888,6 +1890,7 @@
"VNgKZz": ["進階設定"],
"VTulZj": ["在 worktree 中開啟"],
"VUijjF": ["嵌入一張圖片,可選填替代文字。"],
+ "VVRrPk": [["0"], " 沒有可調整的設定"],
"VXGFMg": ["程式碼欄位的復原或重做"],
"VYd_YA": ["從磁碟開啟一個既有的專案資料夾。"],
"VZGh8G": ["摺疊、展開、全部摺疊或全部展開原始碼範圍。"],
diff --git a/packages/app/src/locales/zh-Hant/messages.po b/packages/app/src/locales/zh-Hant/messages.po
index d1202b113..6fcd3a415 100644
--- a/packages/app/src/locales/zh-Hant/messages.po
+++ b/packages/app/src/locales/zh-Hant/messages.po
@@ -251,6 +251,11 @@ msgstr "{0, plural, other {技能}}"
msgid "{0} · default"
msgstr "{0} · 預設"
+#. placeholder {0}: info.agent.name
+#: src/components/acp/ThreadView.tsx
+msgid "{0} acts without asking — OpenKnowledge can't add permission prompts for it"
+msgstr "{0} 不經詢問即執行操作 — OpenKnowledge 無法為其加入權限確認"
+
#. placeholder {0}: result.additions
#. placeholder {0}: stat.additions
#. placeholder {1}: result.deletions
@@ -270,6 +275,16 @@ msgstr "{0},第 {displayLine} 行"
msgid "{0} can't continue this chat — the transcript is kept, but the agent session is gone."
msgstr "{0} 無法繼續此對話 — 對話記錄已保留,但智慧代理的工作階段已遺失。"
+#. placeholder {0}: info.agent.name
+#: src/components/acp/ThreadView.tsx
+msgid "{0} doesn't offer any settings to adjust"
+msgstr "{0} 沒有可調整的設定"
+
+#. placeholder {0}: info.agent.name
+#: src/components/acp/ThreadView.tsx
+msgid "{0} hasn't reported its settings yet"
+msgstr "{0} 尚未回報其設定"
+
#. placeholder {0}: activeData.label
#: src/components/EditorWorkspace.tsx
msgid "{0} is over {destination}."
diff --git a/packages/core/package.json b/packages/core/package.json
index 007201aee..93e96c304 100644
--- a/packages/core/package.json
+++ b/packages/core/package.json
@@ -45,6 +45,16 @@
"types": "./src/acp/thread-protocol.ts",
"default": "./dist/acp-thread-protocol.mjs"
},
+ "./acp/agent-posture": {
+ "development": "./src/acp/agent-posture.ts",
+ "types": "./src/acp/agent-posture.ts",
+ "default": "./dist/acp-agent-posture.mjs"
+ },
+ "./acp/permissive-mode": {
+ "development": "./src/acp/permissive-mode.ts",
+ "types": "./src/acp/permissive-mode.ts",
+ "default": "./dist/acp-permissive-mode.mjs"
+ },
"./desktop-bridge": {
"development": "./src/desktop-bridge.ts",
"types": "./src/desktop-bridge.ts",
diff --git a/packages/core/src/acp/agent-posture.test.ts b/packages/core/src/acp/agent-posture.test.ts
new file mode 100644
index 000000000..db2ae7371
--- /dev/null
+++ b/packages/core/src/acp/agent-posture.test.ts
@@ -0,0 +1,58 @@
+import { describe, expect, test } from 'vitest';
+import { deriveAgentPosture } from './agent-posture.ts';
+
+const modesOf = (...ids: string[]) => ({
+ currentModeId: ids[0] ?? '',
+ availableModes: ids.map((id) => ({ id, name: id })),
+});
+
+describe('deriveAgentPosture', () => {
+ test('verified table wins over declared modes', () => {
+ // Claude declares modes AND asks — the table entry must beat derivation.
+ expect(deriveAgentPosture('claude-acp', modesOf('default', 'acceptEdits'))).toBe('asks');
+ expect(deriveAgentPosture('claude-acp', null)).toBe('asks');
+ });
+
+ test('a permissive current mode demotes a verified asks to self-managed', () => {
+ // "Asks before acting" is false while bypassPermissions is in force —
+ // the badge must agree with the permissive-mode accent, not contradict it.
+ const modes = {
+ currentModeId: 'bypassPermissions',
+ availableModes: [
+ { id: 'default', name: 'Default' },
+ { id: 'bypassPermissions', name: 'Bypass Permissions' },
+ ],
+ };
+ expect(deriveAgentPosture('claude-acp', modes)).toBe('self-managed');
+ // Callers rendering a config-option mode surface pass it explicitly.
+ expect(
+ deriveAgentPosture('claude-acp', null, { id: 'acceptEdits', name: 'Accept Edits' }),
+ ).toBe('self-managed');
+ // A non-permissive current mode keeps the verified answer.
+ expect(deriveAgentPosture('claude-acp', null, { id: 'default', name: 'Default' })).toBe('asks');
+ // Demotion is scoped to the asks claim — other verified postures keep
+ // their answer under a permissive current mode.
+ expect(deriveAgentPosture('pi-acp', null, { id: 'yolo', name: 'YOLO' })).toBe('autonomous');
+ expect(deriveAgentPosture('codex-acp', null, { id: 'agent-full-access' })).toBe('self-managed');
+ });
+
+ test('verified self-managed and autonomous agents', () => {
+ expect(deriveAgentPosture('codex-acp', null)).toBe('self-managed');
+ expect(deriveAgentPosture('cursor', null)).toBe('self-managed');
+ expect(deriveAgentPosture('pi-acp', null)).toBe('autonomous');
+ });
+
+ test('unverified agent with declared modes derives self-managed', () => {
+ expect(deriveAgentPosture('some-new-agent', modesOf('plan', 'agent'))).toBe('self-managed');
+ // Boundary: a single declared mode also qualifies as self-managed.
+ expect(deriveAgentPosture('some-new-agent', modesOf('agent'))).toBe('self-managed');
+ });
+
+ test('unverified agent without modes is unknown, never autonomous', () => {
+ expect(deriveAgentPosture('some-new-agent', null)).toBe('unknown');
+ expect(deriveAgentPosture('some-new-agent', undefined)).toBe('unknown');
+ expect(deriveAgentPosture('some-new-agent', { currentModeId: '', availableModes: [] })).toBe(
+ 'unknown',
+ );
+ });
+});
diff --git a/packages/core/src/acp/agent-posture.ts b/packages/core/src/acp/agent-posture.ts
new file mode 100644
index 000000000..07b5fa672
--- /dev/null
+++ b/packages/core/src/acp/agent-posture.ts
@@ -0,0 +1,80 @@
+/**
+ * OK-owned knowledge of each agent's permission posture — who gets to
+ * authorize a risky action (file edit, command run) on a thread. ACP has no
+ * handshake field for this: whether an agent routes actions through
+ * `session/request_permission` is only observable behavior, so the verified
+ * table below is keyed by registry agent id and maintained by hand. Lives in
+ * core (not app) so the live thread UI and a future catalog/picker surface
+ * can render one consistent answer.
+ */
+
+import type { SessionModeState } from '@agentclientprotocol/sdk';
+import { isPermissiveMode } from './permissive-mode.ts';
+
+export type AgentPermissionPosture =
+ /** Routes risky actions through OK's permission prompts before acting. */
+ | 'asks'
+ /** Never asks OK; safety is governed by the agent's own declared mode. */
+ | 'self-managed'
+ /** Never asks and declares no modes — OK cannot intervene at all. */
+ | 'autonomous'
+ /** Unverified and not derivable from the session surface. */
+ | 'unknown';
+
+/**
+ * Postures verified by observation, keyed by registry agent id. An entry
+ * here beats derivation: Claude both declares modes and asks, and only the
+ * asking is what the user needs to know.
+ *
+ * Sibling per-agent tables: `FEATURED_AGENT_IDS` and `ACP_AGENT_EDITOR_IDS`
+ * in `packages/server/src/acp/registry.ts` — those live in server because
+ * only the server reads them; this one lives in core because both sides of
+ * the wire consume it. Touching agent ids? Check all three.
+ */
+export const VERIFIED_AGENT_POSTURES: {
+ readonly [agentId: string]: AgentPermissionPosture | undefined;
+} = {
+ 'claude-acp': 'asks',
+ 'codex-acp': 'self-managed',
+ cursor: 'self-managed',
+ 'pi-acp': 'autonomous',
+};
+
+/**
+ * Posture for one agent: the verified table first, else the one protocol
+ * surface that implies self-management (declared modes), else unknown.
+ * `modes` is the thread's live `SessionModeState` when a session is open;
+ * pass null/undefined before the handshake resolves — an unverified agent
+ * reads as `unknown` (not `autonomous`) until its modes are known, because
+ * "we can't tell yet" must never render as "this agent never asks".
+ *
+ * A verified `asks` is a claim about the agent's asking modes, and the user
+ * can switch to one that doesn't ask (Claude's `acceptEdits` /
+ * `bypassPermissions`) — carried across threads by remembered settings, so
+ * it can be wrong from a thread's first render. When the CURRENT mode reads
+ * as permissive, `asks` demotes to `self-managed`: the honest answer, and
+ * the one that can never contradict the permissive-mode warning driven by
+ * the same detector. `currentMode` lets callers pass the mode surface they
+ * actually render (config-option modes included); absent, the current entry
+ * of `modes` is used.
+ */
+export function deriveAgentPosture(
+ agentId: string,
+ modes: SessionModeState | null | undefined,
+ currentMode?: { id: string; name?: string } | null,
+): AgentPermissionPosture {
+ const current =
+ currentMode ??
+ (modes != null
+ ? (modes.availableModes.find((mode) => mode.id === modes.currentModeId) ?? null)
+ : null);
+ const verified = VERIFIED_AGENT_POSTURES[agentId];
+ if (verified !== undefined) {
+ if (verified === 'asks' && current !== null && isPermissiveMode(current)) {
+ return 'self-managed';
+ }
+ return verified;
+ }
+ if (modes != null && modes.availableModes.length > 0) return 'self-managed';
+ return 'unknown';
+}
diff --git a/packages/core/src/acp/permissive-mode.ts b/packages/core/src/acp/permissive-mode.ts
new file mode 100644
index 000000000..bfc488328
--- /dev/null
+++ b/packages/core/src/acp/permissive-mode.ts
@@ -0,0 +1,94 @@
+/**
+ * Best-effort detection of agent modes that let the agent act without asking.
+ *
+ * ACP hands the client an opaque `{id, name}` mode list with no "affects
+ * permissions" flag, so OK cannot know what a mode does. What it CAN do is
+ * recognise the vocabulary the common harnesses use for their permissive modes
+ * — Claude Code's `bypassPermissions` / `acceptEdits`, Gemini's YOLO, Codex's
+ * full-auto and danger-full-access, and the auto-approve / skip-permissions
+ * naming everyone converges on.
+ *
+ * This drives a visual warning only (the amber accent on the settings trigger).
+ * It never gates, blocks, or rewrites a mode, so the failure modes are mild in
+ * both directions: a miss loses a hint, a false positive shows one too many.
+ * Deliberately biased toward matching — an unflagged bypass mode is the worse
+ * error — but not so loose that ordinary modes (`plan`, `ask`, `architect`,
+ * `code`, `default`) trip it.
+ */
+
+/**
+ * Matched against the id and name with everything but letters removed, so
+ * `accept-edits`, `acceptEdits`, and "Accept Edits" all reduce to
+ * `acceptedits`. Keep the alternatives letters-only for the same reason.
+ *
+ * The first group is what the adapters in the ACP registry actually advertise
+ * over `session/new` — read out of the shipped adapters, not from their CLI
+ * flags, which differ (Codex's mode id is `agent-full-access`; the
+ * `danger-full-access` you see in its docs is the sandbox policy behind it):
+ *
+ * claude-agent-acp default · plan · acceptEdits · bypassPermissions
+ * codex-acp read-only · agent · agent-full-access
+ * gemini-cli default · plan · auto_edit · yolo
+ * cursor-agent agent · plan · ask (none permissive)
+ * goose auto · approve · smart_approve · chat
+ * pi-acp off · minimal · … · xhigh (see note below)
+ *
+ * The second group is naming seen in these tools' flags and elsewhere in their
+ * binaries (opencode carries `unrestricted` / `autoApprove` / `dangerously`,
+ * amp carries `dangerously`) but not yet observed as a mode id. Cheap to
+ * carry: matching one costs a dot the user can ignore.
+ *
+ * `agent` must never be added — Codex and Cursor both call their ordinary
+ * mode that, so it would flag what almost everyone runs. `smart_approve` is
+ * likewise left alone: it still prompts for the risky operations.
+ *
+ * Not every agent uses modes for permissions at all — pi-acp exposes reasoning
+ * effort through the same surface. Matching on permission vocabulary rather
+ * than on "is a non-default mode" is what keeps those quiet.
+ */
+const PERMISSIVE = new RegExp(
+ [
+ // Observed in shipped adapters.
+ 'bypass', // claude-agent-acp `bypassPermissions`
+ 'acceptedits', // claude-agent-acp `acceptEdits`
+ 'fullaccess', // codex-acp `agent-full-access`
+ 'autoedit', // gemini-cli `auto_edit`
+ 'yolo', // gemini-cli `yolo`
+ // Speculative: seen in these tools' flags/docs, not (yet) as mode ids.
+ 'danger', // `--dangerously-skip-permissions`, codex `danger-full-access`
+ 'fullauto', // codex `--full-auto`
+ 'autoaccept',
+ 'autoapprove',
+ 'autorun',
+ 'skippermission',
+ 'noconfirm',
+ 'noprompt',
+ 'unrestricted',
+ 'allowall',
+ ].join('|'),
+);
+
+/**
+ * Words that mean "no approval" as a WHOLE mode, but are too common to match
+ * as a substring: goose names its full-autonomy mode exactly `auto`, while
+ * `auto` inside a longer word says nothing on its own (an "Autocomplete" mode
+ * is not a permission grant). The specific `auto*` compounds that DO carry the
+ * meaning — `auto_edit`, `autoApprove` — are in `PERMISSIVE` above.
+ */
+const PERMISSIVE_EXACT = new Set(['auto']);
+
+/** Letters only, lowercased — separators and casing vary per harness. */
+function normalize(value: string): string {
+ return value.toLowerCase().replace(/[^a-z]/g, '');
+}
+
+/**
+ * True when a mode's id or name reads as "act without asking". See the module
+ * header for why this is a hint rather than a guarantee.
+ */
+export function isPermissiveMode(mode: { id: string; name?: string }): boolean {
+ const id = normalize(mode.id);
+ const name = normalize(mode.name ?? '');
+ if (PERMISSIVE_EXACT.has(id) || PERMISSIVE_EXACT.has(name)) return true;
+ return PERMISSIVE.test(id) || PERMISSIVE.test(name);
+}
diff --git a/packages/core/src/acp/thread-protocol.ts b/packages/core/src/acp/thread-protocol.ts
index fc443b684..2593409ca 100644
--- a/packages/core/src/acp/thread-protocol.ts
+++ b/packages/core/src/acp/thread-protocol.ts
@@ -19,6 +19,7 @@
import type {
ContentBlock,
PermissionOption,
+ PromptCapabilities,
SessionConfigOption,
SessionModeState,
SessionUpdate,
@@ -141,6 +142,16 @@ export interface ThreadInfo {
status: ThreadStatus;
createdAt: number;
lastActivityAt: number;
+ /**
+ * Prompt content the agent declared it can accept at `initialize`, beyond
+ * the protocol baseline of text + resource links (image / audio /
+ * embedded context). Set from the moment the handshake resolves; `{}`
+ * means the handshake resolved and the agent accepts baseline content
+ * only. Null or absent means the handshake hasn't resolved yet — "not yet
+ * known" is a different answer than "no", and the UI renders the two
+ * differently.
+ */
+ promptCapabilities?: PromptCapabilities | null;
/** Present once the agent advertised modes (Ask / Architect / Code …). */
modes?: SessionModeState | null;
/**
@@ -649,6 +660,7 @@ export function parseThreadClientFrame(raw: string): ThreadClientFrame | null {
export type {
ContentBlock,
PermissionOption,
+ PromptCapabilities,
SessionConfigOption,
SessionModeState,
SessionUpdate,
diff --git a/packages/core/src/bridge/bind-frontmatter-doc.ts b/packages/core/src/bridge/bind-frontmatter-doc.ts
index d7a845280..dfd95ef49 100644
--- a/packages/core/src/bridge/bind-frontmatter-doc.ts
+++ b/packages/core/src/bridge/bind-frontmatter-doc.ts
@@ -1,3 +1,4 @@
+
import type * as Y from 'yjs';
import type { Err, Ok, Result } from '../config/result.ts';
import { type FrontmatterValidationError, toFrontmatterIssue } from '../frontmatter/errors.ts';
diff --git a/packages/core/src/bridge/bridge-invariant.ts b/packages/core/src/bridge/bridge-invariant.ts
index 005627195..8bfdb40cd 100644
--- a/packages/core/src/bridge/bridge-invariant.ts
+++ b/packages/core/src/bridge/bridge-invariant.ts
@@ -1,3 +1,4 @@
+
import { fnv1aDigest } from './hash-util.ts';
export type BridgeInvariantSite = 'observer-b' | 'persistence' | 'test-harness';
diff --git a/packages/core/src/bridge/compose.ts b/packages/core/src/bridge/compose.ts
index f4cc8a286..2a597ec3d 100644
--- a/packages/core/src/bridge/compose.ts
+++ b/packages/core/src/bridge/compose.ts
@@ -1,3 +1,4 @@
+
import { prependFrontmatter, stripFrontmatter } from '../extensions/frontmatter.ts';
export type ComposeAdjustment = 'none' | 'body' | 'frontmatter' | 'unresolved';
diff --git a/packages/core/src/bridge/doc-boundary-space.ts b/packages/core/src/bridge/doc-boundary-space.ts
index 8fb428b90..01ef76a9f 100644
--- a/packages/core/src/bridge/doc-boundary-space.ts
+++ b/packages/core/src/bridge/doc-boundary-space.ts
@@ -1,3 +1,4 @@
+
import { FRONTMATTER_RE, stripFrontmatter } from '../extensions/frontmatter.ts';
import { carriedEdgeEmpties, type DocEdgeEmpties } from '../markdown/doc-edge-blank-runs.ts';
diff --git a/packages/core/src/bridge/growth-detect.ts b/packages/core/src/bridge/growth-detect.ts
index 9d9c244b0..463e89595 100644
--- a/packages/core/src/bridge/growth-detect.ts
+++ b/packages/core/src/bridge/growth-detect.ts
@@ -1,3 +1,4 @@
+
const DEFAULT_MIN_SUBSTANTIVE_LINE_LENGTH = 16;
export const DUPLICATION_GATE_MIN_LINE_LENGTH = 8;
diff --git a/packages/core/src/bridge/intraline-predicate.ts b/packages/core/src/bridge/intraline-predicate.ts
index c43fdd7e7..0939885bb 100644
--- a/packages/core/src/bridge/intraline-predicate.ts
+++ b/packages/core/src/bridge/intraline-predicate.ts
@@ -1,3 +1,4 @@
+
export function rawLineCounts(doc: string): Map<string, number> {
const counts = new Map<string, number>();
for (const line of doc.split('\n')) {
diff --git a/packages/core/src/bridge/merge-three-way.ts b/packages/core/src/bridge/merge-three-way.ts
index 251560a35..c0dc65705 100644
--- a/packages/core/src/bridge/merge-three-way.ts
+++ b/packages/core/src/bridge/merge-three-way.ts
@@ -65,6 +65,7 @@ export function tryLineLevelCombine(
return { clean: true, merged };
}
+
export type BridgeMergeContentLossSide = 'user' | 'agent';
export type BridgeMergeContentLossWhich = 'substring' | 'order' | 'growth';
diff --git a/packages/core/src/bridge/normalize.ts b/packages/core/src/bridge/normalize.ts
index 01ac80099..dcc5b0690 100644
--- a/packages/core/src/bridge/normalize.ts
+++ b/packages/core/src/bridge/normalize.ts
@@ -1,3 +1,4 @@
+
import { stripFrontmatter } from '../extensions/frontmatter.ts';
import { bodyEdgeEmpties } from './doc-boundary-space.ts';
diff --git a/packages/core/src/bridge/pm-structural-equivalence.ts b/packages/core/src/bridge/pm-structural-equivalence.ts
index 754dc5cc2..0be5203e4 100644
--- a/packages/core/src/bridge/pm-structural-equivalence.ts
+++ b/packages/core/src/bridge/pm-structural-equivalence.ts
@@ -32,6 +32,7 @@ const BR_SENTINEL: PmStructuralNode = { type: '__br__' };
const BR_LITERAL_RE = /^<br\s*\/?>$/i;
+
interface DegradeEntry {
readonly label: string;
readonly severity: ToleranceClassSeverity;
@@ -127,6 +128,7 @@ export interface ComparePmStructuralOptions {
ignoreAttrs?: (attrKey: string) => boolean;
}
+
/** Rebuild a node with `fn` applied to each child; identity when childless.
* Shared by the degrade canonicalizers so none re-implements the walk. */
function mapChildren(
@@ -248,6 +250,7 @@ function applyDegrades(tree: PmStructuralNode): {
return { normalized: current, fired };
}
+
export function comparePmStructural(
expected: PmStructuralNode,
actual: PmStructuralNode,
diff --git a/packages/core/src/bridge/subsequence.ts b/packages/core/src/bridge/subsequence.ts
index af20de1e2..dca644141 100644
--- a/packages/core/src/bridge/subsequence.ts
+++ b/packages/core/src/bridge/subsequence.ts
@@ -1,3 +1,4 @@
+
/** True when `needle` is a subsequence of `haystack` (two-pointer, O(n+m)):
* insertions in `haystack` are free; any dropped or substituted `needle` byte
* fails. */
diff --git a/packages/core/src/markdown/callout-transformer.ts b/packages/core/src/markdown/callout-transformer.ts
index 83d47404a..a363dfd54 100644
--- a/packages/core/src/markdown/callout-transformer.ts
+++ b/packages/core/src/markdown/callout-transformer.ts
@@ -1,3 +1,4 @@
+
import type { Blockquote, Paragraph, Root } from 'mdast';
import type { MdxJsxAttribute, MdxJsxFlowElement } from 'mdast-util-mdx';
import { visit } from 'unist-util-visit';
diff --git a/packages/core/src/markdown/code-fence.ts b/packages/core/src/markdown/code-fence.ts
index 9807a7e82..4499dbc92 100644
--- a/packages/core/src/markdown/code-fence.ts
+++ b/packages/core/src/markdown/code-fence.ts
@@ -1,3 +1,4 @@
+
export function selectFenceChar(info: string): '`' | '~' {
return info.includes('`') ? '~' : '`';
}
diff --git a/packages/core/src/markdown/comment-promoter.ts b/packages/core/src/markdown/comment-promoter.ts
index 7415c474a..34704165b 100644
--- a/packages/core/src/markdown/comment-promoter.ts
+++ b/packages/core/src/markdown/comment-promoter.ts
@@ -1,3 +1,4 @@
+
import type { Nodes, Paragraph, PhrasingContent, Root, RootContent, Text } from 'mdast';
import { SKIP, visit } from 'unist-util-visit';
import type { VFile } from 'vfile';
diff --git a/packages/core/src/markdown/dedent-block-jsx-close.ts b/packages/core/src/markdown/dedent-block-jsx-close.ts
index ece5c02a1..b6299a948 100644
--- a/packages/core/src/markdown/dedent-block-jsx-close.ts
+++ b/packages/core/src/markdown/dedent-block-jsx-close.ts
@@ -1,3 +1,4 @@
+
import { findFencedRegions, isInsideFence } from './fence-regions.ts';
const INDENTED_BLOCK_JSX_CLOSE_RE = /^([ ]{1,3})(<\/[A-Z][A-Za-z0-9_]*\s*>)([ \t]*)$/gm;
diff --git a/packages/core/src/markdown/details-accordion-promoter.ts b/packages/core/src/markdown/details-accordion-promoter.ts
index 54774764a..acd398aa6 100644
--- a/packages/core/src/markdown/details-accordion-promoter.ts
+++ b/packages/core/src/markdown/details-accordion-promoter.ts
@@ -1,3 +1,4 @@
+
import type { Nodes, Paragraph, Parent, Root, Text } from 'mdast';
import type { MdxJsxAttribute, MdxJsxFlowElement } from 'mdast-util-mdx';
import { visit } from 'unist-util-visit';
diff --git a/packages/core/src/markdown/div-align-promoter.ts b/packages/core/src/markdown/div-align-promoter.ts
index 43ecdc709..ba9b56384 100644
--- a/packages/core/src/markdown/div-align-promoter.ts
+++ b/packages/core/src/markdown/div-align-promoter.ts
@@ -1,3 +1,4 @@
+
import type { Nodes, Paragraph, Parent, Root, Text } from 'mdast';
import type { MdxJsxFlowElement } from 'mdast-util-mdx';
import { visit } from 'unist-util-visit';
diff --git a/packages/core/src/markdown/fence-regions.ts b/packages/core/src/markdown/fence-regions.ts
index 6d3f3643e..4513da9bb 100644
--- a/packages/core/src/markdown/fence-regions.ts
+++ b/packages/core/src/markdown/fence-regions.ts
@@ -1,3 +1,4 @@
+
const FENCE_RE = /^(`{3,}|~{3,})/gm;
export function findFencedRegions(src: string): Array<[number, number]> {
diff --git a/packages/core/src/markdown/fixtures/index.ts b/packages/core/src/markdown/fixtures/index.ts
index 00f5771ee..6931623c7 100644
--- a/packages/core/src/markdown/fixtures/index.ts
+++ b/packages/core/src/markdown/fixtures/index.ts
@@ -1,3 +1,4 @@
+
import { readFileSync } from 'node:fs';
import { dirname, resolve } from 'node:path';
import { fileURLToPath } from 'node:url';
@@ -8,6 +9,7 @@ function fixturePath(...segments: string[]): string {
return resolve(FIXTURES_DIR, ...segments);
}
+
interface GfmExample {
section: string;
markdown: string;
@@ -17,6 +19,7 @@ export function loadGfmExamples(): GfmExample[] {
return JSON.parse(readFileSync(fixturePath('gfm', 'examples.json'), 'utf8')) as GfmExample[];
}
+
interface MdxCrashEntry {
id: string;
input: string;
@@ -68,6 +71,7 @@ export function loadLargeEmbedFixtures(): LargeEmbedFixture[] {
) as LargeEmbedFixture[];
}
+
export function loadPrd6955Before(): string {
return readFileSync(fixturePath('regression', 'prd-6955-before.md'), 'utf8');
}
@@ -76,6 +80,7 @@ export function loadPrd6955CorruptedTriplicated(): string {
return readFileSync(fixturePath('regression', 'prd-6955-corrupted-triplicated.md'), 'utf8');
}
+
export interface NgPinnedCase {
id: string;
name: string;
@@ -92,6 +97,7 @@ export function loadNgPinnedCases(): NgPinnedCase[] {
) as NgPinnedCase[];
}
+
export function loadLargeRealistic(): string {
return readFileSync(fixturePath('perf', 'large-realistic.md'), 'utf8');
}
diff --git a/packages/core/src/markdown/fixtures/perf/generate.ts b/packages/core/src/markdown/fixtures/perf/generate.ts
index 8b1eb8519..daa3ef82b 100644
--- a/packages/core/src/markdown/fixtures/perf/generate.ts
+++ b/packages/core/src/markdown/fixtures/perf/generate.ts
@@ -1,3 +1,4 @@
+
import { writeFileSync } from 'node:fs';
import { dirname, resolve } from 'node:path';
import { fileURLToPath } from 'node:url';
@@ -10,6 +11,7 @@ const BASELINE_ONLY_COUNTS = [500, 2500] as const;
const SEED = 0xf1de1117;
+
function mulberry32(seed: number): () => number {
let a = seed >>> 0;
return () => {
@@ -36,6 +38,7 @@ function pickWeighted<T>(rand: () => number, items: readonly [T, number][]): T {
return items[items.length - 1][0];
}
+
const WORDS = [
'lorem',
'ipsum',
@@ -153,6 +156,7 @@ function mdxBlock(rand: () => number): string {
return `<${name}>\n\n${sentence(rand)}\n\n</${name}>`;
}
+
type BlockKind = 'paragraph' | 'heading' | 'list' | 'code' | 'table' | 'mdx';
const MIX: readonly [BlockKind, number][] = [
@@ -191,6 +195,7 @@ function generateDocument(blockCount: number, seed: number): string {
return `${blocks.join('\n\n')}\n`;
}
+
function main(): void {
for (const count of [...BLOCK_COUNTS, ...BASELINE_ONLY_COUNTS]) {
const doc = generateDocument(count, SEED);
diff --git a/packages/core/src/markdown/guard-flanking-matrix.ts b/packages/core/src/markdown/guard-flanking-matrix.ts
index 420dc0fe5..32c055c5b 100644
--- a/packages/core/src/markdown/guard-flanking-matrix.ts
+++ b/packages/core/src/markdown/guard-flanking-matrix.ts
@@ -7,6 +7,7 @@ import {
import { BACKSLASH_GUARD_SUBSTITUTIONS, encodeBackslashEscapes } from './backslash-escape-guard.ts';
import { ENTITY_REF_GUARD_SUBSTITUTIONS, encodeEntityRefs } from './entity-ref-guard.ts';
+
export const ATTENTION_DELIMITERS = ['*', '_', '**', '~~', '=='] as const;
export type FlankClass = 'whitespace' | 'punctuation' | 'other';
diff --git a/packages/core/src/markdown/handler-shadow-audit.ts b/packages/core/src/markdown/handler-shadow-audit.ts
index 2653473da..283913255 100644
--- a/packages/core/src/markdown/handler-shadow-audit.ts
+++ b/packages/core/src/markdown/handler-shadow-audit.ts
@@ -1,3 +1,4 @@
+
export interface HandlerShadowWitness {
input: string;
expect: 'byte' | 'byte-and-reparse-type';
diff --git a/packages/core/src/markdown/highlight-promoter.ts b/packages/core/src/markdown/highlight-promoter.ts
index da0a81d23..5d1000cc4 100644
--- a/packages/core/src/markdown/highlight-promoter.ts
+++ b/packages/core/src/markdown/highlight-promoter.ts
@@ -1,3 +1,4 @@
+
import type { Nodes, Parent, PhrasingContent, Root, Text } from 'mdast';
import type { MdxJsxTextElement } from 'mdast-util-mdx';
import { SKIP, visit } from 'unist-util-visit';
diff --git a/packages/core/src/markdown/html-to-mdast.ts b/packages/core/src/markdown/html-to-mdast.ts
index 787315157..9681c0056 100644
--- a/packages/core/src/markdown/html-to-mdast.ts
+++ b/packages/core/src/markdown/html-to-mdast.ts
@@ -1,3 +1,4 @@
+
import type { Element as HastElement, Root as HastRoot } from 'hast';
import type { List, Nodes as MdastNodes, Root as MdastRoot } from 'mdast';
import rehypeParse from 'rehype-parse';
@@ -128,7 +129,8 @@ export function htmlToMdast(html: string, options?: HtmlToMdastOptions): MdastRo
throw new HtmlPayloadTooLargeError(html.length, maxBytes);
}
- const processor = unified().use(rehypeParse, { fragment: true });
+ const processor = unified()
+ .use(rehypeParse, { fragment: true });
for (const plugin of cleanupPlugins) {
processor.use(plugin);
diff --git a/packages/core/src/markdown/image-promoter.ts b/packages/core/src/markdown/image-promoter.ts
index 706fa9afb..994eb6917 100644
--- a/packages/core/src/markdown/image-promoter.ts
+++ b/packages/core/src/markdown/image-promoter.ts
@@ -1,3 +1,4 @@
+
import type { Image, Paragraph, Root } from 'mdast';
import type { MdxJsxAttribute, MdxJsxFlowElement } from 'mdast-util-mdx';
import { visit } from 'unist-util-visit';
diff --git a/packages/core/src/markdown/index.ts b/packages/core/src/markdown/index.ts
index 9075aa7f1..69221627d 100644
--- a/packages/core/src/markdown/index.ts
+++ b/packages/core/src/markdown/index.ts
@@ -1,3 +1,4 @@
+
import {
type FromProseMirrorOptions,
fromPmMark,
@@ -206,6 +207,7 @@ export class MarkdownManager {
}
}
+
const registry = createRegistry();
function destructureAttrs(
@@ -254,6 +256,7 @@ function destructureAttrs(
return result;
}
+
function hasDirtyDescendant(node: PmNode): boolean {
let found = false;
node.descendants((child) => {
@@ -276,6 +279,7 @@ function effectiveDirty(node: PmNode, freshnessChecker?: StructuralFreshnessChec
return freshnessChecker ? freshnessChecker.isDiverged(node.toJSON()) : false;
}
+
function isEmptyMdastParagraph(node: MdastNodes): boolean {
if (node.type !== 'paragraph') return false;
const children = node.children ?? [];
@@ -344,6 +348,7 @@ function extractTextFromMdastNodes(nodes: MdastNodes[]): string {
return out;
}
+
import {
AUDIO_EXTENSIONS,
FILE_ATTACHMENT_EXTENSIONS,
@@ -596,6 +601,7 @@ function buildMdastToPmHandlers(
}));
}
+
if (m.emphasis) {
handlers.emphasis = toPmMark(m.emphasis, (node: Emphasis) => ({
sourceDelimiter: node.data?.sourceDelimiter ?? '*',
@@ -676,6 +682,7 @@ function buildMdastToPmHandlers(
}));
}
+
if (m.link) {
const sourceLiteralMark = m.sourceLiteral;
handlers.link = (node: Link, _parent: MdastParent, state: MdastToPmState) => {
@@ -973,6 +980,7 @@ function buildMdastToPmHandlers(
};
}
+
const blockUnknownHandler = (node: {
type: string;
position?: { start: { offset: number }; end: { offset: number } };
@@ -1098,6 +1106,7 @@ function buildMdastToPmHandlers(
return handlers as RemarkProseMirrorOptions['handlers'];
}
+
function buildPmToMdastHandlers(
schema: Schema,
freshness: FreshnessCheckerHolder,
diff --git a/packages/core/src/markdown/lint/applies-to.ts b/packages/core/src/markdown/lint/applies-to.ts
index fa0be9e86..b79e9aef7 100644
--- a/packages/core/src/markdown/lint/applies-to.ts
+++ b/packages/core/src/markdown/lint/applies-to.ts
@@ -1,3 +1,4 @@
+
import picomatch from 'picomatch';
import { SUPPORTED_DOC_EXTENSIONS } from '../../constants/doc-extensions.ts';
diff --git a/packages/core/src/markdown/lint/config-files.ts b/packages/core/src/markdown/lint/config-files.ts
index 312c9c74b..94b34dee1 100644
--- a/packages/core/src/markdown/lint/config-files.ts
+++ b/packages/core/src/markdown/lint/config-files.ts
@@ -1,3 +1,4 @@
+
const MARKDOWNLINT_JSON_CONFIG_FILES: ReadonlySet<string> = new Set([
'.markdownlint.json',
'.markdownlint.jsonc',
diff --git a/packages/core/src/markdown/lint/config-schemas.ts b/packages/core/src/markdown/lint/config-schemas.ts
index 0ba33b7d8..e413367ef 100644
--- a/packages/core/src/markdown/lint/config-schemas.ts
+++ b/packages/core/src/markdown/lint/config-schemas.ts
@@ -38,6 +38,7 @@ const fullPluginShape = Object.fromEntries(
LINT_PLUGINS.map((plugin) => [plugin.id, plugin.sliceSchema]),
) as z.ZodRawShape;
+
export const LinterConfigSchema = z.object({
enabled: z.boolean(),
plugins: z.object(fullPluginShape),
diff --git a/packages/core/src/markdown/lint/default-config.ts b/packages/core/src/markdown/lint/default-config.ts
index d48eea5e4..a51f2ffb0 100644
--- a/packages/core/src/markdown/lint/default-config.ts
+++ b/packages/core/src/markdown/lint/default-config.ts
@@ -6,6 +6,7 @@ export const DEFAULT_MARKDOWNLINT_CONFIG: Record<string, MarkdownlintRuleSetting
MD013: false,
};
+
export function resolveMarkdownlintConfig(
rules: Record<string, MarkdownlintRuleSetting> | undefined,
): Configuration {
diff --git a/packages/core/src/markdown/lint/frontmatter-schema-edit.ts b/packages/core/src/markdown/lint/frontmatter-schema-edit.ts
index ef478e268..9c9542661 100644
--- a/packages/core/src/markdown/lint/frontmatter-schema-edit.ts
+++ b/packages/core/src/markdown/lint/frontmatter-schema-edit.ts
@@ -1,3 +1,4 @@
+
import { CANONICAL_SCHEMA_DIALECT_URIS, DEFAULT_SCHEMA_DIALECT } from './frontmatter-validate.ts';
export interface FrontmatterFieldConstraint {
diff --git a/packages/core/src/markdown/lint/frontmatter-validate.ts b/packages/core/src/markdown/lint/frontmatter-validate.ts
index 0d4c9a0df..b96d19182 100644
--- a/packages/core/src/markdown/lint/frontmatter-validate.ts
+++ b/packages/core/src/markdown/lint/frontmatter-validate.ts
@@ -1,3 +1,4 @@
+
import Ajv, { type ValidateFunction } from 'ajv';
import Ajv2019 from 'ajv/dist/2019.js';
import Ajv2020 from 'ajv/dist/2020.js';
diff --git a/packages/core/src/markdown/lint/index.ts b/packages/core/src/markdown/lint/index.ts
index 00d08265a..48d260ed6 100644
--- a/packages/core/src/markdown/lint/index.ts
+++ b/packages/core/src/markdown/lint/index.ts
@@ -1,3 +1,4 @@
+
import { LINT_PLUGINS, type LinterConfig } from './plugins.ts';
import type { LintDiagnostic } from './types.ts';
diff --git a/packages/core/src/markdown/lint/plugins.ts b/packages/core/src/markdown/lint/plugins.ts
index 5e832aa19..be5871ed9 100644
--- a/packages/core/src/markdown/lint/plugins.ts
+++ b/packages/core/src/markdown/lint/plugins.ts
@@ -1,3 +1,4 @@
+
import { z } from 'zod';
import { DEFAULT_MARKDOWNLINT_CONFIG, resolveMarkdownlintConfig } from './default-config.ts';
import {
@@ -13,6 +14,7 @@ import {
type MarkdownlintSlice,
} from './types.ts';
+
const MarkdownlintRuleSettingSchema = z.union([
z.boolean(),
z.enum(MARKDOWNLINT_RULE_SEVERITIES),
diff --git a/packages/core/src/markdown/lint/types.ts b/packages/core/src/markdown/lint/types.ts
index 3918e657c..833c3a727 100644
--- a/packages/core/src/markdown/lint/types.ts
+++ b/packages/core/src/markdown/lint/types.ts
@@ -1,3 +1,4 @@
+
export const LINT_PLUGIN_IDS = ['markdownlint', 'frontmatter'] as const;
export type LintPluginId = (typeof LINT_PLUGIN_IDS)[number];
@@ -71,6 +72,7 @@ export interface FrontmatterSlice {
schemas: ResolvedFrontmatterSchemaEntry[];
}
+
interface RuleOptionSpecBase {
key: string;
description: string;
diff --git a/packages/core/src/markdown/lint/validation-counts.ts b/packages/core/src/markdown/lint/validation-counts.ts
index 98238656e..437cc539a 100644
--- a/packages/core/src/markdown/lint/validation-counts.ts
+++ b/packages/core/src/markdown/lint/validation-counts.ts
@@ -1,3 +1,4 @@
+
export interface ValidationSourceCounts {
errorCount: number;
warningCount: number;
diff --git a/packages/core/src/markdown/math-promoter.ts b/packages/core/src/markdown/math-promoter.ts
index a5b511f25..bd79424c7 100644
--- a/packages/core/src/markdown/math-promoter.ts
+++ b/packages/core/src/markdown/math-promoter.ts
@@ -1,3 +1,4 @@
+
import type { Code, Root } from 'mdast';
import type { Math as MdastMath } from 'mdast-util-math';
import type { MdxJsxAttribute, MdxJsxFlowElement } from 'mdast-util-mdx';
diff --git a/packages/core/src/markdown/mdast-to-hast-handlers.ts b/packages/core/src/markdown/mdast-to-hast-handlers.ts
index ed89371d0..00fbc0035 100644
--- a/packages/core/src/markdown/mdast-to-hast-handlers.ts
+++ b/packages/core/src/markdown/mdast-to-hast-handlers.ts
@@ -1,3 +1,4 @@
+
import type { Comment, Element, ElementContent, Properties } from 'hast';
import type { FootnoteDefinition, FootnoteReference } from 'mdast';
import type { MdxJsxFlowElement, MdxJsxTextElement } from 'mdast-util-mdx';
diff --git a/packages/core/src/markdown/mdast-to-html.ts b/packages/core/src/markdown/mdast-to-html.ts
index 8ce2b2492..df788a80d 100644
--- a/packages/core/src/markdown/mdast-to-html.ts
+++ b/packages/core/src/markdown/mdast-to-html.ts
@@ -1,3 +1,4 @@
+
import type { Element, Root as HastRoot, Text as HastText } from 'hast';
import type { Root as MdastRoot, Text as MdastText } from 'mdast';
import type { Handler } from 'mdast-util-to-hast';
diff --git a/packages/core/src/markdown/merged-walker.ts b/packages/core/src/markdown/merged-walker.ts
index bfd7e3109..fa3cfcd86 100644
--- a/packages/core/src/markdown/merged-walker.ts
+++ b/packages/core/src/markdown/merged-walker.ts
@@ -1,3 +1,4 @@
+
import type { Nodes, Parent, Root } from 'mdast';
import { SKIP, visit } from 'unist-util-visit';
import type { VFile } from 'vfile';
diff --git a/packages/core/src/markdown/mermaid-promoter.ts b/packages/core/src/markdown/mermaid-promoter.ts
index 1a897fca8..17ed2b829 100644
--- a/packages/core/src/markdown/mermaid-promoter.ts
+++ b/packages/core/src/markdown/mermaid-promoter.ts
@@ -1,3 +1,4 @@
+
import type { Code, Root } from 'mdast';
import type { MdxJsxAttribute, MdxJsxFlowElement } from 'mdast-util-mdx';
import { visit } from 'unist-util-visit';
diff --git a/packages/core/src/markdown/parse-with-fallback.ts b/packages/core/src/markdown/parse-with-fallback.ts
index d988f4b8b..4aa0490c4 100644
--- a/packages/core/src/markdown/parse-with-fallback.ts
+++ b/packages/core/src/markdown/parse-with-fallback.ts
@@ -168,6 +168,7 @@ export function parseRecursive(
}
}
+
interface VFilePlace {
offset?: number;
start?: { offset?: number };
@@ -186,6 +187,7 @@ function extractErrorOffset(err: unknown): number | undefined {
return undefined;
}
+
interface Region {
start: number;
end: number;
@@ -209,6 +211,7 @@ function nearestBlankLineAfter(src: string, offset: number): number | null {
return null;
}
+
export interface TagEvent {
kind: 'open' | 'close' | 'self-close';
name: string;
@@ -355,6 +358,7 @@ function findFallbackRegion(src: string, errorOffset: number): Region {
return { start: blockStart, end: blockEnd };
}
+
interface SourceBlock {
src: string;
start: number;
@@ -452,6 +456,7 @@ function tryPerBlockFallback(
};
}
+
function wholeDocRawText(source: string): JSONContent {
return {
type: 'doc',
diff --git a/packages/core/src/markdown/parser-drop-closure.ts b/packages/core/src/markdown/parser-drop-closure.ts
index e6ab4fd57..43d420187 100644
--- a/packages/core/src/markdown/parser-drop-closure.ts
+++ b/packages/core/src/markdown/parser-drop-closure.ts
@@ -1,3 +1,4 @@
+
export type DroppedTokenAdjudication =
| {
kind: 'format-dof-axis';
diff --git a/packages/core/src/markdown/pipeline.ts b/packages/core/src/markdown/pipeline.ts
index 449e6f12f..5af2f05f5 100644
--- a/packages/core/src/markdown/pipeline.ts
+++ b/packages/core/src/markdown/pipeline.ts
@@ -1,3 +1,4 @@
+
import {
type FromProseMirrorOptions,
fromProseMirror,
diff --git a/packages/core/src/markdown/position-aware-join.ts b/packages/core/src/markdown/position-aware-join.ts
index 91cdf658f..ccf06e94d 100644
--- a/packages/core/src/markdown/position-aware-join.ts
+++ b/packages/core/src/markdown/position-aware-join.ts
@@ -1,3 +1,4 @@
+
import type { Join } from 'mdast-util-to-markdown';
import type { Position } from 'unist';
import { isBlankLineParagraph } from './zero-emission-blocks.ts';
diff --git a/packages/core/src/markdown/position-slice.ts b/packages/core/src/markdown/position-slice.ts
index 0f399d34c..e5b4c9eba 100644
--- a/packages/core/src/markdown/position-slice.ts
+++ b/packages/core/src/markdown/position-slice.ts
@@ -1,3 +1,4 @@
+
import type { Nodes, Root } from 'mdast';
import { visit } from 'unist-util-visit';
import type { VFile } from 'vfile';
@@ -476,7 +477,8 @@ export function applyPositionSliceToNode(
const first = source[startOff];
if (first !== '[' && first !== '<' && !node.title) {
node.data.sourceStyle = 'gfm-autolink';
- } else if (first === '[') {
+ }
+ else if (first === '[') {
const slice = source.slice(startOff, endOff);
const closeBracketIdx = slice.lastIndexOf('](');
if (closeBracketIdx !== -1) {
diff --git a/packages/core/src/markdown/rehype-plugins/skip-notion-whitespace.ts b/packages/core/src/markdown/rehype-plugins/skip-notion-whitespace.ts
index db10fa54b..ca225ce9b 100644
--- a/packages/core/src/markdown/rehype-plugins/skip-notion-whitespace.ts
+++ b/packages/core/src/markdown/rehype-plugins/skip-notion-whitespace.ts
@@ -1,3 +1,4 @@
+
import type { Comment, Element, Root, Text } from 'hast';
import type { Plugin } from 'unified';
diff --git a/packages/core/src/markdown/rehype-plugins/strip-cocoa-meta.ts b/packages/core/src/markdown/rehype-plugins/strip-cocoa-meta.ts
index 34068d103..3a2524a9a 100644
--- a/packages/core/src/markdown/rehype-plugins/strip-cocoa-meta.ts
+++ b/packages/core/src/markdown/rehype-plugins/strip-cocoa-meta.ts
@@ -1,3 +1,4 @@
+
import type { Element, ElementContent, Root } from 'hast';
import type { Plugin } from 'unified';
diff --git a/packages/core/src/markdown/rehype-plugins/strip-gdocs-wrapper.ts b/packages/core/src/markdown/rehype-plugins/strip-gdocs-wrapper.ts
index 93151d43b..2279a0189 100644
--- a/packages/core/src/markdown/rehype-plugins/strip-gdocs-wrapper.ts
+++ b/packages/core/src/markdown/rehype-plugins/strip-gdocs-wrapper.ts
@@ -1,3 +1,4 @@
+
import type { Element, Root } from 'hast';
import type { Plugin } from 'unified';
diff --git a/packages/core/src/markdown/rehype-plugins/strip-github-hovercard.ts b/packages/core/src/markdown/rehype-plugins/strip-github-hovercard.ts
index 188f02d83..a0f467c42 100644
--- a/packages/core/src/markdown/rehype-plugins/strip-github-hovercard.ts
+++ b/packages/core/src/markdown/rehype-plugins/strip-github-hovercard.ts
@@ -1,3 +1,4 @@
+
import type { Element, Root } from 'hast';
import type { Plugin } from 'unified';
diff --git a/packages/core/src/markdown/rehype-plugins/strip-gmail-classes.ts b/packages/core/src/markdown/rehype-plugins/strip-gmail-classes.ts
index 4ba2c3418..4e8542a21 100644
--- a/packages/core/src/markdown/rehype-plugins/strip-gmail-classes.ts
+++ b/packages/core/src/markdown/rehype-plugins/strip-gmail-classes.ts
@@ -1,3 +1,4 @@
+
import type { Element, Root } from 'hast';
import type { Plugin } from 'unified';
diff --git a/packages/core/src/markdown/rehype-plugins/strip-gsheets-wrapper.ts b/packages/core/src/markdown/rehype-plugins/strip-gsheets-wrapper.ts
index 1a74b1272..a3c96b24a 100644
--- a/packages/core/src/markdown/rehype-plugins/strip-gsheets-wrapper.ts
+++ b/packages/core/src/markdown/rehype-plugins/strip-gsheets-wrapper.ts
@@ -1,3 +1,4 @@
+
import type { Element, ElementContent, Root } from 'hast';
import type { Plugin } from 'unified';
diff --git a/packages/core/src/markdown/rehype-plugins/strip-mso-styles.ts b/packages/core/src/markdown/rehype-plugins/strip-mso-styles.ts
index de35e7b79..e95cf43d6 100644
--- a/packages/core/src/markdown/rehype-plugins/strip-mso-styles.ts
+++ b/packages/core/src/markdown/rehype-plugins/strip-mso-styles.ts
@@ -1,3 +1,4 @@
+
import type { Comment, Element, ElementContent, Root } from 'hast';
import type { Plugin } from 'unified';
diff --git a/packages/core/src/markdown/rehype-plugins/strip-slack-classes.ts b/packages/core/src/markdown/rehype-plugins/strip-slack-classes.ts
index b4be1b2ea..ffdb4d5b5 100644
--- a/packages/core/src/markdown/rehype-plugins/strip-slack-classes.ts
+++ b/packages/core/src/markdown/rehype-plugins/strip-slack-classes.ts
@@ -1,3 +1,4 @@
+
import type { Element, ElementContent, Root } from 'hast';
import type { Plugin } from 'unified';
diff --git a/packages/core/src/markdown/rehype-plugins/strip-vscode-spans.ts b/packages/core/src/markdown/rehype-plugins/strip-vscode-spans.ts
index 3c8d88b7c..e2a96d1a7 100644
--- a/packages/core/src/markdown/rehype-plugins/strip-vscode-spans.ts
+++ b/packages/core/src/markdown/rehype-plugins/strip-vscode-spans.ts
@@ -1,3 +1,4 @@
+
import type { Element, Root } from 'hast';
import type { Plugin } from 'unified';
diff --git a/packages/core/src/markdown/resolve-image-url.ts b/packages/core/src/markdown/resolve-image-url.ts
index cf2c9da8e..0389575ac 100644
--- a/packages/core/src/markdown/resolve-image-url.ts
+++ b/packages/core/src/markdown/resolve-image-url.ts
@@ -1,3 +1,4 @@
+
import { isRelativeUrl } from './safe-url.ts';
function isDevDiagnosticContext(): boolean {
diff --git a/packages/core/src/markdown/safe-url.ts b/packages/core/src/markdown/safe-url.ts
index 4d3250d3a..8be632ba4 100644
--- a/packages/core/src/markdown/safe-url.ts
+++ b/packages/core/src/markdown/safe-url.ts
@@ -1,3 +1,4 @@
+
export const SAFE_URL_SCHEMES = ['https', 'http', 'mailto', 'tel', 'ftp', 'sms'] as const;
const SCHEME_ALT = SAFE_URL_SCHEMES.map((s) => `${s}:`).join('|');
diff --git a/packages/core/src/markdown/serialize-fidelity.test-helper.ts b/packages/core/src/markdown/serialize-fidelity.test-helper.ts
index 0dd54070e..96304e7a5 100644
--- a/packages/core/src/markdown/serialize-fidelity.test-helper.ts
+++ b/packages/core/src/markdown/serialize-fidelity.test-helper.ts
@@ -1,3 +1,4 @@
+
import type { JSONContent } from '@tiptap/core';
import type { Nodes } from 'mdast';
import { expect } from 'vitest';
diff --git a/packages/core/src/markdown/serialize-helpers.ts b/packages/core/src/markdown/serialize-helpers.ts
index 7cac5b042..93798cf83 100644
--- a/packages/core/src/markdown/serialize-helpers.ts
+++ b/packages/core/src/markdown/serialize-helpers.ts
@@ -1,3 +1,4 @@
+
import type { Node as PmNode } from '@tiptap/pm/model';
import type {
MdxJsxAttribute,
diff --git a/packages/core/src/markdown/single-dollar-math-promoter.ts b/packages/core/src/markdown/single-dollar-math-promoter.ts
index b012a5aff..8c08b7a04 100644
--- a/packages/core/src/markdown/single-dollar-math-promoter.ts
+++ b/packages/core/src/markdown/single-dollar-math-promoter.ts
@@ -1,3 +1,4 @@
+
import type { PhrasingContent, Root, Text } from 'mdast';
import type { InlineMath } from 'mdast-util-math';
import { SKIP, visit } from 'unist-util-visit';
diff --git a/packages/core/src/markdown/to-markdown-handlers.ts b/packages/core/src/markdown/to-markdown-handlers.ts
index 3e79f8cb6..959cc0bd2 100644
--- a/packages/core/src/markdown/to-markdown-handlers.ts
+++ b/packages/core/src/markdown/to-markdown-handlers.ts
@@ -1,3 +1,4 @@
+
import type { Nodes, Parents } from 'mdast';
import type { MdxJsxAttribute, MdxJsxExpressionAttribute, MdxJsxFlowElement } from 'mdast-util-mdx';
import type { Handle, Info, State } from 'mdast-util-to-markdown';
diff --git a/packages/core/src/markdown/underline-promoter.ts b/packages/core/src/markdown/underline-promoter.ts
index 0f1b0f27d..6e6d73400 100644
--- a/packages/core/src/markdown/underline-promoter.ts
+++ b/packages/core/src/markdown/underline-promoter.ts
@@ -1,3 +1,4 @@
+
import type { Nodes, Parent, Root } from 'mdast';
import type { MdxJsxTextElement } from 'mdast-util-mdx';
import { visit } from 'unist-util-visit';
diff --git a/packages/core/src/markdown/unknown-mdast-guard.ts b/packages/core/src/markdown/unknown-mdast-guard.ts
index 1a082bda7..932d7d2a8 100644
--- a/packages/core/src/markdown/unknown-mdast-guard.ts
+++ b/packages/core/src/markdown/unknown-mdast-guard.ts
@@ -1,3 +1,4 @@
+
import type { Root as MdastRoot } from 'mdast';
import type { VFile } from 'vfile';
diff --git a/packages/core/src/markdown/whitespace-char-ref.ts b/packages/core/src/markdown/whitespace-char-ref.ts
index d578476a7..ac9f5239b 100644
--- a/packages/core/src/markdown/whitespace-char-ref.ts
+++ b/packages/core/src/markdown/whitespace-char-ref.ts
@@ -1,3 +1,4 @@
+
const INLINE_WHITESPACE_BY_CODE: ReadonlyMap<number, string> = new Map([
[0x20, ' '],
[0x09, '\t'],
diff --git a/packages/core/src/markdown/wiki-link-micromark.ts b/packages/core/src/markdown/wiki-link-micromark.ts
index 6dad26200..afd9936fe 100644
--- a/packages/core/src/markdown/wiki-link-micromark.ts
+++ b/packages/core/src/markdown/wiki-link-micromark.ts
@@ -17,6 +17,7 @@ declare module 'micromark-util-types' {
}
}
+
const CODE_BANG = 33; // !
const CODE_LBRACKET = 91; // [
const CODE_RBRACKET = 93; // ]
@@ -260,6 +261,7 @@ export function wikiLinkSyntax(): Extension {
};
}
+
function enterWikiLink(this: CompileContext, token: Token) {
this.enter(
{
@@ -385,6 +387,7 @@ export const wikiLinkToMarkdown: {
unsafe: [{ character: '[', inConstruct: ['phrasing'] }],
};
+
const MICROMARK_EXT = wikiLinkSyntax();
export function remarkWikiLink(this: Processor) {
diff --git a/packages/core/tsdown.config.ts b/packages/core/tsdown.config.ts
index d8db905d3..3ca1ad9fa 100644
--- a/packages/core/tsdown.config.ts
+++ b/packages/core/tsdown.config.ts
@@ -10,6 +10,8 @@ export default defineConfig({
'helper-bundle': 'src/helper-bundle.ts',
'skills-catalog': 'src/skills-catalog/index.ts',
'acp-thread-protocol': 'src/acp/thread-protocol.ts',
+ 'acp-agent-posture': 'src/acp/agent-posture.ts',
+ 'acp-permissive-mode': 'src/acp/permissive-mode.ts',
'desktop-bridge': 'src/desktop-bridge.ts',
},
unbundle: false,
diff --git a/packages/server/src/acp/thread-manager.integration.test.ts b/packages/server/src/acp/thread-manager.integration.test.ts
index 454233254..ebf0532e9 100644
--- a/packages/server/src/acp/thread-manager.integration.test.ts
+++ b/packages/server/src/acp/thread-manager.integration.test.ts
@@ -464,6 +464,9 @@ process.stdin.on('data', (chunk) => {
type: 'select',
currentValue: 'sonnet',
});
+ // Agent advertised no prompt capabilities: the handshake still resolves
+ // the field to {} ("baseline content only"), never leaves it absent.
+ expect(manager.getInfo(info.threadId)?.promptCapabilities).toEqual({});
manager.setConfigOption(info.threadId, 'model', 'opus');
await waitFor(
@@ -473,6 +476,67 @@ process.stdin.on('data', (chunk) => {
await manager.closeThread(info.threadId);
}, 30_000);
+
+ test('prompt capabilities: advertised at initialize, land on thread info', async () => {
+ const contentDir = tmp();
+ const localDir = tmp();
+ const agentPath = join(localDir, 'prompt-caps-agent.mjs');
+ writeFileSync(
+ agentPath,
+ `
+let buffer = '';
+process.stdin.setEncoding('utf8');
+process.stdin.on('data', (chunk) => {
+ buffer += chunk;
+ let idx = buffer.indexOf('\\n');
+ while (idx !== -1) {
+ const line = buffer.slice(0, idx);
+ buffer = buffer.slice(idx + 1);
+ idx = buffer.indexOf('\\n');
+ if (line.trim() === '') continue;
+ const msg = JSON.parse(line);
+ const reply = (result) =>
+ process.stdout.write(JSON.stringify({ jsonrpc: '2.0', id: msg.id, result }) + '\\n');
+ if (msg.method === 'initialize') {
+ reply({
+ protocolVersion: 1,
+ agentCapabilities: { promptCapabilities: { image: true, embeddedContext: true } },
+ });
+ } else if (msg.method === 'session/new') {
+ reply({ sessionId: 's1' });
+ } else if (msg.method === 'session/prompt') {
+ reply({ stopReason: 'end_turn' });
+ } else if (msg.id !== undefined) {
+ reply({});
+ }
+ }
+});
+`,
+ );
+ writeFileSync(
+ join(localDir, 'acp-agents.json'),
+ JSON.stringify([
+ { id: 'caps-agent', name: 'Caps Agent', command: 'node', args: [agentPath] },
+ ]),
+ );
+ const manager = makeManager(contentDir, localDir);
+
+ const info = await manager.createThread({ agent: { source: 'custom', id: 'caps-agent' } });
+ expect(info.promptCapabilities).toBeNull();
+ const deadline = Date.now() + 15_000;
+ while (manager.getInfo(info.threadId)?.status !== 'ready') {
+ if (Date.now() > deadline) {
+ throw new Error(`timed out; info: ${JSON.stringify(manager.getInfo(info.threadId))}`);
+ }
+ await new Promise((r) => setTimeout(r, 50));
+ }
+ expect(manager.getInfo(info.threadId)?.promptCapabilities).toEqual({
+ image: true,
+ embeddedContext: true,
+ });
+
+ await manager.closeThread(info.threadId);
+ }, 30_000);
});
/**
diff --git a/packages/server/src/acp/thread-manager.ts b/packages/server/src/acp/thread-manager.ts
index 09f567946..06f111a92 100644
--- a/packages/server/src/acp/thread-manager.ts
+++ b/packages/server/src/acp/thread-manager.ts
@@ -620,6 +620,7 @@ export class AcpThreadManager {
status: 'installing',
createdAt: now,
lastActivityAt: now,
+ promptCapabilities: null,
modes: null,
configOptions: null,
lastSeq: -1,
@@ -906,6 +907,14 @@ export class AcpThreadManager {
}
if (record.closed) return null;
record.lastInit = init;
+ // Captured wherever the handshake runs (create, resume, retry). The
+ // post-authenticate retry never re-initializes — `authenticateThread`
+ // reopens the session on this same connection, inheriting this capture.
+ // `{}` — not absence — is the "baseline content only" answer: the wire
+ // contract distinguishes "agent said no" from "handshake hasn't
+ // resolved yet".
+ record.info.promptCapabilities = init.agentCapabilities?.promptCapabilities ?? {};
+ this.emitInfo(record);
return { conn, init, launch };
}