Skip to content

Beautiful, AI-native markdown IDE and LLM wiki

Treat unknown git hosts as generic, not GitHub Enterprise (PRD-8413) (#4786)

miles-kt-inkeep0ea41ee2f8bb
diff --git a/.changeset/prd-8413-generic-git-hosts.md b/.changeset/prd-8413-generic-git-hosts.md
new file mode 100644
index 000000000..c6ea96b66
--- /dev/null
+++ b/.changeset/prd-8413-generic-git-hosts.md
@@ -0,0 +1,5 @@
+---
+"@inkeep/open-knowledge": minor
+---
+
+Unknown git hosts now use your system credentials without GitHub permission checks blocking sync. For Enterprise sharing and sign-in, declare `git.hosts.<host>.provider: github` in `~/.ok/global.yml` and restart; see the [configuration guide](https://openknowledge.ai/docs/reference/configuration).
diff --git a/.changeset/retried-agent-connection-lifetime.md b/.changeset/retried-agent-connection-lifetime.md
new file mode 100644
index 000000000..004e8c3bf
--- /dev/null
+++ b/.changeset/retried-agent-connection-lifetime.md
@@ -0,0 +1,5 @@
+---
+"@inkeep/open-knowledge-server": patch
+---
+
+Keep a retried agent connected when its previous connection finishes closing.
diff --git a/docs/content/features/github-sync.mdx b/docs/content/features/github-sync.mdx
index 0610956c7..bf50f618c 100644
--- a/docs/content/features/github-sync.mdx
+++ b/docs/content/features/github-sync.mdx
@@ -111,7 +111,18 @@ If you are logged in with the GitHub CLI, OpenKnowledge will use those credentia
Manage the connection from **Settings → Account**. **Connect GitHub** authorizes OpenKnowledge to browse and sync your repositories; **Disconnect** clears OpenKnowledge's GitHub token only. From a terminal, the [`ok auth`](/docs/reference/cli) subcommands manage the same credentials: `ok auth signout` matches **Disconnect**, `ok auth pat` stores a Personal Access Token when device authentication isn't an option, and `--host` targets GitHub Enterprise.
-When a project's `origin` remote points at a GitHub Enterprise Server host, OpenKnowledge resolves credentials and identity for that host automatically: the account shown in settings, the sync token, the push-permission check, and the `ok auth` default `--host` all follow the workspace's remote instead of assuming github.com. Share links work with enterprise remotes too — a recipient opening a GHES share is asked to confirm the server unless they are already signed in to it.
+For GitHub Enterprise Server, add the host under **Settings → Account → GitHub Enterprise Server hosts**, or declare it in your user configuration, `~/.ok/global.yml`, then restart OpenKnowledge:
+
+```yaml
+git:
+ hosts:
+ github.example.com:
+ provider: github
+```
+
+The declaration applies to every project on your machine. It enables GitHub credential handling, push-permission checks, share links, and the default host for `ok auth`. Without a declaration, OpenKnowledge treats the host as ordinary git, preserves your system git credentials and refuses sharing and project GitHub sign-in requests. **Settings → Account** says the project's remote isn't a recognized GitHub host and points to the Enterprise hosts list instead of offering sign-in.
+
+[Share links](/docs/features/share) work with declared enterprise remotes. A recipient opening a GHES share is asked to confirm the server unless they are already signed in to it.
### Which GitHub account is used
@@ -182,4 +193,4 @@ A few situations stop sync from completing successfully. Most of them change the
### Temporary problems
- **Network or service hiccups.** Flaky Wi-Fi, a VPN drop, or a brief GitHub outage. OpenKnowledge retries automatically, slowing down progressively as described in [How often sync runs](#how-often-sync-runs). No action needed; a manual trigger from the sync indicator resets the backoff immediately if you want sync to run sooner.
-- **Another program is holding the Git index lock.** Git lets one process at a time write `.git/index`, and it enforces that by creating `.git/index.lock` first. Another tool on your machine — a terminal command, an editor extension, a background indexer — was holding that lock file when sync reached for it. The sync menu names `.git/index.lock` so you know it isn't your work that's wrong. In Auto and Follow modes sync keeps trying and picks up on its own once the other program lets go. In Manual mode nothing runs unattended, so press Sync again after the other program finishes. If the message persists, look for a git command still open in a terminal.
+- **Another program is holding the Git index lock.** Git lets one process at a time write `.git/index`, and it enforces that by creating `.git/index.lock` first. Another tool on your machine — a terminal command, an editor extension, a background indexer — was holding that lock file when sync reached for it. The sync menu names `.git/index.lock` so you know it isn't your work that's wrong. In the automatic modes, sync keeps trying and picks up on its own once the other program lets go. In Manual mode nothing runs unattended, so press Sync again after the other program finishes. If the message persists, look for a git command still open in a terminal.
diff --git a/docs/content/reference/cli.mdx b/docs/content/reference/cli.mdx
index 12f46b2e7..6f78860f6 100644
--- a/docs/content/reference/cli.mdx
+++ b/docs/content/reference/cli.mdx
@@ -96,7 +96,9 @@ ok auth login
If you're already logged in with the `gh` CLI, you can skip this step.
-`ok auth` also provides `status` (show who's logged in), `repos` (list repositories you can access), `signout` (remove stored credentials), and `pat` (store a Personal Access Token). Every subcommand takes `--host <hostname>` for GitHub Enterprise.
+`ok auth` also provides `status` (show who's logged in), `repos` (list repositories you can access), `signout` (remove stored credentials), and `pat` (store a Personal Access Token). Every subcommand takes `--host <hostname>`. GitHub Enterprise hosts must be declared as `git.hosts.<host>.provider: github` in `~/.ok/global.yml` before commands contact them. See [configuration](/docs/reference/configuration).
+
+Without `--host`, commands select the recognized GitHub origin, or `github.com` when no origin exists. An unrecognized origin requires explicit host selection, so commands cannot contact or clear credentials for a different host by accident. `status` and `repos` contact GitHub APIs. `signout --host <hostname>` only removes local credentials and works even after that host's declaration has been removed.
## Sync with GitHub
diff --git a/docs/content/reference/configuration.mdx b/docs/content/reference/configuration.mdx
index 0fe2fd509..dfc02314a 100644
--- a/docs/content/reference/configuration.mdx
+++ b/docs/content/reference/configuration.mdx
@@ -58,6 +58,7 @@ A key set in a file more specific than its scope (a user-scope key in `.ok/confi
| `autoSync.pushIntervalSeconds` | `number` | `60` | project-local | Seconds between scheduled pushes while `autoSync.mode` is `full` (30–3600). Shown in **Settings → Sync** as **Push my edits every**. Ignored in every other mode, which never pushes on a schedule. Each cycle with pending edits authors a commit, so a shorter interval means more, smaller commits in shared history. |
| `autoSync.enabled` | `boolean \| null` | `null` | project-local | Legacy per-machine auto-sync toggle, superseded by `autoSync.mode`. Read only when `mode` is absent (`true` = full, `false` = off). `null` means "unanswered". |
| `autoSync.default` | `"off" \| "follow" \| "full" \| boolean \| null` | `null` | project | Committed seed for each machine's first-open sync mode: `off` / `follow` / `full`, or the legacy boolean (`true` = full, `false` = off). `null` = ask. Lets a maintainer pre-answer the onboarding prompt for everyone who clones; a per-machine `autoSync.mode` overrides it. Compatibility note: a committed string value (`off` / `follow` / `full`) is rejected by app versions released before `autoSync.mode` existed, resetting that machine to config defaults until it updates (it never silently syncs). The legacy boolean seed (`true` / `false`) stays readable by older apps — commit `follow` only once collaborators are on a current version. |
+| `git.hosts.<host>.provider` | `"github"` | (unset) | user | Declares that `<host>` is a GitHub Enterprise Server instance, so OpenKnowledge treats remotes on it the way it treats `github.com`: OpenKnowledge's own credential handling, the push-permission check, share links, and the default host for `ok auth`. `github` is the only accepted value today. Shown in **Settings → Account** as **GitHub Enterprise Server hosts**, which adds and removes entries for you. A host that is neither `github.com` nor declared here is treated as a generic git remote, so OpenKnowledge leaves the machine's own git credentials alone and reports push permission as unknown instead of pausing sync. Per-machine: one entry covers every project on this machine, and a declaration committed in a project's `.ok/config.yml` is ignored. Read at server start. Matching uses the hostname without its port, across transports. Invalid entries produce config diagnostics without erasing valid siblings. Undeclared origins cause GitHub-specific CLI commands and project sign-in requests to refuse; CLI commands can still target a declared host with `--host`. |
| `server.bind` | list of addresses | `["127.0.0.1"]` | project-local | Addresses the server binds, e.g. `[127.0.0.1]` or `[0.0.0.0]`. The loopback default keeps everything off-machine out. A non-loopback bind additionally requires the `server.allowExternal` consent interlock. Per-machine — a value committed to `.ok/config.yml` is ignored (the exposing host would otherwise refuse to boot for every teammate who clones and runs locally, since the interlock needs per-machine consent that is never committed). Set it where the server is exposed: `OK_BIND` (space-separated), `ok start --bind <address>`, or `.ok/local/config.yml`. Lists replace, never merge. Read at server start. |
| `server.port` | number | (unset) | project | TCP port the server listens on. Unset = a local start picks a free port dynamically (deployment platforms inject `PORT` instead). Read at server start. |
| `server.externalUrl` | string | (unset) | project | Canonical external origin the server is reached at, e.g. `https://kb.example.com` — its host joins the Host/Origin allowlists and issued URLs. Setting it declares external exposure, which additionally requires the `server.allowExternal` consent interlock. Env: `OK_EXTERNAL_URL`; flag: `ok start --external-url <url>`. Read at server start. |
diff --git a/docs/src/lib/share-splash.test.ts b/docs/src/lib/share-splash.test.ts
index 37214c4b0..e11f0176e 100644
--- a/docs/src/lib/share-splash.test.ts
+++ b/docs/src/lib/share-splash.test.ts
@@ -1,8 +1,4 @@
-import {
- encodeShareUrl,
- isValidBranchName,
- KNOWN_NON_GITHUB_GIT_HOSTS,
-} from '@inkeep/open-knowledge-core';
+import { encodeShareUrl, isValidBranchName } from '@inkeep/open-knowledge-core';
import { describe, expect, test } from 'vitest';
import fixture from '../../../test-support/fixtures/share-url-v1-v2.json';
import { STABLE_DMG_URL } from './download-links.ts';
@@ -20,6 +16,15 @@ import {
} from './share-splash.ts';
import { SITE_NAME } from './site.ts';
+const CANONICAL_NON_GITHUB_FORGES = [
+ 'gitlab.com',
+ 'bitbucket.org',
+ 'codeberg.org',
+ 'gitea.com',
+ 'sr.ht',
+ 'sourcehut.org',
+] as const;
+
function encodeV1(sharedUrl: string): string {
return encodeShareUrl(sharedUrl);
}
@@ -297,7 +302,7 @@ describe('buildSplashViewModel', () => {
expect(view).toEqual({ kind: 'invalid' });
});
- for (const forge of KNOWN_NON_GITHUB_GIT_HOSTS) {
+ for (const forge of CANONICAL_NON_GITHUB_FORGES) {
test(`returns \`invalid\` for canonical forge host ${forge}`, () => {
const view = buildSplashViewModel(
encodeV1(`https://${forge}/owner/repo/blob/main/README.md`),
diff --git a/packages/app/BUNDLE-SIZE.md b/packages/app/BUNDLE-SIZE.md
index a278c73f9..cab4767c0 100644
--- a/packages/app/BUNDLE-SIZE.md
+++ b/packages/app/BUNDLE-SIZE.md
@@ -94,4 +94,6 @@ Combined-chunks 6.56->6.57 MB while hiding connection options an agent has no su
Combined-chunks 8.8->8.82 MB for the searchable chat-history side panel, its responsive presentation state, and the new strings compiled into every locale catalog. CI measured 8,804,992 B against the prior 8,800,000 B ceiling; the eager main bundle remained at 437.22 kB against 487 kB and CSS at 8.36 kB against 59 kB. The 20 kB ratchet records the feature's total chunk inventory with about 15 kB of headroom while preserving the existing eager-load budgets.
+Combined-chunks 8.84->8.85 MB for GitHub Enterprise Server host handling in Settings → Account: the hosts card (list, add field, input parsing) and the explanation shown when a project's remote is not a recognized GitHub host, plus their 17 new strings compiled into every locale catalog. CI measured 8,841,175 B, 1,175 B over the prior ceiling; a local build measured 8,840,090 B. The main app bundle stayed at 438.19 kB against its 487 kB limit and CSS at 8.36 kB against 59 kB, so the growth is on-demand chunk weight: the settings dialog body is lazy-loaded and each reader downloads one catalog. No reclamation lever beyond the lazy-load levers above.
+
Combined-chunks 8.84->8.86 MB for repository-aware worktree discovery and presentation. A forced clean local build measured 8,840,825 B against the prior 8,840,000 B ceiling, with 26,938 B of growth over the same-machine `main` build at 8,813,887 B. The eager main-app and CSS budgets remain unchanged at 487 kB and 59 kB because this ratchet records the feature's aggregate chunk inventory rather than a new first-load allowance. The new ceiling leaves 19,175 B of headroom over that local measurement; the corresponding CI size job passed.
diff --git a/packages/app/src/components/AuthModal.dom.test.tsx b/packages/app/src/components/AuthModal.dom.test.tsx
index 34ba6c6a3..155486f48 100644
--- a/packages/app/src/components/AuthModal.dom.test.tsx
+++ b/packages/app/src/components/AuthModal.dom.test.tsx
@@ -1,7 +1,7 @@
import { act, cleanup, render, screen } from '@testing-library/react';
import { afterEach, describe, expect, test, vi } from 'vitest';
import type { OkLocalOpAuthEvent, OkLocalOpAuthStatusResponse } from '@/lib/desktop-bridge-types';
-import type { AuthQueryTransport } from '@/lib/transports/auth-query-transport';
+import type { AuthQueryStatus, AuthQueryTransport } from '@/lib/transports/auth-query-transport';
import type { AuthTransport } from '@/lib/transports/auth-transport';
import { AuthModal } from './AuthModal';
@@ -34,7 +34,7 @@ const CONNECTED: OkLocalOpAuthStatusResponse = {
};
const NOT_CONNECTED: OkLocalOpAuthStatusResponse = { authenticated: false, host: 'github.com' };
-function makeQueryTransport(status: OkLocalOpAuthStatusResponse): AuthQueryTransport {
+function makeQueryTransport(status: AuthQueryStatus): AuthQueryTransport {
return {
status: async () => status,
repos: async () => ({ ok: true, host: 'github.com', repos: [] }),
@@ -160,6 +160,19 @@ describe('AuthModal identityPrompt (set-identity) path', () => {
}
});
+ test('a hostless dialog probe that reports a refused origin opens the token step for that host', async () => {
+ renderModal({
+ queryTransport: makeQueryTransport({
+ authenticated: false,
+ host: 'ghes.acme.test',
+ unsupportedOrigin: { host: 'ghes.acme.test' },
+ }),
+ });
+
+ expect(await screen.findByText('Create a token on ghes.acme.test')).toBeDefined();
+ expect(screen.queryByText('Starting sign-in flow')).toBeNull();
+ });
+
test('sign-in path (no identityPrompt) goes straight to the device flow', async () => {
const throwingQuery: AuthQueryTransport = {
status: async () => {
diff --git a/packages/app/src/components/CloneDialog.dom.test.tsx b/packages/app/src/components/CloneDialog.dom.test.tsx
index c9091a24d..461379172 100644
--- a/packages/app/src/components/CloneDialog.dom.test.tsx
+++ b/packages/app/src/components/CloneDialog.dom.test.tsx
@@ -1,4 +1,4 @@
-import { cleanup, render, screen } from '@testing-library/react';
+import { cleanup, render, screen, waitFor } from '@testing-library/react';
import { afterEach, beforeEach, describe, expect, test } from 'vitest';
import { getLastKnownSignedIn, setLastKnownSignedIn } from '@/lib/auth-state-cache';
import type { AuthQueryTransport } from '@/lib/transports/auth-query-transport';
@@ -85,4 +85,28 @@ describe('CloneDialog first paint from the shared auth-state cache', () => {
await screen.findByText('Browse your repos:');
expect(getLastKnownSignedIn()).toBe(true);
});
+
+ test('an origin refusal from the on-open status check leaves the shared cache untouched', async () => {
+ setLastKnownSignedIn(true);
+ let resolved = false;
+ const refusingQueryTransport: AuthQueryTransport = {
+ status: async () => {
+ resolved = true;
+ return {
+ authenticated: false,
+ host: 'ghes.acme.test',
+ unsupportedOrigin: { host: 'ghes.acme.test' },
+ };
+ },
+ repos: () => new Promise(() => {}),
+ signout: async () => ({ ok: true }),
+ };
+ render(
+ <CloneDialog open onOpenChange={() => {}} authQueryTransport={refusingQueryTransport} />,
+ );
+
+ await waitFor(() => expect(resolved).toBe(true));
+ await Promise.resolve();
+ expect(getLastKnownSignedIn()).toBe(true);
+ });
});
diff --git a/packages/app/src/components/CloneDialog.tsx b/packages/app/src/components/CloneDialog.tsx
index 9380809c8..ced3a8372 100644
--- a/packages/app/src/components/CloneDialog.tsx
+++ b/packages/app/src/components/CloneDialog.tsx
@@ -4,7 +4,7 @@ import { Trans, useLingui } from '@lingui/react/macro';
import { GlobeIcon, LockIcon } from 'lucide-react';
import { useEffect, useId, useRef, useState } from 'react';
import { toast } from 'sonner';
-import { getLastKnownSignedIn, setLastKnownSignedIn } from '@/lib/auth-state-cache';
+import { getLastKnownSignedIn, recordAuthStatus } from '@/lib/auth-state-cache';
import {
type AuthQueryTransport,
httpAuthQueryTransport,
@@ -115,7 +115,7 @@ export function CloneDialog({
void resolvedAuthQuery
.status()
.then((data) => {
- setLastKnownSignedIn(data.authenticated);
+ recordAuthStatus(data);
if (!cancelled) setIsSignedIn(data.authenticated);
})
.catch(() => {
diff --git a/packages/app/src/components/settings/AccountSection.dom.test.tsx b/packages/app/src/components/settings/AccountSection.dom.test.tsx
index 49acf466e..4b110706f 100644
--- a/packages/app/src/components/settings/AccountSection.dom.test.tsx
+++ b/packages/app/src/components/settings/AccountSection.dom.test.tsx
@@ -1,6 +1,8 @@
+import { bindConfigDoc, type ConfigBinding } from '@inkeep/open-knowledge-core';
import { act, cleanup, render, screen, within } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import { afterEach, beforeEach, describe, expect, test } from 'vitest';
+import * as Y from 'yjs';
import { TooltipProvider } from '@/components/ui/tooltip';
import { getLastKnownSignedIn, setLastKnownSignedIn } from '@/lib/auth-state-cache';
import type { OkLocalOpAuthEvent, OkLocalOpAuthStatusResponse } from '@/lib/desktop-bridge-types';
@@ -68,10 +70,31 @@ const noopAuthTransport: AuthTransport = {
}),
};
+const bindings: ConfigBinding[] = [];
+
+function bindUserConfig(): ConfigBinding {
+ const listeners = new Set<() => void>();
+ const binding = bindConfigDoc(
+ {
+ document: new Y.Doc(),
+ on: (_event, listener) => listeners.add(listener),
+ off: (_event, listener) => listeners.delete(listener),
+ },
+ 'user',
+ );
+ for (const listener of listeners) listener();
+ bindings.push(binding);
+ return binding;
+}
+
function renderSection(authQueryTransport: AuthQueryTransport) {
return render(
<TooltipProvider>
- <AccountSection authQueryTransport={authQueryTransport} authTransport={noopAuthTransport} />
+ <AccountSection
+ authQueryTransport={authQueryTransport}
+ authTransport={noopAuthTransport}
+ userBinding={bindUserConfig()}
+ />
</TooltipProvider>,
);
}
@@ -81,6 +104,7 @@ describe('AccountSection', () => {
afterEach(() => {
cleanup();
setLastKnownSignedIn(null);
+ for (const binding of bindings.splice(0)) binding.dispose();
});
test('shows "Connected as @<login>" and a Disconnect control when authenticated', async () => {
@@ -100,6 +124,44 @@ describe('AccountSection', () => {
expect(screen.queryByTestId('settings-account-disconnect')).toBeNull();
});
+ test('an origin on an unrecognized host explains why instead of offering Sign in', async () => {
+ setLastKnownSignedIn(true);
+ renderSection(
+ makeQueryTransport({
+ status: async () => ({
+ authenticated: false,
+ host: 'ghes.acme.test',
+ error: 'GitHub sign-in is unavailable for this host.',
+ unsupportedOrigin: { host: 'ghes.acme.test' },
+ }),
+ }),
+ );
+
+ const row = await screen.findByTestId('settings-account-unsupported-origin');
+ expect(row.textContent).toContain('ghes.acme.test');
+ expect(row.textContent).toContain('GitHub Enterprise Server hosts');
+ expect(screen.getByTestId('settings-enterprise-hosts')).toBeDefined();
+ expect(screen.queryByRole('button', { name: 'Sign in' })).toBeNull();
+ expect(screen.queryByText('Not connected')).toBeNull();
+ expect(getLastKnownSignedIn()).toBe(true);
+ });
+
+ test('an origin that names no host explains that sign-in is unavailable', async () => {
+ renderSection(
+ makeQueryTransport({
+ status: async () => ({
+ authenticated: false,
+ host: 'github.com',
+ unsupportedOrigin: { host: null },
+ }),
+ }),
+ );
+
+ const row = await screen.findByTestId('settings-account-unsupported-origin');
+ expect(row.textContent).toContain("couldn't find a host name");
+ expect(screen.queryByRole('button', { name: 'Sign in' })).toBeNull();
+ });
+
test('clicking Sign in opens the AuthModal in connect mode (not reauth)', async () => {
const user = userEvent.setup();
renderSection(makeQueryTransport({ status: async () => NOT_CONNECTED }));
diff --git a/packages/app/src/components/settings/AccountSection.tsx b/packages/app/src/components/settings/AccountSection.tsx
index 09e004a33..1b2d96d82 100644
--- a/packages/app/src/components/settings/AccountSection.tsx
+++ b/packages/app/src/components/settings/AccountSection.tsx
@@ -1,28 +1,35 @@
+import type { ConfigBinding } from '@inkeep/open-knowledge-core';
import { Trans, useLingui } from '@lingui/react/macro';
import { useEffect, useRef, useState } from 'react';
import { AuthModal } from '@/components/AuthModal';
import { Button } from '@/components/ui/button';
import { Skeleton } from '@/components/ui/skeleton';
-import { setLastKnownSignedIn } from '@/lib/auth-state-cache';
-import type { OkLocalOpAuthStatusResponse } from '@/lib/desktop-bridge-types';
+import { recordAuthStatus } from '@/lib/auth-state-cache';
import {
+ type AuthQueryStatus,
type AuthQueryTransport,
httpAuthQueryTransport,
} from '@/lib/transports/auth-query-transport';
import type { AuthTransport } from '@/lib/transports/auth-transport';
+import { EnterpriseHostsSection } from './EnterpriseHostsSection';
import { SettingsSectionHeader } from './SettingsSectionHeader';
type StatusState =
| { phase: 'loading' }
- | { phase: 'loaded'; result: OkLocalOpAuthStatusResponse }
+ | { phase: 'loaded'; result: AuthQueryStatus }
| { phase: 'check-failed' };
interface AccountSectionProps {
authQueryTransport?: AuthQueryTransport;
authTransport?: AuthTransport;
+ userBinding: ConfigBinding;
}
-export function AccountSection({ authQueryTransport, authTransport }: AccountSectionProps) {
+export function AccountSection({
+ authQueryTransport,
+ authTransport,
+ userBinding,
+}: AccountSectionProps) {
const { t } = useLingui();
const resolvedQuery = authQueryTransport ?? httpAuthQueryTransport();
const [status, setStatus] = useState<StatusState>({ phase: 'loading' });
@@ -36,7 +43,7 @@ export function AccountSection({ authQueryTransport, authTransport }: AccountSec
try {
const result = await resolvedQuery.status();
setStatus({ phase: 'loaded', result });
- setLastKnownSignedIn(result.authenticated);
+ recordAuthStatus(result);
} catch (err) {
console.warn('[AccountSection] GitHub status check failed', err);
setStatus({ phase: 'check-failed' });
@@ -123,10 +130,14 @@ export function AccountSection({ authQueryTransport, authTransport }: AccountSec
onDisconnect={() => void handleDisconnect()}
/>
)
+ ) : status.result.unsupportedOrigin !== undefined ? (
+ <UnsupportedOriginRow host={status.result.unsupportedOrigin.host} />
) : (
<DisconnectedRow onConnect={() => setAuthModalOpen(true)} />
)}
+ <EnterpriseHostsSection binding={userBinding} />
+
<AuthModal
open={authModalOpen}
onOpenChange={(open) => {
@@ -217,6 +228,34 @@ function GhCliRow({ login }: { login: string }) {
);
}
+function UnsupportedOriginRow({ host }: { host: string | null }) {
+ return (
+ <div
+ role="status"
+ className="space-y-1 rounded-md border p-3"
+ data-testid="settings-account-unsupported-origin"
+ >
+ <div className="text-sm font-medium">
+ <Trans>GitHub sign-in isn't available for this project</Trans>
+ </div>
+ <p className="text-muted-foreground text-1sm">
+ {host === null ? (
+ <Trans>
+ OpenKnowledge couldn't find a host name in this project's git remote, so it can't tell
+ which GitHub server to sign in to.
+ </Trans>
+ ) : (
+ <Trans>
+ This project's git remote is on {host}, which OpenKnowledge doesn't recognize as a
+ GitHub host. If {host} runs GitHub Enterprise Server, add it to GitHub Enterprise Server
+ hosts below, then restart OpenKnowledge.
+ </Trans>
+ )}
+ </p>
+ </div>
+ );
+}
+
function DisconnectedRow({ onConnect }: { onConnect: () => void }) {
return (
<div className="rounded-md border p-3" data-testid="settings-account-disconnected">
diff --git a/packages/app/src/components/settings/EnterpriseHostsSection.dom.test.tsx b/packages/app/src/components/settings/EnterpriseHostsSection.dom.test.tsx
new file mode 100644
index 000000000..f26c098ef
--- /dev/null
+++ b/packages/app/src/components/settings/EnterpriseHostsSection.dom.test.tsx
@@ -0,0 +1,151 @@
+import { bindConfigDoc, type ConfigBinding } from '@inkeep/open-knowledge-core';
+import { cleanup, render, screen, within } from '@testing-library/react';
+import userEvent from '@testing-library/user-event';
+import { afterEach, beforeEach, describe, expect, test } from 'vitest';
+import * as Y from 'yjs';
+import { EnterpriseHostsSection } from './EnterpriseHostsSection';
+
+let doc: Y.Doc;
+let binding: ConfigBinding;
+
+function bindUserConfig(initialYaml = ''): ConfigBinding {
+ doc = new Y.Doc();
+ if (initialYaml !== '') doc.getText('source').insert(0, initialYaml);
+ const syncedListeners = new Set<() => void>();
+ const bound = bindConfigDoc(
+ {
+ document: doc,
+ on: (_event, listener) => syncedListeners.add(listener),
+ off: (_event, listener) => syncedListeners.delete(listener),
+ },
+ 'user',
+ );
+ for (const listener of syncedListeners) listener();
+ return bound;
+}
+
+function source(): string {
+ return doc.getText('source').toString();
+}
+
+function renderSection() {
+ return render(<EnterpriseHostsSection binding={binding} />);
+}
+
+describe('EnterpriseHostsSection', () => {
+ beforeEach(() => {
+ binding = bindUserConfig();
+ });
+
+ afterEach(() => {
+ cleanup();
+ binding.dispose();
+ });
+
+ test('shows an empty state when no host is declared', () => {
+ renderSection();
+ expect(screen.getByTestId('settings-enterprise-hosts-empty')).toBeTruthy();
+ });
+
+ test('keeps the add button disabled until a host is typed', async () => {
+ const user = userEvent.setup();
+ renderSection();
+ const add = screen.getByRole('button', { name: 'Add host' }) as HTMLButtonElement;
+ expect(add.disabled).toBe(true);
+ await user.type(screen.getByLabelText('Add a host'), ' ');
+ expect(add.disabled).toBe(true);
+ await user.type(screen.getByLabelText('Add a host'), 'ghes.example.com');
+ expect(add.disabled).toBe(false);
+ });
+
+ test('adding a host writes a normalized github declaration to the user config', async () => {
+ const user = userEvent.setup();
+ renderSection();
+ await user.type(
+ screen.getByLabelText('Add a host'),
+ 'https://GHES.Example.com:8443/team/kb.git',
+ );
+ await user.click(screen.getByRole('button', { name: 'Add host' }));
+
+ expect(binding.current().git.hosts['ghes.example.com']?.provider).toBe('github');
+ expect(source()).toContain('ghes.example.com');
+ const list = screen.getByTestId('settings-enterprise-hosts-list');
+ expect(within(list).getByText('ghes.example.com')).toBeTruthy();
+ expect((screen.getByLabelText('Add a host') as HTMLInputElement).value).toBe('');
+ expect(screen.getByRole('status').textContent).toContain('Restart OpenKnowledge');
+ });
+
+ test('removing a host deletes only that declaration', async () => {
+ binding.dispose();
+ binding = bindUserConfig(
+ 'git:\n hosts:\n a.example.com:\n provider: github\n b.example.com:\n provider: github\n',
+ );
+ const user = userEvent.setup();
+ renderSection();
+ await user.click(screen.getByRole('button', { name: 'Remove a.example.com' }));
+
+ expect(binding.current().git.hosts['a.example.com']).toBeUndefined();
+ expect(binding.current().git.hosts['b.example.com']?.provider).toBe('github');
+ expect(screen.queryByText('a.example.com')).toBeNull();
+ expect(screen.getByText('b.example.com')).toBeTruthy();
+ });
+
+ test('removing a host moves focus to the next remaining remove button', async () => {
+ binding.dispose();
+ binding = bindUserConfig(
+ 'git:\n hosts:\n a.example.com:\n provider: github\n b.example.com:\n provider: github\n c.example.com:\n provider: github\n',
+ );
+ const user = userEvent.setup();
+ renderSection();
+ await user.click(screen.getByRole('button', { name: 'Remove b.example.com' }));
+ expect(document.activeElement).toBe(
+ screen.getByRole('button', { name: 'Remove c.example.com' }),
+ );
+ await user.click(screen.getByRole('button', { name: 'Remove c.example.com' }));
+ expect(document.activeElement).toBe(
+ screen.getByRole('button', { name: 'Remove a.example.com' }),
+ );
+ });
+
+ test('removing the last host moves focus to the add field', async () => {
+ binding.dispose();
+ binding = bindUserConfig('git:\n hosts:\n a.example.com:\n provider: github\n');
+ const user = userEvent.setup();
+ renderSection();
+ await user.click(screen.getByRole('button', { name: 'Remove a.example.com' }));
+ expect(document.activeElement).toBe(screen.getByLabelText('Add a host'));
+ });
+
+ test.each([
+ ['github.com', 'always recognized'],
+ ['not a host', "isn't a valid hostname"],
+ ])('refuses %j without writing and explains why', async (input, message) => {
+ const user = userEvent.setup();
+ renderSection();
+ await user.type(screen.getByLabelText('Add a host'), input);
+ await user.click(screen.getByRole('button', { name: 'Add host' }));
+
+ expect(screen.getByRole('alert').textContent).toContain(message);
+ expect(screen.getByLabelText('Add a host').getAttribute('aria-invalid')).toBe('true');
+ expect(source()).toBe('');
+ });
+
+ test('refuses a host that is already declared', async () => {
+ binding.dispose();
+ binding = bindUserConfig('git:\n hosts:\n ghes.example.com:\n provider: github\n');
+ const before = source();
+ const user = userEvent.setup();
+ renderSection();
+ await user.type(screen.getByLabelText('Add a host'), 'GHES.example.com');
+ await user.click(screen.getByRole('button', { name: 'Add host' }));
+
+ expect(screen.getByRole('alert').textContent).toContain('already in the list');
+ expect(source()).toBe(before);
+ });
+
+ test('reflects declarations written elsewhere', async () => {
+ renderSection();
+ binding.patch({ git: { hosts: { 'remote.example.com': { provider: 'github' } } } });
+ expect(await screen.findByText('remote.example.com')).toBeTruthy();
+ });
+});
diff --git a/packages/app/src/components/settings/EnterpriseHostsSection.tsx b/packages/app/src/components/settings/EnterpriseHostsSection.tsx
new file mode 100644
index 000000000..1327d391a
--- /dev/null
+++ b/packages/app/src/components/settings/EnterpriseHostsSection.tsx
@@ -0,0 +1,176 @@
+import { type ConfigBinding, humanFormat, normalizeGitHostname } from '@inkeep/open-knowledge-core';
+import { Trans, useLingui } from '@lingui/react/macro';
+import { Trash2 } from 'lucide-react';
+import { type SubmitEvent, useEffect, useId, useRef, useState } from 'react';
+import { Button } from '@/components/ui/button';
+import { Input } from '@/components/ui/input';
+import {
+ declaredEnterpriseHosts,
+ type EnterpriseHostInputResult,
+ parseEnterpriseHostInput,
+} from './enterprise-host-input';
+
+export function EnterpriseHostsSection({ binding }: { binding: ConfigBinding }) {
+ const { t } = useLingui();
+ const hintId = useId();
+ const errorId = useId();
+ const [hosts, setHosts] = useState(() => declaredEnterpriseHosts(binding.current()));
+ const [draft, setDraft] = useState('');
+ const [error, setError] = useState<string | null>(null);
+ const [pendingRestart, setPendingRestart] = useState(false);
+ const [focusAfterRemove, setFocusAfterRemove] = useState<{ host: string | null } | null>(null);
+ const removeButtons = useRef(new Map<string, HTMLButtonElement>());
+ const inputRef = useRef<HTMLInputElement>(null);
+
+ useEffect(() => {
+ if (focusAfterRemove === null) return;
+ const target =
+ focusAfterRemove.host === null ? null : removeButtons.current.get(focusAfterRemove.host);
+ (target ?? inputRef.current)?.focus();
+ setFocusAfterRemove(null);
+ }, [focusAfterRemove]);
+
+ useEffect(() => binding.subscribe((next) => setHosts(declaredEnterpriseHosts(next))), [binding]);
+
+ function rejectionMessage(
+ reason: Extract<EnterpriseHostInputResult, { ok: false }>['reason'],
+ ): string {
+ switch (reason) {
+ case 'empty':
+ return t`Enter a hostname, such as github.example.com.`;
+ case 'invalid':
+ return t`That isn't a valid hostname. Enter just the server name, such as github.example.com.`;
+ case 'github-com':
+ return t`github.com is always recognized, so it doesn't need to be added.`;
+ case 'duplicate':
+ return t`That host is already in the list.`;
+ }
+ }
+
+ function handleAdd(event: SubmitEvent<HTMLFormElement>) {
+ event.preventDefault();
+ const parsed = parseEnterpriseHostInput(
+ draft,
+ new Set(hosts.map((host) => normalizeGitHostname(host))),
+ );
+ if (!parsed.ok) {
+ setError(rejectionMessage(parsed.reason));
+ return;
+ }
+ const result = binding.patch({ git: { hosts: { [parsed.host]: { provider: 'github' } } } });
+ if (!result.ok) {
+ setError(humanFormat(result.error));
+ return;
+ }
+ setHosts(declaredEnterpriseHosts(result.effective));
+ setDraft('');
+ setError(null);
+ setPendingRestart(true);
+ }
+
+ function handleRemove(host: string) {
+ const index = hosts.indexOf(host);
+ const neighbor = hosts[index + 1] ?? hosts[index - 1] ?? null;
+ const result = binding.patch({ git: { hosts: { [host]: null } } });
+ if (!result.ok) {
+ setError(humanFormat(result.error));
+ return;
+ }
+ setHosts(declaredEnterpriseHosts(result.effective));
+ setFocusAfterRemove({ host: neighbor });
+ setError(null);
+ setPendingRestart(true);
+ }
+
+ return (
+ <section
+ aria-labelledby="settings-enterprise-hosts-title"
+ className="space-y-4 pt-5"
+ data-field="section:enterprise-hosts"
+ data-testid="settings-enterprise-hosts"
+ >
+ <div>
+ <h4 id="settings-enterprise-hosts-title" className="text-sm font-medium">
+ <Trans>GitHub Enterprise Server hosts</Trans>
+ </h4>
+ <p id={hintId} className="text-1sm text-muted-foreground">
+ <Trans>
+ If you use a GitHub Enterprise Server, add its host here so OpenKnowledge can sign in,
+ check push permission, and create share links for repositories hosted there.
+ </Trans>
+ </p>
+ </div>
+
+ <div className="space-y-2 rounded-lg border bg-card p-3">
+ {hosts.length > 0 ? (
+ <ul className="space-y-1" data-testid="settings-enterprise-hosts-list">
+ {hosts.map((host) => (
+ <li key={host} className="flex items-center justify-between gap-3">
+ <span className="min-w-0 flex-1 truncate font-mono text-xs">{host}</span>
+ <Button
+ variant="ghost"
+ size="icon"
+ className="size-7"
+ aria-label={t`Remove ${host}`}
+ ref={(element) => {
+ if (element) removeButtons.current.set(host, element);
+ else removeButtons.current.delete(host);
+ }}
+ onClick={() => handleRemove(host)}
+ >
+ <Trash2 aria-hidden="true" />
+ </Button>
+ </li>
+ ))}
+ </ul>
+ ) : (
+ <p
+ className="text-1sm text-muted-foreground"
+ data-testid="settings-enterprise-hosts-empty"
+ >
+ <Trans>No Enterprise hosts added. Only github.com is treated as GitHub.</Trans>
+ </p>
+ )}
+
+ <form className="flex items-center gap-2 pt-1" onSubmit={handleAdd} noValidate>
+ <Input
+ ref={inputRef}
+ value={draft}
+ aria-label={t`Add a host`}
+ placeholder="github.example.com"
+ autoComplete="off"
+ spellCheck={false}
+ inputMode="url"
+ className="h-7 flex-1 font-mono text-xs"
+ aria-invalid={error !== null}
+ aria-describedby={error !== null ? `${hintId} ${errorId}` : hintId}
+ onChange={(event) => {
+ setDraft(event.target.value);
+ if (error !== null) setError(null);
+ }}
+ />
+ <Button
+ type="submit"
+ size="sm"
+ variant="secondary"
+ disabled={draft.trim() === ''}
+ className="h-7 px-2 font-normal text-xs"
+ >
+ <Trans>Add host</Trans>
+ </Button>
+ </form>
+
+ {error !== null ? (
+ <p id={errorId} role="alert" className="text-1sm text-destructive">
+ {error}
+ </p>
+ ) : null}
+ {pendingRestart ? (
+ <p role="status" className="text-1sm text-muted-foreground">
+ <Trans>Saved. Restart OpenKnowledge to apply the change.</Trans>
+ </p>
+ ) : null}
+ </div>
+ </section>
+ );
+}
diff --git a/packages/app/src/components/settings/SettingsDialogBody.sections.dom.test.tsx b/packages/app/src/components/settings/SettingsDialogBody.sections.dom.test.tsx
index a2951c799..b71e1e2c6 100644
--- a/packages/app/src/components/settings/SettingsDialogBody.sections.dom.test.tsx
+++ b/packages/app/src/components/settings/SettingsDialogBody.sections.dom.test.tsx
@@ -449,6 +449,46 @@ describe('SettingsDialogBody section runtime dispatch', () => {
expect(screen.getByTestId('settings-scope-badge-user')).not.toBeNull();
});
+ test('the Account page mounts the Enterprise hosts card from the user binding', async () => {
+ const { bindConfigDoc } = await import('@inkeep/open-knowledge-core');
+ const { Doc } = await import('yjs');
+ const listeners = new Set<() => void>();
+ const binding = bindConfigDoc(
+ {
+ document: new Doc(),
+ on: (_event, listener) => listeners.add(listener),
+ off: (_event, listener) => listeners.delete(listener),
+ },
+ 'user',
+ );
+ for (const listener of listeners) listener();
+ const fetchSpy = vi
+ .spyOn(globalThis, 'fetch')
+ .mockRejectedValue(new Error('offline in this test'));
+ const warn = vi.spyOn(console, 'warn').mockImplementation(() => {});
+ try {
+ await renderBody({ activeId: 'account', userBinding: binding });
+ expect(await screen.findByTestId('settings-enterprise-hosts')).not.toBeNull();
+ expect(screen.getByLabelText('Add a host')).not.toBeNull();
+ } finally {
+ fetchSpy.mockRestore();
+ warn.mockRestore();
+ binding.dispose();
+ }
+ });
+
+ test('the Account page waits for the user binding instead of rendering without the hosts card', async () => {
+ const fetchSpy = vi.spyOn(globalThis, 'fetch');
+ try {
+ await renderBody({ activeId: 'account' });
+ expect(screen.queryByTestId('settings-account')).toBeNull();
+ expect(screen.queryByTestId('settings-enterprise-hosts')).toBeNull();
+ expect(fetchSpy).not.toHaveBeenCalled();
+ } finally {
+ fetchSpy.mockRestore();
+ }
+ });
+
test('user preferences carries the User badge on its heading', async () => {
await renderBody({
activeId: 'preferences',
diff --git a/packages/app/src/components/settings/SettingsDialogBody.tsx b/packages/app/src/components/settings/SettingsDialogBody.tsx
index 1864530b2..20e2fe840 100644
--- a/packages/app/src/components/settings/SettingsDialogBody.tsx
+++ b/packages/app/src/components/settings/SettingsDialogBody.tsx
@@ -95,7 +95,7 @@ export function SettingsDialogBody({
return <HotkeysSection />;
}
if (activeId === 'account') {
- return <AccountSection />;
+ return userBinding ? <AccountSection userBinding={userBinding} /> : <SectionSkeleton />;
}
if (activeId === 'sync') {
return (
diff --git a/packages/app/src/components/settings/SettingsDialogShell.tsx b/packages/app/src/components/settings/SettingsDialogShell.tsx
index 2133a5cad..88731e299 100644
--- a/packages/app/src/components/settings/SettingsDialogShell.tsx
+++ b/packages/app/src/components/settings/SettingsDialogShell.tsx
@@ -216,7 +216,22 @@ export function SettingsDialogShell({
] satisfies SidebarSubsection[],
},
{ id: 'hotkeys', label: t`Hotkeys` },
- { id: 'account', label: t`Account` },
+ {
+ id: 'account',
+ label: t`Account`,
+ subsections: [
+ {
+ id: 'enterprise-hosts',
+ label: t`GitHub Enterprise Server hosts`,
+ anchor: 'section:enterprise-hosts',
+ keywords: [
+ t({ message: 'GHES', context: 'settings search keyword' }),
+ t({ message: 'enterprise', context: 'settings search keyword' }),
+ t({ message: 'git host', context: 'settings search keyword' }),
+ ],
+ },
+ ] satisfies SidebarSubsection[],
+ },
{ id: 'user-plugins-manage', label: t`Plugins` },
{ id: 'user-skills', label: t`Skills Studio` },
],
diff --git a/packages/app/src/components/settings/enterprise-host-input.test.ts b/packages/app/src/components/settings/enterprise-host-input.test.ts
new file mode 100644
index 000000000..cdd3606ab
--- /dev/null
+++ b/packages/app/src/components/settings/enterprise-host-input.test.ts
@@ -0,0 +1,76 @@
+import type { Config } from '@inkeep/open-knowledge-core';
+import { describe, expect, test } from 'vitest';
+import { declaredEnterpriseHosts, parseEnterpriseHostInput } from './enterprise-host-input';
+
+describe('parseEnterpriseHostInput', () => {
+ const none = new Set<string>();
+
+ test.each([
+ ['ghes.example.com', 'ghes.example.com'],
+ [' GHES.Example.COM ', 'ghes.example.com'],
+ ['ghes.example.com:8443', 'ghes.example.com'],
+ ['https://ghes.example.com/team/kb.git', 'ghes.example.com'],
+ ['https://[email protected]:8443/team/kb', 'ghes.example.com'],
+ ['ssh://[email protected]/team/kb.git', 'ghes.example.com'],
+ ['[email protected]:team/kb.git', 'ghes.example.com'],
+ ['ghes.example.com/team/kb', 'ghes.example.com'],
+ ['127.0.0.1', '127.0.0.1'],
+ ['git-internal', 'git-internal'],
+ ])('accepts %j as %j', (raw, host) => {
+ expect(parseEnterpriseHostInput(raw, none)).toEqual({ ok: true, host });
+ });
+
+ test.each(['github.example.com', 'https://github.acme.test/team/kb.git'])(
+ 'accepts %j, because only github.com itself is recognized without a declaration',
+ (raw) => {
+ expect(parseEnterpriseHostInput(raw, none)).toMatchObject({ ok: true });
+ },
+ );
+
+ test('rejects empty input', () => {
+ expect(parseEnterpriseHostInput(' ', none)).toEqual({ ok: false, reason: 'empty' });
+ });
+
+ test.each(['not a host', 'bad_host.example', '-leading.example', 'https://', '...'])(
+ 'rejects malformed input %j',
+ (raw) => {
+ expect(parseEnterpriseHostInput(raw, none)).toEqual({ ok: false, reason: 'invalid' });
+ },
+ );
+
+ test.each(['github.com', 'www.github.com', 'https://github.com/o/r'])(
+ 'rejects %j because github.com is always recognized',
+ (raw) => {
+ expect(parseEnterpriseHostInput(raw, none)).toEqual({ ok: false, reason: 'github-com' });
+ },
+ );
+
+ test('rejects a host already declared, comparing normalized names', () => {
+ expect(parseEnterpriseHostInput('GHES.example.com', new Set(['ghes.example.com']))).toEqual({
+ ok: false,
+ reason: 'duplicate',
+ });
+ });
+});
+
+describe('declaredEnterpriseHosts', () => {
+ function config(hosts: Config['git']['hosts']): Config {
+ return { git: { hosts } } as Config;
+ }
+
+ test('lists only github-provider entries, sorted, keeping the stored key', () => {
+ expect(
+ declaredEnterpriseHosts(
+ config({
+ 'zeta.example.com': { provider: 'github' },
+ 'Alpha.Example.com': { provider: 'github' },
+ 'no-provider.example.com': {},
+ }),
+ ),
+ ).toEqual(['Alpha.Example.com', 'zeta.example.com']);
+ });
+
+ test('tolerates a config with no git section', () => {
+ expect(declaredEnterpriseHosts({} as Config)).toEqual([]);
+ });
+});
diff --git a/packages/app/src/components/settings/enterprise-host-input.ts b/packages/app/src/components/settings/enterprise-host-input.ts
new file mode 100644
index 000000000..602e7a403
--- /dev/null
+++ b/packages/app/src/components/settings/enterprise-host-input.ts
@@ -0,0 +1,45 @@
+import { type Config, normalizeGitHostname } from '@inkeep/open-knowledge-core';
+
+export type EnterpriseHostInputResult =
+ | { ok: true; host: string }
+ | { ok: false; reason: 'empty' | 'invalid' | 'github-com' | 'duplicate' };
+
+const HOSTNAME_LABEL = '[a-z0-9](?:[a-z0-9-]*[a-z0-9])?';
+const HOSTNAME = new RegExp(`^${HOSTNAME_LABEL}(?:\\.${HOSTNAME_LABEL})*$`);
+const SCHEME = /^[a-z][a-z0-9+.-]*:\/\//i;
+
+function hostPortOf(raw: string): string | null {
+ if (SCHEME.test(raw)) {
+ try {
+ return new URL(raw).host;
+ } catch {
+ return null;
+ }
+ }
+ const authority = raw.split('/')[0] ?? '';
+ const withoutUser = authority.slice(authority.lastIndexOf('@') + 1);
+ return withoutUser.replace(/:(?!\d+$).*$/, '');
+}
+
+export function parseEnterpriseHostInput(
+ raw: string,
+ declared: ReadonlySet<string>,
+): EnterpriseHostInputResult {
+ const trimmed = raw.trim();
+ if (trimmed === '') return { ok: false, reason: 'empty' };
+ const hostPort = hostPortOf(trimmed);
+ if (hostPort === null || hostPort === '') return { ok: false, reason: 'invalid' };
+ const host = normalizeGitHostname(hostPort);
+ if (!HOSTNAME.test(host)) return { ok: false, reason: 'invalid' };
+ if (host === 'github.com') return { ok: false, reason: 'github-com' };
+ if (declared.has(host)) return { ok: false, reason: 'duplicate' };
+ return { ok: true, host };
+}
+
+export function declaredEnterpriseHosts(config: Config): string[] {
+ const hosts = config.git?.hosts ?? {};
+ return Object.entries(hosts)
+ .filter(([, entry]) => entry?.provider === 'github')
+ .map(([host]) => host)
+ .sort((a, b) => a.localeCompare(b));
+}
diff --git a/packages/app/src/lib/auth-state-cache.test.ts b/packages/app/src/lib/auth-state-cache.test.ts
index eb0a2a553..67f1902b5 100644
--- a/packages/app/src/lib/auth-state-cache.test.ts
+++ b/packages/app/src/lib/auth-state-cache.test.ts
@@ -1,5 +1,5 @@
import { afterEach, beforeEach, describe, expect, test } from 'vitest';
-import { getLastKnownSignedIn, setLastKnownSignedIn } from './auth-state-cache';
+import { getLastKnownSignedIn, recordAuthStatus, setLastKnownSignedIn } from './auth-state-cache';
describe('auth-state-cache', () => {
beforeEach(() => setLastKnownSignedIn(null));
@@ -16,4 +16,15 @@ describe('auth-state-cache', () => {
setLastKnownSignedIn(false);
expect(getLastKnownSignedIn()).toBe(false);
});
+
+ test('records a resolved status but ignores an origin refusal, which says nothing about sign-in', () => {
+ recordAuthStatus({ authenticated: true });
+ expect(getLastKnownSignedIn()).toBe(true);
+
+ recordAuthStatus({ authenticated: false, unsupportedOrigin: { host: 'ghes.acme.test' } });
+ expect(getLastKnownSignedIn()).toBe(true);
+
+ recordAuthStatus({ authenticated: false });
+ expect(getLastKnownSignedIn()).toBe(false);
+ });
});
diff --git a/packages/app/src/lib/auth-state-cache.ts b/packages/app/src/lib/auth-state-cache.ts
index f3621c156..ef0cea20b 100644
--- a/packages/app/src/lib/auth-state-cache.ts
+++ b/packages/app/src/lib/auth-state-cache.ts
@@ -7,3 +7,11 @@ export function getLastKnownSignedIn(): boolean | null {
export function setLastKnownSignedIn(value: boolean | null): void {
lastKnownSignedIn = value;
}
+
+export function recordAuthStatus(status: {
+ authenticated: boolean;
+ unsupportedOrigin?: unknown;
+}): void {
+ if (!status.authenticated && status.unsupportedOrigin !== undefined) return;
+ lastKnownSignedIn = status.authenticated;
+}
diff --git a/packages/app/src/lib/transports/auth-query-transport.test.ts b/packages/app/src/lib/transports/auth-query-transport.test.ts
index e921b331a..6c400af0d 100644
--- a/packages/app/src/lib/transports/auth-query-transport.test.ts
+++ b/packages/app/src/lib/transports/auth-query-transport.test.ts
@@ -25,6 +25,54 @@ afterEach(() => {
});
describe('httpAuthQueryTransport().status', () => {
+ function problem(status: number, body: Record<string, unknown>): Response {
+ return new Response(JSON.stringify({ status, instance: undefined, ...body }), {
+ status,
+ headers: { 'Content-Type': 'application/problem+json' },
+ });
+ }
+
+ it('reports a non-GitHub origin refusal with the rejected host instead of github.com', async () => {
+ stubFetch(() =>
+ problem(409, {
+ type: 'urn:ok:error:non-github-origin',
+ title: 'GitHub sign-in is unavailable for this host.',
+ detail: 'ghes.acme.test is not a declared GitHub host.',
+ host: 'ghes.acme.test',
+ }),
+ );
+ expect(await httpAuthQueryTransport().status()).toEqual({
+ authenticated: false,
+ host: 'ghes.acme.test',
+ error: 'GitHub sign-in is unavailable for this host.',
+ unsupportedOrigin: { host: 'ghes.acme.test' },
+ });
+ });
+
+ it('reports an origin refusal whose remote names no host', async () => {
+ stubFetch(() =>
+ problem(409, {
+ type: 'urn:ok:error:non-github-origin',
+ title: 'GitHub sign-in is unavailable for this host.',
+ host: null,
+ }),
+ );
+ const result = await httpAuthQueryTransport().status();
+ expect(result).toMatchObject({ authenticated: false, unsupportedOrigin: { host: null } });
+ });
+
+ it('keeps other failures as a plain unauthenticated result', async () => {
+ stubFetch(() =>
+ problem(500, { type: 'urn:ok:error:internal-server-error', title: 'Internal server error.' }),
+ );
+ const result = await httpAuthQueryTransport().status();
+ expect(result).toEqual({
+ authenticated: false,
+ host: 'github.com',
+ error: 'Internal server error.',
+ });
+ });
+
it('coalesces concurrent same-host checks across transport instances', async () => {
let resolveFetch: ((response: Response) => void) | undefined;
const pendingResponse = new Promise<Response>((resolve) => {
diff --git a/packages/app/src/lib/transports/auth-query-transport.ts b/packages/app/src/lib/transports/auth-query-transport.ts
index a93dca559..725bfd806 100644
--- a/packages/app/src/lib/transports/auth-query-transport.ts
+++ b/packages/app/src/lib/transports/auth-query-transport.ts
@@ -1,5 +1,6 @@
-import { ProblemDetailsSchema } from '@inkeep/open-knowledge-core';
+import { type ProblemDetails, ProblemDetailsSchema } from '@inkeep/open-knowledge-core';
import { t } from '@lingui/core/macro';
+import { z } from 'zod';
import type {
OkDesktopBridge,
OkLocalOpAuthReposResponse,
@@ -8,19 +9,36 @@ import type {
} from '@/lib/desktop-bridge-types';
const DEFAULT_AUTH_QUERY_HOST = 'github.com';
-const authStatusInFlight = new Map<string, Promise<OkLocalOpAuthStatusResponse>>();
+const authStatusInFlight = new Map<string, Promise<AuthQueryStatus>>();
-async function extractProblemTitle(res: Response): Promise<string | undefined> {
+const NonGitHubOriginProblemSchema = ProblemDetailsSchema.extend({
+ type: z.literal('urn:ok:error:non-github-origin'),
+ host: z.string().min(1).nullish().catch(null),
+});
+
+async function readJsonBody(res: Response): Promise<unknown> {
try {
- const body = (await res.json()) as unknown;
- const result = ProblemDetailsSchema.safeParse(body);
- if (result.success) return result.data.title;
- } catch {}
- return undefined;
+ return (await res.json()) as unknown;
+ } catch {
+ return undefined;
+ }
+}
+
+async function extractProblem(res: Response): Promise<ProblemDetails | undefined> {
+ return ProblemDetailsSchema.safeParse(await readJsonBody(res)).data;
}
+type AuthStatusMember<Authenticated extends boolean> = Extract<
+ OkLocalOpAuthStatusResponse,
+ { authenticated: Authenticated }
+>;
+
+export type AuthQueryStatus =
+ | (AuthStatusMember<true> & { unsupportedOrigin?: never })
+ | (AuthStatusMember<false> & { unsupportedOrigin?: { host: string | null } });
+
export interface AuthQueryTransport {
- status(request?: { host?: string }): Promise<OkLocalOpAuthStatusResponse>;
+ status(request?: { host?: string }): Promise<AuthQueryStatus>;
repos(request?: { host?: string }): Promise<OkLocalOpAuthReposResponse>;
signout?(request?: { host?: string }): Promise<OkLocalOpAuthSignoutResponse>;
}
@@ -33,14 +51,22 @@ async function postJson(path: string, body: unknown): Promise<Response> {
});
}
-async function requestAuthStatus(request?: {
- host?: string;
-}): Promise<OkLocalOpAuthStatusResponse> {
+async function requestAuthStatus(request?: { host?: string }): Promise<AuthQueryStatus> {
const host = request?.host ?? DEFAULT_AUTH_QUERY_HOST;
const res = await postJson('/api/local-op/auth/status', request);
if (!res.ok) {
- const error = await extractProblemTitle(res);
- return { authenticated: false, host, error };
+ const body = await readJsonBody(res);
+ const refusal = NonGitHubOriginProblemSchema.safeParse(body);
+ if (refusal.success) {
+ const rejected = refusal.data.host ?? null;
+ return {
+ authenticated: false,
+ host: rejected ?? host,
+ error: refusal.data.title,
+ unsupportedOrigin: { host: rejected },
+ };
+ }
+ return { authenticated: false, host, error: ProblemDetailsSchema.safeParse(body).data?.title };
}
const data = (await res.json()) as Record<string, unknown>;
const h = typeof data.host === 'string' ? data.host : host;
@@ -66,7 +92,7 @@ async function requestAuthStatus(request?: {
};
}
-function coalescedAuthStatus(request?: { host?: string }): Promise<OkLocalOpAuthStatusResponse> {
+function coalescedAuthStatus(request?: { host?: string }): Promise<AuthQueryStatus> {
const host = request?.host ?? DEFAULT_AUTH_QUERY_HOST;
const existing = authStatusInFlight.get(host);
if (existing) return existing;
@@ -98,7 +124,7 @@ export function httpAuthQueryTransport(): AuthQueryTransport {
const host = request?.host ?? 'github.com';
const res = await postJson('/api/local-op/auth/repos', request);
if (!res.ok) {
- const title = await extractProblemTitle(res);
+ const title = (await extractProblem(res))?.title;
return { ok: false, error: title ?? t`Failed to fetch repositories` };
}
const data = lastJsonLine(await res.text());
@@ -125,7 +151,7 @@ export function httpAuthQueryTransport(): AuthQueryTransport {
async signout(request) {
const res = await postJson('/api/local-op/auth/signout', request);
if (!res.ok) {
- const error = await extractProblemTitle(res);
+ const error = (await extractProblem(res))?.title;
return { ok: false, error };
}
return { ok: true };
diff --git a/packages/app/src/lib/transports/auth-transport.test.ts b/packages/app/src/lib/transports/auth-transport.test.ts
index 528ef83b2..64925f59f 100644
--- a/packages/app/src/lib/transports/auth-transport.test.ts
+++ b/packages/app/src/lib/transports/auth-transport.test.ts
@@ -82,6 +82,28 @@ describe('httpAuthTransport().start / ghLogin (streamAuthEndpoint)', () => {
expect(events).toEqual([{ type: 'error', message: 'The GitHub CLI (gh) is not installed.' }]);
});
+ test('a refused sign-in exposes the host-specific remediation detail', async () => {
+ globalThis.fetch = vi.fn(
+ async () =>
+ new Response(
+ JSON.stringify({
+ type: 'urn:ok:error:non-github-origin',
+ title: 'GitHub sign-in is unavailable for this remote.',
+ status: 409,
+ detail:
+ 'Declare ghes.example.test in ~/.ok/global.yml to use GitHub Enterprise sign-in.',
+ }),
+ { status: 409 },
+ ),
+ ) as unknown as typeof fetch;
+ expect(await collectEvents(httpAuthTransport().start())).toEqual([
+ {
+ type: 'error',
+ message: 'Declare ghes.example.test in ~/.ok/global.yml to use GitHub Enterprise sign-in.',
+ },
+ ]);
+ });
+
test('a pre-stream failure with an unparseable body falls back to the generic message', async () => {
globalThis.fetch = vi.fn(
async () => new Response('<html>gateway error</html>', { status: 502 }),
diff --git a/packages/app/src/lib/transports/auth-transport.ts b/packages/app/src/lib/transports/auth-transport.ts
index 8d80e7ca5..cf3928d7e 100644
--- a/packages/app/src/lib/transports/auth-transport.ts
+++ b/packages/app/src/lib/transports/auth-transport.ts
@@ -116,7 +116,7 @@ function streamAuthEndpoint(
let message = t`Failed to start sign-in — try again`;
try {
const result = ProblemDetailsSchema.safeParse((await res.json()) as unknown);
- if (result.success) message = result.data.title;
+ if (result.success) message = result.data.detail || result.data.title;
} catch {}
push({ type: 'error', message });
return;
diff --git a/packages/app/src/locales/ar/messages.json b/packages/app/src/locales/ar/messages.json
index f2e0f8dfe..41662cb0a 100644
--- a/packages/app/src/locales/ar/messages.json
+++ b/packages/app/src/locales/ar/messages.json
@@ -279,6 +279,7 @@
"1ruosn": ["OpenKnowledge"],
"1t_NnN": ["رفض"],
"1u-mAI": ["تعذّر بدء المزامنة. تحقق من اتصالك، ثم أعد المحاولة."],
+ "1uEVfp": ["المؤسسات"],
"1vczDE": ["فتح ", ["displayName"], " Desktop"],
"1vn0CI": ["استجابة الخادم غير صالحة"],
"1xui0Q": ["فشل تحميل الملفات المحلية"],
@@ -406,6 +407,7 @@
")"
],
"3LbBJn": ["إرفاق صور"],
+ "3LuFP-": ["تم الحفظ. أعد تشغيل OpenKnowledge لتطبيق التغيير."],
"3MA3Hh": ["تعذّرت قراءة قاعدة ", ["gitignorePath"], ": ", ["previewError"]],
"3MnvrL": ["تُعرض أفضل ", ["0"], " تطابق — تابع الكتابة للتضييق"],
"3Mwaly": ["تعذّرت تهيئة ", ["0"], "."],
@@ -848,6 +850,13 @@
"7YRrJ9": [
"متاح في تطبيق OpenKnowledge لسطح المكتب. من الطرفية، استخدم<0> ok config-sharing status</0> / <1>share</1> / <2>unshare</2>."
],
+ "7_I248": [
+ "المستودع البعيد لـ git الخاص بهذا المشروع موجود على ",
+ ["host"],
+ "، ولا يتعرّف عليه OpenKnowledge كمضيف GitHub. إذا كان ",
+ ["host"],
+ " يشغّل GitHub Enterprise Server، فأضفه في مضيفو GitHub Enterprise Server أدناه، ثم أعد تشغيل OpenKnowledge."
+ ],
"7_bFEL": ["اسحب ", ["patternText"], " لإعادة الترتيب"],
"7a0YcF": ["اضغط <0>مسافة</0> أو انقر على الـ blob للبدء"],
"7aNk5D": ["عدّل OpenKnowledge ", ["subject"]],
@@ -1092,6 +1101,7 @@
"AItsE5": ["افتحه هناك"],
"AJ7_B2": ["إنشاء سمة جديدة"],
"AKxFtn": [["openedWorktreeCount", "plural", { "one": ["شجرة عمل"], "other": ["أشجار عمل"] }]],
+ "ALFlyF": ["إضافة المضيف"],
"ALhMYW": ["الطرفية"],
"AMU00p": [
"النسختان متطابقتان. اختيار قبول الحالي يُبقي حماية OpenKnowledge مفعّلة، لذا سيُرفض مجددًا أي حفظ آخر للنسخة الأقدم. اختيار قبول الوارد يوقف تلك الحماية."
@@ -1365,6 +1375,7 @@
"DDTdLl": ["إعدادات كتلة الكود"],
"DELNQk": ["يرى المتعاونون تعديلاتك الجارية بمجرد مزامنتها."],
"DEWDbv": ["إظهار المخطط"],
+ "DEkRZA": ["هذا المضيف موجود بالفعل في القائمة."],
"DF1MtZ": ["يجري تحميل التعارض لـ ", ["filePath"]],
"DFQ2Sj": ["البريد الإلكتروني للمتابعة"],
"DFfRbX": ["حالة المزامنة: ", ["syncStateLabel"], " — هوية git غير مضبوطة"],
@@ -1453,6 +1464,7 @@
"Dvr1Sg": ["يجري النسخ"],
"Dvvrs8": [["0"], " تعذر إعادة تشغيله بنافذة السياق هذه. استخدم إعادة المحاولة لاستعادته."],
"Dvwa0U": ["إنشاء شجرة عمل من هذا الفرع"],
+ "Dwu3RL": ["GHES"],
"Dz7fsq": ["تكبير"],
"E-G19G": [
"المنفذ ",
@@ -1807,6 +1819,7 @@
"HJ7aHU": [
"انقل الكتلة الحالية إلى أعلى أو أسفل. في القوائم، انقل العنصر الحالي أو العناصر المحددة."
],
+ "HK2eIK": ["لم تتم إضافة أي مضيف Enterprise. يُعامَل github.com وحده على أنه GitHub."],
"HKH-W-": ["البيانات"],
"HLoO-Z": ["أعاد الخادم استجابة استيراد مشوّهة."],
"HM56Bx": ["يجري الإنشاء..."],
@@ -1935,6 +1948,7 @@
"IxyZXD": ["لقطة الشاشة"],
"J0uRhj": ["مهارة التحقق"],
"J1XRO3": ["ألوان السمة"],
+ "J2-D_a": ["مضيفو GitHub Enterprise Server"],
"J2Mv98": ["الاسم (مثل ", ["login"], ")"],
"J2_JuX": ["لا شيء (", ["0"], " لا يمكن أن يطابق مستندًا)"],
"J2eKUI": ["ملف"],
@@ -2561,6 +2575,9 @@
],
"Pg83C9": ["تم رفع «", ["0"], "»."],
"PgJDqs": ["أظهر بطاقة معاينة عند تمرير المؤشر فوق رابط خارجي في المحرر."],
+ "PgY2nN": [
+ "إذا كنت تستخدم GitHub Enterprise Server، فأضف مضيفه هنا حتى يتمكن OpenKnowledge من تسجيل الدخول، والتحقق من إذن الدفع، وإنشاء روابط مشاركة للمستودعات المستضافة عليه."
+ ],
"Pgu10b": ["حُفظ باسم <0>", ["slug"], ".md</0>"],
"PgzIpb": ["انتقل إلى نتيجة البحث السابقة في المحرر المرئي."],
"PhIa-X": ["هل تستبدل هذه النسخ بروابط رمزية إلى المصدر؟"],
@@ -2620,6 +2637,7 @@
"QWdKwH": ["نقل"],
"QYTOaN": ["يمكنك تغيير هذا لاحقًا من <0>الإعدادات ← المزامنة</0>."],
"QYfQdv": ["واجهة ", ["displayName"], " السطرية"],
+ "Qbf7Q4": ["إضافة مضيف"],
"QcTjRP": ["تحتفظ هذه المحادثة بالنافذة التي بدأت بها. يمكن لمحادثة جديدة استخدام نافذة أخرى."],
"Qca--K": [
"برنامج آخر يستخدم Git هنا — انتظر حتى ينتهي، ثم أعد المزامنة (يحتجز <0>.git/index.lock</0>)"
@@ -2655,6 +2673,7 @@
"الصدفة الحقيقية معطّلة لهذا المشروع. تشغيلها يجعل الأوامر تُنفَّذ بكامل صلاحيات حساب المستخدم الخاص بك."
],
"QqBQu1": ["التسمية <0>(نص الرابط الظاهر)</0>"],
+ "QsnBxE": ["هذا ليس اسم مضيف صالحًا. أدخل اسم الخادم فقط، مثل github.example.com."],
"Qvls7J": ["مواصفات هندسية"],
"Qw-7Ie": [
"مكان بسيط للكتابة، بملف واحد لكل موضوع ويومية يومية. اختر هذا إن أردت البدء بالكتابة فحسب وترك الروابط بين الملاحظات تتكوّن مع الوقت."
@@ -2981,6 +3000,7 @@
]
],
"UIjjFa": ["اطلع على ما سيُضاف"],
+ "UK3GW4": ["يُتعرَّف على github.com دائمًا، لذا لا حاجة إلى إضافته."],
"UL-9ej": ["فتح OpenKnowledge المعاينة المباشرة"],
"UL8A9w": ["وسم"],
"UMT9C9": ["كيفية استخدام OpenKnowledge وأدوات MCP الخاصة به."],
@@ -3263,6 +3283,9 @@
"XAyxsa": ["سحب فرع بعيد"],
"XBBZnv": ["هدف الرابط \"", ["shown"], "\" لا يشير إلى مستند موجود."],
"XBgr2S": ["النسخ إلى هنا"],
+ "XBpH6-": [
+ "لم يعثر OpenKnowledge على اسم مضيف في المستودع البعيد لـ git الخاص بهذا المشروع، لذا لا يمكنه تحديد خادم GitHub الذي يجب تسجيل الدخول إليه."
+ ],
"XDzAnp": ["يفتح في تبويب جديد"],
"XF1kgP": ["كل ما من ", ["source"], " محدّث بالفعل"],
"XGKy1z": ["تعذّر إظهار الصورة"],
@@ -3820,6 +3843,7 @@
"cEoyWz": ["إضافة عنصر إلى ", ["keyName"]],
"cF9DyA": ["يجري إعادة الاتصال بعد إعادة تشغيل الخادم"],
"cFCKYZ": ["رفض"],
+ "cFONFy": ["أدخل اسم مضيف، مثل github.example.com."],
"cFSbbh": ["خاص بهذا الجهاز. ينطبق على كل مشروع تفتحه هنا ولا يُشارك مع المتعاونين أبدًا."],
"cH0dkG": ["كان ينقصه ميزة أحتاجها"],
"cHhH3i": ["أداة git مطلوبة"],
@@ -3836,6 +3860,7 @@
"cNvGbn": ["تعديل وإعادة الإرسال"],
"cOJyVj": ["تعطيل السمات"],
"cOSAfL": ["لم يُعثر على مستودعات في حساب GitHub الخاص بك."],
+ "cOX1Cj": ["مضيف git"],
"cOrTMo": ["رابط المشاركة الخاص بك جاهز أدناه."],
"cPAWbl": ["أُرسل بالبريد"],
"cPgQ_i": [
@@ -6172,6 +6197,7 @@
"x57cJf": ["فتح الرابط"],
"xAlHfe": [["basename"], " — محرر نصوص"],
"xBFg6z": ["من إضافة ", ["0"]],
+ "xBjIs7": ["تسجيل الدخول إلى GitHub غير متاح لهذا المشروع"],
"xCJdfg": ["مسح"],
"xCdTnb": ["إغلاق التبويب الجديد"],
"xD4Xm2": ["جلب"],
@@ -6203,6 +6229,7 @@
"xOTzt5": ["الآن"],
"xSVO3J": ["ما الذي يُنشأ"],
"xV5sXw": ["قبل ", ["0"], " أسبوع"],
+ "xVMoYb": ["إزالة ", ["host"]],
"xW5AUw": ["تم السحب ", ["pulled"]],
"xW7KK3": [
"يوجد بالفعل شيء باسم “",
diff --git a/packages/app/src/locales/ar/messages.po b/packages/app/src/locales/ar/messages.po
index 4a7a67767..23100320a 100644
--- a/packages/app/src/locales/ar/messages.po
+++ b/packages/app/src/locales/ar/messages.po
@@ -1624,6 +1624,10 @@ msgstr "إضافة تعليق"
msgid "Add a file name (e.g. notes.md)"
msgstr "أضف اسم ملف (مثل notes.md)"
+#: src/components/settings/EnterpriseHostsSection.tsx
+msgid "Add a host"
+msgstr "إضافة مضيف"
+
#: src/components/settings/SearchSection.tsx
msgid "Add a key"
msgstr "إضافة مفتاح"
@@ -1677,6 +1681,10 @@ msgstr "إضافة حقل"
msgid "Add file or folder pattern, e.g. guides/**/*"
msgstr "أضف نمط ملف أو مجلد، مثل guides/**/*"
+#: src/components/settings/EnterpriseHostsSection.tsx
+msgid "Add host"
+msgstr "إضافة المضيف"
+
#: src/components/SeedRootPicker.tsx
msgid "Add it directly to this project."
msgstr "أضفه مباشرةً إلى هذا المشروع."
@@ -5793,6 +5801,10 @@ msgstr "أدخل قيمة ست عشرية من 6 خانات مثل #1A2B3C"
msgid "Enter a folder name (e.g. brain)."
msgstr "أدخل اسم مجلد (مثل brain)."
+#: src/components/settings/EnterpriseHostsSection.tsx
+msgid "Enter a hostname, such as github.example.com."
+msgstr "أدخل اسم مضيف، مثل github.example.com."
+
#: src/components/settings/SavedThemesTiles.tsx
msgid "Enter a name for this theme."
msgstr "أدخل اسمًا لهذه السمة."
@@ -5845,6 +5857,11 @@ msgstr "أدخل 3 أحرف على الأقل للبحث حسب المعنى."
msgid "Enter the public origin your tunnel serves, for example https://notes.example.com"
msgstr "أدخل الأصل العام الذي يخدمه النفق الخاص بك، على سبيل المثال https://notes.example.com"
+#: src/components/settings/SettingsDialogShell.tsx
+msgctxt "settings search keyword"
+msgid "enterprise"
+msgstr "المؤسسات"
+
#: src/components/settings/ContentRulesSection.tsx
msgid "Error"
msgstr "خطأ"
@@ -6776,6 +6793,11 @@ msgstr "ابدأ الإعداد"
msgid "Gets the link that opens this project or a document in the app"
msgstr "يحصل على الرابط الذي يفتح هذا المشروع أو مستندًا في التطبيق"
+#: src/components/settings/SettingsDialogShell.tsx
+msgctxt "settings search keyword"
+msgid "GHES"
+msgstr "GHES"
+
#: src/components/ExploreSkills.tsx
msgid "Git & PRs"
msgstr "Git وطلبات السحب"
@@ -6788,6 +6810,11 @@ msgstr "لا يستطيع Git تتبع هذا المجلد — فهو فارغ
msgid "Git has locked this worktree, but it can still be opened."
msgstr "قام Git بقفل شجرة العمل هذه، ولكن لا يزال من الممكن فتحها."
+#: src/components/settings/SettingsDialogShell.tsx
+msgctxt "settings search keyword"
+msgid "git host"
+msgstr "مضيف git"
+
#: src/components/SyncStatusBadge.tsx
msgid "Git identity isn't set — commits use a default author. Set yours so teammates see your name."
msgstr "هوية Git غير مضبوطة — تستخدم الإيداعات مؤلفًا افتراضيًا. اضبط هويتك ليرى زملاؤك اسمك."
@@ -6829,14 +6856,27 @@ msgstr "انتهت صلاحية الاتصال بـ GitHub. أعد الاتصا
msgid "GitHub denied the request. You may need to authorize OpenKnowledge for {owner} in your browser."
msgstr "رفض GitHub الطلب. قد تحتاج إلى منح OpenKnowledge إذنًا لـ {owner} من متصفحك."
+#: src/components/settings/EnterpriseHostsSection.tsx
+#: src/components/settings/SettingsDialogShell.tsx
+msgid "GitHub Enterprise Server hosts"
+msgstr "مضيفو GitHub Enterprise Server"
+
#: src/components/SyncStatusBadge.tsx
msgid "GitHub sign-in is missing or expired. Reconnect to resume syncing."
msgstr "تسجيل الدخول إلى GitHub مفقود أو منتهي الصلاحية. أعد الاتصال لاستئناف المزامنة."
+#: src/components/settings/AccountSection.tsx
+msgid "GitHub sign-in isn't available for this project"
+msgstr "تسجيل الدخول إلى GitHub غير متاح لهذا المشروع"
+
#: src/components/ImportSkillForm.tsx
msgid "GitHub, a git URL, or a local path."
msgstr "GitHub، أو رابط git، أو مسار محلي."
+#: src/components/settings/EnterpriseHostsSection.tsx
+msgid "github.com is always recognized, so it doesn't need to be added."
+msgstr "يُتعرَّف على github.com دائمًا، لذا لا حاجة إلى إضافته."
+
#: src/components/settings/SavedThemesTiles.tsx
msgid "Give it a name before editing its colors."
msgstr "امنحها اسمًا قبل تعديل ألوانها."
@@ -7300,6 +7340,10 @@ msgstr "إذا لم يعرض {agent} أدوات OpenKnowledge، فشغّله ف
msgid "If an update arrives for something you are editing, you choose which version to keep, like a merge conflict."
msgstr "إذا وصل تحديث لشيء تحرّره، فأنت من يختار أي نسخة يُبقي، مثل تعارض الدمج."
+#: src/components/settings/EnterpriseHostsSection.tsx
+msgid "If you use a GitHub Enterprise Server, add its host here so OpenKnowledge can sign in, check push permission, and create share links for repositories hosted there."
+msgstr "إذا كنت تستخدم GitHub Enterprise Server، فأضف مضيفه هنا حتى يتمكن OpenKnowledge من تسجيل الدخول، والتحقق من إذن الدفع، وإنشاء روابط مشاركة للمستودعات المستضافة عليه."
+
#: src/components/settings/ContentRulesSection.tsx
msgid "Ignore broken links in log.md"
msgstr "تجاهل الروابط المعطلة في log.md"
@@ -9291,6 +9335,10 @@ msgstr "لا توجد تعديلات بعد."
msgid "No emoji found."
msgstr "لم يُعثر على رموز تعبيرية."
+#: src/components/settings/EnterpriseHostsSection.tsx
+msgid "No Enterprise hosts added. Only github.com is treated as GitHub."
+msgstr "لم تتم إضافة أي مضيف Enterprise. يُعامَل github.com وحده على أنه GitHub."
+
#: src/editor/link-preview/InternalDocPreviewCard.tsx
msgid "No excerpt"
msgstr "لا يوجد مقتطف"
@@ -10215,6 +10263,10 @@ msgstr "تحقق OpenKnowledge من المشروع"
msgid "OpenKnowledge could not find this agent on this machine."
msgstr "لم يتمكن OpenKnowledge من العثور على هذا الوكيل على هذا الجهاز."
+#: src/components/settings/AccountSection.tsx
+msgid "OpenKnowledge couldn't find a host name in this project's git remote, so it can't tell which GitHub server to sign in to."
+msgstr "لم يعثر OpenKnowledge على اسم مضيف في المستودع البعيد لـ git الخاص بهذا المشروع، لذا لا يمكنه تحديد خادم GitHub الذي يجب تسجيل الدخول إليه."
+
#: src/lib/worktree-create-error.ts
msgid "OpenKnowledge couldn't finish setting up this project. The worktree was created but not opened."
msgstr "تعذر على OpenKnowledge إكمال إعداد هذا المشروع. تم إنشاء شجرة العمل ولكن لم يتم فتحها."
@@ -11584,6 +11636,10 @@ msgstr "إزالة {chip}"
msgid "Remove {fullLabel} from context"
msgstr "إزالة {fullLabel} من السياق"
+#: src/components/settings/EnterpriseHostsSection.tsx
+msgid "Remove {host}"
+msgstr "إزالة {host}"
+
#: src/components/FrontmatterRow.tsx
msgid "Remove {keyName}"
msgstr "إزالة {keyName}"
@@ -12351,6 +12407,10 @@ msgstr "حُفظ في"
msgid "Saved with the project for your team."
msgstr "يُحفظ مع المشروع لفريقك."
+#: src/components/settings/EnterpriseHostsSection.tsx
+msgid "Saved. Restart OpenKnowledge to apply the change."
+msgstr "تم الحفظ. أعد تشغيل OpenKnowledge لتطبيق التغيير."
+
#: src/lib/acp/tool-call-display.ts
msgid "Saves a restore point for every document in the project"
msgstr "يحفظ نقطة استعادة لكل مستند في المشروع"
@@ -14220,6 +14280,14 @@ msgstr "يحتوي هذا المجلد بالفعل على شيفرة لم تك
msgid "That folder isn't an OpenKnowledge project yet. Initialize it and open?"
msgstr "ذلك المجلد ليس مشروع OpenKnowledge بعد. هل تهيّئه وتفتحه؟"
+#: src/components/settings/EnterpriseHostsSection.tsx
+msgid "That host is already in the list."
+msgstr "هذا المضيف موجود بالفعل في القائمة."
+
+#: src/components/settings/EnterpriseHostsSection.tsx
+msgid "That isn't a valid hostname. Enter just the server name, such as github.example.com."
+msgstr "هذا ليس اسم مضيف صالحًا. أدخل اسم الخادم فقط، مثل github.example.com."
+
#: src/components/settings/SpellcheckLanguagesRow.tsx
msgid "That language isn't available for spell checking."
msgstr "هذه اللغة غير متاحة للتدقيق الإملائي."
@@ -15104,6 +15172,10 @@ msgstr "هذا المشروع ليس مستودع git، لذا أشجار الع
msgid "This project lives only on this computer. Connect it to GitHub to back it up and share it with other people."
msgstr "يعيش هذا المشروع على هذا الجهاز وحده. اربطه بـ GitHub لنسخه احتياطيًا ومشاركته مع آخرين."
+#: src/components/settings/AccountSection.tsx
+msgid "This project's git remote is on {host}, which OpenKnowledge doesn't recognize as a GitHub host. If {host} runs GitHub Enterprise Server, add it to GitHub Enterprise Server hosts below, then restart OpenKnowledge."
+msgstr "المستودع البعيد لـ git الخاص بهذا المشروع موجود على {host}، ولا يتعرّف عليه OpenKnowledge كمضيف GitHub. إذا كان {host} يشغّل GitHub Enterprise Server، فأضفه في مضيفو GitHub Enterprise Server أدناه، ثم أعد تشغيل OpenKnowledge."
+
#: src/components/DocumentErrorBoundary.tsx
msgid "This project's running server doesn't support live editing. Restart OpenKnowledge to fix."
msgstr "لا يدعم خادم هذا المشروع العامل التحرير الحي. أعد تشغيل OpenKnowledge للإصلاح."
diff --git a/packages/app/src/locales/bn/messages.json b/packages/app/src/locales/bn/messages.json
index eaea2f5de..18713b150 100644
--- a/packages/app/src/locales/bn/messages.json
+++ b/packages/app/src/locales/bn/messages.json
@@ -223,6 +223,7 @@
"1ruosn": ["OpenKnowledge"],
"1t_NnN": ["প্রত্যাখ্যান করুন"],
"1u-mAI": ["সিঙ্ক শুরু করা যায়নি। আপনার সংযোগ দেখুন, তারপর আবার চেষ্টা করুন।"],
+ "1uEVfp": ["এন্টারপ্রাইজ"],
"1vczDE": [["displayName"], " Desktop খুলুন"],
"1vn0CI": ["সার্ভারের প্রতিক্রিয়া অবৈধ"],
"1xui0Q": ["স্থানীয় ফাইল লোড করতে ব্যর্থ"],
@@ -333,6 +334,7 @@
")"
],
"3LbBJn": ["ছবি সংযুক্ত করুন"],
+ "3LuFP-": ["সংরক্ষিত হয়েছে। পরিবর্তন প্রয়োগ করতে OpenKnowledge আবার চালু করুন।"],
"3MA3Hh": [["gitignorePath"], " নিয়ম পড়া যায়নি: ", ["previewError"]],
"3MnvrL": ["শীর্ষ ", ["0"], "টি মিল দেখানো হচ্ছে — সংকীর্ণ করতে লিখতে থাকুন"],
"3Mwaly": [["0"], " চালু করা যায়নি।"],
@@ -689,6 +691,13 @@
"7YRrJ9": [
"OpenKnowledge ডেস্কটপ অ্যাপে পাওয়া যায়। টার্মিনাল থেকে <0> ok config-sharing status</0> / <1>share</1> / <2>unshare</2> ব্যবহার করুন।"
],
+ "7_I248": [
+ "এই প্রজেক্টের git রিমোট ",
+ ["host"],
+ "-এ আছে, যাকে OpenKnowledge GitHub হোস্ট হিসেবে চেনে না। ",
+ ["host"],
+ "-এ যদি GitHub Enterprise Server চলে, তবে নিচের GitHub Enterprise Server হোস্ট অংশে এটি যোগ করুন, তারপর OpenKnowledge আবার চালু করুন।"
+ ],
"7_bFEL": ["ক্রম বদলাতে ", ["patternText"], " টেনে আনুন"],
"7a0YcF": ["শুরু করতে <0>স্পেস</0> চাপুন বা blob-এ ট্যাপ করুন"],
"7aNk5D": ["OpenKnowledge ", ["subject"], " সম্পাদনা করেছে"],
@@ -910,6 +919,7 @@
"AItsE5": ["সেটি সেখানেই খুলুন"],
"AJ7_B2": ["নতুন থিম তৈরি করুন"],
"AKxFtn": [["openedWorktreeCount", "plural", { "one": ["ওয়ার্কট্রি"], "other": ["ওয়ার্কট্রি"] }]],
+ "ALFlyF": ["হোস্ট যোগ করুন"],
"ALhMYW": ["টার্মিনাল"],
"AMU00p": [
"দুটি সংস্করণ অভিন্ন। বর্তমানটি গ্রহণ করুন বেছে নিলে OpenKnowledge-এর সুরক্ষা চালু থাকে, ফলে পুরোনো সংস্করণের আরেকটি সেভ আবার প্রত্যাখ্যান করা হবে। আগতটি গ্রহণ করুন বেছে নিলে সেই সুরক্ষা বন্ধ হয়ে যায়।"
@@ -1136,6 +1146,7 @@
"DDTdLl": ["কোড ব্লক সেটিং"],
"DELNQk": ["সহযোগীরা সিঙ্ক হওয়ামাত্রই আপনার চলমান সম্পাদনা দেখতে পান।"],
"DEWDbv": ["চিত্র দেখান"],
+ "DEkRZA": ["এই হোস্টটি ইতিমধ্যে তালিকায় আছে।"],
"DF1MtZ": [["filePath"], "-এর দ্বন্দ্ব লোড হচ্ছে"],
"DFQ2Sj": ["পরবর্তী যোগাযোগের ইমেইল"],
"DFfRbX": ["সিঙ্কের অবস্থা: ", ["syncStateLabel"], " — git পরিচয় নির্ধারিত নয়"],
@@ -1198,6 +1209,7 @@
"Dvr1Sg": ["কপি করা হচ্ছে"],
"Dvvrs8": [["0"], " সেই কনটেক্সট উইন্ডোতে পুনরায় চালু হতে পারেনি। ফিরিয়ে আনতে আবার চেষ্টা করুন।"],
"Dvwa0U": ["এই ব্রাঞ্চ থেকে একটি ওয়ার্কট্রি তৈরি করুন"],
+ "Dwu3RL": ["GHES"],
"Dz7fsq": ["বড় করুন"],
"E-G19G": [
"পোর্ট ",
@@ -1530,6 +1542,7 @@
"HHQcx0": ["একটি স্কিলকে আরও জায়গায় উপলব্ধ করে, বা কোনো একটি থেকে সরিয়ে দেয়"],
"HIb0vl": ["নেটওয়ার্ক ত্রুটি — অনুগ্রহ করে আবার চেষ্টা করুন"],
"HJ7aHU": ["বর্তমান ব্লকটি উপরে বা নিচে সরান। তালিকায়, বর্তমান আইটেম বা নির্বাচিত আইটেমগুলি সরান।"],
+ "HK2eIK": ["কোনো Enterprise হোস্ট যোগ করা হয়নি। শুধু github.com-কে GitHub হিসেবে ধরা হয়।"],
"HKH-W-": ["তথ্য"],
"HLoO-Z": ["সার্ভার একটি ত্রুটিপূর্ণ গঠনের ইমপোর্ট প্রতিক্রিয়া ফেরত দিয়েছে।"],
"HM56Bx": ["তৈরি করা হচ্ছে…"],
@@ -1630,6 +1643,7 @@
"IxyZXD": ["স্ক্রিনশট"],
"J0uRhj": ["দক্ষতা পরীক্ষা করা"],
"J1XRO3": ["থিমের রং"],
+ "J2-D_a": ["GitHub Enterprise Server হোস্ট"],
"J2Mv98": ["নাম (যেমন ", ["login"], ")"],
"J2_JuX": ["কিছুই নয় (", ["0"], " কোনো নথির সঙ্গে মিলতে পারে না)"],
"J2eKUI": ["ফাইল"],
@@ -2187,6 +2201,9 @@
],
"Pg83C9": ["\"", ["0"], "\" আপলোড হয়েছে।"],
"PgJDqs": ["সম্পাদকে কোনো বাইরের লিংকের উপর মাউস নিলে একটি প্রাকদর্শন কার্ড দেখান।"],
+ "PgY2nN": [
+ "আপনি যদি GitHub Enterprise Server ব্যবহার করেন, তবে এখানে তার হোস্ট যোগ করুন, যাতে OpenKnowledge সাইন ইন করতে, push অনুমতি যাচাই করতে এবং সেখানে হোস্ট করা রিপোজিটরির জন্য শেয়ার লিংক তৈরি করতে পারে।"
+ ],
"Pgu10b": ["<0>", ["slug"], ".md</0> হিসেবে সংরক্ষিত"],
"PgzIpb": ["দৃশ্য-সম্পাদকের আগের খোঁজার ফলাফলে যান।"],
"PhIa-X": ["এই অনুলিপিগুলো উৎসের সিমলিংক দিয়ে বদলাবেন?"],
@@ -2247,6 +2264,7 @@
"QWdKwH": ["সরান"],
"QYTOaN": ["আপনি এটি পরে <0>Settings → Sync</0>-এ বদলাতে পারেন।"],
"QYfQdv": [["displayName"], " CLI"],
+ "Qbf7Q4": ["একটি হোস্ট যোগ করুন"],
"QcTjRP": ["এই কথোপকথন যে উইন্ডো দিয়ে শুরু হয়েছিল সেটিই রাখে। নতুন কথোপকথনে অন্য উইন্ডো ব্যবহার করা যায়।"],
"Qca--K": [
"অন্য একটি প্রোগ্রাম এখানে Git ব্যবহার করছে — সেটি শেষ হওয়া পর্যন্ত অপেক্ষা করুন, তারপর আবার সিঙ্ক করুন (এটি <0>.git/index.lock</0> ধরে রেখেছে)"
@@ -2272,6 +2290,7 @@
"এই প্রকল্পের জন্য আসল শেল বন্ধ আছে। চালু করলে কমান্ডগুলো আপনার ইউজার অ্যাকাউন্টের পূর্ণ অ্যাক্সেস নিয়ে চলে।"
],
"QqBQu1": ["লেবেল <0>(দৃশ্যমান লিংকের লেখা)</0>"],
+ "QsnBxE": ["এটি বৈধ হোস্টনেম নয়। শুধু সার্ভারের নাম লিখুন, যেমন github.example.com।"],
"Qvls7J": ["ইঞ্জিনিয়ারিং স্পেক"],
"Qw-7Ie": [
"লেখার জন্য একটি সহজ জায়গা, প্রতি বিষয়ে একটি ফাইল আর একটি দৈনিক জার্নাল নিয়ে। আপনি যদি কেবল লেখা শুরু করতে চান এবং সময়ের সঙ্গে নোটগুলোর মধ্যে যোগসূত্র গড়ে উঠতে দিতে চান, তবে এটি বাছুন।"
@@ -2542,6 +2561,7 @@
],
"UI0WPT": [["propertyCount", "plural", { "one": ["#", " প্রপার্টি"], "other": ["#", " প্রপার্টি"] }]],
"UIjjFa": ["কী যুক্ত হবে দেখুন"],
+ "UK3GW4": ["github.com সবসময় চেনা হয়, তাই এটি যোগ করার দরকার নেই।"],
"UL-9ej": ["OpenKnowledge সরাসরি প্রিভিউ খুলেছে"],
"UL8A9w": ["ট্যাগ"],
"UMT9C9": ["OpenKnowledge এবং এর MCP টুল কীভাবে ব্যবহার করবেন।"],
@@ -2763,6 +2783,9 @@
"XAyxsa": ["রিমোট ব্রাঞ্চ চেক আউট করুন"],
"XBBZnv": ["লিংকের লক্ষ্য \"", ["shown"], "\" কোনো বিদ্যমান নথিকে নির্দেশ করে না।"],
"XBgr2S": ["এখানে কপি করুন"],
+ "XBpH6-": [
+ "OpenKnowledge এই প্রজেক্টের git রিমোটে কোনো হোস্টনেম খুঁজে পায়নি, তাই কোন GitHub সার্ভারে সাইন ইন করতে হবে তা বুঝতে পারছে না।"
+ ],
"XDzAnp": ["নতুন ট্যাবে খোলে"],
"XF1kgP": [["source"], " থেকে সবকিছু ইতিমধ্যে আপ টু ডেট"],
"XGKy1z": ["ছবি দেখানো যায়নি"],
@@ -3271,6 +3294,7 @@
"cEoyWz": [["keyName"], "-এ আইটেম যোগ করুন"],
"cF9DyA": ["সার্ভার পুনরায় চালুর পর আবার যুক্ত হচ্ছে"],
"cFCKYZ": ["প্রত্যাখ্যান করুন"],
+ "cFONFy": ["একটি হোস্টনেম লিখুন, যেমন github.example.com।"],
"cFSbbh": [
"এই যন্ত্রেই সীমাবদ্ধ। এখানে আপনি যে প্রকল্পই খুলুন তাতেই প্রযোজ্য এবং কখনও সহযোগীদের সঙ্গে ভাগ করা হয় না।"
],
@@ -3290,6 +3314,7 @@
"cNvGbn": ["সম্পাদনা করে আবার পাঠান"],
"cOJyVj": ["থিম নিষ্ক্রিয় করুন"],
"cOSAfL": ["আপনার GitHub অ্যাকাউন্টে কোনো রিপোজিটরি পাওয়া যায়নি।"],
+ "cOX1Cj": ["git হোস্ট"],
"cOrTMo": ["আপনার শেয়ার লিংক নিচে প্রস্তুত।"],
"cPAWbl": ["ইমেইল করা হয়েছে"],
"cPgQ_i": [
@@ -5246,6 +5271,7 @@
"x57cJf": ["লিংক খুলুন"],
"xAlHfe": [["basename"], " — টেক্সট সম্পাদক"],
"xBFg6z": [["0"], " প্লাগইন থেকে"],
+ "xBjIs7": ["এই প্রজেক্টের জন্য GitHub সাইন-ইন উপলব্ধ নয়"],
"xCJdfg": ["মুছুন"],
"xCdTnb": ["নতুন ট্যাব বন্ধ করুন"],
"xD4Xm2": ["আনা"],
@@ -5266,6 +5292,7 @@
"xOTzt5": ["এইমাত্র"],
"xSVO3J": ["যা যা তৈরি হয়"],
"xV5sXw": [["0"], " সপ্তাহ আগে"],
+ "xVMoYb": [["host"], " সরান"],
"xW5AUw": [["pulled"], " টানা হয়েছে"],
"xW7KK3": [
["scopeLabel"],
diff --git a/packages/app/src/locales/bn/messages.po b/packages/app/src/locales/bn/messages.po
index 86c9b97f1..e10e571b2 100644
--- a/packages/app/src/locales/bn/messages.po
+++ b/packages/app/src/locales/bn/messages.po
@@ -1620,6 +1620,10 @@ msgstr "একটি মন্তব্য যোগ করুন"
msgid "Add a file name (e.g. notes.md)"
msgstr "একটি ফাইলের নাম যোগ করুন (যেমন notes.md)"
+#: src/components/settings/EnterpriseHostsSection.tsx
+msgid "Add a host"
+msgstr "একটি হোস্ট যোগ করুন"
+
#: src/components/settings/SearchSection.tsx
msgid "Add a key"
msgstr "একটি কী যোগ করুন"
@@ -1673,6 +1677,10 @@ msgstr "ফিল্ড যোগ করুন"
msgid "Add file or folder pattern, e.g. guides/**/*"
msgstr "ফাইল বা ফোল্ডার প্যাটার্ন যোগ করুন, যেমন guides/**/*"
+#: src/components/settings/EnterpriseHostsSection.tsx
+msgid "Add host"
+msgstr "হোস্ট যোগ করুন"
+
#: src/components/SeedRootPicker.tsx
msgid "Add it directly to this project."
msgstr "এটি সরাসরি এই প্রকল্পে যোগ করুন।"
@@ -5789,6 +5797,10 @@ msgstr "#1A2B3C-এর মতো ৬-অঙ্কের হেক্স দি
msgid "Enter a folder name (e.g. brain)."
msgstr "একটি ফোল্ডারের নাম দিন (যেমন brain)।"
+#: src/components/settings/EnterpriseHostsSection.tsx
+msgid "Enter a hostname, such as github.example.com."
+msgstr "একটি হোস্টনেম লিখুন, যেমন github.example.com।"
+
#: src/components/settings/SavedThemesTiles.tsx
msgid "Enter a name for this theme."
msgstr "এই থিমের জন্য একটি নাম লিখুন।"
@@ -5841,6 +5853,11 @@ msgstr "অর্থের ভিত্তিতে অনুসন্ধান
msgid "Enter the public origin your tunnel serves, for example https://notes.example.com"
msgstr "আপনার টানেল যে পাবলিক অরিজিন পরিবেশন করে তা লিখুন, উদাহরণস্বরূপ https://notes.example.com"
+#: src/components/settings/SettingsDialogShell.tsx
+msgctxt "settings search keyword"
+msgid "enterprise"
+msgstr "এন্টারপ্রাইজ"
+
#: src/components/settings/ContentRulesSection.tsx
msgid "Error"
msgstr "ত্রুটি"
@@ -6772,6 +6789,11 @@ msgstr "সেট আপ করুন"
msgid "Gets the link that opens this project or a document in the app"
msgstr "অ্যাপে এই প্রকল্প বা একটি নথি খোলার লিংক আনে"
+#: src/components/settings/SettingsDialogShell.tsx
+msgctxt "settings search keyword"
+msgid "GHES"
+msgstr "GHES"
+
#: src/components/ExploreSkills.tsx
msgid "Git & PRs"
msgstr "Git ও PR"
@@ -6784,6 +6806,11 @@ msgstr "Git এই ফোল্ডারের হিসাব রাখতে
msgid "Git has locked this worktree, but it can still be opened."
msgstr "Git এই ওয়ার্কট্রিটি লক করেছে, তবে এটি এখনও খোলা যাবে।"
+#: src/components/settings/SettingsDialogShell.tsx
+msgctxt "settings search keyword"
+msgid "git host"
+msgstr "git হোস্ট"
+
#: src/components/SyncStatusBadge.tsx
msgid "Git identity isn't set — commits use a default author. Set yours so teammates see your name."
msgstr "Git পরিচয় নির্ধারিত নেই — কমিটগুলো একটি ডিফল্ট লেখক ব্যবহার করে। আপনারটি নির্ধারণ করুন যাতে সহকর্মীরা আপনার নাম দেখতে পান।"
@@ -6825,14 +6852,27 @@ msgstr "GitHub সংযোগের মেয়াদ শেষ হয়ে
msgid "GitHub denied the request. You may need to authorize OpenKnowledge for {owner} in your browser."
msgstr "GitHub অনুরোধটি প্রত্যাখ্যান করেছে। আপনাকে হয়তো ব্রাউজারে {owner}-এর জন্য OpenKnowledge-কে অনুমতি দিতে হবে।"
+#: src/components/settings/EnterpriseHostsSection.tsx
+#: src/components/settings/SettingsDialogShell.tsx
+msgid "GitHub Enterprise Server hosts"
+msgstr "GitHub Enterprise Server হোস্ট"
+
#: src/components/SyncStatusBadge.tsx
msgid "GitHub sign-in is missing or expired. Reconnect to resume syncing."
msgstr "GitHub সাইন-ইন অনুপস্থিত বা এর মেয়াদ শেষ। সিঙ্ক আবার শুরু করতে পুনরায় যুক্ত হোন।"
+#: src/components/settings/AccountSection.tsx
+msgid "GitHub sign-in isn't available for this project"
+msgstr "এই প্রজেক্টের জন্য GitHub সাইন-ইন উপলব্ধ নয়"
+
#: src/components/ImportSkillForm.tsx
msgid "GitHub, a git URL, or a local path."
msgstr "GitHub, একটি git URL, বা একটি স্থানীয় পথ।"
+#: src/components/settings/EnterpriseHostsSection.tsx
+msgid "github.com is always recognized, so it doesn't need to be added."
+msgstr "github.com সবসময় চেনা হয়, তাই এটি যোগ করার দরকার নেই।"
+
#: src/components/settings/SavedThemesTiles.tsx
msgid "Give it a name before editing its colors."
msgstr "রং সম্পাদনা করার আগে এটিকে একটি নাম দিন।"
@@ -7296,6 +7336,10 @@ msgstr "{agent}-এ OpenKnowledge টুল না দেখালে, এটি
msgid "If an update arrives for something you are editing, you choose which version to keep, like a merge conflict."
msgstr "আপনি যা সম্পাদনা করছেন তার জন্য কোনো হালনাগাদ এলে আপনি বেছে নেন কোন সংস্করণটি রাখবেন, ঠিক মার্জ দ্বন্দ্বের মতো।"
+#: src/components/settings/EnterpriseHostsSection.tsx
+msgid "If you use a GitHub Enterprise Server, add its host here so OpenKnowledge can sign in, check push permission, and create share links for repositories hosted there."
+msgstr "আপনি যদি GitHub Enterprise Server ব্যবহার করেন, তবে এখানে তার হোস্ট যোগ করুন, যাতে OpenKnowledge সাইন ইন করতে, push অনুমতি যাচাই করতে এবং সেখানে হোস্ট করা রিপোজিটরির জন্য শেয়ার লিংক তৈরি করতে পারে।"
+
#: src/components/settings/ContentRulesSection.tsx
msgid "Ignore broken links in log.md"
msgstr "log.md-এ ভাঙা লিংক উপেক্ষা করুন"
@@ -9287,6 +9331,10 @@ msgstr "এখনও কোনো সম্পাদনা নেই।"
msgid "No emoji found."
msgstr "কোনো ইমোজি পাওয়া যায়নি।"
+#: src/components/settings/EnterpriseHostsSection.tsx
+msgid "No Enterprise hosts added. Only github.com is treated as GitHub."
+msgstr "কোনো Enterprise হোস্ট যোগ করা হয়নি। শুধু github.com-কে GitHub হিসেবে ধরা হয়।"
+
#: src/editor/link-preview/InternalDocPreviewCard.tsx
msgid "No excerpt"
msgstr "কোনো উদ্ধৃতাংশ নেই"
@@ -10211,6 +10259,10 @@ msgstr "OpenKnowledge প্রকল্প পরীক্ষা করেছ
msgid "OpenKnowledge could not find this agent on this machine."
msgstr "OpenKnowledge এই মেশিনে এই এজেন্টটি খুঁজে পায়নি।"
+#: src/components/settings/AccountSection.tsx
+msgid "OpenKnowledge couldn't find a host name in this project's git remote, so it can't tell which GitHub server to sign in to."
+msgstr "OpenKnowledge এই প্রজেক্টের git রিমোটে কোনো হোস্টনেম খুঁজে পায়নি, তাই কোন GitHub সার্ভারে সাইন ইন করতে হবে তা বুঝতে পারছে না।"
+
#: src/lib/worktree-create-error.ts
msgid "OpenKnowledge couldn't finish setting up this project. The worktree was created but not opened."
msgstr "OpenKnowledge এই প্রজেক্টের সেটআপ শেষ করতে পারেনি। ওয়ার্কট্রি তৈরি হয়েছে, কিন্তু খোলা হয়নি।"
@@ -11580,6 +11632,10 @@ msgstr "{chip} সরান"
msgid "Remove {fullLabel} from context"
msgstr "{fullLabel} প্রসঙ্গ থেকে সরান"
+#: src/components/settings/EnterpriseHostsSection.tsx
+msgid "Remove {host}"
+msgstr "{host} সরান"
+
#: src/components/FrontmatterRow.tsx
msgid "Remove {keyName}"
msgstr "{keyName} সরান"
@@ -12347,6 +12403,10 @@ msgstr "যেখানে সংরক্ষিত"
msgid "Saved with the project for your team."
msgstr "আপনার দলের জন্য প্রকল্পের সঙ্গে সংরক্ষিত।"
+#: src/components/settings/EnterpriseHostsSection.tsx
+msgid "Saved. Restart OpenKnowledge to apply the change."
+msgstr "সংরক্ষিত হয়েছে। পরিবর্তন প্রয়োগ করতে OpenKnowledge আবার চালু করুন।"
+
#: src/lib/acp/tool-call-display.ts
msgid "Saves a restore point for every document in the project"
msgstr "প্রকল্পের প্রতিটি নথির জন্য একটি পুনরুদ্ধার বিন্দু সংরক্ষণ করে"
@@ -14216,6 +14276,14 @@ msgstr "ওই ফোল্ডারে ইতিমধ্যেই এমন
msgid "That folder isn't an OpenKnowledge project yet. Initialize it and open?"
msgstr "ওই ফোল্ডারটি এখনও একটি OpenKnowledge প্রকল্প নয়। এটি চালু করে খুলবেন?"
+#: src/components/settings/EnterpriseHostsSection.tsx
+msgid "That host is already in the list."
+msgstr "এই হোস্টটি ইতিমধ্যে তালিকায় আছে।"
+
+#: src/components/settings/EnterpriseHostsSection.tsx
+msgid "That isn't a valid hostname. Enter just the server name, such as github.example.com."
+msgstr "এটি বৈধ হোস্টনেম নয়। শুধু সার্ভারের নাম লিখুন, যেমন github.example.com।"
+
#: src/components/settings/SpellcheckLanguagesRow.tsx
msgid "That language isn't available for spell checking."
msgstr "সেই ভাষাটি বানান পরীক্ষার জন্য উপলব্ধ নয়।"
@@ -15100,6 +15168,10 @@ msgstr "এই প্রকল্পটি একটি git রিপোজি
msgid "This project lives only on this computer. Connect it to GitHub to back it up and share it with other people."
msgstr "এই প্রকল্পটি কেবল এই কম্পিউটারেই আছে। এর ব্যাকআপ রাখতে ও অন্যদের সঙ্গে ভাগ করতে এটি GitHub-এর সঙ্গে যুক্ত করুন।"
+#: src/components/settings/AccountSection.tsx
+msgid "This project's git remote is on {host}, which OpenKnowledge doesn't recognize as a GitHub host. If {host} runs GitHub Enterprise Server, add it to GitHub Enterprise Server hosts below, then restart OpenKnowledge."
+msgstr "এই প্রজেক্টের git রিমোট {host}-এ আছে, যাকে OpenKnowledge GitHub হোস্ট হিসেবে চেনে না। {host}-এ যদি GitHub Enterprise Server চলে, তবে নিচের GitHub Enterprise Server হোস্ট অংশে এটি যোগ করুন, তারপর OpenKnowledge আবার চালু করুন।"
+
#: src/components/DocumentErrorBoundary.tsx
msgid "This project's running server doesn't support live editing. Restart OpenKnowledge to fix."
msgstr "এই প্রকল্পের চলমান সার্ভার সরাসরি সম্পাদনা সমর্থন করে না। ঠিক করতে OpenKnowledge পুনরায় চালু করুন।"
diff --git a/packages/app/src/locales/en/messages.json b/packages/app/src/locales/en/messages.json
index 6084ad4e7..4945226ad 100644
--- a/packages/app/src/locales/en/messages.json
+++ b/packages/app/src/locales/en/messages.json
@@ -230,6 +230,7 @@
"1ruosn": ["OpenKnowledge"],
"1t_NnN": ["Reject"],
"1u-mAI": ["Couldn't start the sync. Check your connection, then retry."],
+ "1uEVfp": ["enterprise"],
"1vczDE": ["Open ", ["displayName"], " Desktop"],
"1vn0CI": ["Invalid server response"],
"1xui0Q": ["Failed to load local files"],
@@ -342,6 +343,7 @@
")"
],
"3LbBJn": ["Attach images"],
+ "3LuFP-": ["Saved. Restart OpenKnowledge to apply the change."],
"3MA3Hh": ["Couldn't read the ", ["gitignorePath"], " rule: ", ["previewError"]],
"3MnvrL": ["Showing top ", ["0"], " matches — keep typing to narrow"],
"3Mwaly": ["Could not initialize ", ["0"], "."],
@@ -703,6 +705,13 @@
"7YRrJ9": [
"Available in the OpenKnowledge desktop app. From a terminal, use<0> ok config-sharing status</0> / <1>share</1> / <2>unshare</2>."
],
+ "7_I248": [
+ "This project's git remote is on ",
+ ["host"],
+ ", which OpenKnowledge doesn't recognize as a GitHub host. If ",
+ ["host"],
+ " runs GitHub Enterprise Server, add it to GitHub Enterprise Server hosts below, then restart OpenKnowledge."
+ ],
"7_bFEL": ["Drag ", ["patternText"], " to reorder"],
"7a0YcF": ["Press <0>Space</0> or tap the blob to start"],
"7aNk5D": ["OpenKnowledge edited ", ["subject"]],
@@ -935,6 +944,7 @@
"AItsE5": ["Open it there"],
"AJ7_B2": ["Create new theme"],
"AKxFtn": [["openedWorktreeCount", "plural", { "one": ["worktree"], "other": ["worktrees"] }]],
+ "ALFlyF": ["Add host"],
"ALhMYW": ["Terminal"],
"AMU00p": [
"Both versions are identical. Choosing Accept current leaves OpenKnowledge's protection on, so another save of the older version is refused again. Choosing Accept incoming turns that protection off."
@@ -1174,6 +1184,7 @@
"DDTdLl": ["Code block settings"],
"DELNQk": ["Collaborators see your in-progress edits as soon as they sync."],
"DEWDbv": ["Show diagram"],
+ "DEkRZA": ["That host is already in the list."],
"DF1MtZ": ["Loading conflict for ", ["filePath"]],
"DFQ2Sj": ["Email for followups"],
"DFfRbX": ["Sync status: ", ["syncStateLabel"], " — git identity unset"],
@@ -1236,6 +1247,7 @@
"Dvr1Sg": ["Copying"],
"Dvvrs8": [["0"], " couldn't restart on that context window. Use Retry to bring it back."],
"Dvwa0U": ["Create a worktree from this branch"],
+ "Dwu3RL": ["GHES"],
"Dz7fsq": ["Zoom In"],
"E-G19G": [
"Port ",
@@ -1581,6 +1593,7 @@
"HJ7aHU": [
"Move the current block up or down. In lists, move the current item or selected items."
],
+ "HK2eIK": ["No Enterprise hosts added. Only github.com is treated as GitHub."],
"HKH-W-": ["Data"],
"HLoO-Z": ["Server returned a malformed import response."],
"HM56Bx": ["Creating..."],
@@ -1687,6 +1700,7 @@
"IxyZXD": ["Screenshot"],
"J0uRhj": ["Checking skill"],
"J1XRO3": ["Theme colors"],
+ "J2-D_a": ["GitHub Enterprise Server hosts"],
"J2Mv98": ["Name (e.g. ", ["login"], ")"],
"J2_JuX": ["nothing (", ["0"], " cannot match a doc)"],
"J2eKUI": ["File"],
@@ -2259,6 +2273,9 @@
"PezM4_": ["OpenKnowledge skill saved. Upload it in Claude Desktop, then click Cowork again."],
"Pg83C9": ["Uploaded \"", ["0"], "\"."],
"PgJDqs": ["Show a preview card when you hover an external link in the editor."],
+ "PgY2nN": [
+ "If you use a GitHub Enterprise Server, add its host here so OpenKnowledge can sign in, check push permission, and create share links for repositories hosted there."
+ ],
"Pgu10b": ["Saved as <0>", ["slug"], ".md</0>"],
"PgzIpb": ["Move to the previous visual-editor find result."],
"PhIa-X": ["Replace these copies with symlinks to the source?"],
@@ -2322,6 +2339,7 @@
"QWdKwH": ["Move"],
"QYTOaN": ["You can change this later in <0>Settings → Sync</0>."],
"QYfQdv": [["displayName"], " CLI"],
+ "Qbf7Q4": ["Add a host"],
"QcTjRP": [
"This conversation keeps the window it started with. A new chat can use a different one."
],
@@ -2348,6 +2366,9 @@
"A real shell is off for this project. Turning it on runs commands with the full access of your user account."
],
"QqBQu1": ["Label <0>(visible link text)</0>"],
+ "QsnBxE": [
+ "That isn't a valid hostname. Enter just the server name, such as github.example.com."
+ ],
"Qvls7J": ["Eng specs"],
"Qw-7Ie": [
"A simple place to write, with one file per topic and a daily journal. Pick this if you just want to start writing and let the links between notes build up over time."
@@ -2621,6 +2642,7 @@
["propertyCount", "plural", { "one": ["#", " property"], "other": ["#", " properties"] }]
],
"UIjjFa": ["See what's added"],
+ "UK3GW4": ["github.com is always recognized, so it doesn't need to be added."],
"UL-9ej": ["OpenKnowledge opened the live preview"],
"UL8A9w": ["Tag"],
"UMT9C9": ["How to use OpenKnowledge and its MCP tools."],
@@ -2844,6 +2866,9 @@
"XAyxsa": ["Check out remote branch"],
"XBBZnv": ["Link target \"", ["shown"], "\" does not resolve to an existing document."],
"XBgr2S": ["Copy in"],
+ "XBpH6-": [
+ "OpenKnowledge couldn't find a host name in this project's git remote, so it can't tell which GitHub server to sign in to."
+ ],
"XDzAnp": ["Opens in a new tab"],
"XF1kgP": ["Everything from ", ["source"], " is already up to date"],
"XGKy1z": ["Image couldn't be displayed"],
@@ -3357,6 +3382,7 @@
"cEoyWz": ["Add item to ", ["keyName"]],
"cF9DyA": ["Reconnecting after server restart"],
"cFCKYZ": ["Deny"],
+ "cFONFy": ["Enter a hostname, such as github.example.com."],
"cFSbbh": [
"Personal to this device. Applies to every project you open here and is never shared with collaborators."
],
@@ -3378,6 +3404,7 @@
"cNvGbn": ["Edit and resend"],
"cOJyVj": ["Disable Themes"],
"cOSAfL": ["No repositories found on your GitHub account."],
+ "cOX1Cj": ["git host"],
"cOrTMo": ["Your share link is ready below."],
"cPAWbl": ["Emailed"],
"cPgQ_i": [
@@ -5450,6 +5477,7 @@
"x57cJf": ["Open link"],
"xAlHfe": [["basename"], " — text editor"],
"xBFg6z": ["From the ", ["0"], " plugin"],
+ "xBjIs7": ["GitHub sign-in isn't available for this project"],
"xCJdfg": ["Clear"],
"xCdTnb": ["Close new tab"],
"xD4Xm2": ["Fetch"],
@@ -5468,6 +5496,7 @@
"xOTzt5": ["just now"],
"xSVO3J": ["What gets created"],
"xV5sXw": [["0"], "w ago"],
+ "xVMoYb": ["Remove ", ["host"]],
"xW5AUw": ["Pulled ", ["pulled"]],
"xW7KK3": [
"Something named \"",
diff --git a/packages/app/src/locales/en/messages.po b/packages/app/src/locales/en/messages.po
index d600d09f7..e64bd1c7e 100644
--- a/packages/app/src/locales/en/messages.po
+++ b/packages/app/src/locales/en/messages.po
@@ -1624,6 +1624,10 @@ msgstr "Add a comment"
msgid "Add a file name (e.g. notes.md)"
msgstr "Add a file name (e.g. notes.md)"
+#: src/components/settings/EnterpriseHostsSection.tsx
+msgid "Add a host"
+msgstr "Add a host"
+
#: src/components/settings/SearchSection.tsx
msgid "Add a key"
msgstr "Add a key"
@@ -1677,6 +1681,10 @@ msgstr "Add field"
msgid "Add file or folder pattern, e.g. guides/**/*"
msgstr "Add file or folder pattern, e.g. guides/**/*"
+#: src/components/settings/EnterpriseHostsSection.tsx
+msgid "Add host"
+msgstr "Add host"
+
#: src/components/SeedRootPicker.tsx
msgid "Add it directly to this project."
msgstr "Add it directly to this project."
@@ -5793,6 +5801,10 @@ msgstr "Enter a 6-digit hex like #1A2B3C"
msgid "Enter a folder name (e.g. brain)."
msgstr "Enter a folder name (e.g. brain)."
+#: src/components/settings/EnterpriseHostsSection.tsx
+msgid "Enter a hostname, such as github.example.com."
+msgstr "Enter a hostname, such as github.example.com."
+
#: src/components/settings/SavedThemesTiles.tsx
msgid "Enter a name for this theme."
msgstr "Enter a name for this theme."
@@ -5845,6 +5857,11 @@ msgstr "Enter at least 3 characters to search by meaning."
msgid "Enter the public origin your tunnel serves, for example https://notes.example.com"
msgstr "Enter the public origin your tunnel serves, for example https://notes.example.com"
+#: src/components/settings/SettingsDialogShell.tsx
+msgctxt "settings search keyword"
+msgid "enterprise"
+msgstr "enterprise"
+
#: src/components/settings/ContentRulesSection.tsx
msgid "Error"
msgstr "Error"
@@ -6776,6 +6793,11 @@ msgstr "Get set up"
msgid "Gets the link that opens this project or a document in the app"
msgstr "Gets the link that opens this project or a document in the app"
+#: src/components/settings/SettingsDialogShell.tsx
+msgctxt "settings search keyword"
+msgid "GHES"
+msgstr "GHES"
+
#: src/components/ExploreSkills.tsx
msgid "Git & PRs"
msgstr "Git & PRs"
@@ -6788,6 +6810,11 @@ msgstr "Git can't track this folder — it's empty or contains only ignored file
msgid "Git has locked this worktree, but it can still be opened."
msgstr "Git has locked this worktree, but it can still be opened."
+#: src/components/settings/SettingsDialogShell.tsx
+msgctxt "settings search keyword"
+msgid "git host"
+msgstr "git host"
+
#: src/components/SyncStatusBadge.tsx
msgid "Git identity isn't set — commits use a default author. Set yours so teammates see your name."
msgstr "Git identity isn't set — commits use a default author. Set yours so teammates see your name."
@@ -6829,14 +6856,27 @@ msgstr "GitHub connection expired. Connect again to continue."
msgid "GitHub denied the request. You may need to authorize OpenKnowledge for {owner} in your browser."
msgstr "GitHub denied the request. You may need to authorize OpenKnowledge for {owner} in your browser."
+#: src/components/settings/EnterpriseHostsSection.tsx
+#: src/components/settings/SettingsDialogShell.tsx
+msgid "GitHub Enterprise Server hosts"
+msgstr "GitHub Enterprise Server hosts"
+
#: src/components/SyncStatusBadge.tsx
msgid "GitHub sign-in is missing or expired. Reconnect to resume syncing."
msgstr "GitHub sign-in is missing or expired. Reconnect to resume syncing."
+#: src/components/settings/AccountSection.tsx
+msgid "GitHub sign-in isn't available for this project"
+msgstr "GitHub sign-in isn't available for this project"
+
#: src/components/ImportSkillForm.tsx
msgid "GitHub, a git URL, or a local path."
msgstr "GitHub, a git URL, or a local path."
+#: src/components/settings/EnterpriseHostsSection.tsx
+msgid "github.com is always recognized, so it doesn't need to be added."
+msgstr "github.com is always recognized, so it doesn't need to be added."
+
#: src/components/settings/SavedThemesTiles.tsx
msgid "Give it a name before editing its colors."
msgstr "Give it a name before editing its colors."
@@ -7300,6 +7340,10 @@ msgstr "If {agent} shows no OpenKnowledge tools, run it in this project and appr
msgid "If an update arrives for something you are editing, you choose which version to keep, like a merge conflict."
msgstr "If an update arrives for something you are editing, you choose which version to keep, like a merge conflict."
+#: src/components/settings/EnterpriseHostsSection.tsx
+msgid "If you use a GitHub Enterprise Server, add its host here so OpenKnowledge can sign in, check push permission, and create share links for repositories hosted there."
+msgstr "If you use a GitHub Enterprise Server, add its host here so OpenKnowledge can sign in, check push permission, and create share links for repositories hosted there."
+
#: src/components/settings/ContentRulesSection.tsx
msgid "Ignore broken links in log.md"
msgstr "Ignore broken links in log.md"
@@ -9291,6 +9335,10 @@ msgstr "No edits yet."
msgid "No emoji found."
msgstr "No emoji found."
+#: src/components/settings/EnterpriseHostsSection.tsx
+msgid "No Enterprise hosts added. Only github.com is treated as GitHub."
+msgstr "No Enterprise hosts added. Only github.com is treated as GitHub."
+
#: src/editor/link-preview/InternalDocPreviewCard.tsx
msgid "No excerpt"
msgstr "No excerpt"
@@ -10215,6 +10263,10 @@ msgstr "OpenKnowledge checked the project"
msgid "OpenKnowledge could not find this agent on this machine."
msgstr "OpenKnowledge could not find this agent on this machine."
+#: src/components/settings/AccountSection.tsx
+msgid "OpenKnowledge couldn't find a host name in this project's git remote, so it can't tell which GitHub server to sign in to."
+msgstr "OpenKnowledge couldn't find a host name in this project's git remote, so it can't tell which GitHub server to sign in to."
+
#: src/lib/worktree-create-error.ts
msgid "OpenKnowledge couldn't finish setting up this project. The worktree was created but not opened."
msgstr "OpenKnowledge couldn't finish setting up this project. The worktree was created but not opened."
@@ -11584,6 +11636,10 @@ msgstr "Remove {chip}"
msgid "Remove {fullLabel} from context"
msgstr "Remove {fullLabel} from context"
+#: src/components/settings/EnterpriseHostsSection.tsx
+msgid "Remove {host}"
+msgstr "Remove {host}"
+
#: src/components/FrontmatterRow.tsx
msgid "Remove {keyName}"
msgstr "Remove {keyName}"
@@ -12351,6 +12407,10 @@ msgstr "Saved to"
msgid "Saved with the project for your team."
msgstr "Saved with the project for your team."
+#: src/components/settings/EnterpriseHostsSection.tsx
+msgid "Saved. Restart OpenKnowledge to apply the change."
+msgstr "Saved. Restart OpenKnowledge to apply the change."
+
#: src/lib/acp/tool-call-display.ts
msgid "Saves a restore point for every document in the project"
msgstr "Saves a restore point for every document in the project"
@@ -14220,6 +14280,14 @@ msgstr "That folder already holds code Open Knowledge didn't write, which the sa
msgid "That folder isn't an OpenKnowledge project yet. Initialize it and open?"
msgstr "That folder isn't an OpenKnowledge project yet. Initialize it and open?"
+#: src/components/settings/EnterpriseHostsSection.tsx
+msgid "That host is already in the list."
+msgstr "That host is already in the list."
+
+#: src/components/settings/EnterpriseHostsSection.tsx
+msgid "That isn't a valid hostname. Enter just the server name, such as github.example.com."
+msgstr "That isn't a valid hostname. Enter just the server name, such as github.example.com."
+
#: src/components/settings/SpellcheckLanguagesRow.tsx
msgid "That language isn't available for spell checking."
msgstr "That language isn't available for spell checking."
@@ -15104,6 +15172,10 @@ msgstr "This project isn't a git repository, so worktrees aren't available."
msgid "This project lives only on this computer. Connect it to GitHub to back it up and share it with other people."
msgstr "This project lives only on this computer. Connect it to GitHub to back it up and share it with other people."
+#: src/components/settings/AccountSection.tsx
+msgid "This project's git remote is on {host}, which OpenKnowledge doesn't recognize as a GitHub host. If {host} runs GitHub Enterprise Server, add it to GitHub Enterprise Server hosts below, then restart OpenKnowledge."
+msgstr "This project's git remote is on {host}, which OpenKnowledge doesn't recognize as a GitHub host. If {host} runs GitHub Enterprise Server, add it to GitHub Enterprise Server hosts below, then restart OpenKnowledge."
+
#: src/components/DocumentErrorBoundary.tsx
msgid "This project's running server doesn't support live editing. Restart OpenKnowledge to fix."
msgstr "This project's running server doesn't support live editing. Restart OpenKnowledge to fix."
diff --git a/packages/app/src/locales/es/messages.json b/packages/app/src/locales/es/messages.json
index affaf33a3..e56a8d8b3 100644
--- a/packages/app/src/locales/es/messages.json
+++ b/packages/app/src/locales/es/messages.json
@@ -266,6 +266,7 @@
"1ruosn": ["OpenKnowledge"],
"1t_NnN": ["Rechazar"],
"1u-mAI": ["No se pudo iniciar la sincronización. Revisa tu conexión y vuelve a intentarlo."],
+ "1uEVfp": ["empresa"],
"1vczDE": ["Abrir ", ["displayName"], " Desktop"],
"1vn0CI": ["Respuesta del servidor no válida"],
"1xui0Q": ["No se pudieron cargar los archivos locales"],
@@ -391,6 +392,7 @@
")"
],
"3LbBJn": ["Adjuntar imágenes"],
+ "3LuFP-": ["Guardado. Reinicia OpenKnowledge para aplicar el cambio."],
"3MA3Hh": ["No se pudo leer la regla de ", ["gitignorePath"], ": ", ["previewError"]],
"3MnvrL": [
"Mostrando las ",
@@ -835,6 +837,13 @@
"7YRrJ9": [
"Disponible en la aplicación de escritorio de OpenKnowledge. Desde una terminal, usa<0> ok config-sharing status</0> / <1>share</1> / <2>unshare</2>."
],
+ "7_I248": [
+ "El remoto de git de este proyecto está en ",
+ ["host"],
+ ", que OpenKnowledge no reconoce como host de GitHub. Si ",
+ ["host"],
+ " ejecuta GitHub Enterprise Server, agrégalo en Hosts de GitHub Enterprise Server más abajo y luego reinicia OpenKnowledge."
+ ],
"7_bFEL": ["Arrastra ", ["patternText"], " para reordenar"],
"7a0YcF": ["Pulsa <0>Espacio</0> o toca el blob para empezar"],
"7aNk5D": ["OpenKnowledge editó ", ["subject"]],
@@ -1104,6 +1113,7 @@
{ "one": ["worktree"], "many": ["worktrees"], "other": ["worktrees"] }
]
],
+ "ALFlyF": ["Agregar host"],
"ALhMYW": ["Terminal"],
"AMU00p": [
"Las dos versiones son idénticas. Elegir Aceptar actual mantiene activa la protección de OpenKnowledge, así que otro guardado de la versión anterior se rechazará de nuevo. Elegir Aceptar entrante desactiva esa protección."
@@ -1383,6 +1393,7 @@
"DDTdLl": ["Ajustes del bloque de código"],
"DELNQk": ["Tus colaboradores ven tus ediciones en curso en cuanto se sincronizan."],
"DEWDbv": ["Mostrar el diagrama"],
+ "DEkRZA": ["Ese host ya está en la lista."],
"DF1MtZ": ["Cargando el conflicto de ", ["filePath"]],
"DFQ2Sj": ["Correo para el seguimiento"],
"DFfRbX": ["Estado de sincronización: ", ["syncStateLabel"], " — identidad de git sin definir"],
@@ -1460,6 +1471,7 @@
" no pudo reiniciarse con esa ventana de contexto. Usa Reintentar para recuperarlo."
],
"Dvwa0U": ["Crear un worktree desde esta rama"],
+ "Dwu3RL": ["GHES"],
"Dz7fsq": ["Acercar"],
"E-G19G": [
"El puerto ",
@@ -1845,6 +1857,7 @@
"HJ7aHU": [
"Mueve el bloque actual hacia arriba o hacia abajo. En las listas, mueve el elemento actual o los elementos seleccionados."
],
+ "HK2eIK": ["No se agregaron hosts de Enterprise. Solo github.com se trata como GitHub."],
"HKH-W-": ["Datos"],
"HLoO-Z": ["El servidor devolvió una respuesta de importación con formato incorrecto."],
"HM56Bx": ["Creando..."],
@@ -1975,6 +1988,7 @@
"IxyZXD": ["Captura de pantalla"],
"J0uRhj": ["Comprobando habilidad"],
"J1XRO3": ["Colores del tema"],
+ "J2-D_a": ["Hosts de GitHub Enterprise Server"],
"J2Mv98": ["Nombre (p. ej. ", ["login"], ")"],
"J2_JuX": ["nada (", ["0"], " no puede coincidir con un documento)"],
"J2eKUI": ["Archivo"],
@@ -2605,6 +2619,9 @@
"PgJDqs": [
"Muestra una tarjeta de vista previa al pasar el cursor por un enlace externo en el editor."
],
+ "PgY2nN": [
+ "Si usas un GitHub Enterprise Server, agrega su host aquí para que OpenKnowledge pueda iniciar sesión, comprobar el permiso de envío y crear enlaces para compartir de los repositorios alojados allí."
+ ],
"Pgu10b": ["Guardado como <0>", ["slug"], ".md</0>"],
"PgzIpb": ["Ir al resultado de búsqueda anterior del editor visual."],
"PhIa-X": ["¿Reemplazar estas copias por enlaces simbólicos al origen?"],
@@ -2676,6 +2693,7 @@
"QWdKwH": ["Mover"],
"QYTOaN": ["Puedes cambiarlo más adelante en <0>Ajustes → Sincronización</0>."],
"QYfQdv": ["CLI de ", ["displayName"]],
+ "Qbf7Q4": ["Agregar un host"],
"QcTjRP": [
"Esta conversacion mantiene la ventana con la que empezo. Un chat nuevo puede usar otra."
],
@@ -2706,6 +2724,9 @@
"El shell real está desactivado para este proyecto. Al activarlo, los comandos se ejecutan con todo el acceso de tu cuenta de usuario."
],
"QqBQu1": ["Etiqueta <0>(texto visible del enlace)</0>"],
+ "QsnBxE": [
+ "Ese no es un nombre de host válido. Escribe solo el nombre del servidor, como github.example.com."
+ ],
"Qvls7J": ["Especificaciones de ingeniería"],
"Qw-7Ie": [
"Un sitio sencillo para escribir, con un archivo por tema y un diario. Elige esto si solo quieres empezar a escribir y dejar que los enlaces entre notas surjan con el tiempo."
@@ -3031,6 +3052,7 @@
]
],
"UIjjFa": ["Ver qué se añade"],
+ "UK3GW4": ["github.com siempre se reconoce, así que no hace falta agregarlo."],
"UL-9ej": ["OpenKnowledge abrió la vista previa en vivo"],
"UL8A9w": ["Etiqueta"],
"UMT9C9": ["Cómo usar OpenKnowledge y sus herramientas MCP."],
@@ -3313,6 +3335,9 @@
"XAyxsa": ["Extraer rama remota"],
"XBBZnv": ["El destino del enlace «", ["shown"], "» no corresponde a un documento existente."],
"XBgr2S": ["Copiar aquí"],
+ "XBpH6-": [
+ "OpenKnowledge no encontró un nombre de host en el remoto de git de este proyecto, así que no puede saber en qué servidor de GitHub iniciar sesión."
+ ],
"XDzAnp": ["Se abre en una pestaña nueva"],
"XF1kgP": ["Todo lo de ", ["source"], " ya está actualizado"],
"XGKy1z": ["No se pudo mostrar la imagen"],
@@ -3898,6 +3923,7 @@
"cEoyWz": ["Añadir elemento a ", ["keyName"]],
"cF9DyA": ["Reconectando tras el reinicio del servidor"],
"cFCKYZ": ["Denegar"],
+ "cFONFy": ["Escribe un nombre de host, como github.example.com."],
"cFSbbh": [
"Personal de este dispositivo. Se aplica a todos los proyectos que abras aquí y nunca se comparte con los colaboradores."
],
@@ -3926,6 +3952,7 @@
"cNvGbn": ["Editar y reenviar"],
"cOJyVj": ["Desactivar los temas"],
"cOSAfL": ["No se encontraron repositorios en tu cuenta de GitHub."],
+ "cOX1Cj": ["host de git"],
"cOrTMo": ["Tu enlace para compartir está listo abajo."],
"cPAWbl": ["Enviado por correo"],
"cPgQ_i": [
@@ -6277,6 +6304,7 @@
"x57cJf": ["Abrir el enlace"],
"xAlHfe": [["basename"], " — editor de texto"],
"xBFg6z": ["Del complemento ", ["0"]],
+ "xBjIs7": ["El inicio de sesión de GitHub no está disponible para este proyecto"],
"xCJdfg": ["Borrar"],
"xCdTnb": ["Cerrar pestaña nueva"],
"xD4Xm2": ["Obtener"],
@@ -6303,6 +6331,7 @@
"xOTzt5": ["ahora mismo"],
"xSVO3J": ["Qué se crea"],
"xV5sXw": ["hace ", ["0"], " sem"],
+ "xVMoYb": ["Quitar ", ["host"]],
"xW5AUw": ["Traído ", ["pulled"]],
"xW7KK3": [
"Ya hay algo llamado «",
diff --git a/packages/app/src/locales/es/messages.po b/packages/app/src/locales/es/messages.po
index a67512766..aecf08fa1 100644
--- a/packages/app/src/locales/es/messages.po
+++ b/packages/app/src/locales/es/messages.po
@@ -1624,6 +1624,10 @@ msgstr "Añadir un comentario"
msgid "Add a file name (e.g. notes.md)"
msgstr "Añade un nombre de archivo (p. ej., notes.md)"
+#: src/components/settings/EnterpriseHostsSection.tsx
+msgid "Add a host"
+msgstr "Agregar un host"
+
#: src/components/settings/SearchSection.tsx
msgid "Add a key"
msgstr "Añadir una clave"
@@ -1677,6 +1681,10 @@ msgstr "Añadir campo"
msgid "Add file or folder pattern, e.g. guides/**/*"
msgstr "Añade un patrón de archivo o carpeta, p. ej. guides/**/*"
+#: src/components/settings/EnterpriseHostsSection.tsx
+msgid "Add host"
+msgstr "Agregar host"
+
#: src/components/SeedRootPicker.tsx
msgid "Add it directly to this project."
msgstr "Añádelo directamente a este proyecto."
@@ -5793,6 +5801,10 @@ msgstr "Escribe un valor hexadecimal de 6 dígitos, como #1A2B3C"
msgid "Enter a folder name (e.g. brain)."
msgstr "Escribe un nombre de carpeta (p. ej. cerebro)."
+#: src/components/settings/EnterpriseHostsSection.tsx
+msgid "Enter a hostname, such as github.example.com."
+msgstr "Escribe un nombre de host, como github.example.com."
+
#: src/components/settings/SavedThemesTiles.tsx
msgid "Enter a name for this theme."
msgstr "Introduce un nombre para este tema."
@@ -5845,6 +5857,11 @@ msgstr "Introduce al menos 3 caracteres para buscar por significado."
msgid "Enter the public origin your tunnel serves, for example https://notes.example.com"
msgstr "Introduce el origen público que sirve tu túnel, por ejemplo https://notes.example.com"
+#: src/components/settings/SettingsDialogShell.tsx
+msgctxt "settings search keyword"
+msgid "enterprise"
+msgstr "empresa"
+
#: src/components/settings/ContentRulesSection.tsx
msgid "Error"
msgstr "Error"
@@ -6776,6 +6793,11 @@ msgstr "Ponte en marcha"
msgid "Gets the link that opens this project or a document in the app"
msgstr "Obtiene el enlace que abre este proyecto o un documento en la app"
+#: src/components/settings/SettingsDialogShell.tsx
+msgctxt "settings search keyword"
+msgid "GHES"
+msgstr "GHES"
+
#: src/components/ExploreSkills.tsx
msgid "Git & PRs"
msgstr "Git y PR"
@@ -6788,6 +6810,11 @@ msgstr "Git no puede seguir esta carpeta: está vacía o solo contiene archivos
msgid "Git has locked this worktree, but it can still be opened."
msgstr "Git ha bloqueado este worktree, pero aún se puede abrir."
+#: src/components/settings/SettingsDialogShell.tsx
+msgctxt "settings search keyword"
+msgid "git host"
+msgstr "host de git"
+
#: src/components/SyncStatusBadge.tsx
msgid "Git identity isn't set — commits use a default author. Set yours so teammates see your name."
msgstr "No has definido tu identidad de git: los commits usan un autor por defecto. Define la tuya para que tus compañeros vean tu nombre."
@@ -6829,14 +6856,27 @@ msgstr "La conexión con GitHub caducó. Vuelve a conectarte para continuar."
msgid "GitHub denied the request. You may need to authorize OpenKnowledge for {owner} in your browser."
msgstr "GitHub denegó la solicitud. Puede que tengas que autorizar OpenKnowledge para {owner} en tu navegador."
+#: src/components/settings/EnterpriseHostsSection.tsx
+#: src/components/settings/SettingsDialogShell.tsx
+msgid "GitHub Enterprise Server hosts"
+msgstr "Hosts de GitHub Enterprise Server"
+
#: src/components/SyncStatusBadge.tsx
msgid "GitHub sign-in is missing or expired. Reconnect to resume syncing."
msgstr "Falta la sesión de GitHub o ha caducado. Vuelve a conectarte para reanudar la sincronización."
+#: src/components/settings/AccountSection.tsx
+msgid "GitHub sign-in isn't available for this project"
+msgstr "El inicio de sesión de GitHub no está disponible para este proyecto"
+
#: src/components/ImportSkillForm.tsx
msgid "GitHub, a git URL, or a local path."
msgstr "GitHub, una URL de git o una ruta local."
+#: src/components/settings/EnterpriseHostsSection.tsx
+msgid "github.com is always recognized, so it doesn't need to be added."
+msgstr "github.com siempre se reconoce, así que no hace falta agregarlo."
+
#: src/components/settings/SavedThemesTiles.tsx
msgid "Give it a name before editing its colors."
msgstr "Ponle un nombre antes de editar sus colores."
@@ -7300,6 +7340,10 @@ msgstr "Si {agent} no muestra las herramientas de OpenKnowledge, ejecútalo en e
msgid "If an update arrives for something you are editing, you choose which version to keep, like a merge conflict."
msgstr "Si llega una actualización de algo que estás editando, tú eliges qué versión conservar, como en un conflicto de fusión."
+#: src/components/settings/EnterpriseHostsSection.tsx
+msgid "If you use a GitHub Enterprise Server, add its host here so OpenKnowledge can sign in, check push permission, and create share links for repositories hosted there."
+msgstr "Si usas un GitHub Enterprise Server, agrega su host aquí para que OpenKnowledge pueda iniciar sesión, comprobar el permiso de envío y crear enlaces para compartir de los repositorios alojados allí."
+
#: src/components/settings/ContentRulesSection.tsx
msgid "Ignore broken links in log.md"
msgstr "Ignorar los enlaces rotos en log.md"
@@ -9291,6 +9335,10 @@ msgstr "Todavía no hay ediciones."
msgid "No emoji found."
msgstr "No se encontró ningún emoji."
+#: src/components/settings/EnterpriseHostsSection.tsx
+msgid "No Enterprise hosts added. Only github.com is treated as GitHub."
+msgstr "No se agregaron hosts de Enterprise. Solo github.com se trata como GitHub."
+
#: src/editor/link-preview/InternalDocPreviewCard.tsx
msgid "No excerpt"
msgstr "Sin extracto"
@@ -10215,6 +10263,10 @@ msgstr "OpenKnowledge revisó el proyecto"
msgid "OpenKnowledge could not find this agent on this machine."
msgstr "OpenKnowledge no encontró este agente en este equipo."
+#: src/components/settings/AccountSection.tsx
+msgid "OpenKnowledge couldn't find a host name in this project's git remote, so it can't tell which GitHub server to sign in to."
+msgstr "OpenKnowledge no encontró un nombre de host en el remoto de git de este proyecto, así que no puede saber en qué servidor de GitHub iniciar sesión."
+
#: src/lib/worktree-create-error.ts
msgid "OpenKnowledge couldn't finish setting up this project. The worktree was created but not opened."
msgstr "OpenKnowledge no pudo terminar de configurar este proyecto. El worktree se creó, pero no se abrió."
@@ -11584,6 +11636,10 @@ msgstr "Quitar {chip}"
msgid "Remove {fullLabel} from context"
msgstr "Quitar {fullLabel} del contexto"
+#: src/components/settings/EnterpriseHostsSection.tsx
+msgid "Remove {host}"
+msgstr "Quitar {host}"
+
#: src/components/FrontmatterRow.tsx
msgid "Remove {keyName}"
msgstr "Quitar {keyName}"
@@ -12351,6 +12407,10 @@ msgstr "Guardado en"
msgid "Saved with the project for your team."
msgstr "Guardado con el proyecto para tu equipo."
+#: src/components/settings/EnterpriseHostsSection.tsx
+msgid "Saved. Restart OpenKnowledge to apply the change."
+msgstr "Guardado. Reinicia OpenKnowledge para aplicar el cambio."
+
#: src/lib/acp/tool-call-display.ts
msgid "Saves a restore point for every document in the project"
msgstr "Guarda un punto de restauración para cada documento del proyecto"
@@ -14220,6 +14280,14 @@ msgstr "Esa carpeta ya contiene código que Open Knowledge no escribió y que es
msgid "That folder isn't an OpenKnowledge project yet. Initialize it and open?"
msgstr "Esa carpeta todavía no es un proyecto de OpenKnowledge. ¿Inicializarla y abrirla?"
+#: src/components/settings/EnterpriseHostsSection.tsx
+msgid "That host is already in the list."
+msgstr "Ese host ya está en la lista."
+
+#: src/components/settings/EnterpriseHostsSection.tsx
+msgid "That isn't a valid hostname. Enter just the server name, such as github.example.com."
+msgstr "Ese no es un nombre de host válido. Escribe solo el nombre del servidor, como github.example.com."
+
#: src/components/settings/SpellcheckLanguagesRow.tsx
msgid "That language isn't available for spell checking."
msgstr "Ese idioma no está disponible para la corrección ortográfica."
@@ -15104,6 +15172,10 @@ msgstr "Este proyecto no es un repositorio de git, así que los worktrees no est
msgid "This project lives only on this computer. Connect it to GitHub to back it up and share it with other people."
msgstr "Este proyecto solo vive en este equipo. Conéctalo a GitHub para tener una copia de seguridad y compartirlo con otras personas."
+#: src/components/settings/AccountSection.tsx
+msgid "This project's git remote is on {host}, which OpenKnowledge doesn't recognize as a GitHub host. If {host} runs GitHub Enterprise Server, add it to GitHub Enterprise Server hosts below, then restart OpenKnowledge."
+msgstr "El remoto de git de este proyecto está en {host}, que OpenKnowledge no reconoce como host de GitHub. Si {host} ejecuta GitHub Enterprise Server, agrégalo en Hosts de GitHub Enterprise Server más abajo y luego reinicia OpenKnowledge."
+
#: src/components/DocumentErrorBoundary.tsx
msgid "This project's running server doesn't support live editing. Restart OpenKnowledge to fix."
msgstr "El servidor en marcha de este proyecto no admite edición en vivo. Reinicia OpenKnowledge para arreglarlo."
diff --git a/packages/app/src/locales/fr/messages.json b/packages/app/src/locales/fr/messages.json
index 880ea6922..99865cab7 100644
--- a/packages/app/src/locales/fr/messages.json
+++ b/packages/app/src/locales/fr/messages.json
@@ -280,6 +280,7 @@
"1u-mAI": [
"Impossible de démarrer la synchronisation. Vérifiez votre connexion, puis réessayez."
],
+ "1uEVfp": ["entreprise"],
"1vczDE": ["Ouvrir ", ["displayName"], " Desktop"],
"1vn0CI": ["Réponse du serveur invalide"],
"1xui0Q": ["Échec du chargement des fichiers locaux"],
@@ -405,6 +406,7 @@
")"
],
"3LbBJn": ["Joindre des images"],
+ "3LuFP-": ["Enregistré. Redémarrez OpenKnowledge pour appliquer la modification."],
"3MA3Hh": ["Impossible de lire la règle de ", ["gitignorePath"], " : ", ["previewError"]],
"3MnvrL": [
"Affichage des ",
@@ -864,6 +866,13 @@
"7YRrJ9": [
"Disponible dans l'application de bureau OpenKnowledge. Depuis un terminal, utilisez<0> ok config-sharing status</0> / <1>share</1> / <2>unshare</2>."
],
+ "7_I248": [
+ "Le dépôt distant git de ce projet se trouve sur ",
+ ["host"],
+ ", qu’OpenKnowledge ne reconnaît pas comme un hôte GitHub. Si ",
+ ["host"],
+ " exécute GitHub Enterprise Server, ajoutez-le dans Hôtes GitHub Enterprise Server ci-dessous, puis redémarrez OpenKnowledge."
+ ],
"7_bFEL": ["Faites glisser ", ["patternText"], " pour réorganiser"],
"7a0YcF": ["Appuyez sur <0>Espace</0> ou touchez le blob pour commencer"],
"7aNk5D": ["OpenKnowledge a modifié ", ["subject"]],
@@ -1133,6 +1142,7 @@
{ "one": ["worktree"], "many": ["worktrees"], "other": ["worktrees"] }
]
],
+ "ALFlyF": ["Ajouter l’hôte"],
"ALhMYW": ["Terminal"],
"AMU00p": [
"Les deux versions sont identiques. Choisir Accepter l’actuel laisse la protection d’OpenKnowledge activée : un nouvel enregistrement de la version antérieure sera de nouveau refusé. Choisir Accepter l’entrant désactive cette protection."
@@ -1416,6 +1426,7 @@
"Les collaborateurs voient vos modifications en cours dès qu'elles se synchronisent."
],
"DEWDbv": ["Afficher le diagramme"],
+ "DEkRZA": ["Cet hôte figure déjà dans la liste."],
"DF1MtZ": ["Chargement du conflit pour ", ["filePath"]],
"DFQ2Sj": ["Adresse e-mail pour le suivi"],
"DFfRbX": ["État de la synchronisation : ", ["syncStateLabel"], " — identité git non définie"],
@@ -1493,6 +1504,7 @@
" n'a pas pu redémarrer avec cette fenêtre de contexte. Utilisez Réessayer pour le relancer."
],
"Dvwa0U": ["Créer un worktree à partir de cette branche"],
+ "Dwu3RL": ["GHES"],
"Dz7fsq": ["Zoom avant"],
"E-G19G": [
"Le port ",
@@ -1881,6 +1893,7 @@
"HJ7aHU": [
"Déplace le bloc courant vers le haut ou vers le bas. Dans les listes, déplace l’élément courant ou les éléments sélectionnés."
],
+ "HK2eIK": ["Aucun hôte Enterprise ajouté. Seul github.com est traité comme GitHub."],
"HKH-W-": ["Données"],
"HLoO-Z": ["Le serveur a renvoyé une réponse d'importation mal formée."],
"HM56Bx": ["Création…"],
@@ -2007,6 +2020,7 @@
"IxyZXD": ["Capture d'écran"],
"J0uRhj": ["Vérification des compétences"],
"J1XRO3": ["Couleurs du thème"],
+ "J2-D_a": ["Hôtes GitHub Enterprise Server"],
"J2Mv98": ["Nom (par ex. ", ["login"], ")"],
"J2_JuX": ["rien (", ["0"], " ne peut correspondre à aucun document)"],
"J2eKUI": ["Fichier"],
@@ -2648,6 +2662,9 @@
],
"Pg83C9": ["« ", ["0"], " » envoyé."],
"PgJDqs": ["Affiche une carte d'aperçu au survol d'un lien externe dans l'éditeur."],
+ "PgY2nN": [
+ "Si vous utilisez un GitHub Enterprise Server, ajoutez son hôte ici pour qu’OpenKnowledge puisse s’y connecter, vérifier l’autorisation de push et créer des liens de partage pour les dépôts qui y sont hébergés."
+ ],
"Pgu10b": ["Enregistré sous <0>", ["slug"], ".md</0>"],
"PgzIpb": ["Va au résultat de recherche précédent dans l'éditeur visuel."],
"PhIa-X": ["Remplacer ces copies par des liens symboliques vers la source ?"],
@@ -2717,6 +2734,7 @@
"QWdKwH": ["Déplacer"],
"QYTOaN": ["Vous pourrez changer cela plus tard dans <0>Paramètres → Synchronisation</0>."],
"QYfQdv": ["CLI ", ["displayName"]],
+ "Qbf7Q4": ["Ajouter un hôte"],
"QcTjRP": [
"Cette conversation garde la fenetre avec laquelle elle a commence. Une nouvelle conversation peut en utiliser une autre."
],
@@ -2747,6 +2765,9 @@
"Le vrai shell est désactivé pour ce projet. L'activer exécute les commandes avec tous les droits de votre compte utilisateur."
],
"QqBQu1": ["Libellé <0>(texte visible du lien)</0>"],
+ "QsnBxE": [
+ "Ce nom d’hôte n’est pas valide. Saisissez uniquement le nom du serveur, par exemple github.example.com."
+ ],
"Qvls7J": ["Spécifications techniques"],
"Qw-7Ie": [
"Un espace d'écriture simple, avec un fichier par sujet et un journal quotidien. Choisissez ceci si vous voulez juste commencer à écrire et laisser les liens entre les notes se construire au fil du temps."
@@ -3073,6 +3094,7 @@
]
],
"UIjjFa": ["Voir ce qui est ajouté"],
+ "UK3GW4": ["github.com est toujours reconnu : inutile de l’ajouter."],
"UL-9ej": ["OpenKnowledge a ouvert l'aperçu en direct"],
"UL8A9w": ["Étiquette"],
"UMT9C9": ["Comment utiliser OpenKnowledge et ses outils MCP."],
@@ -3361,6 +3383,9 @@
"XAyxsa": ["Extraire une branche distante"],
"XBBZnv": ["La cible du lien « ", ["shown"], " » ne correspond à aucun document existant."],
"XBgr2S": ["Copier ici"],
+ "XBpH6-": [
+ "OpenKnowledge n’a trouvé aucun nom d’hôte dans le dépôt distant git de ce projet : impossible de savoir à quel serveur GitHub se connecter."
+ ],
"XDzAnp": ["S'ouvre dans un nouvel onglet"],
"XF1kgP": ["Tout ce qui provient de ", ["source"], " est déjà à jour"],
"XGKy1z": ["Impossible d'afficher l'image"],
@@ -3951,6 +3976,7 @@
"cEoyWz": ["Ajouter un élément à ", ["keyName"]],
"cF9DyA": ["Reconnexion après le redémarrage du serveur"],
"cFCKYZ": ["Refuser"],
+ "cFONFy": ["Saisissez un nom d’hôte, par exemple github.example.com."],
"cFSbbh": [
"Propre à cet appareil. S'applique à tous les projets que vous ouvrez ici et n'est jamais partagé avec les collaborateurs."
],
@@ -3972,6 +3998,7 @@
"cNvGbn": ["Modifier et renvoyer"],
"cOJyVj": ["Désactiver les thèmes"],
"cOSAfL": ["Aucun dépôt trouvé sur votre compte GitHub."],
+ "cOX1Cj": ["hôte git"],
"cOrTMo": ["Votre lien de partage est prêt ci-dessous."],
"cPAWbl": ["Envoyé par e-mail"],
"cPgQ_i": [
@@ -6349,6 +6376,7 @@
"x57cJf": ["Ouvrir le lien"],
"xAlHfe": [["basename"], " — éditeur de texte"],
"xBFg6z": ["Du plugin ", ["0"]],
+ "xBjIs7": ["La connexion GitHub n’est pas disponible pour ce projet"],
"xCJdfg": ["Effacer"],
"xCdTnb": ["Fermer le nouvel onglet"],
"xD4Xm2": ["Récupérer"],
@@ -6373,6 +6401,7 @@
"xOTzt5": ["à l'instant"],
"xSVO3J": ["Ce qui est créé"],
"xV5sXw": ["il y a ", ["0"], " sem"],
+ "xVMoYb": ["Retirer ", ["host"]],
"xW5AUw": ["Récupéré ", ["pulled"]],
"xW7KK3": [
"Quelque chose nommé « ",
diff --git a/packages/app/src/locales/fr/messages.po b/packages/app/src/locales/fr/messages.po
index cae32791c..469a0d447 100644
--- a/packages/app/src/locales/fr/messages.po
+++ b/packages/app/src/locales/fr/messages.po
@@ -1624,6 +1624,10 @@ msgstr "Ajouter un commentaire"
msgid "Add a file name (e.g. notes.md)"
msgstr "Ajoutez un nom de fichier (p. ex. notes.md)"
+#: src/components/settings/EnterpriseHostsSection.tsx
+msgid "Add a host"
+msgstr "Ajouter un hôte"
+
#: src/components/settings/SearchSection.tsx
msgid "Add a key"
msgstr "Ajouter une clé"
@@ -1677,6 +1681,10 @@ msgstr "Ajouter un champ"
msgid "Add file or folder pattern, e.g. guides/**/*"
msgstr "Ajoutez un motif de fichier ou de dossier, par ex. guides/**/*"
+#: src/components/settings/EnterpriseHostsSection.tsx
+msgid "Add host"
+msgstr "Ajouter l’hôte"
+
#: src/components/SeedRootPicker.tsx
msgid "Add it directly to this project."
msgstr "Ajoutez-le directement à ce projet."
@@ -5793,6 +5801,10 @@ msgstr "Saisissez une valeur hexadécimale à 6 chiffres, par ex. #1A2B3C"
msgid "Enter a folder name (e.g. brain)."
msgstr "Saisissez un nom de dossier (par ex. brain)."
+#: src/components/settings/EnterpriseHostsSection.tsx
+msgid "Enter a hostname, such as github.example.com."
+msgstr "Saisissez un nom d’hôte, par exemple github.example.com."
+
#: src/components/settings/SavedThemesTiles.tsx
msgid "Enter a name for this theme."
msgstr "Saisissez un nom pour ce thème."
@@ -5845,6 +5857,11 @@ msgstr "Saisissez au moins 3 caractères pour rechercher par sens."
msgid "Enter the public origin your tunnel serves, for example https://notes.example.com"
msgstr "Saisissez l'origine publique servie par votre tunnel, par exemple https://notes.example.com"
+#: src/components/settings/SettingsDialogShell.tsx
+msgctxt "settings search keyword"
+msgid "enterprise"
+msgstr "entreprise"
+
#: src/components/settings/ContentRulesSection.tsx
msgid "Error"
msgstr "Erreur"
@@ -6776,6 +6793,11 @@ msgstr "Configurer"
msgid "Gets the link that opens this project or a document in the app"
msgstr "Obtient le lien qui ouvre ce projet ou un document dans l'app"
+#: src/components/settings/SettingsDialogShell.tsx
+msgctxt "settings search keyword"
+msgid "GHES"
+msgstr "GHES"
+
#: src/components/ExploreSkills.tsx
msgid "Git & PRs"
msgstr "Git et PR"
@@ -6788,6 +6810,11 @@ msgstr "Git ne peut pas suivre ce dossier — il est vide ou ne contient que des
msgid "Git has locked this worktree, but it can still be opened."
msgstr "Git a verrouillé ce worktree, mais il peut toujours être ouvert."
+#: src/components/settings/SettingsDialogShell.tsx
+msgctxt "settings search keyword"
+msgid "git host"
+msgstr "hôte git"
+
#: src/components/SyncStatusBadge.tsx
msgid "Git identity isn't set — commits use a default author. Set yours so teammates see your name."
msgstr "L'identité git n'est pas définie — les commits utilisent un auteur par défaut. Définissez la vôtre pour que vos coéquipiers voient votre nom."
@@ -6829,14 +6856,27 @@ msgstr "La connexion à GitHub a expiré. Reconnectez-vous pour continuer."
msgid "GitHub denied the request. You may need to authorize OpenKnowledge for {owner} in your browser."
msgstr "GitHub a refusé la demande. Vous devrez peut-être autoriser OpenKnowledge pour {owner} dans votre navigateur."
+#: src/components/settings/EnterpriseHostsSection.tsx
+#: src/components/settings/SettingsDialogShell.tsx
+msgid "GitHub Enterprise Server hosts"
+msgstr "Hôtes GitHub Enterprise Server"
+
#: src/components/SyncStatusBadge.tsx
msgid "GitHub sign-in is missing or expired. Reconnect to resume syncing."
msgstr "La connexion GitHub est absente ou expirée. Reconnectez-vous pour reprendre la synchronisation."
+#: src/components/settings/AccountSection.tsx
+msgid "GitHub sign-in isn't available for this project"
+msgstr "La connexion GitHub n’est pas disponible pour ce projet"
+
#: src/components/ImportSkillForm.tsx
msgid "GitHub, a git URL, or a local path."
msgstr "GitHub, une URL git, ou un chemin local."
+#: src/components/settings/EnterpriseHostsSection.tsx
+msgid "github.com is always recognized, so it doesn't need to be added."
+msgstr "github.com est toujours reconnu : inutile de l’ajouter."
+
#: src/components/settings/SavedThemesTiles.tsx
msgid "Give it a name before editing its colors."
msgstr "Donnez-lui un nom avant de modifier ses couleurs."
@@ -7300,6 +7340,10 @@ msgstr "Si {agent} n'affiche aucun outil OpenKnowledge, exécutez-le dans ce pro
msgid "If an update arrives for something you are editing, you choose which version to keep, like a merge conflict."
msgstr "Si une mise à jour arrive pour ce que vous êtes en train de modifier, vous choisissez quelle version conserver, comme pour un conflit de fusion."
+#: src/components/settings/EnterpriseHostsSection.tsx
+msgid "If you use a GitHub Enterprise Server, add its host here so OpenKnowledge can sign in, check push permission, and create share links for repositories hosted there."
+msgstr "Si vous utilisez un GitHub Enterprise Server, ajoutez son hôte ici pour qu’OpenKnowledge puisse s’y connecter, vérifier l’autorisation de push et créer des liens de partage pour les dépôts qui y sont hébergés."
+
#: src/components/settings/ContentRulesSection.tsx
msgid "Ignore broken links in log.md"
msgstr "Ignorer les liens cassés dans log.md"
@@ -9291,6 +9335,10 @@ msgstr "Pas encore de modifications."
msgid "No emoji found."
msgstr "Aucun émoji trouvé."
+#: src/components/settings/EnterpriseHostsSection.tsx
+msgid "No Enterprise hosts added. Only github.com is treated as GitHub."
+msgstr "Aucun hôte Enterprise ajouté. Seul github.com est traité comme GitHub."
+
#: src/editor/link-preview/InternalDocPreviewCard.tsx
msgid "No excerpt"
msgstr "Pas d'extrait"
@@ -10215,6 +10263,10 @@ msgstr "OpenKnowledge a vérifié le projet"
msgid "OpenKnowledge could not find this agent on this machine."
msgstr "OpenKnowledge n'a pas trouvé cet agent sur cette machine."
+#: src/components/settings/AccountSection.tsx
+msgid "OpenKnowledge couldn't find a host name in this project's git remote, so it can't tell which GitHub server to sign in to."
+msgstr "OpenKnowledge n’a trouvé aucun nom d’hôte dans le dépôt distant git de ce projet : impossible de savoir à quel serveur GitHub se connecter."
+
#: src/lib/worktree-create-error.ts
msgid "OpenKnowledge couldn't finish setting up this project. The worktree was created but not opened."
msgstr "OpenKnowledge n’a pas pu terminer la configuration de ce projet. Le worktree a été créé, mais pas ouvert."
@@ -11584,6 +11636,10 @@ msgstr "Retirer {chip}"
msgid "Remove {fullLabel} from context"
msgstr "Retirer {fullLabel} du contexte"
+#: src/components/settings/EnterpriseHostsSection.tsx
+msgid "Remove {host}"
+msgstr "Retirer {host}"
+
#: src/components/FrontmatterRow.tsx
msgid "Remove {keyName}"
msgstr "Retirer {keyName}"
@@ -12351,6 +12407,10 @@ msgstr "Enregistré dans"
msgid "Saved with the project for your team."
msgstr "Enregistré avec le projet pour votre équipe."
+#: src/components/settings/EnterpriseHostsSection.tsx
+msgid "Saved. Restart OpenKnowledge to apply the change."
+msgstr "Enregistré. Redémarrez OpenKnowledge pour appliquer la modification."
+
#: src/lib/acp/tool-call-display.ts
msgid "Saves a restore point for every document in the project"
msgstr "Enregistre un point de restauration pour chaque document du projet"
@@ -14220,6 +14280,14 @@ msgstr "Ce dossier contient déjà du code qu'Open Knowledge n'a pas écrit et q
msgid "That folder isn't an OpenKnowledge project yet. Initialize it and open?"
msgstr "Ce dossier n'est pas encore un projet OpenKnowledge. L'initialiser et l'ouvrir ?"
+#: src/components/settings/EnterpriseHostsSection.tsx
+msgid "That host is already in the list."
+msgstr "Cet hôte figure déjà dans la liste."
+
+#: src/components/settings/EnterpriseHostsSection.tsx
+msgid "That isn't a valid hostname. Enter just the server name, such as github.example.com."
+msgstr "Ce nom d’hôte n’est pas valide. Saisissez uniquement le nom du serveur, par exemple github.example.com."
+
#: src/components/settings/SpellcheckLanguagesRow.tsx
msgid "That language isn't available for spell checking."
msgstr "Cette langue n'est pas disponible pour la correction orthographique."
@@ -15104,6 +15172,10 @@ msgstr "Ce projet n'est pas un dépôt git, les worktrees ne sont donc pas dispo
msgid "This project lives only on this computer. Connect it to GitHub to back it up and share it with other people."
msgstr "Ce projet n'existe que sur cet ordinateur. Connectez-le à GitHub pour le sauvegarder et le partager avec d'autres personnes."
+#: src/components/settings/AccountSection.tsx
+msgid "This project's git remote is on {host}, which OpenKnowledge doesn't recognize as a GitHub host. If {host} runs GitHub Enterprise Server, add it to GitHub Enterprise Server hosts below, then restart OpenKnowledge."
+msgstr "Le dépôt distant git de ce projet se trouve sur {host}, qu’OpenKnowledge ne reconnaît pas comme un hôte GitHub. Si {host} exécute GitHub Enterprise Server, ajoutez-le dans Hôtes GitHub Enterprise Server ci-dessous, puis redémarrez OpenKnowledge."
+
#: src/components/DocumentErrorBoundary.tsx
msgid "This project's running server doesn't support live editing. Restart OpenKnowledge to fix."
msgstr "Le serveur en cours d'exécution de ce projet ne prend pas en charge l'édition en direct. Redémarrez OpenKnowledge pour corriger cela."
diff --git a/packages/app/src/locales/hi/messages.json b/packages/app/src/locales/hi/messages.json
index a98f8c3f6..16aabe477 100644
--- a/packages/app/src/locales/hi/messages.json
+++ b/packages/app/src/locales/hi/messages.json
@@ -225,6 +225,7 @@
"1ruosn": ["OpenKnowledge"],
"1t_NnN": ["अस्वीकारें"],
"1u-mAI": ["सिंक शुरू नहीं किया जा सका। अपना कनेक्शन जाँचें, फिर कोशिश करें।"],
+ "1uEVfp": ["एंटरप्राइज़"],
"1vczDE": [["displayName"], " Desktop खोलें"],
"1vn0CI": ["सर्वर की प्रतिक्रिया अमान्य है"],
"1xui0Q": ["स्थानीय फ़ाइलें लोड करने में विफल"],
@@ -333,6 +334,7 @@
")"
],
"3LbBJn": ["छवियाँ संलग्न करें"],
+ "3LuFP-": ["सहेजा गया। बदलाव लागू करने के लिए OpenKnowledge को फिर से शुरू करें।"],
"3MA3Hh": [["gitignorePath"], " नियम नहीं पढ़ा जा सका: ", ["previewError"]],
"3MnvrL": ["शीर्ष ", ["0"], " मेल दिखाए जा रहे हैं — सीमित करने के लिए लिखते रहें"],
"3Mwaly": [["0"], " आरंभ नहीं किया जा सका।"],
@@ -694,6 +696,13 @@
"7YRrJ9": [
"OpenKnowledge डेस्कटॉप ऐप में उपलब्ध। टर्मिनल से <0> ok config-sharing status</0> / <1>share</1> / <2>unshare</2> का उपयोग करें।"
],
+ "7_I248": [
+ "इस प्रोजेक्ट का git रिमोट ",
+ ["host"],
+ " पर है, जिसे OpenKnowledge GitHub होस्ट के रूप में नहीं पहचानता। यदि ",
+ ["host"],
+ " पर GitHub Enterprise Server चलता है, तो उसे नीचे GitHub Enterprise Server होस्ट में जोड़ें, फिर OpenKnowledge को फिर से शुरू करें।"
+ ],
"7_bFEL": ["क्रम बदलने के लिए ", ["patternText"], " खींचें"],
"7a0YcF": ["शुरू करने के लिए <0>स्पेस</0> दबाएँ या blob पर टैप करें"],
"7aNk5D": ["OpenKnowledge ने ", ["subject"], " को संपादित किया"],
@@ -914,6 +923,7 @@
"AItsE5": ["इसे वहाँ खोलें"],
"AJ7_B2": ["नई थीम बनाएँ"],
"AKxFtn": [["openedWorktreeCount", "plural", { "one": ["वर्कट्री"], "other": ["वर्कट्री"] }]],
+ "ALFlyF": ["होस्ट जोड़ें"],
"ALhMYW": ["टर्मिनल"],
"AMU00p": [
"दोनों संस्करण एक जैसे हैं। वर्तमान स्वीकारें चुनने पर OpenKnowledge की सुरक्षा चालू रहती है, इसलिए पुराने संस्करण का एक और सेव फिर से अस्वीकार कर दिया जाएगा। आने वाला स्वीकारें चुनने पर वह सुरक्षा बंद हो जाती है।"
@@ -1147,6 +1157,7 @@
"DDTdLl": ["कोड ब्लॉक सेटिंग"],
"DELNQk": ["सहयोगी आपके चल रहे संपादन सिंक होते ही देख लेते हैं।"],
"DEWDbv": ["आरेख दिखाएँ"],
+ "DEkRZA": ["यह होस्ट पहले से सूची में है।"],
"DF1MtZ": [["filePath"], " का टकराव लोड हो रहा है"],
"DFQ2Sj": ["आगे संपर्क के लिए ईमेल"],
"DFfRbX": ["सिंक स्थिति: ", ["syncStateLabel"], " — git पहचान सेट नहीं"],
@@ -1209,6 +1220,7 @@
"Dvr1Sg": ["कॉपी किया जा रहा है"],
"Dvvrs8": [["0"], " उस संदर्भ विंडो पर पुनः आरंभ नहीं हो सका। इसे वापस लाने के लिए पुनः प्रयास करें।"],
"Dvwa0U": ["इस ब्रांच से एक वर्कट्री बनाएँ"],
+ "Dwu3RL": ["GHES"],
"Dz7fsq": ["बड़ा करें"],
"E-G19G": [
"पोर्ट ",
@@ -1529,6 +1541,7 @@
"HHQcx0": ["किसी स्किल को और जगहों पर उपलब्ध कराता है, या किसी एक से हटाता है"],
"HIb0vl": ["नेटवर्क त्रुटि — कृपया फिर कोशिश करें"],
"HJ7aHU": ["मौजूदा ब्लॉक को ऊपर या नीचे ले जाएँ। सूचियों में, मौजूदा आइटम या चुने हुए आइटम ले जाएँ।"],
+ "HK2eIK": ["कोई Enterprise होस्ट नहीं जोड़ा गया। केवल github.com को GitHub माना जाता है।"],
"HKH-W-": ["डेटा"],
"HLoO-Z": ["सर्वर ने गलत प्रारूप वाली इंपोर्ट प्रतिक्रिया लौटाई।"],
"HM56Bx": ["बनाया जा रहा है…"],
@@ -1631,6 +1644,7 @@
"IxyZXD": ["स्क्रीनशॉट"],
"J0uRhj": ["कौशल की जाँच करना"],
"J1XRO3": ["थीम के रंग"],
+ "J2-D_a": ["GitHub Enterprise Server होस्ट"],
"J2Mv98": ["नाम (जैसे ", ["login"], ")"],
"J2_JuX": ["कुछ नहीं (", ["0"], " किसी दस्तावेज़ से मेल नहीं खा सकता)"],
"J2eKUI": ["फ़ाइल"],
@@ -2194,6 +2208,9 @@
],
"Pg83C9": ["\"", ["0"], "\" अपलोड किया गया।"],
"PgJDqs": ["संपादक में किसी बाहरी लिंक पर माउस ले जाने पर एक पूर्वावलोकन कार्ड दिखाएँ।"],
+ "PgY2nN": [
+ "यदि आप GitHub Enterprise Server का इस्तेमाल करते हैं, तो उसका होस्ट यहाँ जोड़ें ताकि OpenKnowledge साइन इन कर सके, push अनुमति जाँच सके, और वहाँ होस्ट की गई रिपॉज़िटरी के लिए शेयर लिंक बना सके।"
+ ],
"Pgu10b": ["<0>", ["slug"], ".md</0> के रूप में सहेजा गया"],
"PgzIpb": ["दृश्य-संपादक के पिछले खोज परिणाम पर जाएँ।"],
"PhIa-X": ["इन प्रतियों को स्रोत के सिमलिंक से बदलें?"],
@@ -2250,6 +2267,7 @@
"QWdKwH": ["हिलाएँ"],
"QYTOaN": ["आप इसे बाद में <0>Settings → Sync</0> में बदल सकते हैं।"],
"QYfQdv": [["displayName"], " CLI"],
+ "Qbf7Q4": ["होस्ट जोड़ें"],
"QcTjRP": [
"यह बातचीत उसी विंडो के साथ चलती रहेगी जिससे शुरू हुई थी। नई बातचीत में दूसरी विंडो चुनी जा सकती है।"
],
@@ -2277,6 +2295,7 @@
"इस प्रोजेक्ट के लिए असली शेल बंद है। इसे चालू करने पर कमांड आपके उपयोगकर्ता खाते की पूरी पहुँच के साथ चलते हैं।"
],
"QqBQu1": ["लेबल <0>(दिखाई देने वाला लिंक पाठ)</0>"],
+ "QsnBxE": ["यह मान्य होस्टनेम नहीं है। केवल सर्वर का नाम दर्ज करें, जैसे github.example.com।"],
"Qvls7J": ["इंजीनियरिंग स्पेक"],
"Qw-7Ie": [
"लिखने के लिए एक सरल जगह, हर विषय के लिए एक फ़ाइल और एक दैनिक जर्नल के साथ। इसे चुनें यदि आप बस लिखना शुरू करना चाहते हैं और समय के साथ नोटों के बीच के संबंध बनने देना चाहते हैं।"
@@ -2540,6 +2559,7 @@
["propertyCount", "plural", { "one": ["#", " प्रॉपर्टी"], "other": ["#", " प्रॉपर्टी"] }]
],
"UIjjFa": ["देखें क्या जुड़ेगा"],
+ "UK3GW4": ["github.com हमेशा पहचाना जाता है, इसलिए इसे जोड़ने की ज़रूरत नहीं है।"],
"UL-9ej": ["OpenKnowledge ने लाइव पूर्वावलोकन खोला"],
"UL8A9w": ["टैग"],
"UMT9C9": ["OpenKnowledge और इसके MCP टूल का उपयोग कैसे करें।"],
@@ -2760,6 +2780,9 @@
"XAyxsa": ["रिमोट ब्रांच चेक आउट करें"],
"XBBZnv": ["लिंक लक्ष्य \"", ["shown"], "\" किसी मौजूदा दस्तावेज़ पर हल नहीं होता।"],
"XBgr2S": ["यहाँ कॉपी करें"],
+ "XBpH6-": [
+ "OpenKnowledge को इस प्रोजेक्ट के git रिमोट में कोई होस्टनेम नहीं मिला, इसलिए वह यह तय नहीं कर सकता कि किस GitHub सर्वर में साइन इन करना है।"
+ ],
"XDzAnp": ["नए टैब में खुलता है"],
"XF1kgP": [["source"], " से सब कुछ पहले से ही अपडेट है"],
"XGKy1z": ["छवि दिखाई नहीं जा सकी"],
@@ -3270,6 +3293,7 @@
"cEoyWz": [["keyName"], " में आइटम जोड़ें"],
"cF9DyA": ["सर्वर पुनः आरंभ होने के बाद फिर से जोड़ा जा रहा है"],
"cFCKYZ": ["अस्वीकारें"],
+ "cFONFy": ["होस्टनेम दर्ज करें, जैसे github.example.com।"],
"cFSbbh": [
"इस डिवाइस तक सीमित। यहाँ आप जो भी प्रोजेक्ट खोलें उस पर लागू होता है और कभी सहयोगियों के साथ साझा नहीं होता।"
],
@@ -3286,6 +3310,7 @@
"cNvGbn": ["संपादित करें और फिर से भेजें"],
"cOJyVj": ["थीम अक्षम करें"],
"cOSAfL": ["आपके GitHub खाते पर कोई रिपॉज़िटरी नहीं मिली।"],
+ "cOX1Cj": ["git होस्ट"],
"cOrTMo": ["आपका साझा लिंक नीचे तैयार है।"],
"cPAWbl": ["ईमेल भेजा गया"],
"cPgQ_i": [
@@ -5244,6 +5269,7 @@
"x57cJf": ["लिंक खोलें"],
"xAlHfe": [["basename"], " — टेक्स्ट संपादक"],
"xBFg6z": [["0"], " प्लगइन से"],
+ "xBjIs7": ["इस प्रोजेक्ट के लिए GitHub साइन-इन उपलब्ध नहीं है"],
"xCJdfg": ["साफ़ करें"],
"xCdTnb": ["नया टैब बंद करें"],
"xD4Xm2": ["लाना"],
@@ -5262,6 +5288,7 @@
"xOTzt5": ["अभी-अभी"],
"xSVO3J": ["क्या बनता है"],
"xV5sXw": [["0"], " सप्ताह पहले"],
+ "xVMoYb": [["host"], " हटाएँ"],
"xW5AUw": [["pulled"], " खींचा"],
"xW7KK3": [
["scopeLabel"],
diff --git a/packages/app/src/locales/hi/messages.po b/packages/app/src/locales/hi/messages.po
index 08c013251..252184d37 100644
--- a/packages/app/src/locales/hi/messages.po
+++ b/packages/app/src/locales/hi/messages.po
@@ -1620,6 +1620,10 @@ msgstr "एक टिप्पणी जोड़ें"
msgid "Add a file name (e.g. notes.md)"
msgstr "फ़ाइल नाम जोड़ें (जैसे notes.md)"
+#: src/components/settings/EnterpriseHostsSection.tsx
+msgid "Add a host"
+msgstr "होस्ट जोड़ें"
+
#: src/components/settings/SearchSection.tsx
msgid "Add a key"
msgstr "एक कुंजी जोड़ें"
@@ -1673,6 +1677,10 @@ msgstr "फ़ील्ड जोड़ें"
msgid "Add file or folder pattern, e.g. guides/**/*"
msgstr "फ़ाइल या फ़ोल्डर पैटर्न जोड़ें, जैसे guides/**/*"
+#: src/components/settings/EnterpriseHostsSection.tsx
+msgid "Add host"
+msgstr "होस्ट जोड़ें"
+
#: src/components/SeedRootPicker.tsx
msgid "Add it directly to this project."
msgstr "इसे सीधे इस प्रोजेक्ट में जोड़ें।"
@@ -5789,6 +5797,10 @@ msgstr "#1A2B3C जैसा 6-अंकों का हेक्स मान
msgid "Enter a folder name (e.g. brain)."
msgstr "एक फ़ोल्डर नाम डालें (जैसे brain)।"
+#: src/components/settings/EnterpriseHostsSection.tsx
+msgid "Enter a hostname, such as github.example.com."
+msgstr "होस्टनेम दर्ज करें, जैसे github.example.com।"
+
#: src/components/settings/SavedThemesTiles.tsx
msgid "Enter a name for this theme."
msgstr "इस थीम का नाम दर्ज करें।"
@@ -5841,6 +5853,11 @@ msgstr "अर्थ के आधार पर खोजने के लिए
msgid "Enter the public origin your tunnel serves, for example https://notes.example.com"
msgstr "वह सार्वजनिक ऑरिजिन दर्ज करें जिसे आपका tunnel सर्व करता है, उदाहरण के लिए https://notes.example.com"
+#: src/components/settings/SettingsDialogShell.tsx
+msgctxt "settings search keyword"
+msgid "enterprise"
+msgstr "एंटरप्राइज़"
+
#: src/components/settings/ContentRulesSection.tsx
msgid "Error"
msgstr "त्रुटि"
@@ -6772,6 +6789,11 @@ msgstr "सेट अप करें"
msgid "Gets the link that opens this project or a document in the app"
msgstr "वह लिंक लाता है जो इस प्रोजेक्ट या किसी दस्तावेज़ को ऐप में खोलता है"
+#: src/components/settings/SettingsDialogShell.tsx
+msgctxt "settings search keyword"
+msgid "GHES"
+msgstr "GHES"
+
#: src/components/ExploreSkills.tsx
msgid "Git & PRs"
msgstr "Git और PR"
@@ -6784,6 +6806,11 @@ msgstr "Git इस फ़ोल्डर पर नज़र नहीं रख
msgid "Git has locked this worktree, but it can still be opened."
msgstr "Git ने इस वर्कट्री को लॉक किया है, लेकिन इसे अभी भी खोला जा सकता है।"
+#: src/components/settings/SettingsDialogShell.tsx
+msgctxt "settings search keyword"
+msgid "git host"
+msgstr "git होस्ट"
+
#: src/components/SyncStatusBadge.tsx
msgid "Git identity isn't set — commits use a default author. Set yours so teammates see your name."
msgstr "Git पहचान सेट नहीं है — कमिट एक डिफ़ॉल्ट लेखक का उपयोग करते हैं। अपनी पहचान सेट करें ताकि सहकर्मी आपका नाम देख सकें।"
@@ -6825,14 +6852,27 @@ msgstr "GitHub कनेक्शन समाप्त हो गया। ज
msgid "GitHub denied the request. You may need to authorize OpenKnowledge for {owner} in your browser."
msgstr "GitHub ने अनुरोध अस्वीकार कर दिया। आपको अपने ब्राउज़र में {owner} के लिए OpenKnowledge को अनुमति देनी पड़ सकती है।"
+#: src/components/settings/EnterpriseHostsSection.tsx
+#: src/components/settings/SettingsDialogShell.tsx
+msgid "GitHub Enterprise Server hosts"
+msgstr "GitHub Enterprise Server होस्ट"
+
#: src/components/SyncStatusBadge.tsx
msgid "GitHub sign-in is missing or expired. Reconnect to resume syncing."
msgstr "GitHub साइन-इन अनुपस्थित है या उसकी अवधि समाप्त हो चुकी है। सिंक फिर से शुरू करने के लिए दोबारा जुड़ें।"
+#: src/components/settings/AccountSection.tsx
+msgid "GitHub sign-in isn't available for this project"
+msgstr "इस प्रोजेक्ट के लिए GitHub साइन-इन उपलब्ध नहीं है"
+
#: src/components/ImportSkillForm.tsx
msgid "GitHub, a git URL, or a local path."
msgstr "GitHub, एक git URL, या एक स्थानीय पथ।"
+#: src/components/settings/EnterpriseHostsSection.tsx
+msgid "github.com is always recognized, so it doesn't need to be added."
+msgstr "github.com हमेशा पहचाना जाता है, इसलिए इसे जोड़ने की ज़रूरत नहीं है।"
+
#: src/components/settings/SavedThemesTiles.tsx
msgid "Give it a name before editing its colors."
msgstr "इसके रंग संपादित करने से पहले इसे नाम दें।"
@@ -7296,6 +7336,10 @@ msgstr "अगर {agent} में OpenKnowledge टूल नहीं दि
msgid "If an update arrives for something you are editing, you choose which version to keep, like a merge conflict."
msgstr "यदि आपके संपादित किए जा रहे किसी हिस्से के लिए कोई अपडेट आता है, तो आप चुनते हैं कि कौन सा संस्करण रखना है, ठीक मर्ज टकराव की तरह।"
+#: src/components/settings/EnterpriseHostsSection.tsx
+msgid "If you use a GitHub Enterprise Server, add its host here so OpenKnowledge can sign in, check push permission, and create share links for repositories hosted there."
+msgstr "यदि आप GitHub Enterprise Server का इस्तेमाल करते हैं, तो उसका होस्ट यहाँ जोड़ें ताकि OpenKnowledge साइन इन कर सके, push अनुमति जाँच सके, और वहाँ होस्ट की गई रिपॉज़िटरी के लिए शेयर लिंक बना सके।"
+
#: src/components/settings/ContentRulesSection.tsx
msgid "Ignore broken links in log.md"
msgstr "log.md में टूटे हुए लिंक अनदेखा करें"
@@ -9287,6 +9331,10 @@ msgstr "अभी कोई संपादन नहीं।"
msgid "No emoji found."
msgstr "कोई इमोजी नहीं मिला।"
+#: src/components/settings/EnterpriseHostsSection.tsx
+msgid "No Enterprise hosts added. Only github.com is treated as GitHub."
+msgstr "कोई Enterprise होस्ट नहीं जोड़ा गया। केवल github.com को GitHub माना जाता है।"
+
#: src/editor/link-preview/InternalDocPreviewCard.tsx
msgid "No excerpt"
msgstr "कोई अंश नहीं"
@@ -10211,6 +10259,10 @@ msgstr "OpenKnowledge ने प्रोजेक्ट की जाँच क
msgid "OpenKnowledge could not find this agent on this machine."
msgstr "OpenKnowledge को इस मशीन पर यह एजेंट नहीं मिला।"
+#: src/components/settings/AccountSection.tsx
+msgid "OpenKnowledge couldn't find a host name in this project's git remote, so it can't tell which GitHub server to sign in to."
+msgstr "OpenKnowledge को इस प्रोजेक्ट के git रिमोट में कोई होस्टनेम नहीं मिला, इसलिए वह यह तय नहीं कर सकता कि किस GitHub सर्वर में साइन इन करना है।"
+
#: src/lib/worktree-create-error.ts
msgid "OpenKnowledge couldn't finish setting up this project. The worktree was created but not opened."
msgstr "OpenKnowledge इस प्रोजेक्ट का सेटअप पूरा नहीं कर सका। वर्कट्री बनाई गई, लेकिन खोली नहीं गई।"
@@ -11580,6 +11632,10 @@ msgstr "{chip} हटाएँ"
msgid "Remove {fullLabel} from context"
msgstr "{fullLabel} को संदर्भ से हटाएँ"
+#: src/components/settings/EnterpriseHostsSection.tsx
+msgid "Remove {host}"
+msgstr "{host} हटाएँ"
+
#: src/components/FrontmatterRow.tsx
msgid "Remove {keyName}"
msgstr "{keyName} हटाएँ"
@@ -12347,6 +12403,10 @@ msgstr "यहाँ सहेजा गया"
msgid "Saved with the project for your team."
msgstr "आपकी टीम के लिए प्रोजेक्ट के साथ सहेजा गया।"
+#: src/components/settings/EnterpriseHostsSection.tsx
+msgid "Saved. Restart OpenKnowledge to apply the change."
+msgstr "सहेजा गया। बदलाव लागू करने के लिए OpenKnowledge को फिर से शुरू करें।"
+
#: src/lib/acp/tool-call-display.ts
msgid "Saves a restore point for every document in the project"
msgstr "प्रोजेक्ट के हर दस्तावेज़ के लिए एक पुनर्स्थापना बिंदु सहेजता है"
@@ -14216,6 +14276,14 @@ msgstr "उस फ़ोल्डर में पहले से ऐसा क
msgid "That folder isn't an OpenKnowledge project yet. Initialize it and open?"
msgstr "वह फ़ोल्डर अभी OpenKnowledge प्रोजेक्ट नहीं है। इसे आरंभ करके खोलें?"
+#: src/components/settings/EnterpriseHostsSection.tsx
+msgid "That host is already in the list."
+msgstr "यह होस्ट पहले से सूची में है।"
+
+#: src/components/settings/EnterpriseHostsSection.tsx
+msgid "That isn't a valid hostname. Enter just the server name, such as github.example.com."
+msgstr "यह मान्य होस्टनेम नहीं है। केवल सर्वर का नाम दर्ज करें, जैसे github.example.com।"
+
#: src/components/settings/SpellcheckLanguagesRow.tsx
msgid "That language isn't available for spell checking."
msgstr "वह भाषा वर्तनी जाँच के लिए उपलब्ध नहीं है।"
@@ -15100,6 +15168,10 @@ msgstr "यह प्रोजेक्ट एक git रिपॉज़िट
msgid "This project lives only on this computer. Connect it to GitHub to back it up and share it with other people."
msgstr "यह प्रोजेक्ट केवल इसी कंप्यूटर पर है। इसका बैकअप लेने और दूसरों के साथ साझा करने के लिए इसे GitHub से जोड़ें।"
+#: src/components/settings/AccountSection.tsx
+msgid "This project's git remote is on {host}, which OpenKnowledge doesn't recognize as a GitHub host. If {host} runs GitHub Enterprise Server, add it to GitHub Enterprise Server hosts below, then restart OpenKnowledge."
+msgstr "इस प्रोजेक्ट का git रिमोट {host} पर है, जिसे OpenKnowledge GitHub होस्ट के रूप में नहीं पहचानता। यदि {host} पर GitHub Enterprise Server चलता है, तो उसे नीचे GitHub Enterprise Server होस्ट में जोड़ें, फिर OpenKnowledge को फिर से शुरू करें।"
+
#: src/components/DocumentErrorBoundary.tsx
msgid "This project's running server doesn't support live editing. Restart OpenKnowledge to fix."
msgstr "इस प्रोजेक्ट का चल रहा सर्वर जीवंत संपादन का समर्थन नहीं करता। ठीक करने के लिए OpenKnowledge पुनः आरंभ करें।"
diff --git a/packages/app/src/locales/id/messages.json b/packages/app/src/locales/id/messages.json
index 58509ec94..678177d39 100644
--- a/packages/app/src/locales/id/messages.json
+++ b/packages/app/src/locales/id/messages.json
@@ -228,6 +228,7 @@
"1ruosn": ["OpenKnowledge"],
"1t_NnN": ["Tolak"],
"1u-mAI": ["Sinkronisasinya tidak bisa dimulai. Periksa koneksi Anda, lalu coba lagi."],
+ "1uEVfp": ["enterprise"],
"1vczDE": ["Buka ", ["displayName"], " Desktop"],
"1vn0CI": ["Respons server tidak valid"],
"1xui0Q": ["Gagal memuat berkas lokal"],
@@ -339,6 +340,7 @@
")"
],
"3LbBJn": ["Lampirkan gambar"],
+ "3LuFP-": ["Tersimpan. Mulai ulang OpenKnowledge untuk menerapkan perubahan."],
"3MA3Hh": ["Tidak dapat membaca aturan ", ["gitignorePath"], ": ", ["previewError"]],
"3MnvrL": ["Menampilkan ", ["0"], " kecocokan teratas — terus ketik untuk mempersempit"],
"3Mwaly": [["0"], " tidak dapat diinisialisasi."],
@@ -718,6 +720,13 @@
"7YRrJ9": [
"Tersedia di aplikasi desktop OpenKnowledge. Dari terminal, gunakan<0> ok config-sharing status</0> / <1>share</1> / <2>unshare</2>."
],
+ "7_I248": [
+ "Remote git proyek ini berada di ",
+ ["host"],
+ ", yang tidak dikenali OpenKnowledge sebagai host GitHub. Jika ",
+ ["host"],
+ " menjalankan GitHub Enterprise Server, tambahkan ke Host GitHub Enterprise Server di bawah, lalu mulai ulang OpenKnowledge."
+ ],
"7_bFEL": ["Seret ", ["patternText"], " untuk menata ulang"],
"7a0YcF": ["Tekan <0>Spasi</0> atau ketuk blob untuk mulai"],
"7aNk5D": ["OpenKnowledge menyunting ", ["subject"]],
@@ -947,6 +956,7 @@
"AItsE5": ["Buka di sana"],
"AJ7_B2": ["Buat tema baru"],
"AKxFtn": [["openedWorktreeCount", "plural", { "one": ["worktree"], "other": ["worktree"] }]],
+ "ALFlyF": ["Tambahkan host"],
"ALhMYW": ["Terminal"],
"AMU00p": [
"Kedua versi identik. Memilih Terima yang sekarang membuat perlindungan OpenKnowledge tetap aktif, sehingga penyimpanan versi lama berikutnya akan ditolak lagi. Memilih Terima yang masuk menonaktifkan perlindungan tersebut."
@@ -1174,6 +1184,7 @@
"DDTdLl": ["Pengaturan blok kode"],
"DELNQk": ["Kolaborator melihat suntingan Anda yang sedang berjalan begitu tersinkronkan."],
"DEWDbv": ["Tampilkan diagram"],
+ "DEkRZA": ["Host tersebut sudah ada di daftar."],
"DF1MtZ": ["Memuat konflik untuk ", ["filePath"]],
"DFQ2Sj": ["Email untuk tindak lanjut"],
"DFfRbX": ["Status sinkronisasi: ", ["syncStateLabel"], " — identitas git belum disetel"],
@@ -1242,6 +1253,7 @@
" tidak dapat dijalankan ulang pada jendela konteks itu. Gunakan Coba lagi untuk memulihkannya."
],
"Dvwa0U": ["Buat worktree dari cabang ini"],
+ "Dwu3RL": ["GHES"],
"Dz7fsq": ["Perbesar"],
"E-G19G": [
"Port ",
@@ -1605,6 +1617,9 @@
"HJ7aHU": [
"Pindahkan blok saat ini ke atas atau ke bawah. Dalam daftar, pindahkan item saat ini atau item yang dipilih."
],
+ "HK2eIK": [
+ "Belum ada host Enterprise yang ditambahkan. Hanya github.com yang diperlakukan sebagai GitHub."
+ ],
"HKH-W-": ["Data"],
"HLoO-Z": ["Server mengembalikan respons impor yang salah bentuk."],
"HM56Bx": ["Membuat..."],
@@ -1716,6 +1731,7 @@
"IxyZXD": ["Tangkapan layar"],
"J0uRhj": ["Memeriksa keterampilan"],
"J1XRO3": ["Warna tema"],
+ "J2-D_a": ["Host GitHub Enterprise Server"],
"J2Mv98": ["Nama (mis. ", ["login"], ")"],
"J2_JuX": ["tidak apa pun (", ["0"], " tidak bisa cocok dengan sebuah dokumen)"],
"J2eKUI": ["Berkas"],
@@ -2278,6 +2294,9 @@
"PgJDqs": [
"Menampilkan kartu pratinjau saat Anda mengarahkan kursor ke tautan eksternal di penyunting."
],
+ "PgY2nN": [
+ "Jika Anda menggunakan GitHub Enterprise Server, tambahkan host-nya di sini agar OpenKnowledge dapat masuk, memeriksa izin push, dan membuat tautan berbagi untuk repositori yang dihosting di sana."
+ ],
"Pgu10b": ["Disimpan sebagai <0>", ["slug"], ".md</0>"],
"PgzIpb": ["Pergi ke hasil pencarian penyunting visual sebelumnya."],
"PhIa-X": ["Ganti salinan-salinan ini dengan symlink ke sumbernya?"],
@@ -2345,6 +2364,7 @@
"QWdKwH": ["Pindahkan"],
"QYTOaN": ["Anda bisa mengubah ini nanti di <0>Pengaturan → Sinkronisasi</0>."],
"QYfQdv": ["CLI ", ["displayName"]],
+ "Qbf7Q4": ["Tambahkan host"],
"QcTjRP": [
"Percakapan ini mempertahankan jendela awalnya. Percakapan baru bisa memakai jendela lain."
],
@@ -2371,6 +2391,9 @@
"Shell asli dinonaktifkan untuk proyek ini. Mengaktifkannya membuat perintah berjalan dengan akses penuh akun pengguna Anda."
],
"QqBQu1": ["Label <0>(teks tautan yang terlihat)</0>"],
+ "QsnBxE": [
+ "Itu bukan nama host yang valid. Masukkan nama servernya saja, misalnya github.example.com."
+ ],
"Qvls7J": ["Spesifikasi teknik"],
"Qw-7Ie": [
"Tempat sederhana untuk menulis, dengan satu berkas per topik dan jurnal harian. Pilih ini jika Anda hanya ingin mulai menulis dan membiarkan tautan antarcatatan tumbuh seiring waktu."
@@ -2641,6 +2664,7 @@
],
"UI0WPT": [["propertyCount", "plural", { "other": ["#", " properti"] }]],
"UIjjFa": ["Lihat yang ditambahkan"],
+ "UK3GW4": ["github.com selalu dikenali, jadi tidak perlu ditambahkan."],
"UL-9ej": ["OpenKnowledge membuka pratinjau langsung"],
"UL8A9w": ["Tag"],
"UMT9C9": ["Cara menggunakan OpenKnowledge dan alat MCP-nya."],
@@ -2881,6 +2905,9 @@
"XAyxsa": ["Ambil cabang remote"],
"XBBZnv": ["Target tautan \"", ["shown"], "\" tidak merujuk ke dokumen yang ada."],
"XBgr2S": ["Salin ke sini"],
+ "XBpH6-": [
+ "OpenKnowledge tidak menemukan nama host di remote git proyek ini, jadi tidak dapat mengetahui server GitHub mana yang harus dimasuki."
+ ],
"XDzAnp": ["Terbuka di tab baru"],
"XF1kgP": ["Semua dari ", ["source"], " sudah yang terbaru"],
"XGKy1z": ["Gambar tidak dapat ditampilkan"],
@@ -3404,6 +3431,7 @@
"cEoyWz": ["Tambahkan item ke ", ["keyName"]],
"cF9DyA": ["Menyambung ulang setelah server dimulai ulang"],
"cFCKYZ": ["Tolak"],
+ "cFONFy": ["Masukkan nama host, misalnya github.example.com."],
"cFSbbh": [
"Pribadi untuk perangkat ini. Berlaku untuk setiap proyek yang Anda buka di sini dan tidak pernah dibagikan ke kolaborator."
],
@@ -3425,6 +3453,7 @@
"cNvGbn": ["Ubah dan kirim ulang"],
"cOJyVj": ["Nonaktifkan Tema"],
"cOSAfL": ["Tidak ada repositori yang ditemukan di akun GitHub Anda."],
+ "cOX1Cj": ["host git"],
"cOrTMo": ["Tautan berbagi Anda sudah siap di bawah."],
"cPAWbl": ["Dikirim lewat surel"],
"cPgQ_i": [
@@ -5466,6 +5495,7 @@
"x57cJf": ["Buka tautan"],
"xAlHfe": [["basename"], " — penyunting teks"],
"xBFg6z": ["Dari plugin ", ["0"]],
+ "xBjIs7": ["Masuk ke GitHub tidak tersedia untuk proyek ini"],
"xCJdfg": ["Bersihkan"],
"xCdTnb": ["Tutup tab baru"],
"xD4Xm2": ["Ambil"],
@@ -5484,6 +5514,7 @@
"xOTzt5": ["baru saja"],
"xSVO3J": ["Apa yang dibuat"],
"xV5sXw": [["0"], " mgg lalu"],
+ "xVMoYb": ["Hapus ", ["host"]],
"xW5AUw": ["Ditarik ", ["pulled"]],
"xW7KK3": [
"Sudah ada sesuatu bernama “",
diff --git a/packages/app/src/locales/id/messages.po b/packages/app/src/locales/id/messages.po
index a8516e3ac..329ca3abe 100644
--- a/packages/app/src/locales/id/messages.po
+++ b/packages/app/src/locales/id/messages.po
@@ -1620,6 +1620,10 @@ msgstr "Tambahkan komentar"
msgid "Add a file name (e.g. notes.md)"
msgstr "Tambahkan nama file (mis. notes.md)"
+#: src/components/settings/EnterpriseHostsSection.tsx
+msgid "Add a host"
+msgstr "Tambahkan host"
+
#: src/components/settings/SearchSection.tsx
msgid "Add a key"
msgstr "Tambahkan kunci"
@@ -1673,6 +1677,10 @@ msgstr "Tambahkan bidang"
msgid "Add file or folder pattern, e.g. guides/**/*"
msgstr "Tambahkan pola berkas atau folder, mis. guides/**/*"
+#: src/components/settings/EnterpriseHostsSection.tsx
+msgid "Add host"
+msgstr "Tambahkan host"
+
#: src/components/SeedRootPicker.tsx
msgid "Add it directly to this project."
msgstr "Tambahkan langsung ke proyek ini."
@@ -5789,6 +5797,10 @@ msgstr "Masukkan nilai heksa 6 digit seperti #1A2B3C"
msgid "Enter a folder name (e.g. brain)."
msgstr "Masukkan nama folder (mis. otak)."
+#: src/components/settings/EnterpriseHostsSection.tsx
+msgid "Enter a hostname, such as github.example.com."
+msgstr "Masukkan nama host, misalnya github.example.com."
+
#: src/components/settings/SavedThemesTiles.tsx
msgid "Enter a name for this theme."
msgstr "Masukkan nama untuk tema ini."
@@ -5841,6 +5853,11 @@ msgstr "Masukkan minimal 3 karakter untuk mencari berdasarkan makna."
msgid "Enter the public origin your tunnel serves, for example https://notes.example.com"
msgstr "Masukkan origin publik yang dilayani tunnel Anda, misalnya https://notes.example.com"
+#: src/components/settings/SettingsDialogShell.tsx
+msgctxt "settings search keyword"
+msgid "enterprise"
+msgstr "enterprise"
+
#: src/components/settings/ContentRulesSection.tsx
msgid "Error"
msgstr "Galat"
@@ -6772,6 +6789,11 @@ msgstr "Mulai siapkan"
msgid "Gets the link that opens this project or a document in the app"
msgstr "Mengambil tautan yang membuka proyek ini atau sebuah dokumen di aplikasi"
+#: src/components/settings/SettingsDialogShell.tsx
+msgctxt "settings search keyword"
+msgid "GHES"
+msgstr "GHES"
+
#: src/components/ExploreSkills.tsx
msgid "Git & PRs"
msgstr "Git & PR"
@@ -6784,6 +6806,11 @@ msgstr "Git tidak bisa melacak folder ini — folder ini kosong atau hanya beris
msgid "Git has locked this worktree, but it can still be opened."
msgstr "Git telah mengunci worktree ini, tetapi masih dapat dibuka."
+#: src/components/settings/SettingsDialogShell.tsx
+msgctxt "settings search keyword"
+msgid "git host"
+msgstr "host git"
+
#: src/components/SyncStatusBadge.tsx
msgid "Git identity isn't set — commits use a default author. Set yours so teammates see your name."
msgstr "Identitas git belum disetel — commit memakai penulis bawaan. Setel milik Anda agar rekan tim melihat nama Anda."
@@ -6825,14 +6852,27 @@ msgstr "Koneksi GitHub kedaluwarsa. Hubungkan lagi untuk melanjutkan."
msgid "GitHub denied the request. You may need to authorize OpenKnowledge for {owner} in your browser."
msgstr "GitHub menolak permintaan ini. Anda mungkin perlu mengizinkan OpenKnowledge untuk {owner} di peramban Anda."
+#: src/components/settings/EnterpriseHostsSection.tsx
+#: src/components/settings/SettingsDialogShell.tsx
+msgid "GitHub Enterprise Server hosts"
+msgstr "Host GitHub Enterprise Server"
+
#: src/components/SyncStatusBadge.tsx
msgid "GitHub sign-in is missing or expired. Reconnect to resume syncing."
msgstr "Status masuk GitHub tidak ada atau kedaluwarsa. Sambungkan ulang untuk melanjutkan sinkronisasi."
+#: src/components/settings/AccountSection.tsx
+msgid "GitHub sign-in isn't available for this project"
+msgstr "Masuk ke GitHub tidak tersedia untuk proyek ini"
+
#: src/components/ImportSkillForm.tsx
msgid "GitHub, a git URL, or a local path."
msgstr "GitHub, sebuah URL git, atau jalur lokal."
+#: src/components/settings/EnterpriseHostsSection.tsx
+msgid "github.com is always recognized, so it doesn't need to be added."
+msgstr "github.com selalu dikenali, jadi tidak perlu ditambahkan."
+
#: src/components/settings/SavedThemesTiles.tsx
msgid "Give it a name before editing its colors."
msgstr "Beri nama sebelum menyunting warnanya."
@@ -7296,6 +7336,10 @@ msgstr "Jika {agent} tidak menampilkan alat OpenKnowledge, jalankan di proyek in
msgid "If an update arrives for something you are editing, you choose which version to keep, like a merge conflict."
msgstr "Jika sebuah pembaruan datang untuk hal yang sedang Anda sunting, Anda memilih versi mana yang disimpan, seperti konflik penggabungan."
+#: src/components/settings/EnterpriseHostsSection.tsx
+msgid "If you use a GitHub Enterprise Server, add its host here so OpenKnowledge can sign in, check push permission, and create share links for repositories hosted there."
+msgstr "Jika Anda menggunakan GitHub Enterprise Server, tambahkan host-nya di sini agar OpenKnowledge dapat masuk, memeriksa izin push, dan membuat tautan berbagi untuk repositori yang dihosting di sana."
+
#: src/components/settings/ContentRulesSection.tsx
msgid "Ignore broken links in log.md"
msgstr "Abaikan tautan rusak di log.md"
@@ -9287,6 +9331,10 @@ msgstr "Belum ada suntingan."
msgid "No emoji found."
msgstr "Tidak ada emoji yang ditemukan."
+#: src/components/settings/EnterpriseHostsSection.tsx
+msgid "No Enterprise hosts added. Only github.com is treated as GitHub."
+msgstr "Belum ada host Enterprise yang ditambahkan. Hanya github.com yang diperlakukan sebagai GitHub."
+
#: src/editor/link-preview/InternalDocPreviewCard.tsx
msgid "No excerpt"
msgstr "Tanpa cuplikan"
@@ -10211,6 +10259,10 @@ msgstr "OpenKnowledge memeriksa proyek"
msgid "OpenKnowledge could not find this agent on this machine."
msgstr "OpenKnowledge tidak menemukan agen ini di mesin ini."
+#: src/components/settings/AccountSection.tsx
+msgid "OpenKnowledge couldn't find a host name in this project's git remote, so it can't tell which GitHub server to sign in to."
+msgstr "OpenKnowledge tidak menemukan nama host di remote git proyek ini, jadi tidak dapat mengetahui server GitHub mana yang harus dimasuki."
+
#: src/lib/worktree-create-error.ts
msgid "OpenKnowledge couldn't finish setting up this project. The worktree was created but not opened."
msgstr "OpenKnowledge tidak dapat menyelesaikan penyiapan proyek ini. Worktree dibuat, tetapi tidak dibuka."
@@ -11580,6 +11632,10 @@ msgstr "Hapus {chip}"
msgid "Remove {fullLabel} from context"
msgstr "Hapus {fullLabel} dari konteks"
+#: src/components/settings/EnterpriseHostsSection.tsx
+msgid "Remove {host}"
+msgstr "Hapus {host}"
+
#: src/components/FrontmatterRow.tsx
msgid "Remove {keyName}"
msgstr "Hapus {keyName}"
@@ -12347,6 +12403,10 @@ msgstr "Disimpan ke"
msgid "Saved with the project for your team."
msgstr "Disimpan bersama proyek untuk tim Anda."
+#: src/components/settings/EnterpriseHostsSection.tsx
+msgid "Saved. Restart OpenKnowledge to apply the change."
+msgstr "Tersimpan. Mulai ulang OpenKnowledge untuk menerapkan perubahan."
+
#: src/lib/acp/tool-call-display.ts
msgid "Saves a restore point for every document in the project"
msgstr "Menyimpan titik pemulihan untuk setiap dokumen di proyek"
@@ -14216,6 +14276,14 @@ msgstr "Folder itu sudah berisi kode yang tidak ditulis Open Knowledge, dan kepe
msgid "That folder isn't an OpenKnowledge project yet. Initialize it and open?"
msgstr "Folder itu belum menjadi proyek OpenKnowledge. Inisialisasi lalu buka?"
+#: src/components/settings/EnterpriseHostsSection.tsx
+msgid "That host is already in the list."
+msgstr "Host tersebut sudah ada di daftar."
+
+#: src/components/settings/EnterpriseHostsSection.tsx
+msgid "That isn't a valid hostname. Enter just the server name, such as github.example.com."
+msgstr "Itu bukan nama host yang valid. Masukkan nama servernya saja, misalnya github.example.com."
+
#: src/components/settings/SpellcheckLanguagesRow.tsx
msgid "That language isn't available for spell checking."
msgstr "Bahasa itu tidak tersedia untuk pemeriksaan ejaan."
@@ -15100,6 +15168,10 @@ msgstr "Proyek ini bukan repositori git, jadi worktree tidak tersedia."
msgid "This project lives only on this computer. Connect it to GitHub to back it up and share it with other people."
msgstr "Proyek ini hanya ada di komputer ini. Hubungkan ke GitHub untuk mencadangkannya dan membagikannya dengan orang lain."
+#: src/components/settings/AccountSection.tsx
+msgid "This project's git remote is on {host}, which OpenKnowledge doesn't recognize as a GitHub host. If {host} runs GitHub Enterprise Server, add it to GitHub Enterprise Server hosts below, then restart OpenKnowledge."
+msgstr "Remote git proyek ini berada di {host}, yang tidak dikenali OpenKnowledge sebagai host GitHub. Jika {host} menjalankan GitHub Enterprise Server, tambahkan ke Host GitHub Enterprise Server di bawah, lalu mulai ulang OpenKnowledge."
+
#: src/components/DocumentErrorBoundary.tsx
msgid "This project's running server doesn't support live editing. Restart OpenKnowledge to fix."
msgstr "Server proyek ini yang sedang berjalan tidak mendukung penyuntingan langsung. Mulai ulang OpenKnowledge untuk memperbaikinya."
diff --git a/packages/app/src/locales/ko/messages.json b/packages/app/src/locales/ko/messages.json
index 72e0bb501..b3326b26c 100644
--- a/packages/app/src/locales/ko/messages.json
+++ b/packages/app/src/locales/ko/messages.json
@@ -218,6 +218,7 @@
"1ruosn": ["OpenKnowledge"],
"1t_NnN": ["거부"],
"1u-mAI": ["동기화를 시작할 수 없습니다. 연결을 확인한 후 다시 시도하세요."],
+ "1uEVfp": ["엔터프라이즈"],
"1vczDE": [["displayName"], " Desktop 열기"],
"1vn0CI": ["잘못된 서버 응답"],
"1xui0Q": ["로컬 파일 불러오기 실패"],
@@ -326,6 +327,7 @@
")"
],
"3LbBJn": ["이미지 첨부"],
+ "3LuFP-": ["저장되었습니다. 변경 사항을 적용하려면 OpenKnowledge를 다시 시작하세요."],
"3MA3Hh": [["gitignorePath"], " 규칙을 읽지 못했습니다: ", ["previewError"]],
"3MnvrL": ["상위 ", ["0"], "개 일치 항목을 표시합니다. 계속 입력하여 범위를 좁히세요"],
"3Mwaly": [["0"], " 초기화에 실패했습니다."],
@@ -690,6 +692,13 @@
"7YRrJ9": [
"OpenKnowledge 데스크톱 앱에서 사용할 수 있습니다. 터미널에서 <0> ok config-sharing status</0> / <1>share</1> / <2>unshare</2>를 사용합니다."
],
+ "7_I248": [
+ "이 프로젝트의 git 원격은 ",
+ ["host"],
+ "에 있으며, OpenKnowledge는 이를 GitHub 호스트로 인식하지 않습니다. ",
+ ["host"],
+ "이(가) GitHub Enterprise Server를 실행한다면 아래의 GitHub Enterprise Server 호스트에 추가한 다음 OpenKnowledge를 다시 시작하세요."
+ ],
"7_bFEL": [["patternText"], " 드래그로 순서를 변경합니다."],
"7a0YcF": ["<0>스페이스</0>를 누르거나 블롭을 탭하여 시작"],
"7aNk5D": ["OpenKnowledge에서 ", ["subject"], " 편집"],
@@ -912,6 +921,7 @@
"AItsE5": ["그곳에서 열기"],
"AJ7_B2": ["새 테마 만들기"],
"AKxFtn": [["openedWorktreeCount", "plural", { "one": ["워크트리"], "other": ["워크트리"] }]],
+ "ALFlyF": ["호스트 추가"],
"ALhMYW": ["터미널"],
"AMU00p": [
"두 버전이 동일합니다. 현재 항목 적용을 선택하면 OpenKnowledge의 보호가 켜진 상태로 유지되어 이전 버전의 또 다른 저장이 다시 거부됩니다. 수신 항목 적용을 선택하면 그 보호가 해제됩니다."
@@ -1136,6 +1146,7 @@
"DDTdLl": ["코드 블록 설정"],
"DELNQk": ["공동 작업자는 동기화가 완료되면 진행 중인 편집 내용을 바로 볼 수 있습니다."],
"DEWDbv": ["다이어그램 보기"],
+ "DEkRZA": ["이미 목록에 있는 호스트입니다."],
"DF1MtZ": [["filePath"], "의 충돌 불러오는 중"],
"DFQ2Sj": ["후속 연락용 이메일"],
"DFfRbX": ["동기화 상태: ", ["syncStateLabel"], ". git 사용자 정보가 설정되지 않았습니다."],
@@ -1203,6 +1214,7 @@
"이(가) 해당 컨텍스트 창으로 다시 시작하지 못했습니다. 다시 시도를 눌러 복구하세요."
],
"Dvwa0U": ["이 브랜치에서 워크트리 만들기"],
+ "Dwu3RL": ["GHES"],
"Dz7fsq": ["확대"],
"E-G19G": [
"포트 ",
@@ -1538,6 +1550,7 @@
"HJ7aHU": [
"현재 블록을 위나 아래로 이동합니다. 목록에서는 현재 항목이나 선택한 항목을 이동합니다."
],
+ "HK2eIK": ["추가된 Enterprise 호스트가 없습니다. github.com만 GitHub로 취급됩니다."],
"HKH-W-": ["데이터"],
"HLoO-Z": ["서버에서 잘못된 가져오기 응답을 반환했습니다."],
"HM56Bx": ["만드는 중…"],
@@ -1641,6 +1654,7 @@
"IxyZXD": ["스크린샷"],
"J0uRhj": ["스킬 확인 중"],
"J1XRO3": ["테마 색상"],
+ "J2-D_a": ["GitHub Enterprise Server 호스트"],
"J2Mv98": ["이름(예: ", ["login"], ")"],
"J2_JuX": ["없음 (", ["0"], "로는 문서와 일치하지 않음)"],
"J2eKUI": ["파일"],
@@ -2188,6 +2202,9 @@
"PezM4_": ["OpenKnowledge 스킬 저장됨. Claude Desktop에 업로드 후 Cowork 다시 클릭하세요."],
"Pg83C9": ["\"", ["0"], "\"을 업로드했습니다."],
"PgJDqs": ["편집기에서 외부 링크 위에 마우스를 올리면 미리보기 카드를 표시합니다."],
+ "PgY2nN": [
+ "GitHub Enterprise Server를 사용한다면 여기에 호스트를 추가하세요. 그러면 OpenKnowledge가 로그인하고, 푸시 권한을 확인하고, 그곳에 호스팅된 저장소의 공유 링크를 만들 수 있습니다."
+ ],
"Pgu10b": ["<0>", ["slug"], ".md</0>로 저장됨"],
"PgzIpb": ["이전 비주얼 편집기 찾기 결과로 이동합니다."],
"PhIa-X": ["이 복사본을 소스를 가리키는 심볼릭 링크로 바꿀까요?"],
@@ -2246,6 +2263,7 @@
"QWdKwH": ["이동"],
"QYTOaN": ["나중에 <0>설정 → 동기화</0>에서 변경할 수 있습니다."],
"QYfQdv": [["displayName"], " CLI"],
+ "Qbf7Q4": ["호스트 추가"],
"QcTjRP": ["이 대화는 시작할 때의 창을 유지합니다. 새 대화에서는 다른 창을 쓸 수 있습니다."],
"Qca--K": [
"다른 프로그램이 여기서 Git을 사용 중입니다. 끝날 때까지 기다린 후 다시 동기화하세요(<0>.git/index.lock</0>을 잡고 있습니다)."
@@ -2266,6 +2284,7 @@
"이 프로젝트에서 실제 셸이 꺼져 있습니다. 켜면 사용자 계정의 전체 권한으로 명령을 실행합니다."
],
"QqBQu1": ["레이블 <0>(표시되는 링크 텍스트)</0>"],
+ "QsnBxE": ["올바른 호스트 이름이 아닙니다. github.example.com처럼 서버 이름만 입력하세요."],
"Qvls7J": ["엔지니어링 사양"],
"Qw-7Ie": [
"주제별 파일 하나와 일일 저널을 제공하는 간단한 작성 공간입니다. 글쓰기를 시작하고 시간이 지나며 노트 사이의 링크를 쌓고 싶다면 이것을 선택하세요."
@@ -2529,6 +2548,7 @@
],
"UI0WPT": [["propertyCount", "plural", { "other": ["속성 ", "#", "개"] }]],
"UIjjFa": ["추가되는 항목 보기"],
+ "UK3GW4": ["github.com은 항상 인식되므로 추가할 필요가 없습니다."],
"UL-9ej": ["OpenKnowledge에서 실시간 미리보기 열기"],
"UL8A9w": ["태그"],
"UMT9C9": ["OpenKnowledge와 MCP 도구를 사용하는 방법."],
@@ -2754,6 +2774,9 @@
"XAyxsa": ["원격 브랜치 체크아웃"],
"XBBZnv": ["링크 대상 \"", ["shown"], "\"이 존재하는 문서로 확인되지 않습니다."],
"XBgr2S": ["복사해 넣기"],
+ "XBpH6-": [
+ "OpenKnowledge가 이 프로젝트의 git 원격 주소에서 호스트 이름을 찾지 못해 어느 GitHub 서버에 로그인해야 할지 알 수 없습니다."
+ ],
"XDzAnp": ["새 탭에서 열림"],
"XF1kgP": [["source"], "의 모든 항목이 이미 최신입니다"],
"XGKy1z": ["이미지를 표시할 수 없음"],
@@ -3253,6 +3276,7 @@
"cEoyWz": [["keyName"], "에 항목 추가"],
"cF9DyA": ["서버를 다시 시작한 후 다시 연결하는 중"],
"cFCKYZ": ["거부"],
+ "cFONFy": ["github.example.com과 같은 호스트 이름을 입력하세요."],
"cFSbbh": [
"이 기기에만 적용됩니다. 여기에서 여는 모든 프로젝트에 적용되며 협업자와 공유되지 않습니다."
],
@@ -3272,6 +3296,7 @@
"cNvGbn": ["편집하여 다시 보내기"],
"cOJyVj": ["테마 사용 안 함"],
"cOSAfL": ["GitHub 계정에서 저장소를 찾을 수 없습니다."],
+ "cOX1Cj": ["git 호스트"],
"cOrTMo": ["공유 링크가 아래에 준비되어 있습니다."],
"cPAWbl": ["이메일로 보냄"],
"cPgQ_i": [
@@ -5220,6 +5245,7 @@
"x57cJf": ["링크 열기"],
"xAlHfe": [["basename"], " 텍스트 편집기"],
"xBFg6z": [["0"], " 플러그인에서"],
+ "xBjIs7": ["이 프로젝트에서는 GitHub 로그인을 사용할 수 없습니다"],
"xCJdfg": ["지우기"],
"xCdTnb": ["새 탭 닫기"],
"xD4Xm2": ["가져오기"],
@@ -5238,6 +5264,7 @@
"xOTzt5": ["방금"],
"xSVO3J": ["생성되는 항목"],
"xV5sXw": [["0"], "주 전"],
+ "xVMoYb": [["host"], " 제거"],
"xW5AUw": [["pulled"], " 풀"],
"xW7KK3": [
"“",
diff --git a/packages/app/src/locales/ko/messages.po b/packages/app/src/locales/ko/messages.po
index 48bcf33ac..2d676e624 100644
--- a/packages/app/src/locales/ko/messages.po
+++ b/packages/app/src/locales/ko/messages.po
@@ -1624,6 +1624,10 @@ msgstr "댓글 추가"
msgid "Add a file name (e.g. notes.md)"
msgstr "파일 이름을 추가하세요 (예: notes.md)"
+#: src/components/settings/EnterpriseHostsSection.tsx
+msgid "Add a host"
+msgstr "호스트 추가"
+
#: src/components/settings/SearchSection.tsx
msgid "Add a key"
msgstr "키 추가"
@@ -1677,6 +1681,10 @@ msgstr "필드 추가"
msgid "Add file or folder pattern, e.g. guides/**/*"
msgstr "파일 또는 폴더 패턴 추가, 예: guides/**/*"
+#: src/components/settings/EnterpriseHostsSection.tsx
+msgid "Add host"
+msgstr "호스트 추가"
+
#: src/components/SeedRootPicker.tsx
msgid "Add it directly to this project."
msgstr "이 프로젝트에 직접 추가합니다."
@@ -5793,6 +5801,10 @@ msgstr "6자리 16진수 입력, 예: #1A2B3C"
msgid "Enter a folder name (e.g. brain)."
msgstr "폴더 이름을 입력하세요(예: brain)."
+#: src/components/settings/EnterpriseHostsSection.tsx
+msgid "Enter a hostname, such as github.example.com."
+msgstr "github.example.com과 같은 호스트 이름을 입력하세요."
+
#: src/components/settings/SavedThemesTiles.tsx
msgid "Enter a name for this theme."
msgstr "이 테마의 이름을 입력합니다."
@@ -5845,6 +5857,11 @@ msgstr "의미로 검색하려면 3자 이상 입력하세요."
msgid "Enter the public origin your tunnel serves, for example https://notes.example.com"
msgstr "터널이 제공하는 공개 오리진을 입력하세요. 예: https://notes.example.com"
+#: src/components/settings/SettingsDialogShell.tsx
+msgctxt "settings search keyword"
+msgid "enterprise"
+msgstr "엔터프라이즈"
+
#: src/components/settings/ContentRulesSection.tsx
msgid "Error"
msgstr "오류"
@@ -6776,6 +6793,11 @@ msgstr "설정 시작"
msgid "Gets the link that opens this project or a document in the app"
msgstr "이 프로젝트나 문서를 앱에서 여는 링크를 가져옵니다"
+#: src/components/settings/SettingsDialogShell.tsx
+msgctxt "settings search keyword"
+msgid "GHES"
+msgstr "GHES"
+
#: src/components/ExploreSkills.tsx
msgid "Git & PRs"
msgstr "Git 및 PR"
@@ -6788,6 +6810,11 @@ msgstr "Git이 이 폴더를 추적할 수 없습니다. 비어 있거나 무시
msgid "Git has locked this worktree, but it can still be opened."
msgstr "Git에서 이 워크트리를 잠갔지만 계속 열 수 있습니다."
+#: src/components/settings/SettingsDialogShell.tsx
+msgctxt "settings search keyword"
+msgid "git host"
+msgstr "git 호스트"
+
#: src/components/SyncStatusBadge.tsx
msgid "Git identity isn't set — commits use a default author. Set yours so teammates see your name."
msgstr "Git 사용자 정보가 설정되지 않았습니다. 커밋에 기본 작성자가 사용됩니다. 팀원이 이름을 볼 수 있도록 사용자 정보를 설정하세요."
@@ -6829,14 +6856,27 @@ msgstr "GitHub 연결이 만료되었습니다. 계속하려면 다시 연결하
msgid "GitHub denied the request. You may need to authorize OpenKnowledge for {owner} in your browser."
msgstr "GitHub에서 요청을 거부했습니다. 브라우저에서 {owner}에 OpenKnowledge 권한을 부여해야 할 수 있습니다."
+#: src/components/settings/EnterpriseHostsSection.tsx
+#: src/components/settings/SettingsDialogShell.tsx
+msgid "GitHub Enterprise Server hosts"
+msgstr "GitHub Enterprise Server 호스트"
+
#: src/components/SyncStatusBadge.tsx
msgid "GitHub sign-in is missing or expired. Reconnect to resume syncing."
msgstr "GitHub 로그인이 없거나 만료되었습니다. 동기화를 계속하려면 다시 연결하세요."
+#: src/components/settings/AccountSection.tsx
+msgid "GitHub sign-in isn't available for this project"
+msgstr "이 프로젝트에서는 GitHub 로그인을 사용할 수 없습니다"
+
#: src/components/ImportSkillForm.tsx
msgid "GitHub, a git URL, or a local path."
msgstr "GitHub, git URL 또는 로컬 경로입니다."
+#: src/components/settings/EnterpriseHostsSection.tsx
+msgid "github.com is always recognized, so it doesn't need to be added."
+msgstr "github.com은 항상 인식되므로 추가할 필요가 없습니다."
+
#: src/components/settings/SavedThemesTiles.tsx
msgid "Give it a name before editing its colors."
msgstr "색상을 편집하기 전에 이름을 지정합니다."
@@ -7300,6 +7340,10 @@ msgstr "{agent}에 OpenKnowledge 도구가 보이지 않으면 이 프로젝트
msgid "If an update arrives for something you are editing, you choose which version to keep, like a merge conflict."
msgstr "편집 중인 항목에 업데이트가 도착하면 병합 충돌처럼 유지할 버전을 선택합니다."
+#: src/components/settings/EnterpriseHostsSection.tsx
+msgid "If you use a GitHub Enterprise Server, add its host here so OpenKnowledge can sign in, check push permission, and create share links for repositories hosted there."
+msgstr "GitHub Enterprise Server를 사용한다면 여기에 호스트를 추가하세요. 그러면 OpenKnowledge가 로그인하고, 푸시 권한을 확인하고, 그곳에 호스팅된 저장소의 공유 링크를 만들 수 있습니다."
+
#: src/components/settings/ContentRulesSection.tsx
msgid "Ignore broken links in log.md"
msgstr "log.md의 손상된 링크 무시"
@@ -9291,6 +9335,10 @@ msgstr "아직 편집 없음."
msgid "No emoji found."
msgstr "이모지를 찾지 못했습니다."
+#: src/components/settings/EnterpriseHostsSection.tsx
+msgid "No Enterprise hosts added. Only github.com is treated as GitHub."
+msgstr "추가된 Enterprise 호스트가 없습니다. github.com만 GitHub로 취급됩니다."
+
#: src/editor/link-preview/InternalDocPreviewCard.tsx
msgid "No excerpt"
msgstr "발췌문 없음"
@@ -10215,6 +10263,10 @@ msgstr "OpenKnowledge에서 프로젝트 확인"
msgid "OpenKnowledge could not find this agent on this machine."
msgstr "OpenKnowledge가 이 컴퓨터에서 이 에이전트를 찾지 못했습니다."
+#: src/components/settings/AccountSection.tsx
+msgid "OpenKnowledge couldn't find a host name in this project's git remote, so it can't tell which GitHub server to sign in to."
+msgstr "OpenKnowledge가 이 프로젝트의 git 원격 주소에서 호스트 이름을 찾지 못해 어느 GitHub 서버에 로그인해야 할지 알 수 없습니다."
+
#: src/lib/worktree-create-error.ts
msgid "OpenKnowledge couldn't finish setting up this project. The worktree was created but not opened."
msgstr "OpenKnowledge가 이 프로젝트 설정을 완료하지 못했습니다. 워크트리는 생성되었지만 열리지 않았습니다."
@@ -11584,6 +11636,10 @@ msgstr "{chip} 제거"
msgid "Remove {fullLabel} from context"
msgstr "현재 내용에서 {fullLabel} 제거"
+#: src/components/settings/EnterpriseHostsSection.tsx
+msgid "Remove {host}"
+msgstr "{host} 제거"
+
#: src/components/FrontmatterRow.tsx
msgid "Remove {keyName}"
msgstr "{keyName} 제거"
@@ -12351,6 +12407,10 @@ msgstr "저장 위치"
msgid "Saved with the project for your team."
msgstr "팀을 위해 프로젝트와 함께 저장됨."
+#: src/components/settings/EnterpriseHostsSection.tsx
+msgid "Saved. Restart OpenKnowledge to apply the change."
+msgstr "저장되었습니다. 변경 사항을 적용하려면 OpenKnowledge를 다시 시작하세요."
+
#: src/lib/acp/tool-call-display.ts
msgid "Saves a restore point for every document in the project"
msgstr "프로젝트의 모든 문서에 대한 복원 지점을 저장합니다"
@@ -14220,6 +14280,14 @@ msgstr "해당 폴더에는 Open Knowledge가 작성하지 않은 코드가 이
msgid "That folder isn't an OpenKnowledge project yet. Initialize it and open?"
msgstr "해당 폴더는 아직 OpenKnowledge 프로젝트가 아닙니다. 초기화하고 여시겠습니까?"
+#: src/components/settings/EnterpriseHostsSection.tsx
+msgid "That host is already in the list."
+msgstr "이미 목록에 있는 호스트입니다."
+
+#: src/components/settings/EnterpriseHostsSection.tsx
+msgid "That isn't a valid hostname. Enter just the server name, such as github.example.com."
+msgstr "올바른 호스트 이름이 아닙니다. github.example.com처럼 서버 이름만 입력하세요."
+
#: src/components/settings/SpellcheckLanguagesRow.tsx
msgid "That language isn't available for spell checking."
msgstr "해당 언어는 맞춤법 검사에서 지원되지 않습니다."
@@ -15104,6 +15172,10 @@ msgstr "이 프로젝트는 git 저장소가 아니므로 워크트리를 사용
msgid "This project lives only on this computer. Connect it to GitHub to back it up and share it with other people."
msgstr "이 프로젝트는 이 컴퓨터에만 있습니다. 백업하고 다른 사람과 공유하려면 GitHub에 연결합니다."
+#: src/components/settings/AccountSection.tsx
+msgid "This project's git remote is on {host}, which OpenKnowledge doesn't recognize as a GitHub host. If {host} runs GitHub Enterprise Server, add it to GitHub Enterprise Server hosts below, then restart OpenKnowledge."
+msgstr "이 프로젝트의 git 원격은 {host}에 있으며, OpenKnowledge는 이를 GitHub 호스트로 인식하지 않습니다. {host}이(가) GitHub Enterprise Server를 실행한다면 아래의 GitHub Enterprise Server 호스트에 추가한 다음 OpenKnowledge를 다시 시작하세요."
+
#: src/components/DocumentErrorBoundary.tsx
msgid "This project's running server doesn't support live editing. Restart OpenKnowledge to fix."
msgstr "이 프로젝트에서 실행 중인 서버는 실시간 편집을 지원하지 않습니다. OpenKnowledge를 다시 시작하여 수정하세요."
diff --git a/packages/app/src/locales/pseudo/messages.json b/packages/app/src/locales/pseudo/messages.json
index 15c0790c4..e2935e46b 100644
--- a/packages/app/src/locales/pseudo/messages.json
+++ b/packages/app/src/locales/pseudo/messages.json
@@ -230,6 +230,7 @@
"1ruosn": ["ŌƥēńĶńōŵĺēďĝē"],
"1t_NnN": ["ŔēĴēćţ"],
"1u-mAI": ["Ćōũĺďń'ţ śţàŕţ ţĥē śŷńć. Ćĥēćķ ŷōũŕ ćōńńēćţĩōń, ţĥēń ŕēţŕŷ."],
+ "1uEVfp": ["ēńţēŕƥŕĩśē"],
"1vczDE": ["Ōƥēń ", ["displayName"], " Ďēśķţōƥ"],
"1vn0CI": ["Ĩńvàĺĩď śēŕvēŕ ŕēśƥōńśē"],
"1xui0Q": ["Ƒàĩĺēď ţō ĺōàď ĺōćàĺ ƒĩĺēś"],
@@ -342,6 +343,7 @@
")"
],
"3LbBJn": ["Àţţàćĥ ĩḿàĝēś"],
+ "3LuFP-": ["Śàvēď. Ŕēśţàŕţ ŌƥēńĶńōŵĺēďĝē ţō àƥƥĺŷ ţĥē ćĥàńĝē."],
"3MA3Hh": ["Ćōũĺďń'ţ ŕēàď ţĥē ", ["gitignorePath"], " ŕũĺē: ", ["previewError"]],
"3MnvrL": ["Śĥōŵĩńĝ ţōƥ ", ["0"], " ḿàţćĥēś — ķēēƥ ţŷƥĩńĝ ţō ńàŕŕōŵ"],
"3Mwaly": ["Ćōũĺď ńōţ ĩńĩţĩàĺĩźē ", ["0"], "."],
@@ -703,6 +705,13 @@
"7YRrJ9": [
"Àvàĩĺàƀĺē ĩń ţĥē ŌƥēńĶńōŵĺēďĝē ďēśķţōƥ àƥƥ. Ƒŕōḿ à ţēŕḿĩńàĺ, ũśē<0> ōķ ćōńƒĩĝ-śĥàŕĩńĝ śţàţũś</0> / <1>śĥàŕē</1> / <2>ũńśĥàŕē</2>."
],
+ "7_I248": [
+ "Ţĥĩś ƥŕōĴēćţ'ś ĝĩţ ŕēḿōţē ĩś ōń ",
+ ["host"],
+ ", ŵĥĩćĥ ŌƥēńĶńōŵĺēďĝē ďōēśń'ţ ŕēćōĝńĩźē àś à ĜĩţĤũƀ ĥōśţ. Ĩƒ ",
+ ["host"],
+ " ŕũńś ĜĩţĤũƀ Ēńţēŕƥŕĩśē Śēŕvēŕ, àďď ĩţ ţō ĜĩţĤũƀ Ēńţēŕƥŕĩśē Śēŕvēŕ ĥōśţś ƀēĺōŵ, ţĥēń ŕēśţàŕţ ŌƥēńĶńōŵĺēďĝē."
+ ],
"7_bFEL": ["Ďŕàĝ ", ["patternText"], " ţō ŕēōŕďēŕ"],
"7a0YcF": ["Ƥŕēśś <0>Śƥàćē</0> ōŕ ţàƥ ţĥē ƀĺōƀ ţō śţàŕţ"],
"7aNk5D": ["ŌƥēńĶńōŵĺēďĝē ēďĩţēď ", ["subject"]],
@@ -935,6 +944,7 @@
"AItsE5": ["Ōƥēń ĩţ ţĥēŕē"],
"AJ7_B2": ["Ćŕēàţē ńēŵ ţĥēḿē"],
"AKxFtn": [["openedWorktreeCount", "plural", { "one": ["ŵōŕķţŕēē"], "other": ["ŵōŕķţŕēēś"] }]],
+ "ALFlyF": ["Àďď ĥōśţ"],
"ALhMYW": ["Ţēŕḿĩńàĺ"],
"AMU00p": [
"ßōţĥ vēŕśĩōńś àŕē ĩďēńţĩćàĺ. Ćĥōōśĩńĝ Àććēƥţ ćũŕŕēńţ ĺēàvēś ŌƥēńĶńōŵĺēďĝē'ś ƥŕōţēćţĩōń ōń, śō àńōţĥēŕ śàvē ōƒ ţĥē ōĺďēŕ vēŕśĩōń ĩś ŕēƒũśēď àĝàĩń. Ćĥōōśĩńĝ Àććēƥţ ĩńćōḿĩńĝ ţũŕńś ţĥàţ ƥŕōţēćţĩōń ōƒƒ."
@@ -1174,6 +1184,7 @@
"DDTdLl": ["Ćōďē ƀĺōćķ śēţţĩńĝś"],
"DELNQk": ["Ćōĺĺàƀōŕàţōŕś śēē ŷōũŕ ĩń-ƥŕōĝŕēśś ēďĩţś àś śōōń àś ţĥēŷ śŷńć."],
"DEWDbv": ["Śĥōŵ ďĩàĝŕàḿ"],
+ "DEkRZA": ["Ţĥàţ ĥōśţ ĩś àĺŕēàďŷ ĩń ţĥē ĺĩśţ."],
"DF1MtZ": ["Ĺōàďĩńĝ ćōńƒĺĩćţ ƒōŕ ", ["filePath"]],
"DFQ2Sj": ["Ēḿàĩĺ ƒōŕ ƒōĺĺōŵũƥś"],
"DFfRbX": ["Śŷńć śţàţũś: ", ["syncStateLabel"], " — ĝĩţ ĩďēńţĩţŷ ũńśēţ"],
@@ -1236,6 +1247,7 @@
"Dvr1Sg": ["Ćōƥŷĩńĝ"],
"Dvvrs8": [["0"], " ćōũĺďń'ţ ŕēśţàŕţ ōń ţĥàţ ćōńţēxţ ŵĩńďōŵ. Ũśē Ŕēţŕŷ ţō ƀŕĩńĝ ĩţ ƀàćķ."],
"Dvwa0U": ["Ćŕēàţē à ŵōŕķţŕēē ƒŕōḿ ţĥĩś ƀŕàńćĥ"],
+ "Dwu3RL": ["ĜĤĒŚ"],
"Dz7fsq": ["Źōōḿ Ĩń"],
"E-G19G": [
"Ƥōŕţ ",
@@ -1581,6 +1593,7 @@
"HJ7aHU": [
"Ḿōvē ţĥē ćũŕŕēńţ ƀĺōćķ ũƥ ōŕ ďōŵń. Ĩń ĺĩśţś, ḿōvē ţĥē ćũŕŕēńţ ĩţēḿ ōŕ śēĺēćţēď ĩţēḿś."
],
+ "HK2eIK": ["Ńō Ēńţēŕƥŕĩśē ĥōśţś àďďēď. Ōńĺŷ ĝĩţĥũƀ.ćōḿ ĩś ţŕēàţēď àś ĜĩţĤũƀ."],
"HKH-W-": ["Ďàţà"],
"HLoO-Z": ["Śēŕvēŕ ŕēţũŕńēď à ḿàĺƒōŕḿēď ĩḿƥōŕţ ŕēśƥōńśē."],
"HM56Bx": ["Ćŕēàţĩńĝ..."],
@@ -1687,6 +1700,7 @@
"IxyZXD": ["Śćŕēēńśĥōţ"],
"J0uRhj": ["Ćĥēćķĩńĝ śķĩĺĺ"],
"J1XRO3": ["Ţĥēḿē ćōĺōŕś"],
+ "J2-D_a": ["ĜĩţĤũƀ Ēńţēŕƥŕĩśē Śēŕvēŕ ĥōśţś"],
"J2Mv98": ["Ńàḿē (ē.ĝ. ", ["login"], ")"],
"J2_JuX": ["ńōţĥĩńĝ (", ["0"], " ćàńńōţ ḿàţćĥ à ďōć)"],
"J2eKUI": ["Ƒĩĺē"],
@@ -2259,6 +2273,9 @@
"PezM4_": ["ŌƥēńĶńōŵĺēďĝē śķĩĺĺ śàvēď. Ũƥĺōàď ĩţ ĩń Ćĺàũďē Ďēśķţōƥ, ţĥēń ćĺĩćķ Ćōŵōŕķ àĝàĩń."],
"Pg83C9": ["Ũƥĺōàďēď \"", ["0"], "\"."],
"PgJDqs": ["Śĥōŵ à ƥŕēvĩēŵ ćàŕď ŵĥēń ŷōũ ĥōvēŕ àń ēxţēŕńàĺ ĺĩńķ ĩń ţĥē ēďĩţōŕ."],
+ "PgY2nN": [
+ "Ĩƒ ŷōũ ũśē à ĜĩţĤũƀ Ēńţēŕƥŕĩśē Śēŕvēŕ, àďď ĩţś ĥōśţ ĥēŕē śō ŌƥēńĶńōŵĺēďĝē ćàń śĩĝń ĩń, ćĥēćķ ƥũśĥ ƥēŕḿĩśśĩōń, àńď ćŕēàţē śĥàŕē ĺĩńķś ƒōŕ ŕēƥōśĩţōŕĩēś ĥōśţēď ţĥēŕē."
+ ],
"Pgu10b": ["Śàvēď àś <0>", ["slug"], ".ḿď</0>"],
"PgzIpb": ["Ḿōvē ţō ţĥē ƥŕēvĩōũś vĩśũàĺ-ēďĩţōŕ ƒĩńď ŕēśũĺţ."],
"PhIa-X": ["Ŕēƥĺàćē ţĥēśē ćōƥĩēś ŵĩţĥ śŷḿĺĩńķś ţō ţĥē śōũŕćē?"],
@@ -2322,6 +2339,7 @@
"QWdKwH": ["Ḿōvē"],
"QYTOaN": ["Ŷōũ ćàń ćĥàńĝē ţĥĩś ĺàţēŕ ĩń <0>Śēţţĩńĝś → Śŷńć</0>."],
"QYfQdv": [["displayName"], " ĆĹĨ"],
+ "Qbf7Q4": ["Àďď à ĥōśţ"],
"QcTjRP": [
"Ţĥĩś ćōńvēŕśàţĩōń ķēēƥś ţĥē ŵĩńďōŵ ĩţ śţàŕţēď ŵĩţĥ. À ńēŵ ćĥàţ ćàń ũśē à ďĩƒƒēŕēńţ ōńē."
],
@@ -2348,6 +2366,9 @@
"À ŕēàĺ śĥēĺĺ ĩś ōƒƒ ƒōŕ ţĥĩś ƥŕōĴēćţ. Ţũŕńĩńĝ ĩţ ōń ŕũńś ćōḿḿàńďś ŵĩţĥ ţĥē ƒũĺĺ àććēśś ōƒ ŷōũŕ ũśēŕ àććōũńţ."
],
"QqBQu1": ["Ĺàƀēĺ <0>(vĩśĩƀĺē ĺĩńķ ţēxţ)</0>"],
+ "QsnBxE": [
+ "Ţĥàţ ĩśń'ţ à vàĺĩď ĥōśţńàḿē. Ēńţēŕ Ĵũśţ ţĥē śēŕvēŕ ńàḿē, śũćĥ àś ĝĩţĥũƀ.ēxàḿƥĺē.ćōḿ."
+ ],
"Qvls7J": ["Ēńĝ śƥēćś"],
"Qw-7Ie": [
"À śĩḿƥĺē ƥĺàćē ţō ŵŕĩţē, ŵĩţĥ ōńē ƒĩĺē ƥēŕ ţōƥĩć àńď à ďàĩĺŷ Ĵōũŕńàĺ. Ƥĩćķ ţĥĩś ĩƒ ŷōũ Ĵũśţ ŵàńţ ţō śţàŕţ ŵŕĩţĩńĝ àńď ĺēţ ţĥē ĺĩńķś ƀēţŵēēń ńōţēś ƀũĩĺď ũƥ ōvēŕ ţĩḿē."
@@ -2621,6 +2642,7 @@
["propertyCount", "plural", { "one": ["#", " ƥŕōƥēŕţŷ"], "other": ["#", " ƥŕōƥēŕţĩēś"] }]
],
"UIjjFa": ["Śēē ŵĥàţ'ś àďďēď"],
+ "UK3GW4": ["ĝĩţĥũƀ.ćōḿ ĩś àĺŵàŷś ŕēćōĝńĩźēď, śō ĩţ ďōēśń'ţ ńēēď ţō ƀē àďďēď."],
"UL-9ej": ["ŌƥēńĶńōŵĺēďĝē ōƥēńēď ţĥē ĺĩvē ƥŕēvĩēŵ"],
"UL8A9w": ["Ţàĝ"],
"UMT9C9": ["Ĥōŵ ţō ũśē ŌƥēńĶńōŵĺēďĝē àńď ĩţś ḾĆƤ ţōōĺś."],
@@ -2844,6 +2866,9 @@
"XAyxsa": ["Ćĥēćķ ōũţ ŕēḿōţē ƀŕàńćĥ"],
"XBBZnv": ["Ĺĩńķ ţàŕĝēţ \"", ["shown"], "\" ďōēś ńōţ ŕēśōĺvē ţō àń ēxĩśţĩńĝ ďōćũḿēńţ."],
"XBgr2S": ["Ćōƥŷ ĩń"],
+ "XBpH6-": [
+ "ŌƥēńĶńōŵĺēďĝē ćōũĺďń'ţ ƒĩńď à ĥōśţ ńàḿē ĩń ţĥĩś ƥŕōĴēćţ'ś ĝĩţ ŕēḿōţē, śō ĩţ ćàń'ţ ţēĺĺ ŵĥĩćĥ ĜĩţĤũƀ śēŕvēŕ ţō śĩĝń ĩń ţō."
+ ],
"XDzAnp": ["Ōƥēńś ĩń à ńēŵ ţàƀ"],
"XF1kgP": ["Ēvēŕŷţĥĩńĝ ƒŕōḿ ", ["source"], " ĩś àĺŕēàďŷ ũƥ ţō ďàţē"],
"XGKy1z": ["Ĩḿàĝē ćōũĺďń'ţ ƀē ďĩśƥĺàŷēď"],
@@ -3357,6 +3382,7 @@
"cEoyWz": ["Àďď ĩţēḿ ţō ", ["keyName"]],
"cF9DyA": ["Ŕēćōńńēćţĩńĝ àƒţēŕ śēŕvēŕ ŕēśţàŕţ"],
"cFCKYZ": ["Ďēńŷ"],
+ "cFONFy": ["Ēńţēŕ à ĥōśţńàḿē, śũćĥ àś ĝĩţĥũƀ.ēxàḿƥĺē.ćōḿ."],
"cFSbbh": [
"Ƥēŕśōńàĺ ţō ţĥĩś ďēvĩćē. Àƥƥĺĩēś ţō ēvēŕŷ ƥŕōĴēćţ ŷōũ ōƥēń ĥēŕē àńď ĩś ńēvēŕ śĥàŕēď ŵĩţĥ ćōĺĺàƀōŕàţōŕś."
],
@@ -3378,6 +3404,7 @@
"cNvGbn": ["Ēďĩţ àńď ŕēśēńď"],
"cOJyVj": ["Ďĩśàƀĺē Ţĥēḿēś"],
"cOSAfL": ["Ńō ŕēƥōśĩţōŕĩēś ƒōũńď ōń ŷōũŕ ĜĩţĤũƀ àććōũńţ."],
+ "cOX1Cj": ["ĝĩţ ĥōśţ"],
"cOrTMo": ["Ŷōũŕ śĥàŕē ĺĩńķ ĩś ŕēàďŷ ƀēĺōŵ."],
"cPAWbl": ["Ēḿàĩĺēď"],
"cPgQ_i": [
@@ -5450,6 +5477,7 @@
"x57cJf": ["Ōƥēń ĺĩńķ"],
"xAlHfe": [["basename"], " — ţēxţ ēďĩţōŕ"],
"xBFg6z": ["Ƒŕōḿ ţĥē ", ["0"], " ƥĺũĝĩń"],
+ "xBjIs7": ["ĜĩţĤũƀ śĩĝń-ĩń ĩśń'ţ àvàĩĺàƀĺē ƒōŕ ţĥĩś ƥŕōĴēćţ"],
"xCJdfg": ["Ćĺēàŕ"],
"xCdTnb": ["Ćĺōśē ńēŵ ţàƀ"],
"xD4Xm2": ["Ƒēţćĥ"],
@@ -5468,6 +5496,7 @@
"xOTzt5": ["Ĵũśţ ńōŵ"],
"xSVO3J": ["Ŵĥàţ ĝēţś ćŕēàţēď"],
"xV5sXw": [["0"], "ŵ àĝō"],
+ "xVMoYb": ["Ŕēḿōvē ", ["host"]],
"xW5AUw": ["Ƥũĺĺēď ", ["pulled"]],
"xW7KK3": [
"Śōḿēţĥĩńĝ ńàḿēď \"",
diff --git a/packages/app/src/locales/pseudo/messages.po b/packages/app/src/locales/pseudo/messages.po
index 36657ad6b..c50fa2003 100644
--- a/packages/app/src/locales/pseudo/messages.po
+++ b/packages/app/src/locales/pseudo/messages.po
@@ -1620,6 +1620,10 @@ msgstr ""
msgid "Add a file name (e.g. notes.md)"
msgstr ""
+#: src/components/settings/EnterpriseHostsSection.tsx
+msgid "Add a host"
+msgstr ""
+
#: src/components/settings/SearchSection.tsx
msgid "Add a key"
msgstr ""
@@ -1673,6 +1677,10 @@ msgstr ""
msgid "Add file or folder pattern, e.g. guides/**/*"
msgstr ""
+#: src/components/settings/EnterpriseHostsSection.tsx
+msgid "Add host"
+msgstr ""
+
#: src/components/SeedRootPicker.tsx
msgid "Add it directly to this project."
msgstr ""
@@ -5789,6 +5797,10 @@ msgstr ""
msgid "Enter a folder name (e.g. brain)."
msgstr ""
+#: src/components/settings/EnterpriseHostsSection.tsx
+msgid "Enter a hostname, such as github.example.com."
+msgstr ""
+
#: src/components/settings/SavedThemesTiles.tsx
msgid "Enter a name for this theme."
msgstr ""
@@ -5841,6 +5853,11 @@ msgstr ""
msgid "Enter the public origin your tunnel serves, for example https://notes.example.com"
msgstr ""
+#: src/components/settings/SettingsDialogShell.tsx
+msgctxt "settings search keyword"
+msgid "enterprise"
+msgstr ""
+
#: src/components/settings/ContentRulesSection.tsx
msgid "Error"
msgstr ""
@@ -6772,6 +6789,11 @@ msgstr ""
msgid "Gets the link that opens this project or a document in the app"
msgstr ""
+#: src/components/settings/SettingsDialogShell.tsx
+msgctxt "settings search keyword"
+msgid "GHES"
+msgstr ""
+
#: src/components/ExploreSkills.tsx
msgid "Git & PRs"
msgstr ""
@@ -6784,6 +6806,11 @@ msgstr ""
msgid "Git has locked this worktree, but it can still be opened."
msgstr ""
+#: src/components/settings/SettingsDialogShell.tsx
+msgctxt "settings search keyword"
+msgid "git host"
+msgstr ""
+
#: src/components/SyncStatusBadge.tsx
msgid "Git identity isn't set — commits use a default author. Set yours so teammates see your name."
msgstr ""
@@ -6825,14 +6852,27 @@ msgstr ""
msgid "GitHub denied the request. You may need to authorize OpenKnowledge for {owner} in your browser."
msgstr ""
+#: src/components/settings/EnterpriseHostsSection.tsx
+#: src/components/settings/SettingsDialogShell.tsx
+msgid "GitHub Enterprise Server hosts"
+msgstr ""
+
#: src/components/SyncStatusBadge.tsx
msgid "GitHub sign-in is missing or expired. Reconnect to resume syncing."
msgstr ""
+#: src/components/settings/AccountSection.tsx
+msgid "GitHub sign-in isn't available for this project"
+msgstr ""
+
#: src/components/ImportSkillForm.tsx
msgid "GitHub, a git URL, or a local path."
msgstr ""
+#: src/components/settings/EnterpriseHostsSection.tsx
+msgid "github.com is always recognized, so it doesn't need to be added."
+msgstr ""
+
#: src/components/settings/SavedThemesTiles.tsx
msgid "Give it a name before editing its colors."
msgstr ""
@@ -7296,6 +7336,10 @@ msgstr ""
msgid "If an update arrives for something you are editing, you choose which version to keep, like a merge conflict."
msgstr ""
+#: src/components/settings/EnterpriseHostsSection.tsx
+msgid "If you use a GitHub Enterprise Server, add its host here so OpenKnowledge can sign in, check push permission, and create share links for repositories hosted there."
+msgstr ""
+
#: src/components/settings/ContentRulesSection.tsx
msgid "Ignore broken links in log.md"
msgstr ""
@@ -9287,6 +9331,10 @@ msgstr ""
msgid "No emoji found."
msgstr ""
+#: src/components/settings/EnterpriseHostsSection.tsx
+msgid "No Enterprise hosts added. Only github.com is treated as GitHub."
+msgstr ""
+
#: src/editor/link-preview/InternalDocPreviewCard.tsx
msgid "No excerpt"
msgstr ""
@@ -10211,6 +10259,10 @@ msgstr ""
msgid "OpenKnowledge could not find this agent on this machine."
msgstr ""
+#: src/components/settings/AccountSection.tsx
+msgid "OpenKnowledge couldn't find a host name in this project's git remote, so it can't tell which GitHub server to sign in to."
+msgstr ""
+
#: src/lib/worktree-create-error.ts
msgid "OpenKnowledge couldn't finish setting up this project. The worktree was created but not opened."
msgstr ""
@@ -11580,6 +11632,10 @@ msgstr ""
msgid "Remove {fullLabel} from context"
msgstr ""
+#: src/components/settings/EnterpriseHostsSection.tsx
+msgid "Remove {host}"
+msgstr ""
+
#: src/components/FrontmatterRow.tsx
msgid "Remove {keyName}"
msgstr ""
@@ -12347,6 +12403,10 @@ msgstr ""
msgid "Saved with the project for your team."
msgstr ""
+#: src/components/settings/EnterpriseHostsSection.tsx
+msgid "Saved. Restart OpenKnowledge to apply the change."
+msgstr ""
+
#: src/lib/acp/tool-call-display.ts
msgid "Saves a restore point for every document in the project"
msgstr ""
@@ -14216,6 +14276,14 @@ msgstr ""
msgid "That folder isn't an OpenKnowledge project yet. Initialize it and open?"
msgstr ""
+#: src/components/settings/EnterpriseHostsSection.tsx
+msgid "That host is already in the list."
+msgstr ""
+
+#: src/components/settings/EnterpriseHostsSection.tsx
+msgid "That isn't a valid hostname. Enter just the server name, such as github.example.com."
+msgstr ""
+
#: src/components/settings/SpellcheckLanguagesRow.tsx
msgid "That language isn't available for spell checking."
msgstr ""
@@ -15100,6 +15168,10 @@ msgstr ""
msgid "This project lives only on this computer. Connect it to GitHub to back it up and share it with other people."
msgstr ""
+#: src/components/settings/AccountSection.tsx
+msgid "This project's git remote is on {host}, which OpenKnowledge doesn't recognize as a GitHub host. If {host} runs GitHub Enterprise Server, add it to GitHub Enterprise Server hosts below, then restart OpenKnowledge."
+msgstr ""
+
#: src/components/DocumentErrorBoundary.tsx
msgid "This project's running server doesn't support live editing. Restart OpenKnowledge to fix."
msgstr ""
diff --git a/packages/app/src/locales/pt-BR/messages.json b/packages/app/src/locales/pt-BR/messages.json
index b7e868c20..ca09b8681 100644
--- a/packages/app/src/locales/pt-BR/messages.json
+++ b/packages/app/src/locales/pt-BR/messages.json
@@ -266,6 +266,7 @@
"1ruosn": ["OpenKnowledge"],
"1t_NnN": ["Rejeitar"],
"1u-mAI": ["Não deu para iniciar a sincronização. Verifique sua conexão e tente de novo."],
+ "1uEVfp": ["empresa"],
"1vczDE": ["Abrir ", ["displayName"], " Desktop"],
"1vn0CI": ["Resposta do servidor inválida"],
"1xui0Q": ["Falha ao carregar os arquivos locais"],
@@ -391,6 +392,7 @@
")"
],
"3LbBJn": ["Anexar imagens"],
+ "3LuFP-": ["Salvo. Reinicie o OpenKnowledge para aplicar a alteração."],
"3MA3Hh": ["Não foi possível ler a regra de ", ["gitignorePath"], ": ", ["previewError"]],
"3MnvrL": [
"Mostrando as ",
@@ -835,6 +837,13 @@
"7YRrJ9": [
"Disponível no app de desktop do OpenKnowledge. Em um terminal, use<0> ok config-sharing status</0> / <1>share</1> / <2>unshare</2>."
],
+ "7_I248": [
+ "O remoto git deste projeto está em ",
+ ["host"],
+ ", que o OpenKnowledge não reconhece como host do GitHub. Se ",
+ ["host"],
+ " executa o GitHub Enterprise Server, adicione-o em Hosts do GitHub Enterprise Server abaixo e reinicie o OpenKnowledge."
+ ],
"7_bFEL": ["Arraste ", ["patternText"], " para reordenar"],
"7a0YcF": ["Pressione <0>Espaço</0> ou toque no blob para começar"],
"7aNk5D": ["OpenKnowledge editou ", ["subject"]],
@@ -1094,6 +1103,7 @@
{ "one": ["worktree"], "many": ["worktrees"], "other": ["worktrees"] }
]
],
+ "ALFlyF": ["Adicionar host"],
"ALhMYW": ["Terminal"],
"AMU00p": [
"As duas versões são idênticas. Escolher Aceitar atual mantém a proteção do OpenKnowledge ativada, então outro salvamento da versão mais antiga será recusado novamente. Escolher Aceitar recebido desativa essa proteção."
@@ -1361,6 +1371,7 @@
"DDTdLl": ["Configurações do bloco de código"],
"DELNQk": ["Os colaboradores veem suas edições em andamento assim que elas sincronizam."],
"DEWDbv": ["Mostrar o diagrama"],
+ "DEkRZA": ["Esse host já está na lista."],
"DF1MtZ": ["Carregando o conflito de ", ["filePath"]],
"DFQ2Sj": ["E-mail para acompanhamento"],
"DFfRbX": [
@@ -1438,6 +1449,7 @@
" não conseguiu reiniciar com essa janela de contexto. Use Tentar novamente para retomá-lo."
],
"Dvwa0U": ["Criar um worktree a partir deste ramo"],
+ "Dwu3RL": ["GHES"],
"Dz7fsq": ["Aproximar"],
"E-G19G": [
"A porta ",
@@ -1830,6 +1842,7 @@
"HJ7aHU": [
"Move o bloco atual para cima ou para baixo. Nas listas, move o item atual ou os itens selecionados."
],
+ "HK2eIK": ["Nenhum host Enterprise adicionado. Somente o github.com é tratado como GitHub."],
"HKH-W-": ["Dados"],
"HLoO-Z": ["O servidor retornou uma resposta de importação malformada."],
"HM56Bx": ["Criando..."],
@@ -1952,6 +1965,7 @@
"IxyZXD": ["Captura de tela"],
"J0uRhj": ["Verificando habilidade"],
"J1XRO3": ["Cores do tema"],
+ "J2-D_a": ["Hosts do GitHub Enterprise Server"],
"J2Mv98": ["Nome (ex.: ", ["login"], ")"],
"J2_JuX": ["nada (", ["0"], " não pode corresponder a um documento)"],
"J2eKUI": ["Arquivo"],
@@ -2574,6 +2588,9 @@
"PgJDqs": [
"Mostra um cartão de pré-visualização quando você passa o cursor sobre um link externo no editor."
],
+ "PgY2nN": [
+ "Se você usa um GitHub Enterprise Server, adicione o host dele aqui para que o OpenKnowledge possa fazer login, verificar a permissão de push e criar links de compartilhamento para os repositórios hospedados nele."
+ ],
"Pgu10b": ["Salvo como <0>", ["slug"], ".md</0>"],
"PgzIpb": ["Vai para o resultado de busca anterior do editor visual."],
"PhIa-X": ["Substituir estas cópias por links simbólicos para a fonte?"],
@@ -2643,6 +2660,7 @@
"QWdKwH": ["Mover"],
"QYTOaN": ["Você pode mudar isto depois em <0>Configurações → Sincronização</0>."],
"QYfQdv": ["CLI do ", ["displayName"]],
+ "Qbf7Q4": ["Adicionar um host"],
"QcTjRP": ["Esta conversa mantem a janela com que comecou. Uma nova conversa pode usar outra."],
"Qca--K": [
"Outro programa está usando o Git aqui — espere ele terminar e sincronize de novo (ele está segurando o <0>.git/index.lock</0>)"
@@ -2671,6 +2689,9 @@
"O shell real está desativado para este projeto. Ativá-lo faz os comandos rodarem com todo o acesso da sua conta de usuário."
],
"QqBQu1": ["Rótulo <0>(texto visível do link)</0>"],
+ "QsnBxE": [
+ "Esse não é um nome de host válido. Digite apenas o nome do servidor, como github.example.com."
+ ],
"Qvls7J": ["Especificações de engenharia"],
"Qw-7Ie": [
"Um lugar simples para escrever, com um arquivo por assunto e um diário. Escolha isto se quiser apenas começar a escrever e deixar os links entre notas surgirem com o tempo."
@@ -2990,6 +3011,7 @@
]
],
"UIjjFa": ["Ver o que será adicionado"],
+ "UK3GW4": ["O github.com é sempre reconhecido, então não precisa ser adicionado."],
"UL-9ej": ["OpenKnowledge abriu a pré-visualização ao vivo"],
"UL8A9w": ["Tag"],
"UMT9C9": ["Como usar o OpenKnowledge e suas ferramentas MCP."],
@@ -3264,6 +3286,9 @@
"XAyxsa": ["Extrair ramo remoto"],
"XBBZnv": ["O destino do link \"", ["shown"], "\" não corresponde a um documento existente."],
"XBgr2S": ["Copiar para cá"],
+ "XBpH6-": [
+ "O OpenKnowledge não encontrou um nome de host no remoto git deste projeto, então não consegue saber em qual servidor GitHub fazer login."
+ ],
"XDzAnp": ["Abre em uma nova aba"],
"XF1kgP": ["Tudo de ", ["source"], " já está atualizado"],
"XGKy1z": ["Não foi possível mostrar a imagem"],
@@ -3818,6 +3843,7 @@
"cEoyWz": ["Adicionar item a ", ["keyName"]],
"cF9DyA": ["Reconectando após o reinício do servidor"],
"cFCKYZ": ["Negar"],
+ "cFONFy": ["Digite um nome de host, como github.example.com."],
"cFSbbh": [
"Pessoal deste dispositivo. Vale para todos os projetos que você abrir aqui e nunca é compartilhado com os colaboradores."
],
@@ -3839,6 +3865,7 @@
"cNvGbn": ["Editar e reenviar"],
"cOJyVj": ["Desativar os temas"],
"cOSAfL": ["Nenhum repositório encontrado na sua conta do GitHub."],
+ "cOX1Cj": ["host git"],
"cOrTMo": ["Seu link de compartilhamento está pronto abaixo."],
"cPAWbl": ["Enviado por e-mail"],
"cPgQ_i": [
@@ -6145,6 +6172,7 @@
"x57cJf": ["Abrir o link"],
"xAlHfe": [["basename"], " — editor de texto"],
"xBFg6z": ["Do plugin ", ["0"]],
+ "xBjIs7": ["O login no GitHub não está disponível para este projeto"],
"xCJdfg": ["Limpar"],
"xCdTnb": ["Fechar nova aba"],
"xD4Xm2": ["Buscar"],
@@ -6173,6 +6201,7 @@
"xOTzt5": ["agora mesmo"],
"xSVO3J": ["O que é criado"],
"xV5sXw": ["há ", ["0"], " sem"],
+ "xVMoYb": ["Remover ", ["host"]],
"xW5AUw": ["Baixado ", ["pulled"]],
"xW7KK3": [
"Já existe algo chamado “",
diff --git a/packages/app/src/locales/pt-BR/messages.po b/packages/app/src/locales/pt-BR/messages.po
index 4e5ab79e5..08e23f0e9 100644
--- a/packages/app/src/locales/pt-BR/messages.po
+++ b/packages/app/src/locales/pt-BR/messages.po
@@ -1620,6 +1620,10 @@ msgstr "Adicionar um comentário"
msgid "Add a file name (e.g. notes.md)"
msgstr "Adicione um nome de arquivo (ex.: notes.md)"
+#: src/components/settings/EnterpriseHostsSection.tsx
+msgid "Add a host"
+msgstr "Adicionar um host"
+
#: src/components/settings/SearchSection.tsx
msgid "Add a key"
msgstr "Adicionar uma chave"
@@ -1673,6 +1677,10 @@ msgstr "Adicionar campo"
msgid "Add file or folder pattern, e.g. guides/**/*"
msgstr "Adicione um padrão de arquivo ou pasta, ex.: guides/**/*"
+#: src/components/settings/EnterpriseHostsSection.tsx
+msgid "Add host"
+msgstr "Adicionar host"
+
#: src/components/SeedRootPicker.tsx
msgid "Add it directly to this project."
msgstr "Adicione-o diretamente a este projeto."
@@ -5789,6 +5797,10 @@ msgstr "Digite um valor hexadecimal de 6 dígitos, como #1A2B3C"
msgid "Enter a folder name (e.g. brain)."
msgstr "Digite um nome de pasta (ex.: cerebro)."
+#: src/components/settings/EnterpriseHostsSection.tsx
+msgid "Enter a hostname, such as github.example.com."
+msgstr "Digite um nome de host, como github.example.com."
+
#: src/components/settings/SavedThemesTiles.tsx
msgid "Enter a name for this theme."
msgstr "Insira um nome para este tema."
@@ -5841,6 +5853,11 @@ msgstr "Digite pelo menos 3 caracteres para buscar por significado."
msgid "Enter the public origin your tunnel serves, for example https://notes.example.com"
msgstr "Insira a origem pública que seu túnel serve, por exemplo https://notes.example.com"
+#: src/components/settings/SettingsDialogShell.tsx
+msgctxt "settings search keyword"
+msgid "enterprise"
+msgstr "empresa"
+
#: src/components/settings/ContentRulesSection.tsx
msgid "Error"
msgstr "Erro"
@@ -6772,6 +6789,11 @@ msgstr "Comece agora"
msgid "Gets the link that opens this project or a document in the app"
msgstr "Obtém o link que abre este projeto ou um documento no app"
+#: src/components/settings/SettingsDialogShell.tsx
+msgctxt "settings search keyword"
+msgid "GHES"
+msgstr "GHES"
+
#: src/components/ExploreSkills.tsx
msgid "Git & PRs"
msgstr "Git e PRs"
@@ -6784,6 +6806,11 @@ msgstr "O git não consegue rastrear esta pasta — ela está vazia ou só tem a
msgid "Git has locked this worktree, but it can still be opened."
msgstr "O Git bloqueou este worktree, mas ele ainda pode ser aberto."
+#: src/components/settings/SettingsDialogShell.tsx
+msgctxt "settings search keyword"
+msgid "git host"
+msgstr "host git"
+
#: src/components/SyncStatusBadge.tsx
msgid "Git identity isn't set — commits use a default author. Set yours so teammates see your name."
msgstr "Sua identidade do git não está definida — os commits usam um autor padrão. Defina a sua para que os colegas vejam seu nome."
@@ -6825,14 +6852,27 @@ msgstr "A conexão com o GitHub expirou. Conecte-se novamente para continuar."
msgid "GitHub denied the request. You may need to authorize OpenKnowledge for {owner} in your browser."
msgstr "O GitHub negou a solicitação. Talvez você precise autorizar o OpenKnowledge para {owner} no seu navegador."
+#: src/components/settings/EnterpriseHostsSection.tsx
+#: src/components/settings/SettingsDialogShell.tsx
+msgid "GitHub Enterprise Server hosts"
+msgstr "Hosts do GitHub Enterprise Server"
+
#: src/components/SyncStatusBadge.tsx
msgid "GitHub sign-in is missing or expired. Reconnect to resume syncing."
msgstr "O login do GitHub está ausente ou expirou. Reconecte para retomar a sincronização."
+#: src/components/settings/AccountSection.tsx
+msgid "GitHub sign-in isn't available for this project"
+msgstr "O login no GitHub não está disponível para este projeto"
+
#: src/components/ImportSkillForm.tsx
msgid "GitHub, a git URL, or a local path."
msgstr "GitHub, uma URL de git ou um caminho local."
+#: src/components/settings/EnterpriseHostsSection.tsx
+msgid "github.com is always recognized, so it doesn't need to be added."
+msgstr "O github.com é sempre reconhecido, então não precisa ser adicionado."
+
#: src/components/settings/SavedThemesTiles.tsx
msgid "Give it a name before editing its colors."
msgstr "Dê um nome antes de editar as cores."
@@ -7296,6 +7336,10 @@ msgstr "Se o {agent} não mostrar as ferramentas do OpenKnowledge, execute-o nes
msgid "If an update arrives for something you are editing, you choose which version to keep, like a merge conflict."
msgstr "Se chegar uma atualização de algo que você está editando, você escolhe qual versão manter, como em um conflito de mesclagem."
+#: src/components/settings/EnterpriseHostsSection.tsx
+msgid "If you use a GitHub Enterprise Server, add its host here so OpenKnowledge can sign in, check push permission, and create share links for repositories hosted there."
+msgstr "Se você usa um GitHub Enterprise Server, adicione o host dele aqui para que o OpenKnowledge possa fazer login, verificar a permissão de push e criar links de compartilhamento para os repositórios hospedados nele."
+
#: src/components/settings/ContentRulesSection.tsx
msgid "Ignore broken links in log.md"
msgstr "Ignorar links quebrados em log.md"
@@ -9287,6 +9331,10 @@ msgstr "Ainda não há edições."
msgid "No emoji found."
msgstr "Nenhum emoji encontrado."
+#: src/components/settings/EnterpriseHostsSection.tsx
+msgid "No Enterprise hosts added. Only github.com is treated as GitHub."
+msgstr "Nenhum host Enterprise adicionado. Somente o github.com é tratado como GitHub."
+
#: src/editor/link-preview/InternalDocPreviewCard.tsx
msgid "No excerpt"
msgstr "Sem trecho"
@@ -10211,6 +10259,10 @@ msgstr "OpenKnowledge verificou o projeto"
msgid "OpenKnowledge could not find this agent on this machine."
msgstr "O OpenKnowledge não encontrou este agente nesta máquina."
+#: src/components/settings/AccountSection.tsx
+msgid "OpenKnowledge couldn't find a host name in this project's git remote, so it can't tell which GitHub server to sign in to."
+msgstr "O OpenKnowledge não encontrou um nome de host no remoto git deste projeto, então não consegue saber em qual servidor GitHub fazer login."
+
#: src/lib/worktree-create-error.ts
msgid "OpenKnowledge couldn't finish setting up this project. The worktree was created but not opened."
msgstr "O OpenKnowledge não conseguiu concluir a configuração deste projeto. O worktree foi criado, mas não foi aberto."
@@ -11580,6 +11632,10 @@ msgstr "Remover {chip}"
msgid "Remove {fullLabel} from context"
msgstr "Remover {fullLabel} do contexto"
+#: src/components/settings/EnterpriseHostsSection.tsx
+msgid "Remove {host}"
+msgstr "Remover {host}"
+
#: src/components/FrontmatterRow.tsx
msgid "Remove {keyName}"
msgstr "Remover {keyName}"
@@ -12347,6 +12403,10 @@ msgstr "Salvo em"
msgid "Saved with the project for your team."
msgstr "Salvo com o projeto para sua equipe."
+#: src/components/settings/EnterpriseHostsSection.tsx
+msgid "Saved. Restart OpenKnowledge to apply the change."
+msgstr "Salvo. Reinicie o OpenKnowledge para aplicar a alteração."
+
#: src/lib/acp/tool-call-display.ts
msgid "Saves a restore point for every document in the project"
msgstr "Salva um ponto de restauração para cada documento do projeto"
@@ -14216,6 +14276,14 @@ msgstr "Essa pasta já contém código que o Open Knowledge não escreveu e que
msgid "That folder isn't an OpenKnowledge project yet. Initialize it and open?"
msgstr "Essa pasta ainda não é um projeto do OpenKnowledge. Inicializar e abrir?"
+#: src/components/settings/EnterpriseHostsSection.tsx
+msgid "That host is already in the list."
+msgstr "Esse host já está na lista."
+
+#: src/components/settings/EnterpriseHostsSection.tsx
+msgid "That isn't a valid hostname. Enter just the server name, such as github.example.com."
+msgstr "Esse não é um nome de host válido. Digite apenas o nome do servidor, como github.example.com."
+
#: src/components/settings/SpellcheckLanguagesRow.tsx
msgid "That language isn't available for spell checking."
msgstr "Esse idioma não está disponível para a verificação ortográfica."
@@ -15100,6 +15168,10 @@ msgstr "Este projeto não é um repositório git, então worktrees não estão d
msgid "This project lives only on this computer. Connect it to GitHub to back it up and share it with other people."
msgstr "Este projeto vive só neste computador. Conecte-o ao GitHub para fazer backup e compartilhar com outras pessoas."
+#: src/components/settings/AccountSection.tsx
+msgid "This project's git remote is on {host}, which OpenKnowledge doesn't recognize as a GitHub host. If {host} runs GitHub Enterprise Server, add it to GitHub Enterprise Server hosts below, then restart OpenKnowledge."
+msgstr "O remoto git deste projeto está em {host}, que o OpenKnowledge não reconhece como host do GitHub. Se {host} executa o GitHub Enterprise Server, adicione-o em Hosts do GitHub Enterprise Server abaixo e reinicie o OpenKnowledge."
+
#: src/components/DocumentErrorBoundary.tsx
msgid "This project's running server doesn't support live editing. Restart OpenKnowledge to fix."
msgstr "O servidor em execução deste projeto não suporta edição ao vivo. Reinicie o OpenKnowledge para corrigir."
diff --git a/packages/app/src/locales/ur/messages.json b/packages/app/src/locales/ur/messages.json
index f59d6fe4e..9477a9def 100644
--- a/packages/app/src/locales/ur/messages.json
+++ b/packages/app/src/locales/ur/messages.json
@@ -230,6 +230,7 @@
"1ruosn": ["OpenKnowledge"],
"1t_NnN": ["مسترد کریں"],
"1u-mAI": ["مطابقت پذیری شروع نہیں ہو سکی۔ اپنا کنکشن دیکھیں، پھر دوبارہ کوشش کریں۔"],
+ "1uEVfp": ["انٹرپرائز"],
"1vczDE": [["displayName"], " Desktop کھولیں"],
"1vn0CI": ["سرور کا جواب غیر درست ہے"],
"1xui0Q": ["مقامی فائلیں لوڈ نہیں ہو سکیں"],
@@ -340,6 +341,7 @@
")"
],
"3LbBJn": ["تصاویر منسلک کریں"],
+ "3LuFP-": ["محفوظ ہو گیا۔ تبدیلی لاگو کرنے کے لیے OpenKnowledge دوبارہ شروع کریں۔"],
"3MA3Hh": [["gitignorePath"], " قاعدہ نہیں پڑھا جا سکا: ", ["previewError"]],
"3MnvrL": ["سرِ فہرست ", ["0"], " مماثلتیں دکھائی جا رہی ہیں — محدود کرنے کے لیے لکھتے رہیں"],
"3Mwaly": [["0"], " کا ابتدائیہ نہیں ہو سکا۔"],
@@ -721,6 +723,13 @@
"7YRrJ9": [
"OpenKnowledge ڈیسک ٹاپ ایپ میں دستیاب۔ ٹرمینل سے<0> ok config-sharing status</0> / <1>share</1> / <2>unshare</2> استعمال کریں۔"
],
+ "7_I248": [
+ "اس پروجیکٹ کا git ریموٹ ",
+ ["host"],
+ " پر ہے، جسے OpenKnowledge GitHub ہوسٹ کے طور پر نہیں پہچانتا۔ اگر ",
+ ["host"],
+ " پر GitHub Enterprise Server چلتا ہے تو اسے نیچے GitHub Enterprise Server ہوسٹس میں شامل کریں، پھر OpenKnowledge دوبارہ شروع کریں۔"
+ ],
"7_bFEL": ["ترتیب بدلنے کے لیے ", ["patternText"], " کھینچیں"],
"7a0YcF": ["شروع کرنے کے لیے <0>اسپیس</0> دبائیں یا blob پر ٹیپ کریں"],
"7aNk5D": ["OpenKnowledge نے ", ["subject"], " میں ترمیم کی"],
@@ -953,6 +962,7 @@
"AItsE5": ["اسے وہیں کھولیں"],
"AJ7_B2": ["نئی تھیم بنائیں"],
"AKxFtn": [["openedWorktreeCount", "plural", { "one": ["ورک ٹری"], "other": ["ورک ٹری"] }]],
+ "ALFlyF": ["ہوسٹ شامل کریں"],
"ALhMYW": ["ٹرمینل"],
"AMU00p": [
"دونوں ورژن یکساں ہیں۔ موجودہ قبول کریں منتخب کرنے سے OpenKnowledge کا تحفظ فعال رہتا ہے، اس لیے پرانے ورژن کا ایک اور سیو دوبارہ مسترد کر دیا جائے گا۔ آنے والا قبول کریں منتخب کرنے سے وہ تحفظ بند ہو جاتا ہے۔"
@@ -1190,6 +1200,7 @@
"DDTdLl": ["کوڈ بلاک کی ترتیبات"],
"DELNQk": ["ساتھی آپ کی جاری ترامیم مطابقت پذیری ہوتے ہی دیکھ لیتے ہیں۔"],
"DEWDbv": ["خاکہ دکھائیں"],
+ "DEkRZA": ["یہ ہوسٹ پہلے سے فہرست میں ہے۔"],
"DF1MtZ": [["filePath"], " کا تصادم لوڈ ہو رہا ہے"],
"DFQ2Sj": ["مزید رابطے کے لیے ای میل"],
"DFfRbX": ["مطابقت پذیری کی حالت: ", ["syncStateLabel"], " — git کی شناخت مقرر نہیں"],
@@ -1259,6 +1270,7 @@
" اس سیاق ونڈو پر دوبارہ شروع نہیں ہو سکا۔ اسے واپس لانے کے لیے دوبارہ کوشش کریں۔"
],
"Dvwa0U": ["اس برانچ سے ورک ٹری بنائیں"],
+ "Dwu3RL": ["GHES"],
"Dz7fsq": ["بڑا کریں"],
"E-G19G": [
"پورٹ ",
@@ -1609,6 +1621,7 @@
"HJ7aHU": [
"موجودہ بلاک کو اوپر یا نیچے منتقل کریں۔ فہرستوں میں، موجودہ آئٹم یا منتخب آئٹمز کو منتقل کریں۔"
],
+ "HK2eIK": ["کوئی Enterprise ہوسٹ شامل نہیں کیا گیا۔ صرف github.com کو GitHub سمجھا جاتا ہے۔"],
"HKH-W-": ["ڈیٹا"],
"HLoO-Z": ["سرور نے بگڑا ہوا امپورٹ جواب لوٹایا۔"],
"HM56Bx": ["بنایا جا رہا ہے..."],
@@ -1717,6 +1730,7 @@
"IxyZXD": ["اسکرین شاٹ"],
"J0uRhj": ["جانچ پڑتال کی مہارت"],
"J1XRO3": ["تھیم کے رنگ"],
+ "J2-D_a": ["GitHub Enterprise Server ہوسٹس"],
"J2Mv98": ["نام (مثلاً ", ["login"], ")"],
"J2_JuX": ["کچھ نہیں (", ["0"], " کسی دستاویز سے مماثل نہیں ہو سکتا)"],
"J2eKUI": ["فائل"],
@@ -2304,6 +2318,9 @@
],
"Pg83C9": ["«", ["0"], "» اپ لوڈ ہو گیا۔"],
"PgJDqs": ["ایڈیٹر میں بیرونی لنک پر ماؤس لے جانے پر پیش منظر کا کارڈ دکھائیں۔"],
+ "PgY2nN": [
+ "اگر آپ GitHub Enterprise Server استعمال کرتے ہیں تو اس کا ہوسٹ یہاں شامل کریں تاکہ OpenKnowledge سائن ان کر سکے، push کی اجازت چیک کر سکے، اور وہاں ہوسٹ کی گئی ریپوزیٹریز کے لیے شیئر لنکس بنا سکے۔"
+ ],
"Pgu10b": ["<0>", ["slug"], ".md</0> کے نام سے محفوظ ہوا"],
"PgzIpb": ["بصری ایڈیٹر کے پچھلے تلاش نتیجے پر جائیں۔"],
"PhIa-X": ["کیا ان نقول کو ماخذ کے سِم لنکس سے بدل دیا جائے؟"],
@@ -2366,6 +2383,7 @@
"QWdKwH": ["منتقل کریں"],
"QYTOaN": ["آپ اسے بعد میں <0>ترتیبات ← مطابقت پذیری</0> میں بدل سکتے ہیں۔"],
"QYfQdv": [["displayName"], " CLI"],
+ "Qbf7Q4": ["ہوسٹ شامل کریں"],
"QcTjRP": [
"یہ گفتگو اسی ونڈو کے ساتھ رہتی ہے جس سے شروع ہوئی تھی۔ نئی گفتگو میں دوسری ونڈو استعمال ہو سکتی ہے۔"
],
@@ -2393,6 +2411,7 @@
"اس پروجیکٹ کے لیے اصل شیل بند ہے۔ اسے آن کرنے پر کمانڈز آپ کے صارف اکاؤنٹ کی مکمل رسائی کے ساتھ چلتی ہیں۔"
],
"QqBQu1": ["لیبل <0>(نظر آنے والا لنک متن)</0>"],
+ "QsnBxE": ["یہ درست ہوسٹ نیم نہیں ہے۔ صرف سرور کا نام درج کریں، جیسے github.example.com۔"],
"Qvls7J": ["انجینئرنگ اسپیکس"],
"Qw-7Ie": [
"لکھنے کے لیے ایک سادہ جگہ، ہر موضوع کے لیے ایک فائل اور روزانہ کا جریدہ۔ اگر آپ صرف لکھنا شروع کرنا چاہتے ہیں اور نوٹس کے درمیان روابط کو وقت کے ساتھ بننے دینا چاہتے ہیں تو یہ منتخب کریں۔"
@@ -2676,6 +2695,7 @@
["propertyCount", "plural", { "one": ["#", " خصوصیت"], "other": ["#", " خصوصیات"] }]
],
"UIjjFa": ["دیکھیں کیا شامل ہوگا"],
+ "UK3GW4": ["github.com ہمیشہ پہچانا جاتا ہے، اس لیے اسے شامل کرنے کی ضرورت نہیں۔"],
"UL-9ej": ["OpenKnowledge نے لائیو پیش منظر کھولا"],
"UL8A9w": ["ٹیگ"],
"UMT9C9": ["OpenKnowledge اور اس کے MCP ٹولز کا استعمال کیسے کریں۔"],
@@ -2910,6 +2930,9 @@
"XAyxsa": ["ریموٹ برانچ چیک آؤٹ کریں"],
"XBBZnv": ["لنک کا ہدف \"", ["shown"], "\" کسی موجودہ دستاویز کی طرف اشارہ نہیں کرتا۔"],
"XBgr2S": ["یہاں کاپی کریں"],
+ "XBpH6-": [
+ "OpenKnowledge کو اس پروجیکٹ کے git ریموٹ میں کوئی ہوسٹ نیم نہیں ملا، اس لیے وہ طے نہیں کر سکتا کہ کس GitHub سرور میں سائن ان کرنا ہے۔"
+ ],
"XDzAnp": ["نئے ٹیب میں کھلتا ہے"],
"XF1kgP": [["source"], " سے سب کچھ پہلے ہی اپ ڈیٹ ہے"],
"XGKy1z": ["تصویر دکھائی نہیں جا سکی"],
@@ -3445,6 +3468,7 @@
"cEoyWz": [["keyName"], " میں آئٹم شامل کریں"],
"cF9DyA": ["سرور دوبارہ چلنے کے بعد دوبارہ منسلک ہو رہا ہے"],
"cFCKYZ": ["مسترد کریں"],
+ "cFONFy": ["ہوسٹ نیم درج کریں، جیسے github.example.com۔"],
"cFSbbh": [
"اسی آلے تک محدود۔ یہاں آپ جو بھی پروجیکٹ کھولیں اس پر لاگو ہوتا ہے اور کبھی ساتھیوں کے ساتھ مشترک نہیں ہوتا۔"
],
@@ -3466,6 +3490,7 @@
"cNvGbn": ["ترمیم کر کے دوبارہ بھیجیں"],
"cOJyVj": ["تھیمز بند کریں"],
"cOSAfL": ["آپ کے GitHub اکاؤنٹ پر کوئی ریپازٹری نہیں ملی۔"],
+ "cOX1Cj": ["git ہوسٹ"],
"cOrTMo": ["آپ کا شیئر لنک نیچے تیار ہے۔"],
"cPAWbl": ["ای میل کیا گیا"],
"cPgQ_i": [
@@ -5538,6 +5563,7 @@
"x57cJf": ["لنک کھولیں"],
"xAlHfe": [["basename"], " — ٹیکسٹ ایڈیٹر"],
"xBFg6z": [["0"], " پلگ اِن سے"],
+ "xBjIs7": ["اس پروجیکٹ کے لیے GitHub سائن ان دستیاب نہیں"],
"xCJdfg": ["صاف کریں"],
"xCdTnb": ["نیا ٹیب بند کریں"],
"xD4Xm2": ["حاصل کرنا"],
@@ -5558,6 +5584,7 @@
"xOTzt5": ["ابھی ابھی"],
"xSVO3J": ["کیا بنتا ہے"],
"xV5sXw": [["0"], " ہفتے پہلے"],
+ "xVMoYb": [["host"], " ہٹائیں"],
"xW5AUw": [["pulled"], " کھینچا گیا"],
"xW7KK3": [
["scopeLabel"],
diff --git a/packages/app/src/locales/ur/messages.po b/packages/app/src/locales/ur/messages.po
index 4f232d799..f2d7b1cd7 100644
--- a/packages/app/src/locales/ur/messages.po
+++ b/packages/app/src/locales/ur/messages.po
@@ -1624,6 +1624,10 @@ msgstr "تبصرہ شامل کریں"
msgid "Add a file name (e.g. notes.md)"
msgstr "فائل کا نام شامل کریں (مثلاً notes.md)"
+#: src/components/settings/EnterpriseHostsSection.tsx
+msgid "Add a host"
+msgstr "ہوسٹ شامل کریں"
+
#: src/components/settings/SearchSection.tsx
msgid "Add a key"
msgstr "کلید شامل کریں"
@@ -1677,6 +1681,10 @@ msgstr "فیلڈ شامل کریں"
msgid "Add file or folder pattern, e.g. guides/**/*"
msgstr "فائل یا فولڈر کا پیٹرن شامل کریں، مثلاً guides/**/*"
+#: src/components/settings/EnterpriseHostsSection.tsx
+msgid "Add host"
+msgstr "ہوسٹ شامل کریں"
+
#: src/components/SeedRootPicker.tsx
msgid "Add it directly to this project."
msgstr "اسے براہِ راست اس پروجیکٹ میں شامل کریں۔"
@@ -5793,6 +5801,10 @@ msgstr "#1A2B3C جیسی 6 ہندسوں کی ہیکس قدر درج کریں"
msgid "Enter a folder name (e.g. brain)."
msgstr "فولڈر کا نام درج کریں (مثلاً brain)۔"
+#: src/components/settings/EnterpriseHostsSection.tsx
+msgid "Enter a hostname, such as github.example.com."
+msgstr "ہوسٹ نیم درج کریں، جیسے github.example.com۔"
+
#: src/components/settings/SavedThemesTiles.tsx
msgid "Enter a name for this theme."
msgstr "اس تھیم کے لیے نام درج کریں۔"
@@ -5845,6 +5857,11 @@ msgstr "معنی کے لحاظ سے تلاش کرنے کے لیے کم از کم
msgid "Enter the public origin your tunnel serves, for example https://notes.example.com"
msgstr "وہ عوامی اوریجن درج کریں جو آپ کا ٹنل سرو کرتا ہے، مثلاً https://notes.example.com"
+#: src/components/settings/SettingsDialogShell.tsx
+msgctxt "settings search keyword"
+msgid "enterprise"
+msgstr "انٹرپرائز"
+
#: src/components/settings/ContentRulesSection.tsx
msgid "Error"
msgstr "خرابی"
@@ -6776,6 +6793,11 @@ msgstr "ترتیب دیں"
msgid "Gets the link that opens this project or a document in the app"
msgstr "وہ لنک لاتا ہے جو اس پروجیکٹ یا کسی دستاویز کو ایپ میں کھولتا ہے"
+#: src/components/settings/SettingsDialogShell.tsx
+msgctxt "settings search keyword"
+msgid "GHES"
+msgstr "GHES"
+
#: src/components/ExploreSkills.tsx
msgid "Git & PRs"
msgstr "Git اور PRs"
@@ -6788,6 +6810,11 @@ msgstr "Git اس فولڈر کو ٹریک نہیں کر سکتا — یہ خال
msgid "Git has locked this worktree, but it can still be opened."
msgstr "Git نے اس ورک ٹری کو لاک کیا ہے، لیکن اسے اب بھی کھولا جا سکتا ہے۔"
+#: src/components/settings/SettingsDialogShell.tsx
+msgctxt "settings search keyword"
+msgid "git host"
+msgstr "git ہوسٹ"
+
#: src/components/SyncStatusBadge.tsx
msgid "Git identity isn't set — commits use a default author. Set yours so teammates see your name."
msgstr "Git کی شناخت مقرر نہیں — کمٹس طے شدہ مصنف استعمال کرتے ہیں۔ اپنی شناخت مقرر کریں تاکہ ساتھی آپ کا نام دیکھیں۔"
@@ -6829,14 +6856,27 @@ msgstr "GitHub کنکشن ختم ہو گیا۔ جاری رکھنے کے لیے
msgid "GitHub denied the request. You may need to authorize OpenKnowledge for {owner} in your browser."
msgstr "GitHub نے درخواست مسترد کر دی۔ ممکن ہے آپ کو اپنے براؤزر میں {owner} کے لیے OpenKnowledge کو اجازت دینی پڑے۔"
+#: src/components/settings/EnterpriseHostsSection.tsx
+#: src/components/settings/SettingsDialogShell.tsx
+msgid "GitHub Enterprise Server hosts"
+msgstr "GitHub Enterprise Server ہوسٹس"
+
#: src/components/SyncStatusBadge.tsx
msgid "GitHub sign-in is missing or expired. Reconnect to resume syncing."
msgstr "GitHub کا سائن اِن غائب یا میعاد ختم ہے۔ مطابقت پذیری جاری رکھنے کے لیے دوبارہ منسلک ہوں۔"
+#: src/components/settings/AccountSection.tsx
+msgid "GitHub sign-in isn't available for this project"
+msgstr "اس پروجیکٹ کے لیے GitHub سائن ان دستیاب نہیں"
+
#: src/components/ImportSkillForm.tsx
msgid "GitHub, a git URL, or a local path."
msgstr "GitHub، کوئی git URL، یا مقامی راستہ۔"
+#: src/components/settings/EnterpriseHostsSection.tsx
+msgid "github.com is always recognized, so it doesn't need to be added."
+msgstr "github.com ہمیشہ پہچانا جاتا ہے، اس لیے اسے شامل کرنے کی ضرورت نہیں۔"
+
#: src/components/settings/SavedThemesTiles.tsx
msgid "Give it a name before editing its colors."
msgstr "اس کے رنگوں میں ترمیم سے پہلے اسے نام دیں۔"
@@ -7300,6 +7340,10 @@ msgstr "اگر {agent} میں OpenKnowledge ٹولز نظر نہ آئیں تو
msgid "If an update arrives for something you are editing, you choose which version to keep, like a merge conflict."
msgstr "اگر آپ جس چیز میں ترمیم کر رہے ہیں اس کی اپ ڈیٹ آ جائے تو آپ خود منتخب کرتے ہیں کہ کون سا ورژن رکھنا ہے، بالکل ضم کے تصادم کی طرح۔"
+#: src/components/settings/EnterpriseHostsSection.tsx
+msgid "If you use a GitHub Enterprise Server, add its host here so OpenKnowledge can sign in, check push permission, and create share links for repositories hosted there."
+msgstr "اگر آپ GitHub Enterprise Server استعمال کرتے ہیں تو اس کا ہوسٹ یہاں شامل کریں تاکہ OpenKnowledge سائن ان کر سکے، push کی اجازت چیک کر سکے، اور وہاں ہوسٹ کی گئی ریپوزیٹریز کے لیے شیئر لنکس بنا سکے۔"
+
#: src/components/settings/ContentRulesSection.tsx
msgid "Ignore broken links in log.md"
msgstr "log.md میں ٹوٹے ہوئے لنکس نظر انداز کریں"
@@ -9291,6 +9335,10 @@ msgstr "ابھی کوئی ترمیم نہیں۔"
msgid "No emoji found."
msgstr "کوئی ایموجی نہیں ملا۔"
+#: src/components/settings/EnterpriseHostsSection.tsx
+msgid "No Enterprise hosts added. Only github.com is treated as GitHub."
+msgstr "کوئی Enterprise ہوسٹ شامل نہیں کیا گیا۔ صرف github.com کو GitHub سمجھا جاتا ہے۔"
+
#: src/editor/link-preview/InternalDocPreviewCard.tsx
msgid "No excerpt"
msgstr "کوئی اقتباس نہیں"
@@ -10215,6 +10263,10 @@ msgstr "OpenKnowledge نے پروجیکٹ کی جانچ کی"
msgid "OpenKnowledge could not find this agent on this machine."
msgstr "OpenKnowledge کو اس مشین پر یہ ایجنٹ نہیں ملا۔"
+#: src/components/settings/AccountSection.tsx
+msgid "OpenKnowledge couldn't find a host name in this project's git remote, so it can't tell which GitHub server to sign in to."
+msgstr "OpenKnowledge کو اس پروجیکٹ کے git ریموٹ میں کوئی ہوسٹ نیم نہیں ملا، اس لیے وہ طے نہیں کر سکتا کہ کس GitHub سرور میں سائن ان کرنا ہے۔"
+
#: src/lib/worktree-create-error.ts
msgid "OpenKnowledge couldn't finish setting up this project. The worktree was created but not opened."
msgstr "OpenKnowledge اس پروجیکٹ کا سیٹ اپ مکمل نہیں کر سکا۔ ورک ٹری بن گئی، لیکن کھولی نہیں گئی۔"
@@ -11584,6 +11636,10 @@ msgstr "{chip} ہٹائیں"
msgid "Remove {fullLabel} from context"
msgstr "{fullLabel} کو سیاق سے ہٹائیں"
+#: src/components/settings/EnterpriseHostsSection.tsx
+msgid "Remove {host}"
+msgstr "{host} ہٹائیں"
+
#: src/components/FrontmatterRow.tsx
msgid "Remove {keyName}"
msgstr "{keyName} ہٹائیں"
@@ -12351,6 +12407,10 @@ msgstr "یہاں محفوظ ہوا"
msgid "Saved with the project for your team."
msgstr "آپ کی ٹیم کے لیے پروجیکٹ کے ساتھ محفوظ۔"
+#: src/components/settings/EnterpriseHostsSection.tsx
+msgid "Saved. Restart OpenKnowledge to apply the change."
+msgstr "محفوظ ہو گیا۔ تبدیلی لاگو کرنے کے لیے OpenKnowledge دوبارہ شروع کریں۔"
+
#: src/lib/acp/tool-call-display.ts
msgid "Saves a restore point for every document in the project"
msgstr "پروجیکٹ کی ہر دستاویز کے لیے ایک بحالی پوائنٹ محفوظ کرتا ہے"
@@ -14220,6 +14280,14 @@ msgstr "اس فولڈر میں پہلے سے ایسا کوڈ موجود ہے ج
msgid "That folder isn't an OpenKnowledge project yet. Initialize it and open?"
msgstr "وہ فولڈر ابھی OpenKnowledge پروجیکٹ نہیں ہے۔ اس کا ابتدائیہ کر کے کھولیں؟"
+#: src/components/settings/EnterpriseHostsSection.tsx
+msgid "That host is already in the list."
+msgstr "یہ ہوسٹ پہلے سے فہرست میں ہے۔"
+
+#: src/components/settings/EnterpriseHostsSection.tsx
+msgid "That isn't a valid hostname. Enter just the server name, such as github.example.com."
+msgstr "یہ درست ہوسٹ نیم نہیں ہے۔ صرف سرور کا نام درج کریں، جیسے github.example.com۔"
+
#: src/components/settings/SpellcheckLanguagesRow.tsx
msgid "That language isn't available for spell checking."
msgstr "وہ زبان املا کی جانچ کے لیے دستیاب نہیں ہے۔"
@@ -15104,6 +15172,10 @@ msgstr "یہ پروجیکٹ git ریپازٹری نہیں ہے، اس لیے و
msgid "This project lives only on this computer. Connect it to GitHub to back it up and share it with other people."
msgstr "یہ پروجیکٹ صرف اسی کمپیوٹر پر ہے۔ اس کا بیک اپ رکھنے اور دوسروں کے ساتھ شیئر کرنے کے لیے اسے GitHub سے منسلک کریں۔"
+#: src/components/settings/AccountSection.tsx
+msgid "This project's git remote is on {host}, which OpenKnowledge doesn't recognize as a GitHub host. If {host} runs GitHub Enterprise Server, add it to GitHub Enterprise Server hosts below, then restart OpenKnowledge."
+msgstr "اس پروجیکٹ کا git ریموٹ {host} پر ہے، جسے OpenKnowledge GitHub ہوسٹ کے طور پر نہیں پہچانتا۔ اگر {host} پر GitHub Enterprise Server چلتا ہے تو اسے نیچے GitHub Enterprise Server ہوسٹس میں شامل کریں، پھر OpenKnowledge دوبارہ شروع کریں۔"
+
#: src/components/DocumentErrorBoundary.tsx
msgid "This project's running server doesn't support live editing. Restart OpenKnowledge to fix."
msgstr "اس پروجیکٹ کا چلتا ہوا سرور براہِ راست ترمیم کی حمایت نہیں کرتا۔ ٹھیک کرنے کے لیے OpenKnowledge دوبارہ چلائیں۔"
diff --git a/packages/app/src/locales/zh-Hans/messages.json b/packages/app/src/locales/zh-Hans/messages.json
index b2fcc6add..ce9eb325c 100644
--- a/packages/app/src/locales/zh-Hans/messages.json
+++ b/packages/app/src/locales/zh-Hans/messages.json
@@ -202,6 +202,7 @@
"1ruosn": ["OpenKnowledge"],
"1t_NnN": ["拒绝"],
"1u-mAI": ["无法开始同步。请检查你的网络连接,然后重试。"],
+ "1uEVfp": ["企业版"],
"1vczDE": ["打开 ", ["displayName"], " Desktop"],
"1vn0CI": ["服务器响应无效"],
"1xui0Q": ["加载本地文件失败"],
@@ -299,6 +300,7 @@
")"
],
"3LbBJn": ["附加图片"],
+ "3LuFP-": ["已保存。重启 OpenKnowledge 以应用更改。"],
"3MA3Hh": ["无法读取 ", ["gitignorePath"], " 规则:", ["previewError"]],
"3MnvrL": ["正在显示最相关的 ", ["0"], " 条匹配——继续输入可缩小范围"],
"3Mwaly": ["无法初始化 ", ["0"], "。"],
@@ -619,6 +621,13 @@
"7YRrJ9": [
"在 OpenKnowledge 桌面应用中可用。在终端里可使用<0> ok config-sharing status</0> / <1>share</1> / <2>unshare</2>。"
],
+ "7_I248": [
+ "此项目的 git 远程位于 ",
+ ["host"],
+ ",OpenKnowledge 未将其识别为 GitHub 主机。如果 ",
+ ["host"],
+ " 运行的是 GitHub Enterprise Server,请在下方的“GitHub Enterprise Server 主机”中添加它,然后重启 OpenKnowledge。"
+ ],
"7_bFEL": ["拖动 ", ["patternText"], " 以重新排序"],
"7a0YcF": ["按<0>空格</0>或点击 blob 开始"],
"7aNk5D": ["OpenKnowledge 编辑了 ", ["subject"]],
@@ -821,6 +830,7 @@
"AItsE5": ["在那里打开"],
"AJ7_B2": ["创建新主题"],
"AKxFtn": [["openedWorktreeCount", "plural", { "one": ["worktree"], "other": ["worktree"] }]],
+ "ALFlyF": ["添加主机"],
"ALhMYW": ["终端"],
"AMU00p": [
"两个版本完全相同。选择“采用当前”会让 OpenKnowledge 的保护保持开启,因此再次保存较旧的版本仍会被拒绝。选择“采用传入”会关闭该保护。"
@@ -1029,6 +1039,7 @@
"DDTdLl": ["代码块设置"],
"DELNQk": ["协作者一同步就能看到你正在进行的编辑。"],
"DEWDbv": ["显示图示"],
+ "DEkRZA": ["该主机已在列表中。"],
"DF1MtZ": ["正在加载 ", ["filePath"], " 的冲突"],
"DFQ2Sj": ["用于后续联系的邮箱"],
"DFfRbX": ["同步状态:", ["syncStateLabel"], " —— 未设置 git 身份"],
@@ -1085,6 +1096,7 @@
"Dvr1Sg": ["正在复制"],
"Dvvrs8": [["0"], " 无法在该上下文窗口下重启。请使用「重试」将其恢复。"],
"Dvwa0U": ["基于这个分支创建 worktree"],
+ "Dwu3RL": ["GHES"],
"Dz7fsq": ["放大"],
"E-G19G": [
"端口 ",
@@ -1373,6 +1385,7 @@
"HHQcx0": ["让技能在更多位置可用,或从某个位置移除"],
"HIb0vl": ["网络错误——请重试"],
"HJ7aHU": ["向上或向下移动当前块。在列表中,移动当前项或所选项。"],
+ "HK2eIK": ["尚未添加 Enterprise 主机。只有 github.com 会被视为 GitHub。"],
"HKH-W-": ["数据"],
"HLoO-Z": ["服务器返回的导入响应格式错误。"],
"HM56Bx": ["正在创建…"],
@@ -1462,6 +1475,7 @@
"IxyZXD": ["截图"],
"J0uRhj": ["检查技能"],
"J1XRO3": ["主题颜色"],
+ "J2-D_a": ["GitHub Enterprise Server 主机"],
"J2Mv98": ["名称(例如 ", ["login"], ")"],
"J2_JuX": ["无(", ["0"], " 无法匹配任何文档)"],
"J2eKUI": ["文件"],
@@ -1968,6 +1982,9 @@
"PezM4_": ["已保存 OpenKnowledge 技能。请在 Claude Desktop 中上传,然后再次点击 Cowork。"],
"Pg83C9": ["已上传“", ["0"], "”。"],
"PgJDqs": ["在编辑器中把鼠标悬停在外部链接上时显示预览卡片。"],
+ "PgY2nN": [
+ "如果你使用 GitHub Enterprise Server,请在此添加其主机,以便 OpenKnowledge 能够登录、检查推送权限,并为托管在其上的仓库创建共享链接。"
+ ],
"Pgu10b": ["已保存为 <0>", ["slug"], ".md</0>"],
"PgzIpb": ["跳到可视化编辑器的上一个查找结果。"],
"PhIa-X": ["要把这些副本替换为指向来源的符号链接吗?"],
@@ -2024,6 +2041,7 @@
"QWdKwH": ["移动"],
"QYTOaN": ["之后可以在<0>「设置 → 同步」</0>中更改。"],
"QYfQdv": [["displayName"], " CLI"],
+ "Qbf7Q4": ["添加主机"],
"QcTjRP": ["本次对话保持开始时的窗口。新对话可以使用其他窗口。"],
"Qca--K": [
"另一个程序正在这里使用 Git——等它完成后再同步一次(它占用着 <0>.git/index.lock</0>)"
@@ -2046,6 +2064,7 @@
"QohqVL": ["此智能体不提供斜杠命令"],
"QpSqAP": ["本项目未启用真实 shell。启用后,命令将以你的用户账户的完整权限运行。"],
"QqBQu1": ["标签 <0>(可见的链接文本)</0>"],
+ "QsnBxE": ["这不是有效的主机名。请只输入服务器名称,例如 github.example.com。"],
"Qvls7J": ["工程规格"],
"Qw-7Ie": [
"一个简单的写作空间,每个主题一个文件,外加一份日志。如果你只想先动笔,让笔记之间的链接慢慢生长,请选这个。"
@@ -2281,6 +2300,7 @@
],
"UI0WPT": [["propertyCount", "plural", { "other": ["#", " 项属性"] }]],
"UIjjFa": ["查看将添加的内容"],
+ "UK3GW4": ["github.com 始终会被识别,无需添加。"],
"UL-9ej": ["OpenKnowledge 打开了实时预览"],
"UL8A9w": ["标签"],
"UMT9C9": ["如何使用 OpenKnowledge 及其 MCP 工具。"],
@@ -2492,6 +2512,9 @@
"XAyxsa": ["检出远程分支"],
"XBBZnv": ["链接目标“", ["shown"], "”未指向现有文档。"],
"XBgr2S": ["复制进来"],
+ "XBpH6-": [
+ "OpenKnowledge 在此项目的 git 远程地址中找不到主机名,因此无法确定要登录哪个 GitHub 服务器。"
+ ],
"XDzAnp": ["在新标签页中打开"],
"XF1kgP": ["来自 ", ["source"], " 的内容均已是最新"],
"XGKy1z": ["无法显示图片"],
@@ -2954,6 +2977,7 @@
"cEoyWz": ["向 ", ["keyName"], " 添加项目"],
"cF9DyA": ["服务器重启后正在重新连接"],
"cFCKYZ": ["拒绝"],
+ "cFONFy": ["请输入主机名,例如 github.example.com。"],
"cFSbbh": ["仅限这台设备。对你在这里打开的每个项目都生效,而且绝不会分享给协作者。"],
"cH0dkG": ["它缺少我需要的功能"],
"cHhH3i": ["一个必需的 git 工具"],
@@ -2968,6 +2992,7 @@
"cNvGbn": ["编辑并重发"],
"cOJyVj": ["禁用主题"],
"cOSAfL": ["在你的 GitHub 账户中没有找到仓库。"],
+ "cOX1Cj": ["git 主机"],
"cOrTMo": ["你的共享链接已在下方生成。"],
"cPAWbl": ["已通过邮件发送"],
"cPgQ_i": [
@@ -4714,6 +4739,7 @@
"x57cJf": ["打开链接"],
"xAlHfe": [["basename"], " — 文本编辑器"],
"xBFg6z": ["来自 ", ["0"], " 插件"],
+ "xBjIs7": ["此项目无法使用 GitHub 登录"],
"xCJdfg": ["清除"],
"xCdTnb": ["关闭新标签页"],
"xD4Xm2": ["获取"],
@@ -4732,6 +4758,7 @@
"xOTzt5": ["刚刚"],
"xSVO3J": ["会创建什么"],
"xV5sXw": [["0"], " 周前"],
+ "xVMoYb": ["移除 ", ["host"]],
"xW5AUw": [["pulled"], "拉取"],
"xW7KK3": [
["scopeLabel"],
diff --git a/packages/app/src/locales/zh-Hans/messages.po b/packages/app/src/locales/zh-Hans/messages.po
index b669d2006..349ee85dd 100644
--- a/packages/app/src/locales/zh-Hans/messages.po
+++ b/packages/app/src/locales/zh-Hans/messages.po
@@ -1624,6 +1624,10 @@ msgstr "添加评论"
msgid "Add a file name (e.g. notes.md)"
msgstr "添加文件名(例如 notes.md)"
+#: src/components/settings/EnterpriseHostsSection.tsx
+msgid "Add a host"
+msgstr "添加主机"
+
#: src/components/settings/SearchSection.tsx
msgid "Add a key"
msgstr "添加键"
@@ -1677,6 +1681,10 @@ msgstr "添加字段"
msgid "Add file or folder pattern, e.g. guides/**/*"
msgstr "添加文件或文件夹模式,例如 guides/**/*"
+#: src/components/settings/EnterpriseHostsSection.tsx
+msgid "Add host"
+msgstr "添加主机"
+
#: src/components/SeedRootPicker.tsx
msgid "Add it directly to this project."
msgstr "直接把它添加到这个项目。"
@@ -5793,6 +5801,10 @@ msgstr "请输入 6 位十六进制值,例如 #1A2B3C"
msgid "Enter a folder name (e.g. brain)."
msgstr "请输入文件夹名(例如 brain)。"
+#: src/components/settings/EnterpriseHostsSection.tsx
+msgid "Enter a hostname, such as github.example.com."
+msgstr "请输入主机名,例如 github.example.com。"
+
#: src/components/settings/SavedThemesTiles.tsx
msgid "Enter a name for this theme."
msgstr "输入此主题的名称。"
@@ -5845,6 +5857,11 @@ msgstr "输入至少 3 个字符以按含义搜索。"
msgid "Enter the public origin your tunnel serves, for example https://notes.example.com"
msgstr "输入你的隧道所服务的公开来源,例如 https://notes.example.com"
+#: src/components/settings/SettingsDialogShell.tsx
+msgctxt "settings search keyword"
+msgid "enterprise"
+msgstr "企业版"
+
#: src/components/settings/ContentRulesSection.tsx
msgid "Error"
msgstr "错误"
@@ -6776,6 +6793,11 @@ msgstr "开始设置"
msgid "Gets the link that opens this project or a document in the app"
msgstr "获取在应用中打开此项目或文档的链接"
+#: src/components/settings/SettingsDialogShell.tsx
+msgctxt "settings search keyword"
+msgid "GHES"
+msgstr "GHES"
+
#: src/components/ExploreSkills.tsx
msgid "Git & PRs"
msgstr "Git 与 PR"
@@ -6788,6 +6810,11 @@ msgstr "Git 无法跟踪这个文件夹——它是空的,或者只包含被
msgid "Git has locked this worktree, but it can still be opened."
msgstr "Git 已锁定此工作树,但仍可打开。"
+#: src/components/settings/SettingsDialogShell.tsx
+msgctxt "settings search keyword"
+msgid "git host"
+msgstr "git 主机"
+
#: src/components/SyncStatusBadge.tsx
msgid "Git identity isn't set — commits use a default author. Set yours so teammates see your name."
msgstr "尚未设置 git 身份——提交会使用默认作者。设置你自己的身份,队友才能看到你的名字。"
@@ -6829,14 +6856,27 @@ msgstr "GitHub 连接已过期。请重新连接以继续。"
msgid "GitHub denied the request. You may need to authorize OpenKnowledge for {owner} in your browser."
msgstr "GitHub 拒绝了该请求。你可能需要在浏览器中为 {owner} 授权 OpenKnowledge。"
+#: src/components/settings/EnterpriseHostsSection.tsx
+#: src/components/settings/SettingsDialogShell.tsx
+msgid "GitHub Enterprise Server hosts"
+msgstr "GitHub Enterprise Server 主机"
+
#: src/components/SyncStatusBadge.tsx
msgid "GitHub sign-in is missing or expired. Reconnect to resume syncing."
msgstr "GitHub 登录缺失或已过期。请重新连接以继续同步。"
+#: src/components/settings/AccountSection.tsx
+msgid "GitHub sign-in isn't available for this project"
+msgstr "此项目无法使用 GitHub 登录"
+
#: src/components/ImportSkillForm.tsx
msgid "GitHub, a git URL, or a local path."
msgstr "GitHub、一个 git URL,或一个本地路径。"
+#: src/components/settings/EnterpriseHostsSection.tsx
+msgid "github.com is always recognized, so it doesn't need to be added."
+msgstr "github.com 始终会被识别,无需添加。"
+
#: src/components/settings/SavedThemesTiles.tsx
msgid "Give it a name before editing its colors."
msgstr "请先命名主题,再编辑颜色。"
@@ -7300,6 +7340,10 @@ msgstr "如果 {agent} 没有显示 OpenKnowledge 工具,请在这个项目中
msgid "If an update arrives for something you are editing, you choose which version to keep, like a merge conflict."
msgstr "如果你正在编辑的内容收到更新,你可以像处理合并冲突那样选择保留哪个版本。"
+#: src/components/settings/EnterpriseHostsSection.tsx
+msgid "If you use a GitHub Enterprise Server, add its host here so OpenKnowledge can sign in, check push permission, and create share links for repositories hosted there."
+msgstr "如果你使用 GitHub Enterprise Server,请在此添加其主机,以便 OpenKnowledge 能够登录、检查推送权限,并为托管在其上的仓库创建共享链接。"
+
#: src/components/settings/ContentRulesSection.tsx
msgid "Ignore broken links in log.md"
msgstr "忽略 log.md 中失效的链接"
@@ -9291,6 +9335,10 @@ msgstr "还没有编辑。"
msgid "No emoji found."
msgstr "没有找到表情符号。"
+#: src/components/settings/EnterpriseHostsSection.tsx
+msgid "No Enterprise hosts added. Only github.com is treated as GitHub."
+msgstr "尚未添加 Enterprise 主机。只有 github.com 会被视为 GitHub。"
+
#: src/editor/link-preview/InternalDocPreviewCard.tsx
msgid "No excerpt"
msgstr "没有摘要"
@@ -10215,6 +10263,10 @@ msgstr "OpenKnowledge 检查了项目"
msgid "OpenKnowledge could not find this agent on this machine."
msgstr "OpenKnowledge 未在此设备上找到该智能体。"
+#: src/components/settings/AccountSection.tsx
+msgid "OpenKnowledge couldn't find a host name in this project's git remote, so it can't tell which GitHub server to sign in to."
+msgstr "OpenKnowledge 在此项目的 git 远程地址中找不到主机名,因此无法确定要登录哪个 GitHub 服务器。"
+
#: src/lib/worktree-create-error.ts
msgid "OpenKnowledge couldn't finish setting up this project. The worktree was created but not opened."
msgstr "OpenKnowledge 无法完成此项目的设置。工作树已创建,但未打开。"
@@ -11584,6 +11636,10 @@ msgstr "移除 {chip}"
msgid "Remove {fullLabel} from context"
msgstr "把 {fullLabel} 从上下文中移除"
+#: src/components/settings/EnterpriseHostsSection.tsx
+msgid "Remove {host}"
+msgstr "移除 {host}"
+
#: src/components/FrontmatterRow.tsx
msgid "Remove {keyName}"
msgstr "移除 {keyName}"
@@ -12351,6 +12407,10 @@ msgstr "保存到"
msgid "Saved with the project for your team."
msgstr "与项目一起保存,供你的团队使用。"
+#: src/components/settings/EnterpriseHostsSection.tsx
+msgid "Saved. Restart OpenKnowledge to apply the change."
+msgstr "已保存。重启 OpenKnowledge 以应用更改。"
+
#: src/lib/acp/tool-call-display.ts
msgid "Saves a restore point for every document in the project"
msgstr "为项目中的每个文档保存一个还原点"
@@ -14220,6 +14280,14 @@ msgstr "该文件夹中已有并非 Open Knowledge 写入的代码,同一份
msgid "That folder isn't an OpenKnowledge project yet. Initialize it and open?"
msgstr "那个文件夹还不是 OpenKnowledge 项目。要初始化并打开它吗?"
+#: src/components/settings/EnterpriseHostsSection.tsx
+msgid "That host is already in the list."
+msgstr "该主机已在列表中。"
+
+#: src/components/settings/EnterpriseHostsSection.tsx
+msgid "That isn't a valid hostname. Enter just the server name, such as github.example.com."
+msgstr "这不是有效的主机名。请只输入服务器名称,例如 github.example.com。"
+
#: src/components/settings/SpellcheckLanguagesRow.tsx
msgid "That language isn't available for spell checking."
msgstr "该语言不支持拼写检查。"
@@ -15104,6 +15172,10 @@ msgstr "这个项目不是 git 仓库,因此无法使用 worktree。"
msgid "This project lives only on this computer. Connect it to GitHub to back it up and share it with other people."
msgstr "这个项目只存在于这台电脑上。把它连接到 GitHub 即可备份并与他人共享。"
+#: src/components/settings/AccountSection.tsx
+msgid "This project's git remote is on {host}, which OpenKnowledge doesn't recognize as a GitHub host. If {host} runs GitHub Enterprise Server, add it to GitHub Enterprise Server hosts below, then restart OpenKnowledge."
+msgstr "此项目的 git 远程位于 {host},OpenKnowledge 未将其识别为 GitHub 主机。如果 {host} 运行的是 GitHub Enterprise Server,请在下方的“GitHub Enterprise Server 主机”中添加它,然后重启 OpenKnowledge。"
+
#: src/components/DocumentErrorBoundary.tsx
msgid "This project's running server doesn't support live editing. Restart OpenKnowledge to fix."
msgstr "这个项目正在运行的服务器不支持实时编辑。重启 OpenKnowledge 即可修复。"
diff --git a/packages/app/src/locales/zh-Hant/messages.json b/packages/app/src/locales/zh-Hant/messages.json
index 312d78b50..4d3ac003f 100644
--- a/packages/app/src/locales/zh-Hant/messages.json
+++ b/packages/app/src/locales/zh-Hant/messages.json
@@ -204,6 +204,7 @@
"1ruosn": ["OpenKnowledge"],
"1t_NnN": ["拒絕"],
"1u-mAI": ["無法開始同步。請檢查你的網路連線,然後再試一次。"],
+ "1uEVfp": ["企業版"],
"1vczDE": ["開啟 ", ["displayName"], " Desktop"],
"1vn0CI": ["伺服器回應無效"],
"1xui0Q": ["載入本機檔案失敗"],
@@ -301,6 +302,7 @@
")"
],
"3LbBJn": ["附加圖片"],
+ "3LuFP-": ["已儲存。請重新啟動 OpenKnowledge 以套用變更。"],
"3MA3Hh": ["無法讀取 ", ["gitignorePath"], " 規則:", ["previewError"]],
"3MnvrL": ["正在顯示最相關的 ", ["0"], " 個相符項——繼續輸入可以縮小範圍"],
"3Mwaly": ["無法初始化 ", ["0"], "。"],
@@ -619,6 +621,13 @@
"7YRrJ9": [
"在 OpenKnowledge 桌面應用程式中提供。在終端機裡可以使用<0> ok config-sharing status</0> / <1>share</1> / <2>unshare</2>。"
],
+ "7_I248": [
+ "此專案的 git 遠端位於 ",
+ ["host"],
+ ",OpenKnowledge 並未將其辨識為 GitHub 主機。如果 ",
+ ["host"],
+ " 執行的是 GitHub Enterprise Server,請在下方的「GitHub Enterprise Server 主機」中新增它,然後重新啟動 OpenKnowledge。"
+ ],
"7_bFEL": ["拖曳 ", ["patternText"], " 以重新排序"],
"7a0YcF": ["按<0>空白鍵</0>或點擊 blob 開始"],
"7aNk5D": ["OpenKnowledge 編輯了 ", ["subject"]],
@@ -821,6 +830,7 @@
"AItsE5": ["在那裡開啟"],
"AJ7_B2": ["建立新主題"],
"AKxFtn": [["openedWorktreeCount", "plural", { "one": ["worktree"], "other": ["worktree"] }]],
+ "ALFlyF": ["新增主機"],
"ALhMYW": ["終端機"],
"AMU00p": [
"兩個版本完全相同。選擇「採用目前」會讓 OpenKnowledge 的保護保持開啟,因此再次儲存較舊的版本仍會被拒絕。選擇「採用傳入」會關閉該保護。"
@@ -1029,6 +1039,7 @@
"DDTdLl": ["程式碼區塊設定"],
"DELNQk": ["協作者一同步就會看到你正在進行的編輯。"],
"DEWDbv": ["顯示圖表"],
+ "DEkRZA": ["這個主機已在清單中。"],
"DF1MtZ": ["正在載入 ", ["filePath"], " 的衝突"],
"DFQ2Sj": ["供後續聯絡的電子郵件"],
"DFfRbX": ["同步狀態:", ["syncStateLabel"], " —— 未設定 git 身分"],
@@ -1089,6 +1100,7 @@
"Dvr1Sg": ["正在複製"],
"Dvvrs8": [["0"], " 無法在該脈絡視窗下重新啟動。請使用「重試」將其復原。"],
"Dvwa0U": ["從這個分支建立 worktree"],
+ "Dwu3RL": ["GHES"],
"Dz7fsq": ["放大"],
"E-G19G": [
"連接埠 ",
@@ -1381,6 +1393,7 @@
"HHQcx0": ["讓技能在更多位置可用,或從某個位置移除"],
"HIb0vl": ["網路錯誤——請再試一次"],
"HJ7aHU": ["將目前的區塊向上或向下移動。在清單中,移動目前的項目或所選項目。"],
+ "HK2eIK": ["尚未新增 Enterprise 主機。只有 github.com 會被視為 GitHub。"],
"HKH-W-": ["資料"],
"HLoO-Z": ["伺服器回傳的匯入回應格式錯誤。"],
"HM56Bx": ["正在建立…"],
@@ -1470,6 +1483,7 @@
"IxyZXD": ["螢幕擷圖"],
"J0uRhj": ["檢查技能"],
"J1XRO3": ["主題色彩"],
+ "J2-D_a": ["GitHub Enterprise Server 主機"],
"J2Mv98": ["名稱(例如 ", ["login"], ")"],
"J2_JuX": ["無(", ["0"], " 無法比對到任何文件)"],
"J2eKUI": ["檔案"],
@@ -1986,6 +2000,9 @@
"PezM4_": ["已儲存 OpenKnowledge 技能。請在 Claude Desktop 中上傳,然後再次點選 Cowork。"],
"Pg83C9": ["已上傳「", ["0"], "」。"],
"PgJDqs": ["在編輯器中把游標停在外部連結上時顯示預覽卡片。"],
+ "PgY2nN": [
+ "如果你使用 GitHub Enterprise Server,請在此新增其主機,讓 OpenKnowledge 能夠登入、檢查推送權限,並為託管在其中的存放庫建立分享連結。"
+ ],
"Pgu10b": ["已儲存為 <0>", ["slug"], ".md</0>"],
"PgzIpb": ["跳到視覺化編輯器的上一個尋找結果。"],
"PhIa-X": ["要把這些副本換成指向來源的符號連結嗎?"],
@@ -2042,6 +2059,7 @@
"QWdKwH": ["移動"],
"QYTOaN": ["之後可以在<0>「設定 → 同步」</0>中變更。"],
"QYfQdv": [["displayName"], " CLI"],
+ "Qbf7Q4": ["新增主機"],
"QcTjRP": ["本次對話保持開始時的視窗。新對話可以使用其他視窗。"],
"Qca--K": [
"另一個程式正在這裡使用 Git——等它完成後再同步一次(它佔用著 <0>.git/index.lock</0>)"
@@ -2064,6 +2082,7 @@
"QohqVL": ["此智慧代理不提供斜線指令"],
"QpSqAP": ["本專案未啟用真實 shell。啟用後,命令會以你的使用者帳戶的完整權限執行。"],
"QqBQu1": ["標籤 <0>(可見的連結文字)</0>"],
+ "QsnBxE": ["這不是有效的主機名稱。請只輸入伺服器名稱,例如 github.example.com。"],
"Qvls7J": ["工程規格"],
"Qw-7Ie": [
"一個單純的寫作空間,每個主題一個檔案,外加一份日誌。如果你只想先動筆,讓筆記之間的連結慢慢長出來,請選這個。"
@@ -2299,6 +2318,7 @@
],
"UI0WPT": [["propertyCount", "plural", { "other": ["#", " 項屬性"] }]],
"UIjjFa": ["查看將新增的內容"],
+ "UK3GW4": ["github.com 一律會被辨識,不需要新增。"],
"UL-9ej": ["OpenKnowledge 開啟了即時預覽"],
"UL8A9w": ["標籤"],
"UMT9C9": ["如何使用 OpenKnowledge 及其 MCP 工具。"],
@@ -2512,6 +2532,9 @@
"XAyxsa": ["簽出遠端分支"],
"XBBZnv": ["連結目標「", ["shown"], "」未指向現有文件。"],
"XBgr2S": ["複製進來"],
+ "XBpH6-": [
+ "OpenKnowledge 在此專案的 git 遠端位址中找不到主機名稱,因此無法判斷要登入哪一台 GitHub 伺服器。"
+ ],
"XDzAnp": ["在新分頁中開啟"],
"XF1kgP": ["來自 ", ["source"], " 的內容均已是最新"],
"XGKy1z": ["無法顯示圖片"],
@@ -2972,6 +2995,7 @@
"cEoyWz": ["為 ", ["keyName"], " 新增項目"],
"cF9DyA": ["伺服器重新啟動後正在重新連線"],
"cFCKYZ": ["拒絕"],
+ "cFONFy": ["請輸入主機名稱,例如 github.example.com。"],
"cFSbbh": ["只限這台裝置。對你在這裡打開的每個專案都生效,而且絕不會分享給協作者。"],
"cH0dkG": ["它缺少我需要的功能"],
"cHhH3i": ["一個必要的 git 工具"],
@@ -2986,6 +3010,7 @@
"cNvGbn": ["編輯並重新傳送"],
"cOJyVj": ["停用主題"],
"cOSAfL": ["在你的 GitHub 帳戶中找不到儲存庫。"],
+ "cOX1Cj": ["git 主機"],
"cOrTMo": ["你的分享連結已經在下面產生好了。"],
"cPAWbl": ["已用電子郵件寄出"],
"cPgQ_i": [
@@ -4738,6 +4763,7 @@
"x57cJf": ["開啟連結"],
"xAlHfe": [["basename"], " — 文字編輯器"],
"xBFg6z": ["來自 ", ["0"], " 外掛"],
+ "xBjIs7": ["此專案無法使用 GitHub 登入"],
"xCJdfg": ["清除"],
"xCdTnb": ["關閉新分頁"],
"xD4Xm2": ["取得"],
@@ -4756,6 +4782,7 @@
"xOTzt5": ["剛剛"],
"xSVO3J": ["會建立什麼"],
"xV5sXw": [["0"], " 週前"],
+ "xVMoYb": ["移除 ", ["host"]],
"xW5AUw": [["pulled"], "拉取"],
"xW7KK3": [
["scopeLabel"],
diff --git a/packages/app/src/locales/zh-Hant/messages.po b/packages/app/src/locales/zh-Hant/messages.po
index 4b6ef3d43..3ba03019a 100644
--- a/packages/app/src/locales/zh-Hant/messages.po
+++ b/packages/app/src/locales/zh-Hant/messages.po
@@ -1624,6 +1624,10 @@ msgstr "新增註解"
msgid "Add a file name (e.g. notes.md)"
msgstr "加入檔案名稱(例如 notes.md)"
+#: src/components/settings/EnterpriseHostsSection.tsx
+msgid "Add a host"
+msgstr "新增主機"
+
#: src/components/settings/SearchSection.tsx
msgid "Add a key"
msgstr "新增索引鍵"
@@ -1677,6 +1681,10 @@ msgstr "新增欄位"
msgid "Add file or folder pattern, e.g. guides/**/*"
msgstr "新增檔案或資料夾模式,例如 guides/**/*"
+#: src/components/settings/EnterpriseHostsSection.tsx
+msgid "Add host"
+msgstr "新增主機"
+
#: src/components/SeedRootPicker.tsx
msgid "Add it directly to this project."
msgstr "直接把它加到這個專案。"
@@ -5793,6 +5801,10 @@ msgstr "請輸入 6 位十六進位值,例如 #1A2B3C"
msgid "Enter a folder name (e.g. brain)."
msgstr "請輸入資料夾名稱(例如 brain)。"
+#: src/components/settings/EnterpriseHostsSection.tsx
+msgid "Enter a hostname, such as github.example.com."
+msgstr "請輸入主機名稱,例如 github.example.com。"
+
#: src/components/settings/SavedThemesTiles.tsx
msgid "Enter a name for this theme."
msgstr "輸入這個主題的名稱。"
@@ -5845,6 +5857,11 @@ msgstr "輸入至少 3 個字元以依含義搜尋。"
msgid "Enter the public origin your tunnel serves, for example https://notes.example.com"
msgstr "輸入你的通道所提供服務的公開來源,例如 https://notes.example.com"
+#: src/components/settings/SettingsDialogShell.tsx
+msgctxt "settings search keyword"
+msgid "enterprise"
+msgstr "企業版"
+
#: src/components/settings/ContentRulesSection.tsx
msgid "Error"
msgstr "錯誤"
@@ -6776,6 +6793,11 @@ msgstr "開始設定"
msgid "Gets the link that opens this project or a document in the app"
msgstr "取得在應用程式中開啟此專案或文件的連結"
+#: src/components/settings/SettingsDialogShell.tsx
+msgctxt "settings search keyword"
+msgid "GHES"
+msgstr "GHES"
+
#: src/components/ExploreSkills.tsx
msgid "Git & PRs"
msgstr "Git 與 PR"
@@ -6788,6 +6810,11 @@ msgstr "Git 無法追蹤這個資料夾——它是空的,或者只有被忽
msgid "Git has locked this worktree, but it can still be opened."
msgstr "Git 已鎖定此工作樹,但仍可開啟。"
+#: src/components/settings/SettingsDialogShell.tsx
+msgctxt "settings search keyword"
+msgid "git host"
+msgstr "git 主機"
+
#: src/components/SyncStatusBadge.tsx
msgid "Git identity isn't set — commits use a default author. Set yours so teammates see your name."
msgstr "還沒設定 git 身分——提交會用預設作者。設定你自己的身分,隊友才看得到你的名字。"
@@ -6829,14 +6856,27 @@ msgstr "GitHub 連線已過期。請重新連線以繼續。"
msgid "GitHub denied the request. You may need to authorize OpenKnowledge for {owner} in your browser."
msgstr "GitHub 拒絕了這個要求。你可能需要在瀏覽器中為 {owner} 授權 OpenKnowledge。"
+#: src/components/settings/EnterpriseHostsSection.tsx
+#: src/components/settings/SettingsDialogShell.tsx
+msgid "GitHub Enterprise Server hosts"
+msgstr "GitHub Enterprise Server 主機"
+
#: src/components/SyncStatusBadge.tsx
msgid "GitHub sign-in is missing or expired. Reconnect to resume syncing."
msgstr "GitHub 登入不存在或已過期。請重新連接以繼續同步。"
+#: src/components/settings/AccountSection.tsx
+msgid "GitHub sign-in isn't available for this project"
+msgstr "此專案無法使用 GitHub 登入"
+
#: src/components/ImportSkillForm.tsx
msgid "GitHub, a git URL, or a local path."
msgstr "GitHub、一個 git URL,或一個本機路徑。"
+#: src/components/settings/EnterpriseHostsSection.tsx
+msgid "github.com is always recognized, so it doesn't need to be added."
+msgstr "github.com 一律會被辨識,不需要新增。"
+
#: src/components/settings/SavedThemesTiles.tsx
msgid "Give it a name before editing its colors."
msgstr "請先為主題命名,再編輯色彩。"
@@ -7300,6 +7340,10 @@ msgstr "如果 {agent} 沒有顯示 OpenKnowledge 工具,請在這個專案中
msgid "If an update arrives for something you are editing, you choose which version to keep, like a merge conflict."
msgstr "如果你正在編輯的東西收到更新,你可以像處理合併衝突那樣選擇要保留哪個版本。"
+#: src/components/settings/EnterpriseHostsSection.tsx
+msgid "If you use a GitHub Enterprise Server, add its host here so OpenKnowledge can sign in, check push permission, and create share links for repositories hosted there."
+msgstr "如果你使用 GitHub Enterprise Server,請在此新增其主機,讓 OpenKnowledge 能夠登入、檢查推送權限,並為託管在其中的存放庫建立分享連結。"
+
#: src/components/settings/ContentRulesSection.tsx
msgid "Ignore broken links in log.md"
msgstr "忽略 log.md 中失效的連結"
@@ -9291,6 +9335,10 @@ msgstr "還沒有任何編輯。"
msgid "No emoji found."
msgstr "找不到表情符號。"
+#: src/components/settings/EnterpriseHostsSection.tsx
+msgid "No Enterprise hosts added. Only github.com is treated as GitHub."
+msgstr "尚未新增 Enterprise 主機。只有 github.com 會被視為 GitHub。"
+
#: src/editor/link-preview/InternalDocPreviewCard.tsx
msgid "No excerpt"
msgstr "沒有摘錄"
@@ -10215,6 +10263,10 @@ msgstr "OpenKnowledge 檢查了專案"
msgid "OpenKnowledge could not find this agent on this machine."
msgstr "OpenKnowledge 未在此裝置上找到該代理程式。"
+#: src/components/settings/AccountSection.tsx
+msgid "OpenKnowledge couldn't find a host name in this project's git remote, so it can't tell which GitHub server to sign in to."
+msgstr "OpenKnowledge 在此專案的 git 遠端位址中找不到主機名稱,因此無法判斷要登入哪一台 GitHub 伺服器。"
+
#: src/lib/worktree-create-error.ts
msgid "OpenKnowledge couldn't finish setting up this project. The worktree was created but not opened."
msgstr "OpenKnowledge 無法完成此專案的設定。工作樹已建立,但未開啟。"
@@ -11584,6 +11636,10 @@ msgstr "移除 {chip}"
msgid "Remove {fullLabel} from context"
msgstr "把 {fullLabel} 從脈絡中移除"
+#: src/components/settings/EnterpriseHostsSection.tsx
+msgid "Remove {host}"
+msgstr "移除 {host}"
+
#: src/components/FrontmatterRow.tsx
msgid "Remove {keyName}"
msgstr "移除 {keyName}"
@@ -12351,6 +12407,10 @@ msgstr "儲存到"
msgid "Saved with the project for your team."
msgstr "和專案一起保存,供你的團隊使用。"
+#: src/components/settings/EnterpriseHostsSection.tsx
+msgid "Saved. Restart OpenKnowledge to apply the change."
+msgstr "已儲存。請重新啟動 OpenKnowledge 以套用變更。"
+
#: src/lib/acp/tool-call-display.ts
msgid "Saves a restore point for every document in the project"
msgstr "為專案中的每份文件儲存還原點"
@@ -14220,6 +14280,14 @@ msgstr "該資料夾中已有並非 Open Knowledge 寫入的程式碼,同一
msgid "That folder isn't an OpenKnowledge project yet. Initialize it and open?"
msgstr "那個資料夾還不是 OpenKnowledge 專案。要初始化並開啟它嗎?"
+#: src/components/settings/EnterpriseHostsSection.tsx
+msgid "That host is already in the list."
+msgstr "這個主機已在清單中。"
+
+#: src/components/settings/EnterpriseHostsSection.tsx
+msgid "That isn't a valid hostname. Enter just the server name, such as github.example.com."
+msgstr "這不是有效的主機名稱。請只輸入伺服器名稱,例如 github.example.com。"
+
#: src/components/settings/SpellcheckLanguagesRow.tsx
msgid "That language isn't available for spell checking."
msgstr "該語言不支援拼字檢查。"
@@ -15104,6 +15172,10 @@ msgstr "這個專案不是 git 儲存庫,所以無法使用 worktree。"
msgid "This project lives only on this computer. Connect it to GitHub to back it up and share it with other people."
msgstr "這個專案只存在於這台電腦上。把它連接到 GitHub 就能備份,也能和別人分享。"
+#: src/components/settings/AccountSection.tsx
+msgid "This project's git remote is on {host}, which OpenKnowledge doesn't recognize as a GitHub host. If {host} runs GitHub Enterprise Server, add it to GitHub Enterprise Server hosts below, then restart OpenKnowledge."
+msgstr "此專案的 git 遠端位於 {host},OpenKnowledge 並未將其辨識為 GitHub 主機。如果 {host} 執行的是 GitHub Enterprise Server,請在下方的「GitHub Enterprise Server 主機」中新增它,然後重新啟動 OpenKnowledge。"
+
#: src/components/DocumentErrorBoundary.tsx
msgid "This project's running server doesn't support live editing. Restart OpenKnowledge to fix."
msgstr "這個專案正在執行的伺服器不支援即時編輯。重新啟動 OpenKnowledge 即可修正。"
diff --git a/packages/cli/src/commands/auth/command-host.test.ts b/packages/cli/src/commands/auth/command-host.test.ts
new file mode 100644
index 000000000..de4f9f06a
--- /dev/null
+++ b/packages/cli/src/commands/auth/command-host.test.ts
@@ -0,0 +1,143 @@
+import { execFileSync } from 'node:child_process';
+import { mkdirSync, mkdtempSync, rmSync, writeFileSync } from 'node:fs';
+import { tmpdir } from 'node:os';
+import { join } from 'node:path';
+import password from '@inquirer/password';
+import { afterEach, beforeEach, expect, test, vi } from 'vitest';
+import { clearTokenFromAllBackends, FileBackend } from '../../auth/token-store.ts';
+import { shareNameCheckCommand } from '../share/name-check.ts';
+import { shareOwnersCommand } from '../share/owners.ts';
+import { patCommand } from './pat.ts';
+import { signoutCommand } from './signout.ts';
+
+vi.mock('@inquirer/password', () => ({ default: vi.fn() }));
+vi.mock('../../auth/gh-detect.ts', () => ({ detectGh: () => ({ available: false }) }));
+vi.mock('../../auth/token-store.ts', async (importOriginal) => ({
+ ...(await importOriginal<typeof import('../../auth/token-store.ts')>()),
+ clearTokenFromAllBackends: vi.fn().mockResolvedValue({ touched: ['file'] }),
+}));
+
+let projectDir: string;
+let home: string;
+
+function declareInUserConfig(host: string): void {
+ mkdirSync(join(home, '.ok'));
+ writeFileSync(
+ join(home, '.ok', 'global.yml'),
+ `git:\n hosts:\n ${host}:\n provider: github\n`,
+ );
+}
+
+beforeEach(() => {
+ projectDir = mkdtempSync(join(tmpdir(), 'ok-auth-command-host-'));
+ home = mkdtempSync(join(tmpdir(), 'ok-auth-command-host-home-'));
+ vi.stubEnv('HOME', home);
+ vi.stubEnv('USERPROFILE', home);
+ execFileSync('git', ['init', '-q'], { cwd: projectDir });
+ vi.spyOn(process, 'cwd').mockReturnValue(projectDir);
+ vi.spyOn(process.stderr, 'write').mockImplementation(() => true);
+});
+
+afterEach(() => {
+ vi.restoreAllMocks();
+ vi.clearAllMocks();
+ vi.unstubAllEnvs();
+ rmSync(projectDir, { recursive: true, force: true });
+ rmSync(home, { recursive: true, force: true });
+});
+
+test('explicit signout removes a legacy credential even without a provider declaration', async () => {
+ await signoutCommand().parseAsync(['--host', 'legacy.example.com'], { from: 'user' });
+ expect(clearTokenFromAllBackends).toHaveBeenCalledWith('legacy.example.com');
+});
+
+test('implicit signout refuses a generic origin without clearing another credential', async () => {
+ execFileSync('git', ['remote', 'add', 'origin', 'https://git.example.com/team/kb.git'], {
+ cwd: projectDir,
+ });
+ vi.spyOn(process, 'exit').mockImplementation(() => {
+ throw new Error('exit');
+ });
+ await expect(signoutCommand().parseAsync([], { from: 'user' })).rejects.toThrow('exit');
+ expect(clearTokenFromAllBackends).not.toHaveBeenCalled();
+ const message = vi
+ .mocked(process.stderr.write)
+ .mock.calls.map(([text]) => text)
+ .join('');
+ expect(message).toContain('ok auth signout --host git.example.com');
+ expect(message).toContain('remove stored local credentials');
+ expect(message).toContain('No provider declaration is required');
+ expect(message).not.toContain('sign-in');
+ expect(message).not.toContain('global.yml');
+});
+
+test.each(['/tmp/local-repository.git', 'file:///tmp/local-repository.git'])(
+ 'implicit signout asks for a credential hostname when origin cannot supply one: %s',
+ async (url) => {
+ execFileSync('git', ['remote', 'add', 'origin', url], { cwd: projectDir });
+ vi.spyOn(process, 'exit').mockImplementation(() => {
+ throw new Error('exit');
+ });
+ await expect(signoutCommand().parseAsync([], { from: 'user' })).rejects.toThrow('exit');
+ expect(clearTokenFromAllBackends).not.toHaveBeenCalled();
+ const message = vi
+ .mocked(process.stderr.write)
+ .mock.calls.map(([text]) => text)
+ .join('');
+ expect(message).toContain('Cannot determine');
+ expect(message).toContain('ok auth signout --host <hostname>');
+ expect(message).toContain('remove stored local credentials');
+ expect(message).not.toContain('sign-in');
+ expect(message).not.toContain('global.yml');
+ expect(message).not.toContain('null');
+ },
+);
+
+test('PAT prompt names the resolved enterprise destination before reading a token', async () => {
+ execFileSync('git', ['remote', 'add', 'origin', 'https://ghes.example.com/team/kb.git'], {
+ cwd: projectDir,
+ });
+ declareInUserConfig('ghes.example.com');
+ vi.mocked(password).mockRejectedValue(new Error('prompt cancelled'));
+ const store = new FileBackend(join(projectDir, 'auth.yml'));
+ const save = vi.spyOn(store, 'set');
+ await expect(patCommand(async () => store).parseAsync([], { from: 'user' })).rejects.toThrow(
+ 'prompt cancelled',
+ );
+ expect(password).toHaveBeenCalledWith({ message: 'Enter PAT for ghes.example.com:' });
+ expect(save).not.toHaveBeenCalled();
+});
+
+test('PAT refuses an undeclared explicit host before opening the token prompt', async () => {
+ vi.spyOn(process, 'exit').mockImplementation(() => {
+ throw new Error('exit');
+ });
+ const getStore = vi.fn(async () => new FileBackend(join(projectDir, 'auth.yml')));
+ await expect(
+ patCommand(getStore).parseAsync(['--host', 'undeclared.example.com'], { from: 'user' }),
+ ).rejects.toThrow('exit');
+ expect(getStore).not.toHaveBeenCalled();
+ expect(password).not.toHaveBeenCalled();
+});
+
+test.each(['owners', 'name-check'])(
+ 'share %s honors the user-level declaration from a nested directory',
+ async (name) => {
+ declareInUserConfig('ghes.example.com');
+ const nestedDir = join(projectDir, 'notes');
+ mkdirSync(nestedDir);
+ vi.mocked(process.cwd).mockReturnValue(nestedDir);
+ const store = new FileBackend(join(projectDir, 'auth.yml'));
+ const get = vi.spyOn(store, 'get').mockRejectedValue(new Error('token lookup reached'));
+ const command =
+ name === 'owners'
+ ? shareOwnersCommand(async () => store)
+ : shareNameCheckCommand(async () => store);
+ const args = ['--host', 'ghes.example.com'];
+ if (name === 'name-check') args.push('--owner', 'team', '--name', 'kb');
+ await expect(command.parseAsync(args, { from: 'user' })).rejects.toThrow(
+ 'token lookup reached',
+ );
+ expect(get).toHaveBeenCalledWith('ghes.example.com');
+ },
+);
diff --git a/packages/cli/src/commands/auth/login.ts b/packages/cli/src/commands/auth/login.ts
index 1b1af1be7..c7466579b 100644
--- a/packages/cli/src/commands/auth/login.ts
+++ b/packages/cli/src/commands/auth/login.ts
@@ -1,9 +1,8 @@
-import { originGitHubHost } from '@inkeep/open-knowledge-server';
import { Command } from 'commander';
import { runDeviceFlow } from '../../auth/device-flow.ts';
import type { TokenStore } from '../../auth/token-store.ts';
import { getOAuthClientId } from '../../github/app-config.ts';
-import { validateGitHubHost } from './validate-host.ts';
+import { resolveAuthHost } from './validate-host.ts';
interface LoginOptions {
host: string;
@@ -23,7 +22,6 @@ async function runLogin(
): Promise<void> {
const clientId = getOAuthClientId();
const { host, json } = opts;
- validateGitHubHost(host);
if (!json) {
process.stderr.write(`Logging in to ${host}\n`);
@@ -92,11 +90,11 @@ export function loginCommand(getTokenStore: () => Promise<TokenStore>): Command
.description('Authenticate with GitHub via Device Flow')
.option(
'--host <host>',
- 'GitHub or GitHub Enterprise hostname (default: workspace origin host)',
+ 'GitHub or GitHub Enterprise hostname (default: the GitHub origin host, or github.com with no origin; required otherwise)',
)
.option('--json', 'Output JSONL progress events', false)
.action(async (opts: Omit<LoginOptions, 'host'> & { host?: string }) => {
- const host = opts.host ?? originGitHubHost(process.cwd());
+ const host = resolveAuthHost(opts.host);
const store = await getTokenStore();
await runLogin({ ...opts, host }, store);
});
diff --git a/packages/cli/src/commands/auth/pat.ts b/packages/cli/src/commands/auth/pat.ts
index f2fc04957..a16f1c977 100644
--- a/packages/cli/src/commands/auth/pat.ts
+++ b/packages/cli/src/commands/auth/pat.ts
@@ -1,10 +1,9 @@
-import { originGitHubHost } from '@inkeep/open-knowledge-server';
import password from '@inquirer/password';
import { Octokit } from '@octokit/rest';
import { Command } from 'commander';
import { describeAuthFailure } from '../../auth/describe-auth-error.ts';
import type { TokenStore } from '../../auth/token-store.ts';
-import { validateGitHubHost } from './validate-host.ts';
+import { resolveAuthHost } from './validate-host.ts';
interface PatOptions {
host: string;
@@ -25,9 +24,8 @@ async function runPat(
readToken?: () => Promise<string>,
): Promise<void> {
const { host, json } = opts;
- validateGitHubHost(host);
- const getToken = readToken ?? (() => password({ message: 'Enter PAT:' }));
+ const getToken = readToken ?? (() => password({ message: `Enter PAT for ${host}:` }));
const token = await getToken();
if (!token) {
@@ -70,12 +68,12 @@ export function patCommand(getTokenStore: () => Promise<TokenStore>): Command {
.description('Store a Personal Access Token')
.option(
'--host <host>',
- 'GitHub or GitHub Enterprise hostname (default: workspace origin host)',
+ 'GitHub or GitHub Enterprise hostname (default: the GitHub origin host, or github.com with no origin; required otherwise)',
)
.option('--json', 'Output JSON', false)
.option('--token-stdin', 'Read the token from stdin instead of prompting', false)
.action(async (opts: Omit<PatOptions, 'host'> & { host?: string; tokenStdin?: boolean }) => {
- const host = opts.host ?? originGitHubHost(process.cwd());
+ const host = resolveAuthHost(opts.host);
const readToken = opts.tokenStdin ? readTokenFromStdin : undefined;
await runPat({ host, json: opts.json }, await getTokenStore(), readToken);
});
diff --git a/packages/cli/src/commands/auth/repos.ts b/packages/cli/src/commands/auth/repos.ts
index e579f6944..23d15cafb 100644
--- a/packages/cli/src/commands/auth/repos.ts
+++ b/packages/cli/src/commands/auth/repos.ts
@@ -1,9 +1,8 @@
-import { originGitHubHost } from '@inkeep/open-knowledge-server';
import { Octokit } from '@octokit/rest';
import { Command } from 'commander';
import { detectGh } from '../../auth/gh-detect.ts';
import type { TokenStore } from '../../auth/token-store.ts';
-import { validateGitHubHost } from './validate-host.ts';
+import { resolveAuthHost } from './validate-host.ts';
interface ReposOptions {
host: string;
@@ -23,7 +22,6 @@ export async function resolveReposToken(
async function runRepos(opts: ReposOptions, tokenStore: TokenStore): Promise<void> {
const { host, json } = opts;
- validateGitHubHost(host);
const token = await resolveReposToken(host, tokenStore);
if (token == null) {
process.stderr.write(`Not logged in to ${host}\n`);
@@ -57,11 +55,11 @@ export function reposCommand(getTokenStore: () => Promise<TokenStore>): Command
.description('List accessible repositories')
.option(
'--host <host>',
- 'GitHub or GitHub Enterprise hostname (default: workspace origin host)',
+ 'GitHub or GitHub Enterprise hostname (default: the GitHub origin host, or github.com with no origin; required otherwise)',
)
.option('--json', 'Output JSON', false)
.action(async (opts: Omit<ReposOptions, 'host'> & { host?: string }) => {
- const host = opts.host ?? originGitHubHost(process.cwd());
+ const host = resolveAuthHost(opts.host);
await runRepos({ ...opts, host }, await getTokenStore());
});
}
diff --git a/packages/cli/src/commands/auth/signout.ts b/packages/cli/src/commands/auth/signout.ts
index cd63e39ae..0c92cbad8 100644
--- a/packages/cli/src/commands/auth/signout.ts
+++ b/packages/cli/src/commands/auth/signout.ts
@@ -1,6 +1,6 @@
-import { originGitHubHost } from '@inkeep/open-knowledge-server';
import { Command } from 'commander';
import { clearTokenFromAllBackends } from '../../auth/token-store.ts';
+import { resolveSignoutHost } from './validate-host.ts';
interface SignoutOptions {
host: string;
@@ -29,10 +29,10 @@ export function signoutCommand(): Command {
.description('Remove stored credentials')
.option(
'--host <host>',
- 'GitHub or GitHub Enterprise hostname (default: workspace origin host)',
+ 'GitHub or GitHub Enterprise hostname (default: the GitHub origin host, or github.com with no origin; required otherwise)',
)
.action(async (opts: Omit<SignoutOptions, 'host'> & { host?: string }) => {
- const host = opts.host ?? originGitHubHost(process.cwd());
+ const host = resolveSignoutHost(opts.host);
await runSignout({ ...opts, host });
});
}
diff --git a/packages/cli/src/commands/auth/status.ts b/packages/cli/src/commands/auth/status.ts
index 568312478..bce01d03c 100644
--- a/packages/cli/src/commands/auth/status.ts
+++ b/packages/cli/src/commands/auth/status.ts
@@ -1,10 +1,9 @@
-import { originGitHubHost } from '@inkeep/open-knowledge-server';
import { Octokit } from '@octokit/rest';
import { Command } from 'commander';
import { describeAuthFailure } from '../../auth/describe-auth-error.ts';
import { detectGh } from '../../auth/gh-detect.ts';
import type { TokenStore } from '../../auth/token-store.ts';
-import { validateGitHubHost } from './validate-host.ts';
+import { resolveAuthHost } from './validate-host.ts';
interface StatusOptions {
host: string;
@@ -46,7 +45,6 @@ export function buildStatusPayload(
async function runStatus(opts: StatusOptions, tokenStore: TokenStore): Promise<void> {
const { host, json } = opts;
- validateGitHubHost(host);
const backend = tokenStore.backend;
const source = await resolveStatusSource(host, tokenStore);
@@ -102,11 +100,11 @@ export function statusCommand(getTokenStore: () => Promise<TokenStore>): Command
.description('Show authentication status')
.option(
'--host <host>',
- 'GitHub or GitHub Enterprise hostname (default: workspace origin host)',
+ 'GitHub or GitHub Enterprise hostname (default: the GitHub origin host, or github.com with no origin; required otherwise)',
)
.option('--json', 'Output JSON', false)
.action(async (opts: Omit<StatusOptions, 'host'> & { host?: string }) => {
- const host = opts.host ?? originGitHubHost(process.cwd());
+ const host = resolveAuthHost(opts.host);
await runStatus({ ...opts, host }, await getTokenStore());
});
}
diff --git a/packages/cli/src/commands/auth/validate-host.test.ts b/packages/cli/src/commands/auth/validate-host.test.ts
new file mode 100644
index 000000000..26f9edc8b
--- /dev/null
+++ b/packages/cli/src/commands/auth/validate-host.test.ts
@@ -0,0 +1,220 @@
+import { execFileSync } from 'node:child_process';
+import { mkdirSync, mkdtempSync, rmSync, writeFileSync } from 'node:fs';
+import { tmpdir } from 'node:os';
+import { join } from 'node:path';
+import { afterEach, beforeEach, describe, expect, test, vi } from 'vitest';
+import { gitHubHostRejection, resolveAuthHost, validateGitHubHost } from './validate-host.ts';
+
+function hostsYaml(provider: string, ...hostnames: string[]): string {
+ const entries = hostnames.map((host) => ` ${host}:\n provider: ${provider}\n`).join('');
+ return `git:\n hosts:\n${entries}`;
+}
+
+function writeOkFile(dir: string, file: string, body: string): void {
+ mkdirSync(join(dir, '.ok'), { recursive: true });
+ writeFileSync(join(dir, '.ok', file), body, 'utf-8');
+}
+
+let home: string;
+
+beforeEach(() => {
+ home = mkdtempSync(join(tmpdir(), 'ok-validate-host-home-'));
+ vi.stubEnv('HOME', home);
+ vi.stubEnv('USERPROFILE', home);
+});
+
+afterEach(() => {
+ vi.unstubAllEnvs();
+ rmSync(home, { recursive: true, force: true });
+});
+
+function declare(...hostnames: string[]): void {
+ writeOkFile(home, 'global.yml', hostsYaml('github', ...hostnames));
+}
+
+describe('gitHubHostRejection', () => {
+ let projectDir: string;
+
+ beforeEach(() => {
+ projectDir = mkdtempSync(join(tmpdir(), 'ok-validate-host-'));
+ });
+
+ afterEach(() => {
+ rmSync(projectDir, { recursive: true, force: true });
+ });
+
+ test('accepts github.com with no user config at all', () => {
+ expect(gitHubHostRejection('github.com')).toBeNull();
+ });
+
+ test('accepts www.github.com by folding it onto github.com', () => {
+ expect(gitHubHostRejection('www.github.com')).toBeNull();
+ });
+
+ test('accepts a host declared in the user config', () => {
+ declare('ghes.example.com');
+ expect(gitHubHostRejection('ghes.example.com')).toBeNull();
+ });
+
+ test('matches a declaration case-insensitively and ignoring the port', () => {
+ declare('ghes.example.com');
+ expect(gitHubHostRejection('GHES.Example.com:8443')).toBeNull();
+ });
+
+ test('rejects an undeclared self-hosted host and names the config key as the remedy', () => {
+ const rejection = gitHubHostRejection('git.example.internal');
+ expect(rejection).toContain('git.example.internal is not a known GitHub host');
+ expect(rejection).toContain('~/.ok/global.yml');
+ expect(rejection).toContain(
+ 'git:\n hosts:\n git.example.internal:\n provider: github',
+ );
+ });
+
+ test('suggests a port-free hostname as the config key', () => {
+ expect(gitHubHostRejection('ghes.example.com:8443')).toContain(
+ ' ghes.example.com:\n provider: github',
+ );
+ });
+
+ test('rejects a host declared with some other provider value', () => {
+ writeOkFile(home, 'global.yml', hostsYaml('gitlab', 'git.example.internal'));
+ expect(gitHubHostRejection('git.example.internal')).not.toBeNull();
+ });
+
+ test.each(['gitlab.com', 'bitbucket.org', 'codeberg.org', 'gitea.com', 'sr.ht', 'sourcehut.org'])(
+ 'rejects the formerly denylisted host %s',
+ (host) => {
+ expect(gitHubHostRejection(host)).not.toBeNull();
+ },
+ );
+
+ test("ignores a declaration in the project's .ok/config.yml", () => {
+ writeOkFile(projectDir, 'config.yml', hostsYaml('github', 'ghes.example.com'));
+ expect(gitHubHostRejection('ghes.example.com')).not.toBeNull();
+ });
+});
+
+describe('validateGitHubHost', () => {
+ test('returns without touching the process for an accepted host', () => {
+ expect(() => validateGitHubHost('github.com')).not.toThrow();
+ });
+});
+
+function seedOrigin(projectDir: string, url: string): void {
+ execFileSync('git', ['init', '-q'], { cwd: projectDir });
+ execFileSync('git', ['remote', 'add', 'origin', url], { cwd: projectDir });
+}
+
+describe('resolveAuthHost', () => {
+ let projectDir: string;
+
+ beforeEach(() => {
+ projectDir = mkdtempSync(join(tmpdir(), 'ok-resolve-auth-host-'));
+ });
+
+ afterEach(() => {
+ vi.restoreAllMocks();
+ rmSync(projectDir, { recursive: true, force: true });
+ });
+
+ test('an explicit undeclared host is rejected before an API command can use it', () => {
+ const exit = vi.spyOn(process, 'exit').mockImplementation(() => {
+ throw new Error('exit');
+ });
+ const stderr = vi.spyOn(process.stderr, 'write').mockImplementation(() => true);
+ expect(() => resolveAuthHost('undeclared.example.com', projectDir)).toThrow('exit');
+ expect(exit).toHaveBeenCalledWith(1);
+ expect(String(stderr.mock.calls[0]?.[0])).toContain('provider: github');
+ });
+
+ test('default project resolution reads the origin of the enclosing project from a nested cwd', () => {
+ seedOrigin(projectDir, 'https://ghes.example.com/team/kb.git');
+ writeOkFile(projectDir, 'config.yml', 'content:\n dir: .\n');
+ declare('ghes.example.com');
+ const nestedDir = join(projectDir, 'notes', 'nested');
+ mkdirSync(nestedDir, { recursive: true });
+ vi.spyOn(process, 'cwd').mockReturnValue(nestedDir);
+ expect(resolveAuthHost(undefined)).toBe('ghes.example.com');
+ expect(() => validateGitHubHost('ghes.example.com')).not.toThrow();
+ const exit = vi.spyOn(process, 'exit').mockImplementation(() => {
+ throw new Error('exit');
+ });
+ vi.spyOn(process.stderr, 'write').mockImplementation(() => true);
+ expect(() => validateGitHubHost('undeclared.example.com')).toThrow('exit');
+ expect(exit).toHaveBeenCalledWith(1);
+ });
+
+ test.each(['/tmp/local-repository.git', 'file:///tmp/local-repository.git'])(
+ 'an origin without a recognized hostname explains the parsing limitation: %s',
+ (url) => {
+ seedOrigin(projectDir, url);
+ vi.spyOn(process, 'exit').mockImplementation(() => {
+ throw new Error('exit');
+ });
+ const stderr = vi.spyOn(process.stderr, 'write').mockImplementation(() => true);
+ expect(() => resolveAuthHost(undefined, projectDir)).toThrow('exit');
+ const message = String(stderr.mock.calls[0]?.[0]);
+ expect(message).toContain('Cannot determine');
+ expect(message).not.toContain('is not a GitHub host');
+ expect(message).toContain('--host');
+ },
+ );
+
+ test('an explicit --host wins regardless of the origin', () => {
+ seedOrigin(projectDir, 'https://git.example.internal/team/kb.git');
+ expect(resolveAuthHost('github.com', projectDir)).toBe('github.com');
+ });
+
+ test('an accepted explicit enterprise host retains its port and spelling', () => {
+ declare('ghes.example.com');
+ expect(resolveAuthHost('GHES.Example.com:8443', projectDir)).toBe('GHES.Example.com:8443');
+ });
+
+ test('an explicit host refusal consistently names the normalized hostname', () => {
+ vi.spyOn(process, 'exit').mockImplementation(() => {
+ throw new Error('exit');
+ });
+ const stderr = vi.spyOn(process.stderr, 'write').mockImplementation(() => true);
+ expect(() => resolveAuthHost('GHES.Example.com:8443', projectDir)).toThrow('exit');
+ const message = String(stderr.mock.calls[0]?.[0]);
+ expect(message).toContain('ghes.example.com is not a known GitHub host');
+ expect(message).toContain(' ghes.example.com:\n provider: github');
+ expect(message).not.toContain('GHES.Example.com');
+ expect(message).not.toContain('8443');
+ });
+
+ test('a github.com origin resolves to github.com', () => {
+ seedOrigin(projectDir, 'https://github.com/team/kb.git');
+ expect(resolveAuthHost(undefined, projectDir)).toBe('github.com');
+ });
+
+ test('a declared enterprise origin resolves to that host', () => {
+ seedOrigin(projectDir, 'https://ghes.example.com/team/kb.git');
+ declare('ghes.example.com');
+ expect(resolveAuthHost(undefined, projectDir)).toBe('ghes.example.com');
+ });
+
+ test('no remote at all resolves to github.com so a local project can still publish', () => {
+ execFileSync('git', ['init', '-q'], { cwd: projectDir });
+ expect(resolveAuthHost(undefined, projectDir)).toBe('github.com');
+ });
+
+ test('an undeclared self-hosted origin refuses and names the host and the remedy', () => {
+ seedOrigin(projectDir, 'https://git.example.internal/team/kb.git');
+ const exit = vi.spyOn(process, 'exit').mockImplementation((() => {
+ throw new Error('exit');
+ }) as never);
+ const stderr = vi.spyOn(process.stderr, 'write').mockImplementation(() => true);
+ try {
+ expect(() => resolveAuthHost(undefined, projectDir)).toThrow('exit');
+ expect(exit).toHaveBeenCalledWith(1);
+ expect(String(stderr.mock.calls[0]?.[0])).toContain('not a GitHub host');
+ expect(String(stderr.mock.calls[0]?.[0])).toContain('git.example.internal');
+ expect(String(stderr.mock.calls[0]?.[0])).toContain('--host');
+ expect(String(stderr.mock.calls[0]?.[0])).toContain('provider: github');
+ } finally {
+ exit.mockRestore();
+ stderr.mockRestore();
+ }
+ });
+});
diff --git a/packages/cli/src/commands/auth/validate-host.ts b/packages/cli/src/commands/auth/validate-host.ts
index c11e3b38f..20f0b9e1a 100644
--- a/packages/cli/src/commands/auth/validate-host.ts
+++ b/packages/cli/src/commands/auth/validate-host.ts
@@ -1,11 +1,80 @@
-import { KNOWN_NON_GITHUB_GIT_HOSTS } from '@inkeep/open-knowledge-core';
+import { isGitHubHost, normalizeGitHostname } from '@inkeep/open-knowledge-core';
+import {
+ findEnclosingProjectRoot,
+ readDeclaredGitHubHosts,
+ resolveGitHubAuthHost,
+} from '@inkeep/open-knowledge-server';
+import { error as errorColor } from '../../ui/colors.ts';
+
+function authProjectDir(): string {
+ const cwd = process.cwd();
+ return findEnclosingProjectRoot(cwd)?.rootPath ?? cwd;
+}
+
+function declarationRemedy(host: string): string {
+ return `~/.ok/global.yml:\n\n git:\n hosts:\n ${host}:\n provider: github\n`;
+}
+
+function explicitGitHubHostRejection(host: string): string {
+ return (
+ `${errorColor('Error:')} ${host} is not a known GitHub host.\n` +
+ `To use a GitHub Enterprise Server host, declare it in ${declarationRemedy(host)}`
+ );
+}
+
+export function gitHubHostRejection(host: string): string | null {
+ return isGitHubHost(host, readDeclaredGitHubHosts())
+ ? null
+ : explicitGitHubHostRejection(normalizeGitHostname(host));
+}
export function validateGitHubHost(host: string): void {
- const normalized = host.toLowerCase().replace(/:\d+$/, '');
- if (KNOWN_NON_GITHUB_GIT_HOSTS.has(normalized)) {
- process.stderr.write(
- `Error: ${host} is not a GitHub host. Only GitHub and GitHub Enterprise Server are supported.\n`,
- );
- process.exit(1);
- }
+ const rejection = gitHubHostRejection(host);
+ if (rejection === null) return;
+ process.stderr.write(rejection);
+ process.exit(1);
+}
+
+function nonGitHubOriginRejection(originHost: string | null): string {
+ const lead =
+ originHost === null
+ ? `${errorColor('Error:')} Cannot determine a GitHub hostname from this project's git remote.\n`
+ : `${errorColor('Error:')} this project's git remote is ${originHost}, which is not a GitHub host, so GitHub sign-in does not apply here.\n`;
+ const remedy =
+ originHost === null
+ ? 'Pass --host <hostname> to target a GitHub host explicitly.\n'
+ : `Pass --host <hostname> to target a GitHub host explicitly, or, if ${originHost} runs GitHub Enterprise Server, declare it in ${declarationRemedy(originHost)}`;
+ return lead + remedy;
+}
+
+export function resolveAuthHost(
+ explicitHost: string | undefined,
+ projectDir: string = authProjectDir(),
+): string {
+ const result = resolveGitHubAuthHost(projectDir, explicitHost);
+ if (result.kind === 'ok') return result.host;
+ process.stderr.write(
+ result.kind === 'rejected-explicit'
+ ? explicitGitHubHostRejection(result.host)
+ : nonGitHubOriginRejection(result.host),
+ );
+ process.exit(1);
+}
+
+export function resolveSignoutHost(
+ explicitHost: string | undefined,
+ projectDir: string = authProjectDir(),
+): string {
+ if (explicitHost !== undefined) return explicitHost;
+ const result = resolveGitHubAuthHost(projectDir);
+ if (result.kind === 'ok') return result.host;
+ const lead =
+ result.host === null
+ ? `Cannot determine a hostname from this project's git remote.`
+ : `This project's git remote is ${result.host}, which is not a known GitHub host.`;
+ process.stderr.write(
+ `${errorColor('Error:')} ${lead}\n` +
+ `Run ok auth signout --host ${result.host ?? '<hostname>'} to remove stored local credentials. No provider declaration is required.\n`,
+ );
+ process.exit(1);
}
diff --git a/packages/core/src/config/bind-config-doc.test.ts b/packages/core/src/config/bind-config-doc.test.ts
index 3b4a254f1..342b4d081 100644
--- a/packages/core/src/config/bind-config-doc.test.ts
+++ b/packages/core/src/config/bind-config-doc.test.ts
@@ -117,6 +117,40 @@ describe('bindConfigDoc — current()', () => {
});
describe('bindConfigDoc — patch()', () => {
+ test('allows removing providers and hosts without discarding sibling declarations', () => {
+ const binding = bindSyncedConfigDoc('user');
+ expect(
+ binding.patch({
+ git: {
+ hosts: {
+ first: { provider: 'github' },
+ second: { provider: 'github' },
+ third: { provider: 'github' },
+ },
+ },
+ }).ok,
+ ).toBe(true);
+ const result = binding.patch({ git: { hosts: { first: { provider: null }, second: null } } });
+ expect(result).toMatchObject({
+ ok: true,
+ effective: { git: { hosts: { first: {}, third: { provider: 'github' } } } },
+ });
+ if (result.ok) {
+ expect(result.effective.git.hosts.first?.provider).toBeUndefined();
+ expect(result.effective.git.hosts.second).toBeUndefined();
+ }
+ binding.dispose();
+ });
+ test.each([{ h: { provider: 'gitlab' } }, { h: 'invalid' }, 'invalid'])(
+ 'rejects invalid host patch %j without mutating CRDT state',
+ (hosts) => {
+ const binding = bindSyncedConfigDoc('user');
+ const result = binding.patch({ git: { hosts: hosts as never } });
+ expect(result).toMatchObject({ ok: false, error: { code: 'SCHEMA_INVALID' } });
+ expect(doc.getText('source').toString()).toBe('');
+ binding.dispose();
+ },
+ );
test('writes scalar to synced empty Y.Text + returns effective config', () => {
const binding = bindSyncedConfigDoc('user');
const result = binding.patch({ appearance: { theme: 'dark' } });
diff --git a/packages/core/src/config/bind-config-doc.ts b/packages/core/src/config/bind-config-doc.ts
index a7d6485d0..b670530a2 100644
--- a/packages/core/src/config/bind-config-doc.ts
+++ b/packages/core/src/config/bind-config-doc.ts
@@ -1,6 +1,7 @@
import { isMap, type ParsedNode, parseDocument } from 'yaml';
import type * as Y from 'yjs';
import type { ConfigValidationError, WriteScope } from './errors.ts';
+import { validateGitHostPatch } from './git-host-config.ts';
import type { Err, Ok, Result } from './result.ts';
import { type Config, type ConfigPatch, ConfigSchema } from './schema.ts';
import { addConfigSpanEvent, withConfigSpanSync } from './telemetry.ts';
@@ -151,6 +152,8 @@ function bindConfigDocInner(
if (scopeViolation !== null) {
return err(scopeViolation);
}
+ const hostViolation = validateGitHostPatch(patch);
+ if (hostViolation !== null) return err(hostViolation);
const currentContent = ytext.toString();
let doc = parseDocument(currentContent);
diff --git a/packages/core/src/config/collect-config-diagnostics.test.ts b/packages/core/src/config/collect-config-diagnostics.test.ts
index 33a4b90d5..a26b674f0 100644
--- a/packages/core/src/config/collect-config-diagnostics.test.ts
+++ b/packages/core/src/config/collect-config-diagnostics.test.ts
@@ -96,6 +96,21 @@ function collect() {
}
describe('collectConfigDiagnostics', () => {
+ test('reports invalid host declarations at their user source location', () => {
+ const file = writeScopeConfig('user', { git: { hosts: { h: { provider: 'gitlab' } } } });
+ expect(collect().diagnostics).toContainEqual({
+ code: 'VALUE_FALLBACK',
+ scope: 'user',
+ file,
+ issues: [
+ expect.objectContaining({
+ path: ['git', 'hosts', 'h', 'provider'],
+ line: expect.any(Number),
+ }),
+ ],
+ });
+ });
+
test('the fixture path carries every forbidden value, so no absence check can pass on path luck', () => {
for (const value of CONFIG_VALUES_THE_FINDING_FIELDS_MUST_NEVER_ECHO) {
expect(projectDir, `projectDir must carry ${value}`).toContain(value);
diff --git a/packages/core/src/config/field-registry.test.ts b/packages/core/src/config/field-registry.test.ts
index 2637f53d6..d916f6fd9 100644
--- a/packages/core/src/config/field-registry.test.ts
+++ b/packages/core/src/config/field-registry.test.ts
@@ -2,6 +2,7 @@ import { describe, expect, test } from 'vitest';
import { z } from 'zod';
import { fieldRegistry, getFieldMeta } from './field-registry.ts';
import { ConfigSchema } from './schema.ts';
+import { getLeafFieldMeta } from './schema-leaf.ts';
describe('fieldRegistry singleton', () => {
test('is reachable via the public globalThis Symbol key', () => {
@@ -143,7 +144,7 @@ describe('ConfigSchema coverage (NR3 — every leaf has fieldRegistry metadata)'
expect(allowlisted).toEqual([]);
});
- test('user-strict fields cover agents.autoApproveOkTools + appearance.{colorTheme*,customTheme.*,language,preview.autoOpen,theme} + editor.{previewTabs,wordWrap} + slides.enabled', () => {
+ test('user-strict fields cover agents.autoApproveOkTools + appearance.{colorTheme*,customTheme.*,language,preview.autoOpen,theme} + editor.{previewTabs,wordWrap} + git.hosts + slides.enabled', () => {
const leaves: { path: string[]; schema: unknown }[] = [];
walkLeaves(ConfigSchema, [], leaves);
const userStrict = leaves
@@ -181,6 +182,7 @@ describe('ConfigSchema coverage (NR3 — every leaf has fieldRegistry metadata)'
'appearance.theme',
'editor.previewTabs',
'editor.wordWrap',
+ 'git.hosts',
'slides.enabled',
'telemetry.skillInstallReports.enabled',
]);
@@ -284,7 +286,7 @@ describe('ConfigSchema coverage (NR3 — every leaf has fieldRegistry metadata)'
expect(missing).toEqual([]);
});
- test("boot-only leaves are exactly content.dir + the listener/exposure keys — everything else is 'live'", () => {
+ test("boot-only leaves are exactly content.dir + git.hosts + the listener/exposure keys — everything else is 'live'", () => {
const leaves: { path: string[]; schema: unknown }[] = [];
walkLeaves(ConfigSchema, [], leaves);
const bootOnly = leaves
@@ -293,6 +295,7 @@ describe('ConfigSchema coverage (NR3 — every leaf has fieldRegistry metadata)'
.sort();
expect(bootOnly).toEqual([
'content.dir',
+ 'git.hosts',
'server.allowExternal',
'server.bind',
'server.externalUrl',
@@ -301,3 +304,12 @@ describe('ConfigSchema coverage (NR3 — every leaf has fieldRegistry metadata)'
]);
});
});
+
+describe('git.hosts record registration', () => {
+ test('the record node and the provider leaf beneath it both report user scope', () => {
+ expect(getLeafFieldMeta(ConfigSchema, ['git', 'hosts'])).toMatchObject({ scope: 'user' });
+ expect(
+ getLeafFieldMeta(ConfigSchema, ['git', 'hosts', 'ghes.example.com', 'provider']),
+ ).toMatchObject({ scope: 'user' });
+ });
+});
diff --git a/packages/core/src/config/git-host-config.ts b/packages/core/src/config/git-host-config.ts
new file mode 100644
index 000000000..f47dd23b4
--- /dev/null
+++ b/packages/core/src/config/git-host-config.ts
@@ -0,0 +1,55 @@
+import { z } from 'zod';
+import { GIT_HOST_PROVIDERS } from '../constants/github.ts';
+import type { ConfigValidationError } from './errors.ts';
+import { fieldRegistry } from './field-registry.ts';
+import type { ConfigPatch } from './schema.ts';
+import { toConfigIssue } from './yaml-patch.ts';
+
+const gitHostEntryShape = {
+ provider: z.enum(GIT_HOST_PROVIDERS).register(fieldRegistry, {
+ scope: 'user',
+ agentSettable: false,
+ reload: 'boot',
+ defaultScope: 'user',
+ description:
+ "Declares that this git host is a GitHub Enterprise Server instance, so OpenKnowledge treats its remotes the way it treats github.com (OpenKnowledge credential handling, the push-permission check, share links, and the default host for `ok auth`). 'github' is the only accepted value today. A host that is not declared here and is not github.com is treated as a generic git remote, so OpenKnowledge leaves the machine's own git credentials alone and does not check push permission. Per-machine (user scope, `~/.ok/global.yml`); a value in a project's `.ok/config.yml` is ignored. The declaration takes effect when OpenKnowledge next starts.",
+ }),
+};
+
+type GitHostEntryShape = typeof gitHostEntryShape;
+
+const effectiveEntryShape = Object.fromEntries(
+ Object.entries(gitHostEntryShape).map(([key, schema]) => [
+ key,
+ schema.optional().catch(undefined),
+ ]),
+) as {
+ [K in keyof GitHostEntryShape]: z.ZodCatch<z.ZodOptional<GitHostEntryShape[K]>>;
+};
+
+const patchEntryShape = Object.fromEntries(
+ Object.entries(gitHostEntryShape).map(([key, schema]) => [key, schema.nullish()]),
+) as {
+ [K in keyof GitHostEntryShape]: z.ZodOptional<z.ZodNullable<GitHostEntryShape[K]>>;
+};
+
+export const EffectiveGitHostEntrySchema = z.looseObject(effectiveEntryShape).catch({});
+
+export const GitHostsSchema = z.record(z.string(), z.looseObject(gitHostEntryShape).partial());
+
+const GitHostPatchSchema = z.looseObject({
+ git: z
+ .looseObject({
+ hosts: z.record(z.string(), z.looseObject(patchEntryShape).nullish()).nullish(),
+ })
+ .nullish(),
+});
+
+export function validateGitHostPatch(
+ patch: ConfigPatch,
+): Extract<ConfigValidationError, { code: 'SCHEMA_INVALID' }> | null {
+ const parsed = GitHostPatchSchema.safeParse(patch);
+ return parsed.success
+ ? null
+ : { code: 'SCHEMA_INVALID', issues: parsed.error.issues.map(toConfigIssue) };
+}
diff --git a/packages/core/src/config/merge-layered.test.ts b/packages/core/src/config/merge-layered.test.ts
index bc229c6a4..4d5f402d3 100644
--- a/packages/core/src/config/merge-layered.test.ts
+++ b/packages/core/src/config/merge-layered.test.ts
@@ -57,6 +57,17 @@ describe('mergeLayered — default precedence (no scope-aware short-circuit)', (
});
describe('mergeLayered — scope-aware leaf short-circuits', () => {
+ test("scope: 'user' (git.hosts) ignores host declarations from the project layers", () => {
+ const user = makeConfig({ git: { hosts: { 'ghes.user.test': { provider: 'github' } } } });
+ const project = makeConfig({ git: { hosts: { 'ghes.project.test': { provider: 'github' } } } });
+ const projectLocal = makeConfig({
+ git: { hosts: { 'ghes.local.test': { provider: 'github' } } },
+ });
+ expect(mergeLayered(user, project, projectLocal).git.hosts).toEqual({
+ 'ghes.user.test': { provider: 'github' },
+ });
+ });
+
test("scope: 'user' (appearance.theme) returns user even when project + project-local set it", () => {
const user = makeConfig({ appearance: { theme: 'dark' } });
const project = makeConfig({ appearance: { theme: 'light' } });
diff --git a/packages/core/src/config/read-config-safely.test.ts b/packages/core/src/config/read-config-safely.test.ts
index 9d91cc0ec..73ed619f0 100644
--- a/packages/core/src/config/read-config-safely.test.ts
+++ b/packages/core/src/config/read-config-safely.test.ts
@@ -53,6 +53,80 @@ afterEach(() => {
});
describe('readConfigSafely', () => {
+ test('reports a discarded non-map hosts section', () => {
+ const absPath = resolve(testDir, 'config.yml');
+ writeFileSync(absPath, stringify({ git: { hosts: 'invalid' } }));
+ const result = readConfigSafely({ absPath, warn: () => {} });
+ expect(result.valid).toBe(true);
+ expect(result.value.git.hosts).toEqual({});
+ expect(result.diagnostics).toContainEqual({
+ code: 'VALUE_FALLBACK',
+ issues: [expect.objectContaining({ path: ['git', 'hosts'] })],
+ });
+ });
+
+ test('retains host fallback diagnostics and siblings alongside unrelated schema errors', () => {
+ const absPath = resolve(testDir, 'config.yml');
+ writeFileSync(
+ absPath,
+ stringify({
+ git: { hosts: { good: { provider: 'github' }, bad: null } },
+ autoSync: { mode: 'invalid' },
+ }),
+ );
+ const result = readConfigSafely({ absPath, sideline: false, warn: () => {} });
+ expect(result.valid).toBe(false);
+ expect(result.value.git.hosts.good?.provider).toBe('github');
+ expect(result.diagnostics).toContainEqual({
+ code: 'VALUE_FALLBACK',
+ issues: [expect.objectContaining({ path: ['git', 'hosts', 'bad'] })],
+ });
+ expect(result.diagnostics).toContainEqual(expect.objectContaining({ code: 'SCHEMA_INVALID' }));
+ });
+ test.each([null, 'not-an-object', []].map((bad) => ({ bad })))(
+ 'contains malformed host entry $bad and reports it',
+ ({ bad }) => {
+ const absPath = resolve(testDir, 'config.yml');
+ writeFileSync(absPath, stringify({ git: { hosts: { good: { provider: 'github' }, bad } } }));
+ const warnings: string[] = [];
+ const result = readConfigSafely({ absPath, warn: (message) => warnings.push(message) });
+ expect(result.valid).toBe(true);
+ expect(result.value.git.hosts.good?.provider).toBe('github');
+ expect(result.value.git.hosts.bad?.provider).toBeUndefined();
+ expect(result.diagnostics).toContainEqual({
+ code: 'VALUE_FALLBACK',
+ issues: [expect.objectContaining({ path: ['git', 'hosts', 'bad'] })],
+ });
+ expect(warnings.join('\n')).toContain('git.hosts');
+ },
+ );
+
+ test('preserves host declarations after an unrelated schema failure', () => {
+ const absPath = resolve(testDir, 'config.yml');
+ writeFileSync(
+ absPath,
+ stringify({
+ git: { hosts: { good: { provider: 'github' } } },
+ autoSync: { mode: 'invalid' },
+ }),
+ );
+ const result = readConfigSafely({ absPath, sideline: false, warn: () => {} });
+ expect(result.valid).toBe(false);
+ expect(result.value.git.hosts.good?.provider).toBe('github');
+ expect(result.diagnostics).toContainEqual(expect.objectContaining({ code: 'SCHEMA_INVALID' }));
+ });
+
+ test.each(['unsupported', 12, null])('reports invalid provider %j', (provider) => {
+ const absPath = resolve(testDir, 'config.yml');
+ writeFileSync(absPath, stringify({ git: { hosts: { h: { provider } } } }));
+ const result = readConfigSafely({ absPath, warn: () => {} });
+ expect(result.value.git.hosts.h?.provider).toBeUndefined();
+ expect(result.diagnostics).toContainEqual({
+ code: 'VALUE_FALLBACK',
+ issues: [expect.objectContaining({ path: ['git', 'hosts', 'h', 'provider'] })],
+ });
+ });
+
test('the fixture path carries every value the VALUE_FALLBACK arm must not echo, so no absence check can pass on path luck', () => {
for (const value of CONFIG_VALUES_THE_VALUE_FALLBACK_ARM_MUST_NEVER_ECHO) {
expect(testDir, `testDir must carry ${value}`).toContain(value);
diff --git a/packages/core/src/config/read-config-safely.ts b/packages/core/src/config/read-config-safely.ts
index fb1f11a94..cbe392885 100644
--- a/packages/core/src/config/read-config-safely.ts
+++ b/packages/core/src/config/read-config-safely.ts
@@ -8,6 +8,7 @@ import {
type RecoveredConfigDiagnostic,
type ValueFallbackDiagnostic,
} from './errors.ts';
+import { GitHostsSchema } from './git-host-config.ts';
import { detectRemovedKeys, stripRemovedKeys } from './removed-keys.ts';
import {
type Config,
@@ -131,6 +132,35 @@ function detectEmbeddingsTransportFallbacks(input: {
return issues.length > 0 ? [{ code: 'VALUE_FALLBACK', issues }] : [];
}
+function detectGitHostFallbacks(input: {
+ rawConfig: unknown;
+ doc: Document;
+ source: string;
+ absPath: string;
+}): ValueFallbackDiagnostic[] {
+ const hosts = rawValueAtPath(input.rawConfig, ['git', 'hosts']);
+ if (hosts === undefined) return [];
+ const parsed = GitHostsSchema.safeParse(hosts);
+ if (parsed.success) return [];
+ const issues = parsed.error.issues.map((issue) => {
+ const path = ['git', 'hosts', ...issue.path.map(String)];
+ const located = locateIssue({
+ file: input.absPath,
+ source: input.source,
+ doc: input.doc,
+ path,
+ });
+ return {
+ path,
+ message: `${issue.message}; ignoring this git-host declaration.`,
+ ...(located !== undefined
+ ? { source: { file: located.file, line: located.line, column: located.column } }
+ : {}),
+ };
+ });
+ return [{ code: 'VALUE_FALLBACK', issues }];
+}
+
export function readConfigSafely(options: ReadConfigSafelyOptions): ReadConfigSafelyResult {
const { absPath, sideline = true, timestamp = new Date().toISOString() } = options;
const warn = options.warn ?? ((msg: string) => console.warn(msg));
@@ -177,22 +207,38 @@ export function readConfigSafely(options: ReadConfigSafelyOptions): ReadConfigSa
const removedKeyDiagnostics = detectRemovedKeys({ value: merged, file: absPath, source, doc });
const cleaned = removedKeyDiagnostics.length > 0 ? stripRemovedKeys(merged) : merged;
+ const gitHostDiagnostics = detectGitHostFallbacks({ rawConfig: cleaned, doc, source, absPath });
+ for (const diagnostic of gitHostDiagnostics) {
+ for (const issue of diagnostic.issues) {
+ warn(`[config] ${absPath} ${issue.path.join('.')}: ${issue.message}`);
+ }
+ }
const parsed = ConfigSchema.safeParse(cleaned);
if (!parsed.success) {
const error = buildSchemaInvalidError(parsed, doc, source, absPath);
+ const git =
+ ConfigSchema.shape.git.safeParse(rawValueAtPath(cleaned, ['git'])).data ?? defaults.git;
+ const fallback =
+ Object.keys(git.hosts).length > 0
+ ? 'Using schema defaults while preserving valid git-host declarations.'
+ : 'Using schema defaults.';
warn(
- `[config] ${absPath} fails schema validation (${parsed.error.issues.length} issue(s)). Using schema defaults.` +
+ `[config] ${absPath} fails schema validation (${parsed.error.issues.length} issue(s)). ${fallback}` +
(sideline ? '' : ' Pass-through mode: file left in place.'),
);
const sidelinedTo = sideline ? attemptSideline(absPath, timestamp, warn) : undefined;
const diagnostics: ConfigDiagnostic[] = [
...removedKeyDiagnostics,
+ ...gitHostDiagnostics,
...(isKnownConfigError(error) && error.code === 'SCHEMA_INVALID' ? [{ ...error }] : []),
];
return {
valid: false,
- value: defaults,
+ value: {
+ ...defaults,
+ git,
+ },
error,
diagnostics,
...(sidelinedTo !== undefined ? { sidelinedTo } : {}),
@@ -201,6 +247,7 @@ export function readConfigSafely(options: ReadConfigSafelyOptions): ReadConfigSa
const diagnostics: RecoveredConfigDiagnostic[] = [
...removedKeyDiagnostics,
+ ...gitHostDiagnostics,
...detectEmbeddingsTransportFallbacks({
rawConfig: cleaned,
config: parsed.data,
diff --git a/packages/core/src/config/schema-jsonschema.test.ts b/packages/core/src/config/schema-jsonschema.test.ts
index 9da2252b7..341505e5a 100644
--- a/packages/core/src/config/schema-jsonschema.test.ts
+++ b/packages/core/src/config/schema-jsonschema.test.ts
@@ -223,6 +223,11 @@ const FIXTURES: Fixture[] = [
input: { validation: { suppressLogLinkAdvisories: 'yes' } },
shouldAccept: false,
},
+ {
+ name: 'git.hosts declaring a GitHub Enterprise Server host accepted',
+ input: { git: { hosts: { 'ghes.example.com': { provider: 'github' } } } },
+ shouldAccept: true,
+ },
];
describe('JSON Schema ↔ runtime equivalence', () => {
@@ -456,3 +461,24 @@ describe('semantic embedding transport JSON schema', () => {
expect(ConfigSchema.parse(input).search.semantic.docTimeoutMs).toBe(30_000);
});
});
+
+describe('git.hosts containment', () => {
+ test('an unrecognized provider is rejected by schema tooling and contained at runtime', () => {
+ const input = {
+ git: { hosts: { 'h.example': { provider: 'gitlab' } } },
+ content: { dir: 'docs' },
+ };
+ expect(validate(input)).toBe(false);
+ const parsed = ConfigSchema.parse(input);
+ expect(parsed.git.hosts['h.example']?.provider).toBeUndefined();
+ expect(parsed.content.dir).toBe('docs');
+ });
+
+ test('a non-map hosts value is rejected by schema tooling and contained at runtime', () => {
+ const input = { git: { hosts: 'nope' }, content: { dir: 'docs' } };
+ expect(validate(input)).toBe(false);
+ const parsed = ConfigSchema.parse(input);
+ expect(parsed.git.hosts).toEqual({});
+ expect(parsed.content.dir).toBe('docs');
+ });
+});
diff --git a/packages/core/src/config/schema-leaf.test.ts b/packages/core/src/config/schema-leaf.test.ts
index 3a235577f..61f238bf0 100644
--- a/packages/core/src/config/schema-leaf.test.ts
+++ b/packages/core/src/config/schema-leaf.test.ts
@@ -1,8 +1,20 @@
import { describe, expect, test } from 'vitest';
+import { z } from 'zod';
import { ConfigSchema } from './schema.ts';
import { getLeafFieldMeta, resolveLeafSchema } from './schema-leaf.ts';
describe('resolveLeafSchema', () => {
+ test('does not treat maps or sets as records', () => {
+ expect(resolveLeafSchema(z.map(z.string(), z.boolean()), ['key'])).toBeUndefined();
+ expect(resolveLeafSchema(z.set(z.boolean()), ['key'])).toBeUndefined();
+ });
+
+ test('resolves boolean content-rule entries without inventing leaf metadata', () => {
+ const path = ['contentRules', 'okf', 'rules', 'custom-rule'];
+ expect(resolveLeafSchema(ConfigSchema, path)?.safeParse(true).success).toBe(true);
+ expect(resolveLeafSchema(ConfigSchema, path)?.safeParse('true').success).toBe(false);
+ expect(getLeafFieldMeta(ConfigSchema, path)).toBeUndefined();
+ });
test('descends through .default() wrappers to top-level section', () => {
const leaf = resolveLeafSchema(ConfigSchema, ['content']);
expect(leaf).toBeDefined();
@@ -22,6 +34,16 @@ describe('resolveLeafSchema', () => {
const leaf = resolveLeafSchema(ConfigSchema, ['nonExistentSection']);
expect(leaf).toBeUndefined();
});
+
+ test('descends through a record value type to a leaf under an arbitrary key', () => {
+ const leaf = resolveLeafSchema(ConfigSchema, ['git', 'hosts', 'ghes.example.com', 'provider']);
+ expect(leaf).toBeDefined();
+ });
+
+ test('returns undefined for a missing key inside a record value type', () => {
+ const leaf = resolveLeafSchema(ConfigSchema, ['git', 'hosts', 'h', 'nope']);
+ expect(leaf).toBeUndefined();
+ });
});
describe('getLeafFieldMeta', () => {
@@ -124,6 +146,21 @@ describe('getLeafFieldMeta', () => {
});
});
+ test('resolves user metadata for a git.hosts.<host>.provider leaf behind a record', () => {
+ const meta = getLeafFieldMeta(ConfigSchema, ['git', 'hosts', 'ghes.example.com', 'provider']);
+ expect(meta).toEqual({
+ scope: 'user',
+ agentSettable: false,
+ reload: 'boot',
+ defaultScope: 'user',
+ description: expect.any(String),
+ });
+ });
+
+ test('returns undefined for an unknown leaf inside a record value type', () => {
+ expect(getLeafFieldMeta(ConfigSchema, ['git', 'hosts', 'h', 'nope'])).toBeUndefined();
+ });
+
test('returns undefined for an unresolved path', () => {
const meta = getLeafFieldMeta(ConfigSchema, ['content', 'nonexistent']);
expect(meta).toBeUndefined();
diff --git a/packages/core/src/config/schema-leaf.ts b/packages/core/src/config/schema-leaf.ts
index 980c9d844..e4201707d 100644
--- a/packages/core/src/config/schema-leaf.ts
+++ b/packages/core/src/config/schema-leaf.ts
@@ -24,7 +24,12 @@ export function resolveLeafSchema(
for (const seg of path) {
cur = unwrapToShape(cur);
const shape = (cur as { _zod?: { def?: { shape?: Record<string, AnyZ> } } })?._zod?.def?.shape;
- if (!shape) return undefined;
+ if (!shape) {
+ const def = (cur as { _zod?: { def?: { type?: string; valueType?: unknown } } })?._zod?.def;
+ if (def?.type !== 'record') return undefined;
+ cur = def.valueType;
+ continue;
+ }
cur = shape[String(seg)];
if (cur === undefined) return undefined;
}
diff --git a/packages/core/src/config/schema.test.ts b/packages/core/src/config/schema.test.ts
index 8a37351bb..19fc50144 100644
--- a/packages/core/src/config/schema.test.ts
+++ b/packages/core/src/config/schema.test.ts
@@ -544,3 +544,53 @@ describe('search.semantic embedding transport tuning', () => {
},
);
});
+
+describe('git.hosts.<host>.provider (declared GitHub Enterprise Server hosts)', () => {
+ test('defaults to an empty host map', () => {
+ expect(ConfigSchema.parse({}).git.hosts).toEqual({});
+ });
+
+ test('round-trips a declared host', () => {
+ const parsed = ConfigSchema.parse({
+ git: { hosts: { 'ghes.example.com': { provider: 'github' } } },
+ });
+ expect(parsed.git.hosts['ghes.example.com']?.provider).toBe('github');
+ });
+
+ test('accepts a host entry with no provider', () => {
+ const parsed = ConfigSchema.parse({ git: { hosts: { 'ghes.example.com': {} } } });
+ expect(parsed.git.hosts['ghes.example.com']?.provider).toBeUndefined();
+ });
+
+ test('an unrecognized provider leaves that host undeclared without failing the parse', () => {
+ const parsed = ConfigSchema.parse({
+ git: { hosts: { h: { provider: 'gitlab' } } },
+ content: { dir: 'docs' },
+ });
+ expect(parsed.git.hosts.h?.provider).toBeUndefined();
+ expect(parsed.content.dir).toBe('docs');
+ });
+
+ test('a hosts value that is not a map empties the section without failing the parse', () => {
+ const parsed = ConfigSchema.parse({ git: { hosts: 'nope' }, content: { dir: 'docs' } });
+ expect(parsed.git.hosts).toEqual({});
+ expect(parsed.content.dir).toBe('docs');
+ });
+
+ test('the hosts record and the provider leaf are per-machine user scope, boot-reloaded', () => {
+ expect(getLeafFieldMeta(ConfigSchema, ['git', 'hosts'])).toMatchObject({
+ scope: 'user',
+ defaultScope: 'user',
+ agentSettable: false,
+ reload: 'boot',
+ });
+ expect(
+ getLeafFieldMeta(ConfigSchema, ['git', 'hosts', 'ghes.example.com', 'provider']),
+ ).toMatchObject({
+ scope: 'user',
+ defaultScope: 'user',
+ agentSettable: false,
+ reload: 'boot',
+ });
+ });
+});
diff --git a/packages/core/src/config/schema.ts b/packages/core/src/config/schema.ts
index c6a9d31c4..cb62ca837 100644
--- a/packages/core/src/config/schema.ts
+++ b/packages/core/src/config/schema.ts
@@ -15,6 +15,7 @@ import {
STORED_SYNC_MODES,
} from './auto-sync-mode.ts';
import { fieldRegistry } from './field-registry.ts';
+import { EffectiveGitHostEntrySchema } from './git-host-config.ts';
function base16SlotFields() {
return Object.fromEntries(
@@ -487,6 +488,22 @@ export const ConfigSchema = z.looseObject({
.default(null),
})
.default({ mode: null, enabled: null, default: null }),
+ git: z
+ .looseObject({
+ hosts: z
+ .record(z.string(), EffectiveGitHostEntrySchema)
+ .register(fieldRegistry, {
+ scope: 'user',
+ agentSettable: false,
+ reload: 'boot',
+ defaultScope: 'user',
+ description:
+ "Per-git-host declarations, keyed by hostname (for example ghes.example.com). Each entry says how OpenKnowledge should treat remotes on that host; today the only key an entry carries is `provider`. Hosts absent from this map are treated as generic git remotes. Per-machine (user scope, `~/.ok/global.yml`); a value in a project's `.ok/config.yml` is ignored. Declarations take effect when OpenKnowledge next starts.",
+ })
+ .default({})
+ .catch({}),
+ })
+ .default({ hosts: {} }),
terminal: z
.looseObject({
enabled: z
diff --git a/packages/core/src/config/validate-patch-scopes.test.ts b/packages/core/src/config/validate-patch-scopes.test.ts
index 86f0e3c56..f245d7c70 100644
--- a/packages/core/src/config/validate-patch-scopes.test.ts
+++ b/packages/core/src/config/validate-patch-scopes.test.ts
@@ -2,6 +2,20 @@ import { describe, expect, test } from 'vitest';
import { validatePatchScopes } from './validate-patch-scopes.ts';
describe('validatePatchScopes', () => {
+ test.each([{}, { h: null }, { h: {} }, { h: { provider: 'github' as const } }, null])(
+ 'checks the user-only host record before descending %j',
+ (hosts) => {
+ const patch = { git: { hosts } };
+ expect(validatePatchScopes(patch, 'project')).toMatchObject({
+ code: 'SCOPE_VIOLATION',
+ path: ['git', 'hosts'],
+ });
+ expect(validatePatchScopes(patch, 'project-local')).toMatchObject({
+ code: 'SCOPE_VIOLATION',
+ });
+ expect(validatePatchScopes(patch, 'user')).toBeNull();
+ },
+ );
test('returns null for an empty patch', () => {
expect(validatePatchScopes({}, 'project-local')).toBeNull();
expect(validatePatchScopes({}, 'project')).toBeNull();
diff --git a/packages/core/src/config/validate-patch-scopes.ts b/packages/core/src/config/validate-patch-scopes.ts
index 199697e2f..47544d014 100644
--- a/packages/core/src/config/validate-patch-scopes.ts
+++ b/packages/core/src/config/validate-patch-scopes.ts
@@ -16,6 +16,16 @@ export function validatePatchScopes(
function walk(value: unknown, path: string[]): void {
if (violation !== null) return;
if (value === undefined) return;
+ const meta = getLeafFieldMeta(ConfigSchema, path);
+ if (meta?.scope !== undefined && !isScopeCompatible(meta.scope, writerScope)) {
+ violation = {
+ code: 'SCOPE_VIOLATION',
+ path,
+ expectedScope: meta.scope,
+ actualScope: writerScope,
+ };
+ return;
+ }
if (value !== null && typeof value === 'object' && !Array.isArray(value)) {
for (const [key, subValue] of Object.entries(value)) {
walk(subValue, [...path, key]);
@@ -23,15 +33,6 @@ export function validatePatchScopes(
}
return;
}
- const meta = getLeafFieldMeta(ConfigSchema, path);
- if (meta?.scope === undefined) return;
- if (isScopeCompatible(meta.scope, writerScope)) return;
- violation = {
- code: 'SCOPE_VIOLATION',
- path,
- expectedScope: meta.scope,
- actualScope: writerScope,
- };
}
for (const [key, value] of Object.entries(patch)) {
diff --git a/packages/core/src/config/write-config-patch.test.ts b/packages/core/src/config/write-config-patch.test.ts
index 462da3bad..e5ba8db5b 100644
--- a/packages/core/src/config/write-config-patch.test.ts
+++ b/packages/core/src/config/write-config-patch.test.ts
@@ -259,6 +259,61 @@ describe('writeConfigPatch — project-local scope', () => {
});
describe('writeConfigPatch — user scope', () => {
+ test.each([{ h: { provider: 'gitlab' } }, { h: 'invalid' }, 'invalid'])(
+ 'rejects invalid host patch %j without writing',
+ async (hosts) => {
+ const home = mkdtempSync(join(tmpdir(), 'ok-write-config-patch-home-'));
+ try {
+ const result = await writeConfigPatch({
+ cwd: testDir,
+ scope: 'user',
+ patch: { git: { hosts: hosts as never } },
+ homedirOverride: home,
+ });
+ expect(result).toMatchObject({ ok: false, error: { code: 'SCHEMA_INVALID' } });
+ expect(existsSync(userConfigPath(home))).toBe(false);
+ } finally {
+ rmSync(home, { recursive: true, force: true });
+ }
+ },
+ );
+
+ test('accepts host provider declarations and deletions', async () => {
+ const home = mkdtempSync(join(tmpdir(), 'ok-write-config-patch-home-'));
+ try {
+ const first = await writeConfigPatch({
+ cwd: testDir,
+ scope: 'user',
+ patch: { git: { hosts: { h: { provider: 'github' }, sibling: { provider: 'github' } } } },
+ homedirOverride: home,
+ });
+ expect(first.ok).toBe(true);
+ const removed = await writeConfigPatch({
+ cwd: testDir,
+ scope: 'user',
+ patch: { git: { hosts: { h: null } } },
+ homedirOverride: home,
+ });
+ expect(removed).toMatchObject({
+ ok: true,
+ effective: { git: { hosts: { sibling: { provider: 'github' } } } },
+ });
+ if (removed.ok) expect(removed.effective.git.hosts.h).toBeUndefined();
+ } finally {
+ rmSync(home, { recursive: true, force: true });
+ }
+ });
+
+ test('refuses a host declaration written to the project file', async () => {
+ const result = await writeConfigPatch({
+ cwd: testDir,
+ scope: 'project',
+ patch: { git: { hosts: { h: { provider: 'github' } } } },
+ });
+ expect(result).toMatchObject({ ok: false, error: { code: 'SCOPE_VIOLATION' } });
+ expect(existsSync(projectConfigPath())).toBe(false);
+ });
+
test('lazy first-write of ~/.ok/global.yml creates parent dir', async () => {
const home = mkdtempSync(join(tmpdir(), 'ok-write-config-patch-home-'));
try {
diff --git a/packages/core/src/config/write-config-patch.ts b/packages/core/src/config/write-config-patch.ts
index 339fd783d..9d623e0ff 100644
--- a/packages/core/src/config/write-config-patch.ts
+++ b/packages/core/src/config/write-config-patch.ts
@@ -7,6 +7,7 @@ import { LOCAL_DIR, OK_DIR } from '../constants/ok-dir.ts';
import { atomicWriteFile } from '../util/atomic-yaml-write.ts';
import { FileLockTimeoutError, withFileLock } from '../util/file-lock.ts';
import type { ConfigValidationError, WriteScope } from './errors.ts';
+import { validateGitHostPatch } from './git-host-config.ts';
import type { Err, Ok, Result } from './result.ts';
import { type Config, type ConfigPatch, ConfigSchema } from './schema.ts';
import { CONFIG_SCHEMA_MAJOR_PATH } from './schema-version.ts';
@@ -98,6 +99,8 @@ async function writeConfigPatchInner(
if (scopeViolation !== null) {
return err(scopeViolation);
}
+ const hostViolation = validateGitHostPatch(patch);
+ if (hostViolation !== null) return err(hostViolation);
try {
await mkdir(dirname(absPath), { recursive: true });
diff --git a/packages/core/src/constants/github.test.ts b/packages/core/src/constants/github.test.ts
new file mode 100644
index 000000000..692d9d29e
--- /dev/null
+++ b/packages/core/src/constants/github.test.ts
@@ -0,0 +1,120 @@
+import { describe, expect, test } from 'vitest';
+import {
+ classifyGitHubShareHost,
+ declaredGitHubHostsFrom,
+ isGitHubHost,
+ normalizeGitHostname,
+} from './github.ts';
+
+describe('normalizeGitHostname', () => {
+ test('lowercases the hostname', () => {
+ expect(normalizeGitHostname('GitHub.COM')).toBe('github.com');
+ });
+
+ test('strips a trailing port', () => {
+ expect(normalizeGitHostname('git.example.internal:8443')).toBe('git.example.internal');
+ });
+
+ test('folds www.github.com to github.com', () => {
+ expect(normalizeGitHostname('www.github.com')).toBe('github.com');
+ });
+
+ test('folds a cased, ported www.github.com', () => {
+ expect(normalizeGitHostname('WWW.GitHub.com:443')).toBe('github.com');
+ });
+
+ test('leaves an unrelated host alone', () => {
+ expect(normalizeGitHostname('gitlab.com')).toBe('gitlab.com');
+ });
+});
+
+describe('isGitHubHost', () => {
+ test('github.com is GitHub with no declared set', () => {
+ expect(isGitHubHost('github.com')).toBe(true);
+ });
+
+ test('github.com is GitHub alongside a declared set', () => {
+ expect(isGitHubHost('github.com', new Set(['ghes.example.com']))).toBe(true);
+ });
+
+ test('www.github.com folds to github.com', () => {
+ expect(isGitHubHost('www.github.com')).toBe(true);
+ });
+
+ test('an undeclared self-hosted host is not GitHub', () => {
+ expect(isGitHubHost('git.example.internal')).toBe(false);
+ });
+
+ test('an undeclared self-hosted host is not GitHub against a non-matching declared set', () => {
+ expect(isGitHubHost('git.example.internal', new Set(['ghes.example.com']))).toBe(false);
+ });
+
+ test('a declared host is GitHub', () => {
+ expect(isGitHubHost('git.example.internal', new Set(['git.example.internal']))).toBe(true);
+ });
+
+ test('a declared match is case-insensitive', () => {
+ expect(isGitHubHost('GIT.Example.Internal', new Set(['git.example.internal']))).toBe(true);
+ });
+
+ test('a declared match ignores a port on the queried host', () => {
+ expect(isGitHubHost('git.example.internal:8443', new Set(['git.example.internal']))).toBe(true);
+ });
+
+ test('a formerly denylisted forge is not GitHub', () => {
+ expect(isGitHubHost('gitlab.com')).toBe(false);
+ });
+
+ test.each(['github.example.com', 'notgithub.example.com', 'ssh.github.com'])(
+ 'a host whose name merely contains github is not GitHub until declared: %s',
+ (host) => {
+ expect(isGitHubHost(host)).toBe(false);
+ expect(isGitHubHost(host, new Set([host]))).toBe(true);
+ },
+ );
+});
+
+describe('declaredGitHubHostsFrom', () => {
+ test('returns an empty set for undefined', () => {
+ expect([...declaredGitHubHostsFrom(undefined)]).toEqual([]);
+ });
+
+ test('returns an empty set for an empty record', () => {
+ expect([...declaredGitHubHostsFrom({})]).toEqual([]);
+ });
+
+ test('picks only entries whose provider is github', () => {
+ const declared = declaredGitHubHostsFrom({
+ 'ghes.example.com': { provider: 'github' },
+ 'git.example.internal': {},
+ 'other.example.com': undefined,
+ });
+ expect([...declared]).toEqual(['ghes.example.com']);
+ });
+
+ test('normalizes declared hostnames', () => {
+ const declared = declaredGitHubHostsFrom({
+ 'GHES.Example.COM:8443': { provider: 'github' },
+ 'www.github.com': { provider: 'github' },
+ });
+ expect([...declared].sort()).toEqual(['ghes.example.com', 'github.com']);
+ });
+
+ test('skips a hostname that normalizes to empty', () => {
+ expect([...declaredGitHubHostsFrom({ '': { provider: 'github' } })]).toEqual([]);
+ });
+});
+
+describe('classifyGitHubShareHost', () => {
+ test('still rejects gitlab.com', () => {
+ expect(classifyGitHubShareHost('gitlab.com')).toBeNull();
+ });
+
+ test('still admits an unknown enterprise host', () => {
+ expect(classifyGitHubShareHost('ghes.example.com')).toBe('ghes.example.com');
+ });
+
+ test('still folds www.github.com', () => {
+ expect(classifyGitHubShareHost('www.github.com')).toBe('github.com');
+ });
+});
diff --git a/packages/core/src/constants/github.ts b/packages/core/src/constants/github.ts
index d8b2413fc..92ac7623d 100644
--- a/packages/core/src/constants/github.ts
+++ b/packages/core/src/constants/github.ts
@@ -1,6 +1,10 @@
export const DEFAULT_GITHUB_OAUTH_CLIENT_ID = 'Ov23liqlSd0V1MwR6rhI';
-export const KNOWN_NON_GITHUB_GIT_HOSTS: ReadonlySet<string> = new Set([
+export const GIT_HOST_PROVIDERS = ['github'] as const;
+
+export type GitHostProvider = (typeof GIT_HOST_PROVIDERS)[number];
+
+const KNOWN_NON_GITHUB_GIT_HOSTS: ReadonlySet<string> = new Set([
'gitlab.com',
'bitbucket.org',
'codeberg.org',
@@ -9,6 +13,29 @@ export const KNOWN_NON_GITHUB_GIT_HOSTS: ReadonlySet<string> = new Set([
'sourcehut.org',
]);
+export function normalizeGitHostname(raw: string): string {
+ const host = raw.toLowerCase().replace(/:\d+$/, '');
+ return host === 'www.github.com' ? 'github.com' : host;
+}
+
+export function isGitHubHost(hostname: string, declaredGitHubHosts?: ReadonlySet<string>): boolean {
+ const host = normalizeGitHostname(hostname);
+ return host === 'github.com' || declaredGitHubHosts?.has(host) === true;
+}
+
+export function declaredGitHubHostsFrom(
+ hosts: Readonly<Record<string, { provider?: GitHostProvider } | undefined>> | undefined,
+): ReadonlySet<string> {
+ const declared = new Set<string>();
+ if (!hosts) return declared;
+ for (const [hostname, entry] of Object.entries(hosts)) {
+ if (entry?.provider !== 'github') continue;
+ const normalized = normalizeGitHostname(hostname);
+ if (normalized) declared.add(normalized);
+ }
+ return declared;
+}
+
export function classifyGitHubShareHost(hostname: string): string | null {
const host = hostname.toLowerCase();
const folded = host === 'www.github.com' ? 'github.com' : host;
diff --git a/packages/core/src/handoff/urn-ipc-registry.ts b/packages/core/src/handoff/urn-ipc-registry.ts
index 26a6f5ab2..19ca39b46 100644
--- a/packages/core/src/handoff/urn-ipc-registry.ts
+++ b/packages/core/src/handoff/urn-ipc-registry.ts
@@ -76,6 +76,7 @@ export const URN_HTTP_ONLY: ReadonlySet<ProblemType> = new Set<ProblemType>([
'urn:ok:error:not-found',
'urn:ok:error:auth-failed',
'urn:ok:error:no-project-dir',
+ 'urn:ok:error:non-github-origin',
'urn:ok:error:server-open-failed',
'urn:ok:error:sync-not-active',
'urn:ok:error:project-repo-not-configured',
diff --git a/packages/core/src/index.ts b/packages/core/src/index.ts
index 71cc7ed73..a63a46876 100644
--- a/packages/core/src/index.ts
+++ b/packages/core/src/index.ts
@@ -441,7 +441,11 @@ export type { OkFolderState } from './constants/folder-state.ts';
export {
classifyGitHubShareHost,
DEFAULT_GITHUB_OAUTH_CLIENT_ID,
- KNOWN_NON_GITHUB_GIT_HOSTS,
+ declaredGitHubHostsFrom,
+ GIT_HOST_PROVIDERS,
+ type GitHostProvider,
+ isGitHubHost,
+ normalizeGitHostname,
} from './constants/github.ts';
export { isOrphanMode, ORPHAN_MODES, type OrphanMode } from './constants/graph.ts';
export {
diff --git a/packages/core/src/schemas/api/_envelope.ts b/packages/core/src/schemas/api/_envelope.ts
index 786fa0f10..16a7c2839 100644
--- a/packages/core/src/schemas/api/_envelope.ts
+++ b/packages/core/src/schemas/api/_envelope.ts
@@ -94,6 +94,7 @@ export const ProblemTypeSchema = z.enum([
'urn:ok:error:not-found',
'urn:ok:error:auth-failed',
'urn:ok:error:no-project-dir',
+ 'urn:ok:error:non-github-origin',
'urn:ok:error:server-open-failed',
'urn:ok:error:doc-in-conflict',
'urn:ok:error:concurrent-overwrite-refused',
diff --git a/packages/server/src/api-extension.ts b/packages/server/src/api-extension.ts
index 5885a4faf..d34b5e669 100644
--- a/packages/server/src/api-extension.ts
+++ b/packages/server/src/api-extension.ts
@@ -336,6 +336,7 @@ import { createSkillInstallOpsService } from './services/skill-install-ops.ts';
import { createSkillPlacementOpsService } from './services/skill-placement-ops.ts';
import { createSkillReimportService } from './services/skill-reimport.ts';
import { SERVICE_WRITER, type ShadowRef, shadowGit } from './shadow-repo.ts';
+import { readDeclaredGitHubHosts } from './share/git-context.ts';
import { readSkillInstallModeRaw } from './skill-placements.ts';
@@ -1243,6 +1244,7 @@ export async function renameTrackedPathInGit(
}
export interface ApiExtensionOptions {
+ declaredGitHubHosts?: ReadonlySet<string>;
ingressPolicy?: IngressPolicy;
hocuspocus: Hocuspocus;
durabilityState: DocumentDurabilityState;
@@ -1486,6 +1488,8 @@ export function createApiExtension(
getLinkPreviewsEnabled,
getConfigDiagnostics,
} = options;
+ const declaredGitHubHosts =
+ options.declaredGitHubHosts ?? readDeclaredGitHubHosts(homeDirOverride);
const catalogCache = createSkillsCatalogCache({ homeDirOverride, log });
const { bumpSkillsCatalogGen, enumerateInstalledSkillsCached, pluginSkillsByName } = catalogCache;
const signalChannel: typeof rawSignalChannel = rawSignalChannel
@@ -4956,6 +4960,7 @@ export function createApiExtension(
setBatchInProgress,
});
const shareRoutes = createShareRoutes({
+ declaredGitHubHosts,
projectDir,
contentDir,
log,
@@ -4966,6 +4971,7 @@ export function createApiExtension(
toGitRelativePath,
});
const gitRoutes = createGitRoutes({
+ declaredGitHubHosts,
projectDir,
contentDir,
contentFilter,
@@ -4976,6 +4982,7 @@ export function createApiExtension(
localOpCliArgs,
});
const localOpRoutes = createLocalOpRoutes({
+ declaredGitHubHosts,
projectDir,
contentDir,
log,
diff --git a/packages/server/src/http/git-routes.ts b/packages/server/src/http/git-routes.ts
index 011554217..be0e27bd1 100644
--- a/packages/server/src/http/git-routes.ts
+++ b/packages/server/src/http/git-routes.ts
@@ -24,7 +24,7 @@ import { CHECKOUT_HANDLER_TAG, runCheckoutFlow } from '../git-checkout.ts';
import { buildSyncCredentialConfig, withParentLock } from '../git-handle.ts';
import { readWorktreeStatus } from '../git-worktree-status.ts';
import { toPosix } from '../path-utils.ts';
-import { shouldResetAmbientCredentials } from '../share/git-context.ts';
+import { readDeclaredGitHubHosts, shouldResetAmbientCredentials } from '../share/git-context.ts';
import type { SyncEngine } from '../sync-engine.ts';
import { type ApiRouteGroup, type ApiRouteRecord, createApiRouteGroup } from './api-pipeline.ts';
import { errorResponse } from './error-response.ts';
@@ -33,6 +33,7 @@ import { withValidation } from './request-validation.ts';
import { successResponse } from './success-response.ts';
export interface GitRouteDeps {
+ declaredGitHubHosts?: ReadonlySet<string>;
projectDir: string | undefined;
contentDir: string;
contentFilter: ContentFilter | undefined;
@@ -58,6 +59,7 @@ export function createGitRoutes(deps: GitRouteDeps): ApiRouteGroup {
getPrincipal,
localOpCliArgs,
} = deps;
+ const declaredGitHubHosts = deps.declaredGitHubHosts ?? readDeclaredGitHubHosts();
function toOpenTarget(projectRelPath: string): GitWorktreeOpenTarget | undefined {
const absPath = join(projectDir ?? contentDir, projectRelPath);
@@ -197,7 +199,7 @@ export function createGitRoutes(deps: GitRouteDeps): ApiRouteGroup {
runCheckoutFlow(projectDir, body.branch, {
fastForward: body.fastForward === true,
credentialConfig: buildSyncCredentialConfig(localOpCliArgs, {
- resetAmbient: shouldResetAmbientCredentials(projectDir),
+ resetAmbient: shouldResetAmbientCredentials(projectDir, declaredGitHubHosts),
}),
}),
);
diff --git a/packages/server/src/http/local-op-routes.test.ts b/packages/server/src/http/local-op-routes.test.ts
index e71c63c40..f4f6f7070 100644
--- a/packages/server/src/http/local-op-routes.test.ts
+++ b/packages/server/src/http/local-op-routes.test.ts
@@ -1,9 +1,15 @@
+import { execFileSync } from 'node:child_process';
+import { mkdtempSync, readFileSync, realpathSync, rmSync } from 'node:fs';
import { createServer, type Server as HttpServer } from 'node:http';
-import { afterEach, describe, expect, test } from 'vitest';
+import { tmpdir } from 'node:os';
+import { join } from 'node:path';
+import { afterEach, describe, expect, test, vi } from 'vitest';
import { createConcurrencyGuard } from '../local-op-security.ts';
+import * as ghLogin from '../local-ops/gh-login.ts';
import type { AuthEvent } from '../local-ops/types.ts';
import { loggerFactory } from '../logger.ts';
import { listenOnLoopback } from '../loopback-rig-test-helpers.ts';
+import { declareGitHubHosts, useIsolatedHome } from '../share/git-host-declarations.test-helper.ts';
import type { SyncEngine } from '../sync-engine.ts';
import { createLocalOpRoutes, resumeSyncOnAuthEvent } from './local-op-routes.ts';
@@ -28,7 +34,7 @@ type LocalOpRouteDeps = Parameters<typeof createLocalOpRoutes>[0];
function buildGroup(overrides: Partial<LocalOpRouteDeps> = {}) {
return createLocalOpRoutes({
projectDir: undefined,
- contentDir: '/tmp/ok-local-op-routes-test',
+ contentDir: tmpdir(),
log: loggerFactory.getLogger('test'),
checkLocalOpSecurity: () => true,
localOpCliArgs: ['open-knowledge'],
@@ -177,9 +183,12 @@ async function* ndjsonLines(body: ReadableStream<Uint8Array>): AsyncGenerator<St
}
describe('auth-login stream displacement (a second start orphans the first client)', () => {
+ const home = useIsolatedHome();
+
let servers: HttpServer[] = [];
afterEach(async () => {
+ vi.restoreAllMocks();
const active = servers;
servers = [];
await Promise.allSettled(
@@ -216,6 +225,177 @@ describe('auth-login stream displacement (a second start orphans the first clien
body: JSON.stringify(body),
});
+ test('a project whose origin is not a GitHub host refuses GitHub auth routes that name no host', async () => {
+ const projectDir = mkdtempSync(join(tmpdir(), 'ok-local-op-non-github-'));
+ try {
+ execFileSync('git', ['init', '-q'], { cwd: projectDir });
+ execFileSync('git', ['remote', 'add', 'origin', 'https://git.example.internal/team/kb.git'], {
+ cwd: projectDir,
+ });
+ const baseUrl = await serveLocalOpGroup({
+ projectDir,
+ localOpCliArgs: parkedDeviceFlowCli(),
+ });
+
+ for (const path of [
+ '/api/local-op/auth/status',
+ '/api/local-op/auth/login',
+ '/api/local-op/auth/pat',
+ '/api/local-op/auth/gh-login',
+ '/api/local-op/auth/repos',
+ '/api/local-op/auth/signout',
+ ]) {
+ const body = path.endsWith('/pat') ? { token: 'ghp_test' } : {};
+ const res = await postJson(baseUrl, path, body);
+ expect(res.status, path).toBe(409);
+ expect(await res.json(), path).toMatchObject({
+ type: 'urn:ok:error:non-github-origin',
+ host: 'git.example.internal',
+ detail: expect.stringContaining('git.example.internal'),
+ });
+ }
+
+ const explicit = await postJson(baseUrl, '/api/local-op/auth/login', { host: 'github.com' });
+ expect(explicit.status).toBe(200);
+ await postJson(baseUrl, '/api/local-op/auth/cancel', {});
+ } finally {
+ rmSync(projectDir, { recursive: true, force: true });
+ }
+ });
+
+ test('gh-login rejects an explicit undeclared host before looking up gh and accepts a declaration', async () => {
+ const projectDir = mkdtempSync(join(tmpdir(), 'ok-gh-login-host-'));
+ const probe = vi.spyOn(ghLogin, 'cachedGhBinaryPath').mockResolvedValue(null);
+ try {
+ const baseUrl = await serveLocalOpGroup({ projectDir });
+ const rejected = await postJson(baseUrl, '/api/local-op/auth/gh-login', {
+ host: 'ghes.example.test',
+ });
+ expect(rejected.status).toBe(409);
+ expect(await rejected.json()).toMatchObject({ host: 'ghes.example.test' });
+ expect(probe).not.toHaveBeenCalled();
+ declareGitHubHosts(home(), 'ghes.example.test');
+ const beforeRestart = await postJson(baseUrl, '/api/local-op/auth/gh-login', {
+ host: 'ghes.example.test',
+ });
+ expect(beforeRestart.status).toBe(409);
+ expect(probe).not.toHaveBeenCalled();
+ const restartedUrl = await serveLocalOpGroup({ projectDir });
+ const accepted = await postJson(restartedUrl, '/api/local-op/auth/gh-login', {
+ host: 'ghes.example.test',
+ });
+ expect(accepted.status).toBe(400);
+ expect(await accepted.json()).toMatchObject({
+ title: 'The GitHub CLI (gh) is not installed.',
+ });
+ expect(probe).toHaveBeenCalledOnce();
+ } finally {
+ rmSync(projectDir, { recursive: true, force: true });
+ }
+ });
+
+ test('normalizes rejected explicit hosts without changing accepted network ports', async () => {
+ const projectDir = realpathSync(mkdtempSync(join(tmpdir(), 'ok-auth-normalized-host-')));
+ try {
+ const localOpCliArgs = [
+ process.execPath,
+ '-e',
+ `console.log(JSON.stringify({type: 'complete', host: process.argv[process.argv.indexOf('--host') + 1], login: 'octocat'}));`,
+ ];
+ const baseUrl = await serveLocalOpGroup({ projectDir, localOpCliArgs });
+ const rejected = await postJson(baseUrl, '/api/local-op/auth/login', {
+ host: 'GHES.Example.test:8443',
+ });
+ expect(rejected.status).toBe(409);
+ expect(await rejected.json()).toMatchObject({
+ host: 'ghes.example.test',
+ detail: expect.stringContaining('git.hosts.ghes.example.test.provider'),
+ });
+ const declaredUrl = await serveLocalOpGroup({
+ projectDir,
+ localOpCliArgs,
+ declaredGitHubHosts: new Set(['ghes.example.test']),
+ });
+ const accepted = await postJson(declaredUrl, '/api/local-op/auth/login', {
+ host: 'GHES.Example.test:8443',
+ });
+ expect(accepted.status).toBe(200);
+ expect(await accepted.text()).toContain('"host":"GHES.Example.test:8443"');
+ } finally {
+ rmSync(projectDir, { recursive: true, force: true });
+ }
+ });
+
+ test('explicit undeclared hosts are refused except for local credential deletion', async () => {
+ const projectDir = realpathSync(mkdtempSync(join(tmpdir(), 'ok-auth-explicit-host-')));
+ try {
+ const localOpCliArgs = [process.execPath, '-e', 'process.exit(0)'];
+ const baseUrl = await serveLocalOpGroup({ projectDir, localOpCliArgs });
+ for (const verb of ['login', 'status', 'pat', 'repos']) {
+ const response = await postJson(baseUrl, `/api/local-op/auth/${verb}`, {
+ host: 'git.example.test',
+ ...(verb === 'pat' ? { token: 'test-token' } : {}),
+ });
+ expect(response.status, verb).toBe(409);
+ expect(await response.json()).toMatchObject({ host: 'git.example.test' });
+ }
+ const response = await postJson(baseUrl, '/api/local-op/auth/signout', {
+ host: 'git.example.test',
+ });
+ expect(response.status).toBe(200);
+ } finally {
+ rmSync(projectDir, { recursive: true, force: true });
+ }
+ });
+
+ test('an unparseable origin reports an unknown host without a false provider classification', async () => {
+ const projectDir = mkdtempSync(join(tmpdir(), 'ok-unparseable-origin-'));
+ try {
+ execFileSync('git', ['init', '-q'], { cwd: projectDir });
+ execFileSync('git', ['remote', 'add', 'origin', '../other-repository'], { cwd: projectDir });
+ const baseUrl = await serveLocalOpGroup({ projectDir });
+ const response = await postJson(baseUrl, '/api/local-op/auth/status', {});
+ expect(response.status).toBe(409);
+ expect(await response.json()).toMatchObject({
+ host: null,
+ detail: expect.stringContaining('could not be parsed'),
+ });
+ } finally {
+ rmSync(projectDir, { recursive: true, force: true });
+ }
+ });
+
+ test('auth subprocesses run in the project directory instead of the server cwd', async () => {
+ const projectDir = realpathSync(mkdtempSync(join(tmpdir(), 'ok-auth-cwd-')));
+ vi.spyOn(ghLogin, 'cachedGhBinaryPath').mockResolvedValue(null);
+ try {
+ const localOpCliArgs = [
+ process.execPath,
+ '-e',
+ `
+ const fs = require('node:fs');
+ const verb = process.argv[2];
+ fs.writeFileSync(verb + '.cwd', process.cwd());
+ const fields = {host: 'github.com', login: 'octocat', authenticated: true};
+ console.log(JSON.stringify({type: verb === 'status' ? 'status' : verb === 'repos' ? 'repos' : 'complete', ...fields, repos: []}));
+ `,
+ ];
+ const baseUrl = await serveLocalOpGroup({ projectDir, localOpCliArgs });
+ for (const verb of ['login', 'status', 'pat', 'repos', 'signout']) {
+ const response = await postJson(
+ baseUrl,
+ `/api/local-op/auth/${verb}`,
+ verb === 'pat' ? { token: 'ghp_test' } : {},
+ );
+ expect(response.status, verb).toBe(200);
+ await response.text();
+ expect(readFileSync(join(projectDir, `${verb}.cwd`), 'utf8'), verb).toBe(projectDir);
+ }
+ } finally {
+ rmSync(projectDir, { recursive: true, force: true });
+ }
+ });
+
test('the displaced stream is told it was replaced before the server ends it', async () => {
const baseUrl = await serveLocalOpGroup({ localOpCliArgs: parkedDeviceFlowCli() });
diff --git a/packages/server/src/http/local-op-routes.ts b/packages/server/src/http/local-op-routes.ts
index ecf4084c4..6879ff90c 100644
--- a/packages/server/src/http/local-op-routes.ts
+++ b/packages/server/src/http/local-op-routes.ts
@@ -57,7 +57,7 @@ import {
runPatSubprocess,
} from '../local-ops/index.ts';
import type { PinoLogger } from '../logger.ts';
-import { originGitHubHost } from '../share/git-context.ts';
+import { readDeclaredGitHubHosts, resolveGitHubAuthHost } from '../share/git-context.ts';
import { redactShareSubprocessStderr } from '../share/publish.ts';
import type { SyncEngine } from '../sync-engine.ts';
import { resolveUiRedirectPort } from '../ui-redirect-port.ts';
@@ -83,6 +83,7 @@ export function resumeSyncOnAuthEvent(
}
export interface LocalOpRouteDeps {
+ declaredGitHubHosts?: ReadonlySet<string>;
projectDir: string | undefined;
contentDir: string;
log: PinoLogger;
@@ -494,7 +495,33 @@ export function createLocalOpRoutes(deps: LocalOpRouteDeps): ApiRouteGroup {
const AUTH_DEVICE_FLOW_TIMEOUT_MS = 16 * 60 * 1000;
- const defaultAuthHost = (): string => originGitHubHost(projectDir ?? contentDir);
+ const authProjectDir = projectDir ?? contentDir;
+ const authDeclaredGitHubHosts = deps.declaredGitHubHosts ?? readDeclaredGitHubHosts();
+ function resolveAuthHost(
+ res: ServerResponse,
+ handler: string,
+ explicitHost: string | undefined,
+ ): string | null {
+ const result = resolveGitHubAuthHost(authProjectDir, explicitHost, authDeclaredGitHubHosts);
+ if (result.kind === 'ok') return result.host;
+ const rejectedHost = result.host;
+ const detail =
+ rejectedHost === null
+ ? "The project's origin URL could not be parsed to determine its host. Set a supported origin URL or explicitly select a GitHub host."
+ : `${rejectedHost} is not a declared GitHub host. If it runs GitHub Enterprise Server, declare git.hosts.${rejectedHost}.provider as github in ~/.ok/global.yml and restart OpenKnowledge.`;
+ errorResponse(
+ res,
+ 409,
+ 'urn:ok:error:non-github-origin',
+ 'GitHub sign-in is unavailable for this host.',
+ {
+ handler,
+ detail,
+ extensions: { host: rejectedHost },
+ },
+ );
+ return null;
+ }
type StreamingAuthController = { done: Promise<void>; cancel(): void };
type InFlightAuthStream = { cancel(): void; notifyDisplaced(): void };
@@ -637,7 +664,8 @@ export function createLocalOpRoutes(deps: LocalOpRouteDeps): ApiRouteGroup {
res: ServerResponse,
body: LocalOpAuthHostRequest,
): Promise<void> {
- const host = body.host ?? defaultAuthHost();
+ const host = resolveAuthHost(res, HANDLE_LOCAL_OP_AUTH_LOGIN, body.host);
+ if (host === null) return;
streamAuthFlow({
res,
handler: HANDLE_LOCAL_OP_AUTH_LOGIN,
@@ -648,6 +676,7 @@ export function createLocalOpRoutes(deps: LocalOpRouteDeps): ApiRouteGroup {
makeFlow: (onEvent) =>
runDeviceFlowSubprocess({
cliArgs: localOpCliArgs,
+ cwd: authProjectDir,
host,
timeoutMs: AUTH_DEVICE_FLOW_TIMEOUT_MS,
onEvent,
@@ -659,7 +688,8 @@ export function createLocalOpRoutes(deps: LocalOpRouteDeps): ApiRouteGroup {
const handleLocalOpAuthGhLogin = withValidation(
LocalOpAuthHostRequestSchema,
async (_req, res, body) => {
- const host = body.host ?? defaultAuthHost();
+ const host = resolveAuthHost(res, HANDLE_LOCAL_OP_AUTH_GH_LOGIN, body.host);
+ if (host === null) return;
const ghPath = await cachedGhBinaryPath();
if (ghPath === null) {
errorResponse(
@@ -683,6 +713,7 @@ export function createLocalOpRoutes(deps: LocalOpRouteDeps): ApiRouteGroup {
runGhDeviceLoginSubprocess({
host,
ghPath,
+ cwd: authProjectDir,
timeoutMs: AUTH_DEVICE_FLOW_TIMEOUT_MS,
onEvent,
}),
@@ -733,7 +764,8 @@ export function createLocalOpRoutes(deps: LocalOpRouteDeps): ApiRouteGroup {
const handleLocalOpAuthStatus = withValidation(
LocalOpAuthHostRequestSchema,
async (_req, res, body) => {
- const host = body.host ?? defaultAuthHost();
+ const host = resolveAuthHost(res, HANDLE_LOCAL_OP_AUTH_STATUS, body.host);
+ if (host === null) return;
if (!localOpGuard.tryAcquire(LOCAL_OP_AUTH_STATUS_KEY)) {
errorResponse(
@@ -757,6 +789,7 @@ export function createLocalOpRoutes(deps: LocalOpRouteDeps): ApiRouteGroup {
withHiddenWindowsConsole({
...LOCAL_OP_PIPE_STDIO_OPTIONS,
env: { ...process.env },
+ cwd: authProjectDir,
}),
);
let settled = false;
@@ -841,7 +874,8 @@ export function createLocalOpRoutes(deps: LocalOpRouteDeps): ApiRouteGroup {
const handleLocalOpAuthPat = withValidation(
LocalOpAuthPatRequestSchema,
async (_req, res, body) => {
- const host = body.host ?? defaultAuthHost();
+ const host = resolveAuthHost(res, HANDLE_LOCAL_OP_AUTH_PAT, body.host);
+ if (host === null) return;
if (!localOpGuard.tryAcquire(LOCAL_OP_AUTH_PAT_KEY)) {
errorResponse(
@@ -855,7 +889,12 @@ export function createLocalOpRoutes(deps: LocalOpRouteDeps): ApiRouteGroup {
}
try {
- const result = await runPatSubprocess({ cliArgs: localOpCliArgs, host, token: body.token });
+ const result = await runPatSubprocess({
+ cliArgs: localOpCliArgs,
+ cwd: authProjectDir,
+ host,
+ token: body.token,
+ });
if (result.ok) {
onAuthCredentialLanded(getSyncEngine);
successResponse(
@@ -903,7 +942,8 @@ export function createLocalOpRoutes(deps: LocalOpRouteDeps): ApiRouteGroup {
res: ServerResponse,
body: LocalOpAuthHostRequest,
): Promise<void> {
- const host = body.host ?? defaultAuthHost();
+ const host = resolveAuthHost(res, HANDLE_LOCAL_OP_AUTH_REPOS, body.host);
+ if (host === null) return;
if (!localOpGuard.tryAcquire(LOCAL_OP_AUTH_REPOS_KEY)) {
errorResponse(
@@ -936,6 +976,7 @@ export function createLocalOpRoutes(deps: LocalOpRouteDeps): ApiRouteGroup {
withHiddenWindowsConsole({
...LOCAL_OP_PIPE_STDIO_OPTIONS,
env: { ...process.env },
+ cwd: authProjectDir,
}),
);
@@ -1038,7 +1079,8 @@ export function createLocalOpRoutes(deps: LocalOpRouteDeps): ApiRouteGroup {
const handleLocalOpAuthSignout = withValidation(
LocalOpAuthHostRequestSchema,
async (_req, res, body) => {
- const host = body.host ?? defaultAuthHost();
+ const host = body.host ?? resolveAuthHost(res, HANDLE_LOCAL_OP_AUTH_SIGNOUT, undefined);
+ if (host === null) return;
if (!localOpGuard.tryAcquire(LOCAL_OP_AUTH_SIGNOUT_KEY)) {
errorResponse(
@@ -1062,6 +1104,7 @@ export function createLocalOpRoutes(deps: LocalOpRouteDeps): ApiRouteGroup {
withHiddenWindowsConsole({
...LOCAL_OP_IGNORED_STDIO_OPTIONS,
env: { ...process.env },
+ cwd: authProjectDir,
}),
);
let settled = false;
diff --git a/packages/server/src/http/share-routes.test.ts b/packages/server/src/http/share-routes.test.ts
index 7d28bbc1b..f7b8f9512 100644
--- a/packages/server/src/http/share-routes.test.ts
+++ b/packages/server/src/http/share-routes.test.ts
@@ -1,10 +1,14 @@
+import { execFileSync } from 'node:child_process';
import { randomUUID } from 'node:crypto';
-import { existsSync, rmSync } from 'node:fs';
+import { existsSync, mkdirSync, mkdtempSync, rmSync, writeFileSync } from 'node:fs';
+import type { IncomingMessage } from 'node:http';
import { tmpdir } from 'node:os';
import { join } from 'node:path';
+import { Readable } from 'node:stream';
import { afterEach, describe, expect, test, vi } from 'vitest';
import { makeCaptureRes, makeSyntheticReq } from '../composition-rig.test-helper.ts';
import { loggerFactory } from '../logger.ts';
+import { useIsolatedHome } from '../share/git-host-declarations.test-helper.ts';
import { SHARE_PUBLISH_TIMEOUT_MS } from '../share/publish.ts';
import { createShareRoutes, type ShareRouteDeps } from './share-routes.ts';
@@ -23,6 +27,42 @@ function buildGroup(overrides: Partial<ShareRouteDeps> = {}) {
}
describe('createShareRoutes table', () => {
+ const home = useIsolatedHome();
+
+ test('keeps declared hosts for its lifetime and accepts an injected boot snapshot', async () => {
+ const projectDir = mkdtempSync(join(tmpdir(), 'ok-share-host-snapshot-'));
+ const git = (...args: string[]) => execFileSync('git', args, { cwd: projectDir });
+ try {
+ git('init', '--initial-branch=main');
+ git('remote', 'add', 'origin', 'https://ghes.example.com/team/kb.git');
+ mkdirSync(join(home(), '.ok'));
+ const config = join(home(), '.ok', 'global.yml');
+ writeFileSync(config, 'git:\n hosts:\n ghes.example.com:\n provider: github\n');
+ const initial = buildGroup({ projectDir });
+ const refused = buildGroup({ projectDir, declaredGitHubHosts: new Set() });
+ writeFileSync(config, 'git:\n hosts: {}\n');
+ const restarted = buildGroup({ projectDir });
+ for (const [group, expected] of [
+ [initial, 'branch-not-on-origin'],
+ [refused, 'non-github-remote'],
+ [restarted, 'non-github-remote'],
+ ] as const) {
+ const req = Readable.from([
+ Buffer.from(JSON.stringify({ kind: 'doc', docPath: 'README.md' })),
+ ]) as IncomingMessage;
+ req.method = 'POST';
+ req.url = '/api/share/construct-url';
+ const { res, captured } = makeCaptureRes();
+ const route = group.table.resolve(req.url);
+ if (!route?.dispatch) throw new Error('missing construct-url handler');
+ await route.dispatch(req, res);
+ expect(captured.status).toBe(200);
+ expect(JSON.parse(captured.body)).toMatchObject({ ok: false, error: expected });
+ }
+ } finally {
+ rmSync(projectDir, { recursive: true, force: true });
+ }
+ });
test('registers exactly the five share paths', () => {
expect([...buildGroup().paths].sort()).toEqual(
[
diff --git a/packages/server/src/http/share-routes.ts b/packages/server/src/http/share-routes.ts
index 16df2b81f..943a5ceb1 100644
--- a/packages/server/src/http/share-routes.ts
+++ b/packages/server/src/http/share-routes.ts
@@ -33,6 +33,7 @@ import {
import { computeShareFreshness } from '../share/freshness.ts';
import {
branchExistsOnOrigin,
+ readDeclaredGitHubHosts,
readGitHeadBranch,
readOriginGitHubRepo,
shouldResetAmbientCredentials,
@@ -66,6 +67,7 @@ import { withValidation } from './request-validation.ts';
import { successResponse } from './success-response.ts';
export interface ShareRouteDeps {
+ declaredGitHubHosts?: ReadonlySet<string>;
projectDir: string | undefined;
contentDir: string;
log: PinoLogger;
@@ -91,6 +93,7 @@ export function createShareRoutes(deps: ShareRouteDeps): ApiRouteGroup {
getSyncEngine,
toGitRelativePath,
} = deps;
+ const declaredGitHubHosts = deps.declaredGitHubHosts ?? readDeclaredGitHubHosts();
const handleShareConstructUrl = withValidation(
ShareConstructUrlRequestSchema,
@@ -121,7 +124,7 @@ export function createShareRoutes(deps: ShareRouteDeps): ApiRouteGroup {
}
const branch = readGitHeadBranch(projectDir);
if (branch === null) {
- const originPeek = readOriginGitHubRepo(projectDir);
+ const originPeek = readOriginGitHubRepo(projectDir, declaredGitHubHosts);
if (originPeek.kind === 'no-remote') {
emitShareConstructUrlLog('no-remote', { kind: body.kind });
successResponse(
@@ -143,7 +146,7 @@ export function createShareRoutes(deps: ShareRouteDeps): ApiRouteGroup {
);
return;
}
- const origin = readOriginGitHubRepo(projectDir);
+ const origin = readOriginGitHubRepo(projectDir, declaredGitHubHosts);
if (origin.kind === 'no-remote') {
emitShareConstructUrlLog('no-remote', { kind: body.kind });
successResponse(
@@ -306,7 +309,7 @@ export function createShareRoutes(deps: ShareRouteDeps): ApiRouteGroup {
body.kind,
{
credentialConfig: buildSyncCredentialConfig(localOpCliArgs, {
- resetAmbient: shouldResetAmbientCredentials(projectDir),
+ resetAmbient: shouldResetAmbientCredentials(projectDir, declaredGitHubHosts),
}),
},
);
diff --git a/packages/server/src/index.ts b/packages/server/src/index.ts
index d46b13ef8..e6686b595 100644
--- a/packages/server/src/index.ts
+++ b/packages/server/src/index.ts
@@ -546,8 +546,11 @@ export {
type ShadowObjectStats,
} from './shadow-repo-stats.ts';
export {
+ type GitHubAuthHostResult,
loginShapedUserinfoUser,
- originGitHubHost,
+ readDeclaredGitHubHosts,
+ readOriginGitHubRepo,
+ resolveGitHubAuthHost,
sameGitHubLogin,
} from './share/git-context.ts';
export {
diff --git a/packages/server/src/local-ops/auth-flow.test.ts b/packages/server/src/local-ops/auth-flow.test.ts
index 68bd49cce..253a5b47f 100644
--- a/packages/server/src/local-ops/auth-flow.test.ts
+++ b/packages/server/src/local-ops/auth-flow.test.ts
@@ -1,3 +1,5 @@
+import { realpathSync } from 'node:fs';
+import { tmpdir } from 'node:os';
import { describe, expect, test } from 'vitest';
import { type RunDeviceFlowController, runDeviceFlowSubprocess } from './auth-flow.ts';
import type { AuthEvent } from './types.ts';
@@ -274,3 +276,17 @@ describe('runDeviceFlowSubprocess', () => {
expect(events).toEqual([]);
});
});
+
+test('device flow runs in the supplied project directory', async () => {
+ const cwd = realpathSync(tmpdir());
+ const events: AuthEvent[] = [];
+ const controller = runDeviceFlowSubprocess({
+ cwd,
+ cliArgs: fixtureCli(
+ `console.log(JSON.stringify({type: 'complete', host: process.cwd(), login: 'octocat'}));`,
+ ),
+ onEvent: (event) => events.push(event),
+ });
+ await controller.done;
+ expect(events).toEqual([expect.objectContaining({ type: 'complete', host: cwd })]);
+});
diff --git a/packages/server/src/local-ops/auth-flow.ts b/packages/server/src/local-ops/auth-flow.ts
index 156e4ff1e..0a8124c37 100644
--- a/packages/server/src/local-ops/auth-flow.ts
+++ b/packages/server/src/local-ops/auth-flow.ts
@@ -58,6 +58,7 @@ export function runDeviceFlowSubprocess(opts: RunDeviceFlowOptions): RunDeviceFl
const proc = runSubprocess({
cliArgs: opts.cliArgs,
cliEnv: opts.cliEnv,
+ cwd: opts.cwd,
trailingArgs: ['auth', 'login', '--json', '--host', host],
timeoutMs,
onLine: ({ parsed }) => {
diff --git a/packages/server/src/local-ops/auth-pat.ts b/packages/server/src/local-ops/auth-pat.ts
index a81b01145..0c6766470 100644
--- a/packages/server/src/local-ops/auth-pat.ts
+++ b/packages/server/src/local-ops/auth-pat.ts
@@ -20,6 +20,7 @@ export async function runPatSubprocess(opts: RunPatOptions): Promise<RunPatResul
const proc = runSubprocess({
cliArgs: opts.cliArgs,
cliEnv: opts.cliEnv,
+ cwd: opts.cwd,
trailingArgs: ['auth', 'pat', '--json', '--host', host, '--token-stdin'],
stdinData: opts.token,
timeoutMs: opts.timeoutMs ?? DEFAULT_TIMEOUT_MS,
diff --git a/packages/server/src/local-ops/auth-query.test.ts b/packages/server/src/local-ops/auth-query.test.ts
index 688b241d1..d5583edcb 100644
--- a/packages/server/src/local-ops/auth-query.test.ts
+++ b/packages/server/src/local-ops/auth-query.test.ts
@@ -1,3 +1,5 @@
+import { realpathSync } from 'node:fs';
+import { tmpdir } from 'node:os';
import { describe, expect, test } from 'vitest';
import { runAuthReposSubprocess, runAuthStatusSubprocess } from './auth-query.ts';
@@ -363,3 +365,19 @@ describe('runAuthReposSubprocess', () => {
}
});
});
+
+for (const [name, run, type] of [
+ ['status', runAuthStatusSubprocess, 'status'],
+ ['repos', runAuthReposSubprocess, 'repos'],
+] as const) {
+ test(`${name} runs in the supplied project directory`, async () => {
+ const cwd = realpathSync(tmpdir());
+ const response = await run({
+ cwd,
+ cliArgs: fixtureCli(
+ `console.log(JSON.stringify({type: ${JSON.stringify(type)}, authenticated: true, login: 'octocat', repos: [], host: process.cwd()}));`,
+ ),
+ });
+ expect(response).toMatchObject({ host: cwd });
+ });
+}
diff --git a/packages/server/src/local-ops/auth-query.ts b/packages/server/src/local-ops/auth-query.ts
index adf6215f8..96b8efec9 100644
--- a/packages/server/src/local-ops/auth-query.ts
+++ b/packages/server/src/local-ops/auth-query.ts
@@ -51,6 +51,7 @@ export async function runAuthStatusSubprocess(
const proc = runSubprocess({
cliArgs: opts.cliArgs,
cliEnv: opts.cliEnv,
+ cwd: opts.cwd,
trailingArgs: ['auth', 'status', '--json', '--host', host],
timeoutMs: opts.timeoutMs ?? DEFAULT_TIMEOUT_MS,
onLine: ({ parsed }) => {
@@ -99,6 +100,7 @@ export async function runAuthReposSubprocess(
const proc = runSubprocess({
cliArgs: opts.cliArgs,
cliEnv: opts.cliEnv,
+ cwd: opts.cwd,
trailingArgs: ['auth', 'repos', '--json', '--host', host],
timeoutMs: opts.timeoutMs ?? DEFAULT_TIMEOUT_MS,
onLine: ({ parsed }) => {
diff --git a/packages/server/src/local-ops/gh-login.test.ts b/packages/server/src/local-ops/gh-login.test.ts
index 18633d130..47871063a 100644
--- a/packages/server/src/local-ops/gh-login.test.ts
+++ b/packages/server/src/local-ops/gh-login.test.ts
@@ -1,4 +1,4 @@
-import { chmodSync, mkdtempSync, writeFileSync } from 'node:fs';
+import { chmodSync, mkdtempSync, readFileSync, realpathSync, rmSync, writeFileSync } from 'node:fs';
import { tmpdir } from 'node:os';
import { join } from 'node:path';
import { describe, expect, test } from 'vitest';
@@ -167,3 +167,22 @@ describe('resolveGhBinaryPath', () => {
expect(path).toBeNull();
});
});
+
+test('gh device login runs in the supplied project directory', async () => {
+ const cwd = realpathSync(mkdtempSync(join(tmpdir(), 'gh-login-cwd-')));
+ const script = join(cwd, 'fake-gh');
+ try {
+ writeFileSync(script, '#!/bin/sh\npwd > observed-cwd\nexit 1\n');
+ chmodSync(script, 0o755);
+ const controller = runGhDeviceLoginSubprocess({
+ host: 'ghes.test',
+ ghPath: script,
+ cwd,
+ onEvent: () => {},
+ });
+ await controller.done;
+ expect(readFileSync(join(cwd, 'observed-cwd'), 'utf8').trim()).toBe(cwd);
+ } finally {
+ rmSync(cwd, { recursive: true, force: true });
+ }
+});
diff --git a/packages/server/src/local-ops/gh-login.ts b/packages/server/src/local-ops/gh-login.ts
index e65590d20..380c26774 100644
--- a/packages/server/src/local-ops/gh-login.ts
+++ b/packages/server/src/local-ops/gh-login.ts
@@ -72,6 +72,7 @@ export async function cachedGhBinaryPath(): Promise<string | null> {
export interface RunGhDeviceLoginOptions {
host: string;
ghPath: string;
+ cwd?: string;
timeoutMs?: number;
verificationDeadlineMs?: number;
onEvent: (event: AuthEvent) => void;
@@ -97,6 +98,7 @@ export function runGhDeviceLoginSubprocess(
const proc = runSubprocess({
cliArgs: [opts.ghPath],
+ cwd: opts.cwd,
trailingArgs: [
'auth',
'login',
diff --git a/packages/server/src/local-ops/subprocess.ts b/packages/server/src/local-ops/subprocess.ts
index bdd476c67..0ecad089d 100644
--- a/packages/server/src/local-ops/subprocess.ts
+++ b/packages/server/src/local-ops/subprocess.ts
@@ -12,11 +12,11 @@ type LocalOpCliEnv = Readonly<Record<string, string | undefined>>;
export interface LocalOpCliInvocation {
readonly cliArgs: readonly string[];
readonly cliEnv?: LocalOpCliEnv;
+ readonly cwd?: string;
}
interface SubprocessRunOptions extends LocalOpCliInvocation {
trailingArgs: readonly string[];
- cwd?: string;
extraPathDirs?: readonly string[];
timeoutMs: number;
onLine: (line: ParsedLine) => void;
diff --git a/packages/server/src/server-factory.ts b/packages/server/src/server-factory.ts
index ce8be6c63..ede26a85a 100644
--- a/packages/server/src/server-factory.ts
+++ b/packages/server/src/server-factory.ts
@@ -270,7 +270,11 @@ import {
saveInMemoryCheckpoint,
shadowGit,
} from './shadow-repo.ts';
-import { readOriginGitHubRepo, shouldResetAmbientCredentials } from './share/git-context.ts';
+import {
+ readDeclaredGitHubHosts,
+ readOriginGitHubRepo,
+ shouldResetAmbientCredentials,
+} from './share/git-context.ts';
import { resyncRecordedSkillCopies } from './skill-placements.ts';
import { assertCompatibleStateManifest } from './state-manifest.ts';
import { SyncEngine } from './sync-engine.ts';
@@ -487,6 +491,7 @@ export function createServer(options: ServerOptions): ServerInstance {
singleDocRelPath,
ephemeral = false,
} = options;
+ const declaredGitHubHosts = readDeclaredGitHubHosts(configHomedirOverride);
const log = getLogger('server');
let headWatcher: HeadWatcherHandle | null = null;
@@ -2086,6 +2091,7 @@ export function createServer(options: ServerOptions): ServerInstance {
hocuspocus.configuration.extensions.push(systemDocBroadcastGuard);
const apiExtension = createApiExtension({
+ declaredGitHubHosts,
hocuspocus,
durabilityState,
ingressPolicy,
@@ -4401,9 +4407,12 @@ export function createServer(options: ServerOptions): ServerInstance {
log.warn({ err }, '[conflicts] boot prune of merge-native entries failed');
}
- const resetAmbientCredentials = shouldResetAmbientCredentials(projectDir);
+ const resetAmbientCredentials = shouldResetAmbientCredentials(projectDir, declaredGitHubHosts);
log.debug(
- { resetAmbientCredentials, originKind: readOriginGitHubRepo(projectDir).kind },
+ {
+ resetAmbientCredentials,
+ originKind: readOriginGitHubRepo(projectDir, declaredGitHubHosts).kind,
+ },
'[sync] ambient credential-chain reset decision at boot',
);
const syncCredentialConfig = buildSyncCredentialConfig(localOpCliArgs, {
@@ -4419,6 +4428,7 @@ export function createServer(options: ServerOptions): ServerInstance {
}
try {
syncEngine = new SyncEngine({
+ declaredGitHubHosts,
projectDir,
contentDir,
contentFilter,
diff --git a/packages/server/src/share/construct-url.test.ts b/packages/server/src/share/construct-url.test.ts
index 43b10db81..31b33aafa 100644
--- a/packages/server/src/share/construct-url.test.ts
+++ b/packages/server/src/share/construct-url.test.ts
@@ -12,6 +12,7 @@ import {
emitShareConstructUrlLog,
isValidSharePath,
} from './construct-url.ts';
+import { declareGitHubHosts, useIsolatedHome } from './git-host-declarations.test-helper.ts';
interface TestRig {
port: number;
@@ -104,6 +105,8 @@ function seedRemoteAndHead(
}
}
+const home = useIsolatedHome();
+
async function postConstructUrl(port: number, body: unknown): Promise<Response> {
return fetch(`http://127.0.0.1:${port}/api/share/construct-url`, {
method: 'POST',
@@ -253,13 +256,14 @@ describe('POST /api/share/construct-url', () => {
expect(json).toEqual({ ok: false, error: 'non-github-remote' });
});
- test('GHES origins produce an enterprise-host share URL', async () => {
+ test('a declared GHES origin produces an enterprise-host share URL', async () => {
rig = await bootRig((projectDir) => {
seedRemoteAndHead(projectDir, {
head: 'ref: refs/heads/main\n',
originUrl: 'https://ghes.acme.test/team/notes.git',
branchesOnOrigin: ['main'],
});
+ declareGitHubHosts(home(), 'ghes.acme.test');
});
const res = await postConstructUrl(rig.port, { kind: 'doc', docPath: 'a.md' });
expect(res.status).toBe(200);
diff --git a/packages/server/src/share/endpoint-real-git.test.ts b/packages/server/src/share/endpoint-real-git.test.ts
index 413f64946..c3896ce21 100644
--- a/packages/server/src/share/endpoint-real-git.test.ts
+++ b/packages/server/src/share/endpoint-real-git.test.ts
@@ -5,6 +5,7 @@ import { decodeShareUrl } from '@inkeep/open-knowledge-core';
import { afterEach, describe, expect, test } from 'vitest';
import { bootEndpointServer, type EndpointRig } from './endpoint-http.test-helper.ts';
import { createGitTriangle, type GitTriangle } from './git-fixture.test-helper.ts';
+import { declareGitHubHosts, useIsolatedHome } from './git-host-declarations.test-helper.ts';
import { computeShareTargetStatus } from './target-status.ts';
const triangles: GitTriangle[] = [];
@@ -237,6 +238,8 @@ describe('POST /api/share/construct-url (freshness computed through the endpoint
});
describe('POST /api/share/construct-url (v2 minting through the endpoint)', () => {
+ const home = useIsolatedHome();
+
function shareToken(json: Record<string, unknown>): string {
return (json.shareUrl as string).replace('https://openknowledge.ai/d/', '');
}
@@ -275,10 +278,11 @@ describe('POST /api/share/construct-url (v2 minting through the endpoint)', () =
});
});
- test('a nested content root returns a business error when its origin cannot be encoded as v2', async () => {
+ test('a declared host whose origin cannot be encoded as v2 returns a business error', async () => {
const t = newTriangle();
t.seedAndPush('knowledge/doc.md', '# Document\n');
t.git(t.senderDir, ['remote', 'set-url', 'origin', 'https://127.0.0.1/o/r.git']);
+ declareGitHubHosts(home(), '127.0.0.1');
rig = await bootEndpointServer({
projectDir: t.senderDir,
diff --git a/packages/server/src/share/git-context.test.ts b/packages/server/src/share/git-context.test.ts
index f67c2bbb7..fc2d67b99 100644
--- a/packages/server/src/share/git-context.test.ts
+++ b/packages/server/src/share/git-context.test.ts
@@ -1,17 +1,24 @@
-import { mkdirSync, mkdtempSync, rmSync, writeFileSync } from 'node:fs';
+import { existsSync, mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from 'node:fs';
import { tmpdir } from 'node:os';
import { join, relative, resolve } from 'node:path';
import { afterEach, beforeEach, describe, expect, test } from 'vitest';
import {
branchExistsOnOrigin,
- originGitHubHost,
parseGitHubOriginUrl,
+ readDeclaredGitHubHosts,
readGitHeadBranch,
readOriginGitHubRepo,
readSyncRemoteInfo,
+ resolveGitHubAuthHost,
sameGitHubLogin,
shouldResetAmbientCredentials,
} from './git-context.ts';
+import {
+ declareGitHubHosts,
+ gitHostsYaml,
+ useIsolatedHome,
+ writeUserConfig,
+} from './git-host-declarations.test-helper.ts';
function seedRepo(
root: string,
@@ -49,6 +56,8 @@ function seedRepo(
}
}
+const home = useIsolatedHome();
+
const CANONICAL_HEAD = 'ref: refs/heads/main\n';
const OID_A = 'a'.repeat(40);
const OID_B = 'b'.repeat(40);
@@ -279,13 +288,14 @@ describe('readOriginGitHubRepo', () => {
seedRepo(dir, {
config: '[remote "origin"]\n\turl = [email protected]:inkeep/open-knowledge.git\n',
});
- expect(readOriginGitHubRepo(dir)).toEqual({ kind: 'non-github' });
+ expect(readOriginGitHubRepo(dir)).toEqual({ kind: 'non-github', host: 'gitlab.com' });
});
- test('presumes an unknown host is a GitHub Enterprise host', () => {
+ test('classifies a declared GitHub Enterprise host as a GitHub origin', () => {
seedRepo(dir, {
config: '[remote "origin"]\n\turl = https://ghes.acme.test/inkeep/open-knowledge.git\n',
});
+ declareGitHubHosts(home(), 'ghes.acme.test');
expect(readOriginGitHubRepo(dir)).toEqual({
kind: 'ok',
host: 'ghes.acme.test',
@@ -299,6 +309,7 @@ describe('readOriginGitHubRepo', () => {
seedRepo(dir, {
config: '[remote "origin"]\n\turl = [email protected]:team/kb.git\n',
});
+ declareGitHubHosts(home(), 'github.corp.example.com');
expect(readOriginGitHubRepo(dir)).toEqual({
kind: 'ok',
host: 'github.corp.example.com',
@@ -312,6 +323,7 @@ describe('readOriginGitHubRepo', () => {
seedRepo(dir, {
config: '[remote "origin"]\n\turl = https://ghes.acme.test:8443/acme/kb.git\n',
});
+ declareGitHubHosts(home(), 'ghes.acme.test');
expect(readOriginGitHubRepo(dir)).toEqual({
kind: 'ok',
host: 'ghes.acme.test',
@@ -351,6 +363,7 @@ describe('readOriginGitHubRepo', () => {
seedRepo(dir, {
config: '[remote "origin"]\n\turl = ssh://[email protected]:2222/acme/kb.git\n',
});
+ declareGitHubHosts(home(), 'git.acme.test');
expect(readOriginGitHubRepo(dir)).toEqual({
kind: 'ok',
host: 'git.acme.test',
@@ -381,12 +394,12 @@ describe('readOriginGitHubRepo', () => {
test('treats unparseable origin url as non-github (defensive — origin field present but malformed)', () => {
seedRepo(dir, { config: '[remote "origin"]\n\turl = totally-bogus\n' });
- expect(readOriginGitHubRepo(dir)).toEqual({ kind: 'non-github' });
+ expect(readOriginGitHubRepo(dir)).toEqual({ kind: 'non-github', host: null });
});
test('credential-embedded https URL keeps the username as the login and drops the password', () => {
const url = 'https://user:[email protected]/org/repo.git';
- const parsed = parseGitHubOriginUrl(url);
+ const parsed = parseGitHubOriginUrl(url, new Set(['ghes.corp.example']));
expect(parsed).toEqual({
host: 'ghes.corp.example',
owner: 'org',
@@ -396,6 +409,7 @@ describe('readOriginGitHubRepo', () => {
});
expect(JSON.stringify(parsed)).not.toContain('pass');
seedRepo(dir, { config: `[remote "origin"]\n\turl = ${url}\n` });
+ declareGitHubHosts(home(), 'ghes.corp.example');
expect(readOriginGitHubRepo(dir)).toEqual({
kind: 'ok',
host: 'ghes.corp.example',
@@ -434,7 +448,7 @@ describe('readOriginGitHubRepo', () => {
});
});
-describe('originGitHubHost', () => {
+describe('resolveGitHubAuthHost', () => {
let dir: string;
beforeEach(() => {
@@ -449,25 +463,58 @@ describe('originGitHubHost', () => {
seedRepo(dir, {
config: '[remote "origin"]\n\turl = https://github.com/inkeep/open-knowledge.git\n',
});
- expect(originGitHubHost(dir)).toBe('github.com');
+ expect(resolveGitHubAuthHost(dir)).toEqual({ kind: 'ok', host: 'github.com' });
});
- test('returns the enterprise host for a GHES origin', () => {
+ test('returns the enterprise host for a declared GHES origin', () => {
seedRepo(dir, {
config: '[remote "origin"]\n\turl = https://ghes.acme.test/acme/kb.git\n',
});
- expect(originGitHubHost(dir)).toBe('ghes.acme.test');
+ declareGitHubHosts(home(), 'ghes.acme.test');
+ expect(resolveGitHubAuthHost(dir)).toEqual({ kind: 'ok', host: 'ghes.acme.test' });
});
- test('falls back to github.com for a known non-GitHub forge', () => {
+ test('rejects a known non-GitHub forge, so GitHub flows have no host', () => {
seedRepo(dir, {
config: '[remote "origin"]\n\turl = [email protected]:team/notes.git\n',
});
- expect(originGitHubHost(dir)).toBe('github.com');
+ expect(resolveGitHubAuthHost(dir)).toEqual({ kind: 'rejected-origin', host: 'gitlab.com' });
+ });
+
+ test('normalizes rejected explicit hosts and preserves accepted host ports', () => {
+ expect(resolveGitHubAuthHost(dir, 'GHES.Example.test:8443')).toEqual({
+ kind: 'rejected-explicit',
+ host: 'ghes.example.test',
+ });
+ expect(
+ resolveGitHubAuthHost(dir, 'GHES.Example.test:8443', new Set(['ghes.example.test'])),
+ ).toEqual({
+ kind: 'ok',
+ host: 'GHES.Example.test:8443',
+ });
+ });
+
+ test('uses a captured declaration set until the caller supplies a fresh one', () => {
+ const captured = readDeclaredGitHubHosts();
+ declareGitHubHosts(home(), 'ghes.example.test');
+ expect(resolveGitHubAuthHost(dir, 'ghes.example.test', captured)).toEqual({
+ kind: 'rejected-explicit',
+ host: 'ghes.example.test',
+ });
+ expect(resolveGitHubAuthHost(dir, 'ghes.example.test')).toEqual({
+ kind: 'ok',
+ host: 'ghes.example.test',
+ });
+ });
+
+ test('an explicit GitHub host overrides an unparseable origin', () => {
+ seedRepo(dir, { config: '[remote "origin"]\n\turl = ../repository\n' });
+ expect(resolveGitHubAuthHost(dir, 'github.com')).toEqual({ kind: 'ok', host: 'github.com' });
+ expect(resolveGitHubAuthHost(dir)).toEqual({ kind: 'rejected-origin', host: null });
});
test('falls back to github.com when there is no .git at all', () => {
- expect(originGitHubHost(dir)).toBe('github.com');
+ expect(resolveGitHubAuthHost(dir)).toEqual({ kind: 'ok', host: 'github.com' });
});
});
@@ -489,10 +536,11 @@ describe('shouldResetAmbientCredentials', () => {
expect(shouldResetAmbientCredentials(dir)).toBe(true);
});
- test('GHES origin resets — sign-in accepts unknown hosts as enterprise', () => {
+ test('declared GHES origin resets — the declaration opts the host into GitHub handling', () => {
seedRepo(dir, {
config: '[remote "origin"]\n\turl = https://ghes.acme.test/acme/kb.git\n',
});
+ declareGitHubHosts(home(), 'ghes.acme.test');
expect(shouldResetAmbientCredentials(dir)).toBe(true);
});
@@ -618,10 +666,11 @@ describe('readSyncRemoteInfo', () => {
});
});
- test('GHES origin yields a host-qualified label and a browsable webUrl', () => {
+ test('declared GHES origin yields a host-qualified label and a browsable webUrl', () => {
seedRepo(dir, {
config: '[remote "origin"]\n\turl = https://ghes.acme.test/team/notes.git\n',
});
+ declareGitHubHosts(home(), 'ghes.acme.test');
expect(readSyncRemoteInfo(dir)).toEqual({
label: 'ghes.acme.test/team/notes',
webUrl: 'https://ghes.acme.test/team/notes',
@@ -632,6 +681,7 @@ describe('readSyncRemoteInfo', () => {
seedRepo(dir, {
config: '[remote "origin"]\n\turl = https://user:[email protected]/org/repo.git\n',
});
+ declareGitHubHosts(home(), 'ghes.corp.example');
expect(readSyncRemoteInfo(dir)).toEqual({
label: 'ghes.corp.example/org/repo',
webUrl: 'https://ghes.corp.example/org/repo',
@@ -743,3 +793,137 @@ describe('sameGitHubLogin', () => {
expect(sameGitHubLogin(undefined, undefined)).toBe(false);
});
});
+
+describe('git host declaration gates GitHub treatment', () => {
+ let dir: string;
+
+ beforeEach(() => {
+ dir = mkdtempSync(join(tmpdir(), 'share-git-declared-'));
+ });
+
+ afterEach(() => {
+ rmSync(dir, { recursive: true, force: true });
+ });
+
+ const SELF_HOSTED_CONFIG =
+ '[remote "origin"]\n\turl = https://git.example.internal/team/kb.git\n';
+
+ test('github.com stays a GitHub origin with no declaration', () => {
+ seedRepo(dir, {
+ config: '[remote "origin"]\n\turl = https://github.com/o/r.git\n',
+ });
+ expect(readOriginGitHubRepo(dir)).toEqual({
+ kind: 'ok',
+ host: 'github.com',
+ owner: 'o',
+ repo: 'r',
+ transport: 'https',
+ });
+ });
+
+ test('an undeclared origin whose host merely contains github stays generic', () => {
+ seedRepo(dir, { config: '[remote "origin"]\n\turl = https://github.acme.test/team/kb.git\n' });
+ expect(readOriginGitHubRepo(dir)).toEqual({ kind: 'non-github', host: 'github.acme.test' });
+ expect(shouldResetAmbientCredentials(dir)).toBe(false);
+ expect(resolveGitHubAuthHost(dir)).toEqual({
+ kind: 'rejected-origin',
+ host: 'github.acme.test',
+ });
+ });
+
+ test('an undeclared self-hosted https origin is a generic git remote', () => {
+ seedRepo(dir, { config: SELF_HOSTED_CONFIG });
+ expect(readOriginGitHubRepo(dir)).toEqual({ kind: 'non-github', host: 'git.example.internal' });
+ expect(shouldResetAmbientCredentials(dir)).toBe(false);
+ expect(resolveGitHubAuthHost(dir)).toEqual({
+ kind: 'rejected-origin',
+ host: 'git.example.internal',
+ });
+ expect(readSyncRemoteInfo(dir)?.webUrl).toBeNull();
+ });
+
+ test('declaring the host opts it into GitHub treatment on every surface', () => {
+ seedRepo(dir, { config: SELF_HOSTED_CONFIG });
+ declareGitHubHosts(home(), 'git.example.internal');
+ expect(readOriginGitHubRepo(dir)).toEqual({
+ kind: 'ok',
+ host: 'git.example.internal',
+ owner: 'team',
+ repo: 'kb',
+ transport: 'https',
+ });
+ expect(shouldResetAmbientCredentials(dir)).toBe(true);
+ expect(resolveGitHubAuthHost(dir)).toEqual({ kind: 'ok', host: 'git.example.internal' });
+ expect(readSyncRemoteInfo(dir)).toEqual({
+ label: 'git.example.internal/team/kb',
+ webUrl: 'https://git.example.internal/team/kb',
+ });
+ });
+
+ test('an undeclared self-hosted scp-style ssh origin is a generic git remote', () => {
+ seedRepo(dir, {
+ config: '[remote "origin"]\n\turl = [email protected]:team/kb.git\n',
+ });
+ expect(readOriginGitHubRepo(dir)).toEqual({ kind: 'non-github', host: 'git.example.internal' });
+ });
+
+ test('an undeclared self-hosted ssh:// origin is a generic git remote', () => {
+ seedRepo(dir, {
+ config: '[remote "origin"]\n\turl = ssh://[email protected]/team/kb.git\n',
+ });
+ expect(readOriginGitHubRepo(dir)).toEqual({ kind: 'non-github', host: 'git.example.internal' });
+ });
+
+ test.each(['gitlab.com', 'bitbucket.org', 'codeberg.org', 'gitea.com', 'sr.ht', 'sourcehut.org'])(
+ '%s still classifies as a generic git remote',
+ (host) => {
+ seedRepo(dir, { config: `[remote "origin"]\n\turl = https://${host}/team/kb.git\n` });
+ expect(readOriginGitHubRepo(dir)).toEqual({ kind: 'non-github', host: host });
+ },
+ );
+
+ test('a declaration written without a port matches a ported remote URL', () => {
+ seedRepo(dir, {
+ config: '[remote "origin"]\n\turl = https://git.example.internal:8443/team/kb.git\n',
+ });
+ declareGitHubHosts(home(), 'git.example.internal');
+ expect(readOriginGitHubRepo(dir)).toMatchObject({
+ kind: 'ok',
+ host: 'git.example.internal',
+ });
+ });
+
+ test('a malformed ~/.ok/global.yml yields no declarations and is left on disk unchanged', () => {
+ const malformed = 'git:\n hosts:\n - [unclosed\n';
+ writeUserConfig(home(), malformed);
+ seedRepo(dir, { config: SELF_HOSTED_CONFIG });
+
+ expect(readDeclaredGitHubHosts().size).toBe(0);
+ expect(readOriginGitHubRepo(dir)).toEqual({ kind: 'non-github', host: 'git.example.internal' });
+
+ const configPath = join(home(), '.ok', 'global.yml');
+ expect(existsSync(configPath)).toBe(true);
+ expect(readFileSync(configPath, 'utf-8')).toBe(malformed);
+ });
+
+ test("a declaration in the project's .ok/config.yml is ignored", () => {
+ mkdirSync(join(dir, '.ok'), { recursive: true });
+ writeFileSync(join(dir, '.ok', 'config.yml'), gitHostsYaml('git.example.internal'), 'utf-8');
+ seedRepo(dir, { config: SELF_HOSTED_CONFIG });
+
+ expect(readDeclaredGitHubHosts().size).toBe(0);
+ expect(readOriginGitHubRepo(dir)).toEqual({ kind: 'non-github', host: 'git.example.internal' });
+ expect(shouldResetAmbientCredentials(dir)).toBe(false);
+ });
+
+ test('reads declarations from an explicit home directory override', () => {
+ const otherHome = mkdtempSync(join(tmpdir(), 'share-git-other-home-'));
+ try {
+ declareGitHubHosts(otherHome, 'git.example.internal');
+ expect([...readDeclaredGitHubHosts(otherHome)]).toEqual(['git.example.internal']);
+ expect(readDeclaredGitHubHosts().size).toBe(0);
+ } finally {
+ rmSync(otherHome, { recursive: true, force: true });
+ }
+ });
+});
diff --git a/packages/server/src/share/git-context.ts b/packages/server/src/share/git-context.ts
index 1cb803dcc..4885b5fd4 100644
--- a/packages/server/src/share/git-context.ts
+++ b/packages/server/src/share/git-context.ts
@@ -1,8 +1,13 @@
-import { KNOWN_NON_GITHUB_GIT_HOSTS } from '@inkeep/open-knowledge-core';
+import {
+ declaredGitHubHostsFrom,
+ isGitHubHost,
+ normalizeGitHostname,
+} from '@inkeep/open-knowledge-core';
import {
type GitRepository,
inspectGitRepository,
} from '@inkeep/open-knowledge-core/git-repository';
+import { readConfigSafely, resolveConfigPath } from '@inkeep/open-knowledge-core/server';
import { getLogger } from '../logger.ts';
const log = getLogger('git-context');
@@ -18,7 +23,7 @@ export type OriginResult =
transport: OriginTransport;
}
| { kind: 'no-remote' }
- | { kind: 'non-github' };
+ | { kind: 'non-github'; host: string | null };
function readRepository(projectDir: string): GitRepository | null {
const result = inspectGitRepository(projectDir);
@@ -38,11 +43,6 @@ export interface ParsedOriginRepo {
login?: string;
}
-function normalizeGitHost(rawHost: string): string {
- const host = rawHost.toLowerCase().replace(/:\d+$/, '');
- return host === 'www.github.com' ? 'github.com' : host;
-}
-
const USERINFO_PLACEHOLDER_USERS = new Set([
'git',
'x-access-token',
@@ -92,7 +92,17 @@ function decodeUserinfo(user: string): string {
}
}
-export function parseGitHubOriginUrl(originUrl: string): ParsedOriginRepo | null {
+export function readDeclaredGitHubHosts(homedirOverride?: string): ReadonlySet<string> {
+ return declaredGitHubHostsFrom(
+ readConfigSafely({
+ absPath: resolveConfigPath('user', '', homedirOverride),
+ sideline: false,
+ warn: (message) => log.warn({ message }, 'Git host declaration configuration diagnostic'),
+ }).value.git?.hosts,
+ );
+}
+
+export function parseGitRemoteUrl(originUrl: string): ParsedOriginRepo | null {
const raw = originUrl.trim();
if (!raw) return null;
@@ -103,8 +113,7 @@ export function parseGitHubOriginUrl(originUrl: string): ParsedOriginRepo | null
transport: OriginTransport,
userinfo?: string,
): ParsedOriginRepo | null => {
- const normalized = normalizeGitHost(host);
- if (KNOWN_NON_GITHUB_GIT_HOSTS.has(normalized)) return null;
+ const normalized = normalizeGitHostname(host);
const login = loginFromUserinfo(userinfo);
return login === undefined
? { host: normalized, owner, repo, transport }
@@ -131,6 +140,15 @@ export function parseGitHubOriginUrl(originUrl: string): ParsedOriginRepo | null
return null;
}
+export function parseGitHubOriginUrl(
+ originUrl: string,
+ declaredGitHubHosts?: ReadonlySet<string>,
+): ParsedOriginRepo | null {
+ const parsed = parseGitRemoteUrl(originUrl);
+ if (parsed === null) return null;
+ return isGitHubHost(parsed.host, declaredGitHubHosts) ? parsed : null;
+}
+
export function readOriginRemoteUrl(projectDir: string): string | null {
const origin = readRepository(projectDir)?.readRemoteUrl('origin');
return origin?.kind === 'configured' ? origin.url : null;
@@ -138,35 +156,58 @@ export function readOriginRemoteUrl(projectDir: string): string | null {
function readParsedOrigin(
projectDir: string,
-): { originUrl: string; github: ParsedOriginRepo | null } | null {
+ declaredGitHubHosts: ReadonlySet<string>,
+): { originUrl: string; remote: ParsedOriginRepo | null; github: ParsedOriginRepo | null } | null {
const origin = readRepository(projectDir)?.readRemoteUrl('origin');
if (origin?.kind !== 'configured') return null;
const originUrl = origin.url;
- return { originUrl, github: parseGitHubOriginUrl(originUrl) };
+ const remote = parseGitRemoteUrl(originUrl);
+ return {
+ originUrl,
+ remote,
+ github: remote && isGitHubHost(remote.host, declaredGitHubHosts) ? remote : null,
+ };
}
-export function readOriginGitHubRepo(projectDir: string): OriginResult {
- const parsed = readParsedOrigin(projectDir);
+export function readOriginGitHubRepo(
+ projectDir: string,
+ declaredGitHubHosts: ReadonlySet<string> = readDeclaredGitHubHosts(),
+): OriginResult {
+ const parsed = readParsedOrigin(projectDir, declaredGitHubHosts);
if (!parsed) return { kind: 'no-remote' };
if (parsed.github) {
const { host, owner, repo, transport } = parsed.github;
return { kind: 'ok', host, owner, repo, transport };
}
- return { kind: 'non-github' };
+ return { kind: 'non-github', host: parsed.remote?.host ?? null };
}
-export function originGitHubHost(projectDir: string): string {
- const origin = readOriginGitHubRepo(projectDir);
- if (origin.kind === 'ok') return origin.host;
- log.debug(
- { kind: origin.kind },
- '[git-context] origin is not a GitHub host — falling back to github.com',
- );
- return 'github.com';
+export type GitHubAuthHostResult =
+ | { kind: 'ok'; host: string }
+ | { kind: 'rejected-explicit'; host: string }
+ | { kind: 'rejected-origin'; host: string | null };
+
+export function resolveGitHubAuthHost(
+ projectDir: string,
+ explicitHost?: string,
+ declaredGitHubHosts: ReadonlySet<string> = readDeclaredGitHubHosts(),
+): GitHubAuthHostResult {
+ if (explicitHost !== undefined) {
+ return isGitHubHost(explicitHost, declaredGitHubHosts)
+ ? { kind: 'ok', host: explicitHost }
+ : { kind: 'rejected-explicit', host: normalizeGitHostname(explicitHost) };
+ }
+ const origin = readOriginGitHubRepo(projectDir, declaredGitHubHosts);
+ if (origin.kind === 'ok') return { kind: 'ok', host: origin.host };
+ if (origin.kind === 'no-remote') return { kind: 'ok', host: 'github.com' };
+ return { kind: 'rejected-origin', host: origin.host };
}
-export function shouldResetAmbientCredentials(projectDir: string): boolean {
- return readOriginGitHubRepo(projectDir).kind !== 'non-github';
+export function shouldResetAmbientCredentials(
+ projectDir: string,
+ declaredGitHubHosts: ReadonlySet<string> = readDeclaredGitHubHosts(),
+): boolean {
+ return readOriginGitHubRepo(projectDir, declaredGitHubHosts).kind !== 'non-github';
}
export interface SyncRemoteInfo {
@@ -174,8 +215,11 @@ export interface SyncRemoteInfo {
webUrl: string | null;
}
-export function readSyncRemoteInfo(projectDir: string): SyncRemoteInfo | null {
- const parsed = readParsedOrigin(projectDir);
+export function readSyncRemoteInfo(
+ projectDir: string,
+ declaredGitHubHosts: ReadonlySet<string> = readDeclaredGitHubHosts(),
+): SyncRemoteInfo | null {
+ const parsed = readParsedOrigin(projectDir, declaredGitHubHosts);
if (!parsed) return null;
if (parsed.github) {
const { host, owner, repo } = parsed.github;
diff --git a/packages/server/src/share/git-host-declarations.test-helper.ts b/packages/server/src/share/git-host-declarations.test-helper.ts
new file mode 100644
index 000000000..27c84ecee
--- /dev/null
+++ b/packages/server/src/share/git-host-declarations.test-helper.ts
@@ -0,0 +1,31 @@
+import { mkdirSync, mkdtempSync, rmSync, writeFileSync } from 'node:fs';
+import { tmpdir } from 'node:os';
+import { join } from 'node:path';
+import { afterEach, beforeEach, vi } from 'vitest';
+
+export function useIsolatedHome(): () => string {
+ let home = '';
+ beforeEach(() => {
+ home = mkdtempSync(join(tmpdir(), 'ok-git-hosts-home-'));
+ vi.stubEnv('HOME', home);
+ vi.stubEnv('USERPROFILE', home);
+ });
+ afterEach(() => {
+ vi.unstubAllEnvs();
+ rmSync(home, { recursive: true, force: true });
+ });
+ return () => home;
+}
+
+export function writeUserConfig(home: string, body: string): void {
+ mkdirSync(join(home, '.ok'), { recursive: true });
+ writeFileSync(join(home, '.ok', 'global.yml'), body, 'utf-8');
+}
+
+export function gitHostsYaml(...hosts: string[]): string {
+ return `git:\n hosts:\n${hosts.map((h) => ` ${h}:\n provider: github\n`).join('')}`;
+}
+
+export function declareGitHubHosts(home: string, ...hosts: string[]): void {
+ writeUserConfig(home, gitHostsYaml(...hosts));
+}
diff --git a/packages/server/src/share/github-account.test.ts b/packages/server/src/share/github-account.test.ts
index 4847439db..32b0297bd 100644
--- a/packages/server/src/share/github-account.test.ts
+++ b/packages/server/src/share/github-account.test.ts
@@ -128,8 +128,9 @@ describe('resolveGitHubAccountFromUrl', () => {
);
});
- test('a known non-GitHub forge resolves to the active account with no host', () => {
+ test('a non-GitHub forge carries its host but declares no account', () => {
expect(resolveGitHubAccountFromUrl('https://gitlab.com/o/r.git', { cwd: dir })).toEqual({
+ host: 'gitlab.com',
source: 'active',
});
});
@@ -143,6 +144,12 @@ describe('resolveGitHubAccountFromUrl', () => {
resolveGitHubAccountFromUrl('https://[email protected]/org/repo.git', { cwd: dir }),
).toEqual({ host: 'ghes.corp.example', login: 'alice', source: 'remote-url' });
});
+
+ test('resolution reads the URL shape alone and does not consult declared git hosts', () => {
+ expect(
+ resolveGitHubAccountFromUrl('https://[email protected]/team/kb.git', { cwd: dir }),
+ ).toEqual({ host: 'git.example.internal', login: 'alice', source: 'remote-url' });
+ });
});
describe('credential.<url>.username', () => {
diff --git a/packages/server/src/share/github-account.ts b/packages/server/src/share/github-account.ts
index e57d5af0b..7eb37e931 100644
--- a/packages/server/src/share/github-account.ts
+++ b/packages/server/src/share/github-account.ts
@@ -1,7 +1,7 @@
import { spawnSync } from 'node:child_process';
import { withHiddenWindowsConsole } from '../child-process-windows-hide.ts';
import { getLogger } from '../logger.ts';
-import { asDeclaredGitHubLogin, parseGitHubOriginUrl, readOriginRemoteUrl } from './git-context.ts';
+import { asDeclaredGitHubLogin, parseGitRemoteUrl, readOriginRemoteUrl } from './git-context.ts';
import { redactShareSubprocessStderr } from './publish.ts';
const log = getLogger('github-account');
@@ -63,7 +63,7 @@ export function resolveGitHubAccountFromUrl(
url: string,
options: ResolveGitHubAccountOptions = {},
): GitHubAccount {
- const parsed = parseGitHubOriginUrl(url);
+ const parsed = parseGitRemoteUrl(url);
if (!parsed) return { source: 'active' };
const host = parsed.host;
diff --git a/packages/server/src/sync-engine.test.ts b/packages/server/src/sync-engine.test.ts
index d2d5527c9..3030e6c06 100644
--- a/packages/server/src/sync-engine.test.ts
+++ b/packages/server/src/sync-engine.test.ts
@@ -23,6 +23,7 @@ import type { GitHandle } from './git-handle.ts';
import { listNames } from './git-paths.ts';
import type { DetectGhAccountsFn, DetectGhFn, ProbeTokenStore } from './github-permissions.ts';
import { getLogger } from './logger.ts';
+import { declareGitHubHosts, useIsolatedHome } from './share/git-host-declarations.test-helper.ts';
import type { CredentialUrlMatchReader } from './share/github-account.ts';
import {
CONTENTION_WARN_THRESHOLD,
@@ -4015,6 +4016,36 @@ describe('SyncEngine per-operation error isolation', () => {
});
describe('SyncEngine push-permission probe', () => {
+ const home = useIsolatedHome();
+
+ test('keeps host classification from construction until a new engine starts', async () => {
+ await initGitWithOrigin('https://ghes.acme.test/inkeep/open-knowledge.git');
+ const path = join(home(), '.ok', 'global.yml');
+ declareGitHubHosts(home(), 'ghes.acme.test');
+ const probe = fakeProbe({ kind: 'allowed' });
+ const engine = makeProbeEngine({ syncEnabled: false, fakeProbe: probe.fn });
+ writeFileSync(path, 'git:\n hosts: {}\n');
+ try {
+ await engine.start();
+ await waitForPushPermissionResolved(engine);
+ expect(probe.calls).toBe(1);
+ expect(engine.getStatus().remote?.webUrl).toBe(
+ 'https://ghes.acme.test/inkeep/open-knowledge',
+ );
+ const restartedProbe = fakeProbe({ kind: 'allowed' });
+ const restarted = makeProbeEngine({ syncEnabled: false, fakeProbe: restartedProbe.fn });
+ try {
+ await restarted.start();
+ await waitForPushPermissionResolved(restarted);
+ expect(restartedProbe.calls).toBe(0);
+ expect(restarted.getStatus().remote?.webUrl).toBeNull();
+ } finally {
+ await restarted.destroy();
+ }
+ } finally {
+ await engine.destroy();
+ }
+ });
test('does NOT run when there is no remote', async () => {
const probe = fakeProbe({ kind: 'allowed' });
const engine = makeProbeEngine({ syncEnabled: false, fakeProbe: probe.fn });
@@ -4045,8 +4076,9 @@ describe('SyncEngine push-permission probe', () => {
});
});
- test('probes a GitHub Enterprise origin against the enterprise host', async () => {
+ test('probes a DECLARED GitHub Enterprise origin against the enterprise host', async () => {
await initGitWithOrigin('https://ghes.acme.test/inkeep/open-knowledge.git');
+ declareGitHubHosts(home(), 'ghes.acme.test');
const probe = fakeProbe({ kind: 'allowed' });
const engine = makeProbeEngine({ syncEnabled: false, fakeProbe: probe.fn });
await engine.start();
@@ -4062,6 +4094,23 @@ describe('SyncEngine push-permission probe', () => {
});
});
+ test('does NOT probe or park an UNDECLARED self-hosted https origin in full mode', async () => {
+ await initGitWithOrigin('https://git.example.internal/team/kb.git');
+ const probe = fakeProbe({ kind: 'allowed' });
+ const engine = makeProbeEngine({ mode: 'full', fakeProbe: probe.fn });
+ try {
+ await engine.start();
+ await new Promise((r) => setTimeout(r, 10));
+ const status = engine.getStatus();
+ expect(probe.calls).toBe(0);
+ expect(status.pushPermission).toEqual({ checkStatus: 'unknown' });
+ expect(status.pausedReason).not.toBe('no-push-permission');
+ expect(status.state).not.toBe('disabled');
+ } finally {
+ await engine.destroy();
+ }
+ });
+
test('threads the origin-declared account and the accounts listing into the probe', async () => {
await initGitWithOrigin('https://[email protected]/inkeep/open-knowledge.git');
const probe = fakeProbe({ kind: 'allowed' });
@@ -4352,8 +4401,9 @@ describe('SyncEngine push-permission probe', () => {
expect(persisted).toBe(false);
});
- test('passes the origin transport through to the probe (ssh origin)', async () => {
+ test('passes the origin transport through to the probe (declared ssh origin)', async () => {
await initGitWithOrigin('[email protected]:acme/kb.git');
+ declareGitHubHosts(home(), 'git.example.com');
const probe = fakeProbe({ kind: 'unknown', error: 'ssh-unverified' });
const engine = makeProbeEngine({ syncEnabled: false, fakeProbe: probe.fn });
await engine.start();
@@ -4366,8 +4416,9 @@ describe('SyncEngine push-permission probe', () => {
});
});
- test('ssh-unverified probe result does NOT pause the engine (self-hosted forge over SSH)', async () => {
+ test('ssh-unverified probe result does NOT pause the engine (declared self-hosted forge over SSH)', async () => {
await initGitWithOrigin('[email protected]:acme/kb.git');
+ declareGitHubHosts(home(), 'git.example.com');
const probe = fakeProbe({ kind: 'unknown', error: 'ssh-unverified' });
const engine = makeProbeEngine({ syncEnabled: true, fakeProbe: probe.fn });
await engine.start();
@@ -4765,6 +4816,8 @@ function recordDetectGh(
}
describe('SyncEngine gh-token credential relay', () => {
+ const home = useIsolatedHome();
+
test('threads the resolved gh token through git handles during a real push cycle', async () => {
const git = simpleGit(projectDir);
await git.init(['--initial-branch=main']);
@@ -4804,8 +4857,9 @@ describe('SyncEngine gh-token credential relay', () => {
}
});
- test('resolves the gh token against a GitHub Enterprise origin host', async () => {
+ test('resolves the gh token against a declared GitHub Enterprise origin host', async () => {
await initGitWithOrigin('https://ghes.acme.test/inkeep/open-knowledge.git');
+ declareGitHubHosts(home(), 'ghes.acme.test');
const detect = recordDetectGh({ available: true, token: 'gho_relayed' });
const engine = new SyncEngine({
conflicts: newAuthority(),
diff --git a/packages/server/src/sync-engine.ts b/packages/server/src/sync-engine.ts
index d1b6389e3..38c97dd7e 100644
--- a/packages/server/src/sync-engine.ts
+++ b/packages/server/src/sync-engine.ts
@@ -72,6 +72,7 @@ import {
} from './mcp-config-reconciler.ts';
import { toPosix } from './path-utils.ts';
import {
+ readDeclaredGitHubHosts,
readOriginGitHubRepo,
readSyncRemoteInfo,
type SyncRemoteInfo,
@@ -303,6 +304,7 @@ interface PersistedSyncState {
}
interface SyncEngineOptions {
+ declaredGitHubHosts?: ReadonlySet<string>;
projectDir: string;
contentDir: string;
contentFilter: ContentFilter;
@@ -376,6 +378,7 @@ const FF_ONLY_TIMEOUT_MS = 120_000;
const GIT_BLOCK_TIMEOUT_MS = 120_000;
export class SyncEngine {
+ private readonly declaredGitHubHosts: ReadonlySet<string>;
private state: SyncState = 'dormant';
private projectDir: string;
private contentDir: string;
@@ -469,6 +472,7 @@ export class SyncEngine {
constructor(options: SyncEngineOptions) {
this.projectDir = options.projectDir;
+ this.declaredGitHubHosts = options.declaredGitHubHosts ?? readDeclaredGitHubHosts();
this.contentDir = options.contentDir;
this.contentFilter = options.contentFilter;
this.contentRoot = options.contentRoot ?? '';
@@ -1106,7 +1110,7 @@ export class SyncEngine {
syncEnabled: this.mode !== 'off',
syncMode: this.mode,
identityUnresolved: this.identityUnresolved,
- remote: this.hasRemote ? readSyncRemoteInfo(this.projectDir) : null,
+ remote: this.hasRemote ? readSyncRemoteInfo(this.projectDir, this.declaredGitHubHosts) : null,
...(this.pushError !== undefined ? { pushError: this.pushError } : {}),
...(this.pushErrorCode !== undefined ? { pushErrorCode: this.pushErrorCode } : {}),
...(this.pullError !== undefined ? { pullError: this.pullError } : {}),
@@ -1208,7 +1212,7 @@ export class SyncEngine {
if (!this.hasRemote) return null;
if (this.pushPermissionProbeInFlight) return null;
- const origin = readOriginGitHubRepo(this.projectDir);
+ const origin = readOriginGitHubRepo(this.projectDir, this.declaredGitHubHosts);
if (origin.kind !== 'ok') {
const next: PushPermissionStatus = { checkStatus: 'unknown' };
const prev = this.pushPermission;