Beautiful, AI-native markdown IDE and LLM wiki
TypeScript 2nd-brainagent-skillsclaudecodexcompany-braindocsknowledge-knowledge-baseknowledge-managementllmllm-wikillm-wiki-karpathymarkdownmarkdown-editormdmdxnotespkmsecond-brainskills
Turn off public skill install counting by default (PRD-9075) (#5798)
Andrew Mikofalvy7251f1d5877b
diff --git a/.changeset/prd-9075-skill-install-count-off.md b/.changeset/prd-9075-skill-install-count-off.mdnew file mode 100644index 000000000..7fcc24e26--- /dev/null+++ b/.changeset/prd-9075-skill-install-count-off.md@@ -0,0 +1,5 @@+---+"@inkeep/open-knowledge": patch+---++Counting skill installs on skills.sh is now off by default. Turn it on in Settings → Preferences → Count skill installs publicly; a choice you already made is kept.diff --git a/docs/content/reference/configuration.mdx b/docs/content/reference/configuration.mdxindex 8f182fc46..5916aa398 100644--- a/docs/content/reference/configuration.mdx+++ b/docs/content/reference/configuration.mdx@@ -77,6 +77,7 @@ A key set in a file more specific than its scope (a user-scope key in `.ok/confi| `telemetry.localSink.spans.maxBytes` | number | `52428800` (~50 MB) | project | Max size of the local diagnostic spans file before it rotates. || `telemetry.localSink.logs.maxBytes` | number | `26214400` (~25 MB) | project | Max size of the local diagnostic logs file before it rotates. || `telemetry.localSink.attributeDenylist` | `string[]` | 8 credential keys | project | Attribute keys whose values are redacted (`[REDACTED]`) before any local span/log is written. Extends the built-in denylist (`authorization`, `password`, `cookie`, etc.). |+| `telemetry.skillInstallReports.enabled` | boolean | `false` | user | Report installs of published skills to skills.sh so their public install count is accurate: the skill's name, its source repository, and which agent tools it was installed for, once per skill per machine (per project for a skill installed into a project). Never file contents, and never for a private or local source. Off by default; toggle from **Settings → Preferences → Count skill installs publicly**. `DO_NOT_TRACK=1` / `DISABLE_TELEMETRY=1` suppress it even when on. || `search.semantic.enabled` | boolean | `false` | project-local | Add embeddings-based semantic ranking to the MCP `search` tool and a **By meaning** mode to the cmd-K omnibar. Default off. **When on and a key is set, the search query and matching page content are sent to the configured embeddings provider** (content egress). See [Semantic search](#semantic-search) below. || `search.semantic.baseUrl` | string | `"https://api.openai.com/v1"` | project-local | Base URL of the OpenAI-compatible embeddings API. Override to point at a self-hosted server (Ollama / vLLM / LM Studio) or another provider. The API key is **not** stored here — set it with `ok embeddings set-key`; it is sent to whichever endpoint this names. || `search.semantic.model` | string | `"text-embedding-3-small"` | project-local | Embeddings model id. Must be served by the provider at `baseUrl`. Changing it re-embeds the corpus. |diff --git a/docs/content/reference/what-open-knowledge-writes.mdx b/docs/content/reference/what-open-knowledge-writes.mdxindex b95205cdf..27908300f 100644--- a/docs/content/reference/what-open-knowledge-writes.mdx+++ b/docs/content/reference/what-open-knowledge-writes.mdx@@ -10,7 +10,7 @@ OpenKnowledge keeps your knowledge base as plain markdown in your own project diThis page lists every one of them: **when** each write happens, **what** it is, and **where** it is written.<Callout type="info" title="The short version">- **Nothing about your content leaves your machine by default.** Diagnostic logs and telemetry stay on your machine. The things that *can* send data off it — semantic search, a diagnostic or bug-report bundle, and GitHub sync — are opt-in or on-demand. Three automatic exceptions, none of which touch your documents: the desktop app checks for updates (sending its app version and channel), on its first launch it opens your browser once to check for a pending share link, and installing a **published skill** reports that install to skills.sh so the skill's public install count is accurate — the skill's name and source repository, once per skill (per project, for a skill installed into a project), and never for a private or local source. All of them are listed under [What leaves your machine](#what-leaves-your-machine), and the skill report can be turned off.+ **Nothing about your content leaves your machine by default.** Diagnostic logs and telemetry stay on your machine. The things that *can* send data off it — semantic search, a diagnostic or bug-report bundle, and GitHub sync — are opt-in or on-demand. Two automatic exceptions, neither of which touches your documents: the desktop app checks for updates (sending its app version and channel), and on its first launch it opens your browser once to check for a pending share link. Counting skill installs on skills.sh is off unless you turn on **Count skill installs publicly** in **Settings → Preferences**; when on, installing a **published skill** reports the skill's name and source repository, once per skill (per project, for a skill installed into a project), and never for a private or local source. All of them are listed under [What leaves your machine](#what-leaves-your-machine).</Callout>## How to read this page@@ -399,7 +399,7 @@ One case works differently, and it is the only place OpenKnowledge replaces some## What leaves your machine-None of your content, by default. Everything above is written to your own disk. The only ways data leaves your machine are these — all opt-in or on-demand, except three automatic actions that carry no document content (the desktop update check, a one-time share-link check on first launch, and the skill-install report):+None of your content, by default. Everything above is written to your own disk. The only ways data leaves your machine are these — all opt-in or on-demand, except two automatic actions that carry no document content (the desktop update check and a one-time share-link check on first launch):| What | When | Where it goes || --- | --- | --- |@@ -411,7 +411,7 @@ None of your content, by default. Everything above is written to your own disk.| GitHub sync / share | When you sync, clone, publish, or share | GitHub || Update check | Automatically — on launch and periodically while the desktop app runs | OpenKnowledge update service (`openknowledge.ai/updates`), which redirects to GitHub; sends the app version and channel || First-launch share check | Once, automatically, on the desktop app's first launch | `openknowledge.ai/continue` — redeems a share link if you installed from one |-| Skill-install report | Automatically, the first time a published skill is actually installed — OpenKnowledge's own built-in and starter-pack skills, and skills you install from a skills.sh listing. Counted once per skill for machine-wide installs (the built-in bundles), and once per skill **per project** for skills installed into a project, since each project gets its own copy in its own editor dirs. Never re-sent on a re-run, a reinstall, an app launch, or reopening a project — an app launch that installs nothing sends nothing. A skill you install by typing a **third-party** repository yourself is **not** reported, and neither is a private, local, or internal-hostname source. A skill bundle you switched off is never installed and so is never reported | `add-skill.vercel.sh` — the skill's name, its source repository, and which agent tools it was installed for. No file contents. This is what gives a published skill an accurate install count. Turn it off in **Settings → Preferences**, by setting `telemetry.skillInstallReports.enabled: false`, or with `DO_NOT_TRACK=1` / `DISABLE_TELEMETRY=1` |+| Skill-install report | Only if you turn on **Count skill installs publicly** (off by default): the first time a published skill is actually installed — OpenKnowledge's own built-in and starter-pack skills, and skills you install from a skills.sh listing. Counted once per skill for machine-wide installs (the built-in bundles), and once per skill **per project** for skills installed into a project, since each project gets its own copy in its own editor dirs. Never re-sent on a re-run, a reinstall, an app launch, or reopening a project — an app launch that installs nothing sends nothing. A skill you install by typing a **third-party** repository yourself is **not** reported, and neither is a private, local, or internal-hostname source. A skill bundle you switched off is never installed and so is never reported | `add-skill.vercel.sh` — the skill's name, its source repository, and which agent tools it was installed for. No file contents. This is what gives a published skill an accurate install count. Turn it on in **Settings → Preferences** or by setting `telemetry.skillInstallReports.enabled: true`; `DO_NOT_TRACK=1` / `DISABLE_TELEMETRY=1` still suppress it || npm/`npx` fetch | During CLI installation and catalog-managed in-app agent startup, including package admission probes, package downloads, and cache revalidation | Your configured npm registry (the public npm registry by default); package names, version constraints, and configured registry credentials, without document content || uv/`uvx` fetch | When starting a catalog-managed Python in-app agent, including resolution and tool installation | Your configured Python package index (PyPI by default); package names, version constraints, and configured index credentials, without document content |diff --git a/knip.config.ts b/knip.config.tsindex d3638888e..65f0e8807 100644--- a/knip.config.ts+++ b/knip.config.ts@@ -147,15 +147,11 @@ export default {'packages/server': {entry: ['src/**/*.test.ts', 'src/parse-worker.ts'],project: 'src/**',- ignoreDependencies: [- '@types/shell-quote',- ],+ ignoreDependencies: ['@types/shell-quote'],},'packages/cli': {entry: ['src/**/*.test.ts', 'scripts/*.ts', 'tests/**/*.ts', 'src/parse-worker.ts'],- ignoreDependencies: [- 'yjs',- ],+ ignoreDependencies: ['yjs'],},'packages/desktop': {entry: [diff --git a/packages/app/src/components/settings/SettingsDialogBody.dom.test.tsx b/packages/app/src/components/settings/SettingsDialogBody.dom.test.tsxindex 54f3b8284..1156129dd 100644--- a/packages/app/src/components/settings/SettingsDialogBody.dom.test.tsx+++ b/packages/app/src/components/settings/SettingsDialogBody.dom.test.tsx@@ -186,6 +186,22 @@ describe('SettingsDialogBody preferences runtime', () => {);});+ test('lists Count skill installs publicly, off on an untouched profile, and writes an opt-in', async () => {+ const user = userEvent.setup();+ const { binding, patches } = makeBinding();+ const { container } = await renderPreferences(binding);++ const field = container.querySelector('[data-field="telemetry.skillInstallReports.enabled"]');+ expect(field).toBeTruthy();+ const countSwitch = screen.getByRole('switch', { name: 'Count skill installs publicly' });+ expect(countSwitch.getAttribute('aria-checked')).toBe('false');+ await user.click(countSwitch);++ await waitFor(() => {+ expect(patches).toEqual([{ telemetry: { skillInstallReports: { enabled: true } } }]);+ });+ });+test('places the spelling rows after the interface Language row, keeping the CLI row', async () => {Object.defineProperty(window, 'okDesktop', {value: {diff --git a/packages/app/tests/integration/bug3-source-mode-writeback.test.ts b/packages/app/tests/integration/bug3-source-mode-writeback.test.tsindex 4549c74b3..a50b00123 100644--- a/packages/app/tests/integration/bug3-source-mode-writeback.test.ts+++ b/packages/app/tests/integration/bug3-source-mode-writeback.test.ts@@ -1,4 +1,3 @@-import { readFileSync } from 'node:fs';import { join } from 'node:path';import { setTimeout as wait } from 'node:timers/promises';diff --git a/packages/app/tests/integration/indented-jsx-byte-sacred.test.ts b/packages/app/tests/integration/indented-jsx-byte-sacred.test.tsindex 4fc2c11f9..6fcdc23f2 100644--- a/packages/app/tests/integration/indented-jsx-byte-sacred.test.ts+++ b/packages/app/tests/integration/indented-jsx-byte-sacred.test.ts@@ -1,4 +1,3 @@-import { setTimeout as wait } from 'node:timers/promises';import { normalizeBridge } from '@inkeep/open-knowledge-core';import { updateYFragment } from '@tiptap/y-tiptap';diff --git a/packages/app/tests/integration/interior-edit-freshness.test.ts b/packages/app/tests/integration/interior-edit-freshness.test.tsindex 9f2f6feb6..40b5cdfd6 100644--- a/packages/app/tests/integration/interior-edit-freshness.test.ts+++ b/packages/app/tests/integration/interior-edit-freshness.test.ts@@ -1,4 +1,3 @@-import { setTimeout as wait } from 'node:timers/promises';import { updateYFragment, yXmlFragmentToProseMirrorRootNode } from '@tiptap/y-tiptap';import { afterAll, beforeAll, describe, expect, test } from 'vitest';diff --git a/packages/app/tests/integration/keystroke-cadence-danger-space.test.ts b/packages/app/tests/integration/keystroke-cadence-danger-space.test.tsindex 2a085742b..93666af70 100644--- a/packages/app/tests/integration/keystroke-cadence-danger-space.test.ts+++ b/packages/app/tests/integration/keystroke-cadence-danger-space.test.ts@@ -1,4 +1,3 @@-import { setTimeout as wait } from 'node:timers/promises';import { updateYFragment, yXmlFragmentToProseMirrorRootNode } from '@tiptap/y-tiptap';import { afterAll, beforeAll, describe, expect, test } from 'vitest';diff --git a/packages/app/tests/integration/producer-guard-wiring.test.ts b/packages/app/tests/integration/producer-guard-wiring.test.tsindex 878d5196b..867598d34 100644--- a/packages/app/tests/integration/producer-guard-wiring.test.ts+++ b/packages/app/tests/integration/producer-guard-wiring.test.ts@@ -1,4 +1,3 @@-import { setTimeout as wait } from 'node:timers/promises';import { updateYFragment, yXmlFragmentToProseMirrorRootNode } from '@tiptap/y-tiptap';import { afterAll, beforeAll, describe, expect, test } from 'vitest';diff --git a/packages/app/tests/integration/qa-039-reconciliation-counters-http.test.ts b/packages/app/tests/integration/qa-039-reconciliation-counters-http.test.tsindex 4ada3cf26..0970ac12f 100644--- a/packages/app/tests/integration/qa-039-reconciliation-counters-http.test.ts+++ b/packages/app/tests/integration/qa-039-reconciliation-counters-http.test.ts@@ -1,4 +1,3 @@-import { randomUUID } from 'node:crypto';import { afterEach, describe, expect, test } from 'vitest';import { agentWriteMd, createTestServer, type TestServer } from './test-harness';diff --git a/packages/app/tests/integration/qa-045-restore-after-gc.test.ts b/packages/app/tests/integration/qa-045-restore-after-gc.test.tsindex cbe2b705f..b632185e1 100644--- a/packages/app/tests/integration/qa-045-restore-after-gc.test.ts+++ b/packages/app/tests/integration/qa-045-restore-after-gc.test.ts@@ -1,4 +1,3 @@-import { execFileSync } from 'node:child_process';import { randomUUID } from 'node:crypto';import { join } from 'node:path';diff --git a/packages/app/tests/integration/qa-050-rollback-undo-shipped-path.test.ts b/packages/app/tests/integration/qa-050-rollback-undo-shipped-path.test.tsindex 89bc9b4d9..c530ce4ba 100644--- a/packages/app/tests/integration/qa-050-rollback-undo-shipped-path.test.ts+++ b/packages/app/tests/integration/qa-050-rollback-undo-shipped-path.test.ts@@ -1,4 +1,3 @@-import { randomUUID } from 'node:crypto';import { afterAll, afterEach, beforeAll, describe, expect, test } from 'vitest';import type * as Y from 'yjs';diff --git a/packages/app/tests/integration/undo-after-rollback.test.ts b/packages/app/tests/integration/undo-after-rollback.test.tsindex a78aeb0e4..d3767adc9 100644--- a/packages/app/tests/integration/undo-after-rollback.test.ts+++ b/packages/app/tests/integration/undo-after-rollback.test.ts@@ -1,4 +1,3 @@-import { ROLLBACK_ORIGIN } from '@inkeep/open-knowledge-server';import { afterAll, beforeAll, describe, expect, test } from 'vitest';import * as Y from 'yjs';diff --git a/packages/app/tests/integration/undo-recycle-reset.test.ts b/packages/app/tests/integration/undo-recycle-reset.test.tsindex e7cc69c3f..b076f955c 100644--- a/packages/app/tests/integration/undo-recycle-reset.test.ts+++ b/packages/app/tests/integration/undo-recycle-reset.test.ts@@ -1,4 +1,3 @@-import { writeFileSync } from 'node:fs';import { join } from 'node:path';import { setTimeout as wait } from 'node:timers/promises';diff --git a/packages/app/tests/integration/undo-rederive-survival.test.ts b/packages/app/tests/integration/undo-rederive-survival.test.tsindex 9ddcd0730..7935e35f8 100644--- a/packages/app/tests/integration/undo-rederive-survival.test.ts+++ b/packages/app/tests/integration/undo-rederive-survival.test.ts@@ -1,4 +1,3 @@-import { prependFrontmatter } from '@inkeep/open-knowledge-core';import { Plugin, PluginKey } from '@tiptap/pm/state';import { updateYFragment, yXmlFragmentToProseMirrorRootNode } from '@tiptap/y-tiptap';diff --git a/packages/cli/src/commands/init.test.ts b/packages/cli/src/commands/init.test.tsindex b23bff588..1e08556f1 100644--- a/packages/cli/src/commands/init.test.ts+++ b/packages/cli/src/commands/init.test.ts@@ -16,6 +16,7 @@ import {import { tmpdir } from 'node:os';import { dirname, join, resolve } from 'node:path';import { resolveBundleEnabled } from '@inkeep/open-knowledge-core';+import { resolveConfigPath } from '@inkeep/open-knowledge-core/server';import { readBundleDecision } from '@inkeep/open-knowledge-server';import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';import { parse as parseYaml } from 'yaml';@@ -961,6 +962,48 @@ describe('runInit', () => {expect(output).not.toContain('detected agent hosts');});+ it('does not claim a skills.sh count when install counting was never turned on', async () => {+ vi.stubEnv('DO_NOT_TRACK', '');+ vi.stubEnv('DISABLE_TELEMETRY', '');+ try {+ const result = await runInitForTest({ installUserSkill: async () => 'installed' });+ const output = formatInitResult(result, testDir);+ expect(output).toContain('installed for');+ expect(output).not.toContain('Counted on skills.sh');+ } finally {+ vi.unstubAllEnvs();+ }+ });++ it('says the install is counted on skills.sh when the user opted in', async () => {+ const configPath = resolveConfigPath('user', fakeHome, fakeHome);+ mkdirSync(dirname(configPath), { recursive: true });+ writeFileSync(configPath, 'telemetry:\n skillInstallReports:\n enabled: true\n', 'utf-8');+ vi.stubEnv('DO_NOT_TRACK', '');+ vi.stubEnv('DISABLE_TELEMETRY', '');+ try {+ const result = await runInitForTest({ installUserSkill: async () => 'installed' });+ expect(formatInitResult(result, testDir)).toContain('Counted on skills.sh');+ } finally {+ vi.unstubAllEnvs();+ }+ });++ it('does not claim a skills.sh count when DO_NOT_TRACK overrides an opt-in', async () => {+ const configPath = resolveConfigPath('user', fakeHome, fakeHome);+ mkdirSync(dirname(configPath), { recursive: true });+ writeFileSync(configPath, 'telemetry:\n skillInstallReports:\n enabled: true\n', 'utf-8');+ vi.stubEnv('DO_NOT_TRACK', '1');+ try {+ const result = await runInitForTest({ installUserSkill: async () => 'installed' });+ const output = formatInitResult(result, testDir);+ expect(output).toContain('installed for');+ expect(output).not.toContain('Counted on skills.sh');+ } finally {+ vi.unstubAllEnvs();+ }+ });+it('reports the hosts actually written, never an unverified claim (issue #820)', async () => {mkdirSync(join(fakeHome, '.claude'), { recursive: true });const result = await runInitForTest({diff --git a/packages/cli/src/commands/init.ts b/packages/cli/src/commands/init.tsindex b3d640673..f9cee3535 100644--- a/packages/cli/src/commands/init.ts+++ b/packages/cli/src/commands/init.ts@@ -22,6 +22,7 @@ import {HomeProjectRootError,initContent,installUserSkill,+ isSkillInstallReportEnvOptOut,ONBOARDING_BUNDLE_IDS,ProjectGitInitError,removeProjectSkillGitignoreBlock,@@ -652,6 +653,7 @@ interface InitCommandResult {skillBundles?: readonly { bundleId: BundleId; result: InstallUserSkillResult }[];skillsRequested?: string | boolean;skillHosts?: readonly string[];+ skillInstallsCounted?: boolean;preview?: PreviewResult;didGitInit: boolean;rootGitignoreCreated: boolean;@@ -1343,6 +1345,8 @@ export async function runInit(options: InitCommandOptions = {}): Promise<InitCom? 'no-hosts': 'declined';const skillHosts = anyInstalled ? detectUserSkillHosts(skillHome).map((h) => h.editorId) : [];+ const skillInstallsCounted =+ resolveSkillInstallReportSettings(skillHome).enabled && !isSkillInstallReportEnvOptOut();const defaultAction: EditorMcpResult['action'] = skipMcp ? 'skipped-flag' : 'skipped-missing';const primary = editorResults.find((r) => r.editorId === 'claude') ??@@ -1376,6 +1380,7 @@ export async function runInit(options: InitCommandOptions = {}): Promise<InitComskillBundles,skillsRequested: options.skills,skillHosts,+ skillInstallsCounted,didGitInit: gitResult.didInit,rootGitignoreCreated,gitRootPromoted: resolution.gitRootPromoted,@@ -1712,7 +1717,7 @@ export function formatInitResult(result: InitCommandResult, cwd: string): string}}}- if (bundles.some((b) => b.result === 'installed')) {+ if (result.skillInstallsCounted && bundles.some((b) => b.result === 'installed')) {lines.push(` ${dim('Counted on skills.sh (skill name + source repo, once per machine).')}`);lines.push(` ${dim('Opt out: DO_NOT_TRACK=1, or Settings → User → Preferences.')}`);}diff --git a/packages/core/src/bridge/compose.ts b/packages/core/src/bridge/compose.tsindex 2a597ec3d..f4cc8a286 100644--- a/packages/core/src/bridge/compose.ts+++ b/packages/core/src/bridge/compose.ts@@ -1,4 +1,3 @@-import { prependFrontmatter, stripFrontmatter } from '../extensions/frontmatter.ts';export type ComposeAdjustment = 'none' | 'body' | 'frontmatter' | 'unresolved';diff --git a/packages/core/src/bridge/doc-boundary-space.ts b/packages/core/src/bridge/doc-boundary-space.tsindex 01ef76a9f..8fb428b90 100644--- a/packages/core/src/bridge/doc-boundary-space.ts+++ b/packages/core/src/bridge/doc-boundary-space.ts@@ -1,4 +1,3 @@-import { FRONTMATTER_RE, stripFrontmatter } from '../extensions/frontmatter.ts';import { carriedEdgeEmpties, type DocEdgeEmpties } from '../markdown/doc-edge-blank-runs.ts';diff --git a/packages/core/src/config/schema.test.ts b/packages/core/src/config/schema.test.tsindex 19fc50144..44576e20f 100644--- a/packages/core/src/config/schema.test.ts+++ b/packages/core/src/config/schema.test.ts@@ -594,3 +594,21 @@ describe('git.hosts.<host>.provider (declared GitHub Enterprise Server hosts)',});});});++describe('telemetry.skillInstallReports.enabled', () => {+ test('defaults to off at every nesting level', () => {+ expect(ConfigSchema.parse({}).telemetry.skillInstallReports.enabled).toBe(false);+ expect(ConfigSchema.parse({ telemetry: {} }).telemetry.skillInstallReports.enabled).toBe(false);+ expect(+ ConfigSchema.parse({ telemetry: { skillInstallReports: {} } }).telemetry.skillInstallReports+ .enabled,+ ).toBe(false);+ });++ test('an explicit opt-in is kept', () => {+ expect(+ ConfigSchema.parse({ telemetry: { skillInstallReports: { enabled: true } } }).telemetry+ .skillInstallReports.enabled,+ ).toBe(true);+ });+});diff --git a/packages/core/src/config/schema.ts b/packages/core/src/config/schema.tsindex 47a0342bd..a3d879cf8 100644--- a/packages/core/src/config/schema.ts+++ b/packages/core/src/config/schema.ts@@ -631,11 +631,11 @@ export const ConfigSchema = z.looseObject({reload: 'live',defaultScope: 'user',description:- 'Report skill installs to skills.sh so a published skill shows an accurate install count. Sends the skill name, its source repo, and which agent tools it was installed for — never file contents, and never for a private or local source. One report per skill per machine. Default on; the DO_NOT_TRACK and DISABLE_TELEMETRY environment variables also turn it off.',+ 'Report skill installs to skills.sh so a published skill shows an accurate install count. Sends the skill name, its source repo, and which agent tools it was installed for — never file contents, and never for a private or local source. One report per skill per machine. Default off; when it is on, the DO_NOT_TRACK and DISABLE_TELEMETRY environment variables still turn it off.',})- .default(true),+ .default(false),})- .default({ enabled: true }),+ .default({ enabled: false }),}).default({localSink: {@@ -644,7 +644,7 @@ export const ConfigSchema = z.looseObject({logs: { maxBytes: DEFAULT_LOGS_MAX_BYTES },attributeDenylist: [...DEFAULT_TELEMETRY_ATTRIBUTE_DENYLIST],},- skillInstallReports: { enabled: true },+ skillInstallReports: { enabled: false },}),lossCapture: z.looseObject({diff --git a/packages/core/src/markdown/comment-promoter.ts b/packages/core/src/markdown/comment-promoter.tsindex fb0ba5a7c..fc267cbea 100644--- a/packages/core/src/markdown/comment-promoter.ts+++ b/packages/core/src/markdown/comment-promoter.ts@@ -1,4 +1,3 @@-import type { Nodes, Paragraph, PhrasingContent, Root, RootContent, Text } from 'mdast';import { SKIP, visit } from 'unist-util-visit';import type { VFile } from 'vfile';diff --git a/packages/core/src/markdown/merged-walker.ts b/packages/core/src/markdown/merged-walker.tsindex fa3cfcd86..bfd7e3109 100644--- a/packages/core/src/markdown/merged-walker.ts+++ b/packages/core/src/markdown/merged-walker.ts@@ -1,4 +1,3 @@-import type { Nodes, Parent, Root } from 'mdast';import { SKIP, visit } from 'unist-util-visit';import type { VFile } from 'vfile';diff --git a/packages/core/src/markdown/safe-url.ts b/packages/core/src/markdown/safe-url.tsindex 8be632ba4..4d3250d3a 100644--- a/packages/core/src/markdown/safe-url.ts+++ b/packages/core/src/markdown/safe-url.ts@@ -1,4 +1,3 @@-export const SAFE_URL_SCHEMES = ['https', 'http', 'mailto', 'tel', 'ftp', 'sms'] as const;const SCHEME_ALT = SAFE_URL_SCHEMES.map((s) => `${s}:`).join('|');diff --git a/packages/server/src/index.ts b/packages/server/src/index.tsindex b58627ba2..b10fe131c 100644--- a/packages/server/src/index.ts+++ b/packages/server/src/index.ts@@ -639,7 +639,11 @@ export {writeBundleDecision,writeTargetVersion,} from './skill-state.ts';-export { reportSkillInstall, type SkillInstallReport } from './skills-sh-install-report.ts';+export {+ isSkillInstallReportEnvOptOut,+ reportSkillInstall,+ type SkillInstallReport,+} from './skills-sh-install-report.ts';export {CURSOR_BUNDLE_PATHS_BY_PLATFORM,type HandleSpawnCursorDeps,diff --git a/packages/server/src/skill-install-report-config.test.ts b/packages/server/src/skill-install-report-config.test.tsindex 5da151566..9752b793b 100644--- a/packages/server/src/skill-install-report-config.test.ts+++ b/packages/server/src/skill-install-report-config.test.ts@@ -1,7 +1,7 @@import { mkdirSync, writeFileSync } from 'node:fs';import { dirname } from 'node:path';import { resolveConfigPath } from '@inkeep/open-knowledge-core/server';-import { afterAll, describe, expect, test } from 'vitest';+import { afterAll, describe, expect, test, vi } from 'vitest';import { createTempDirFactory } from '../../../test-support/temp-dir.test-helper.ts';import { resolveSkillInstallReportSettings } from './skill-install-report-config.ts';@@ -19,14 +19,45 @@ function writeUserConfig(home: string, yaml: string): string {}describe('resolveSkillInstallReportSettings', () => {- test('no user config at all → the schema default (on)', () => {- expect(resolveSkillInstallReportSettings(freshHome()).enabled).toBe(true);+ test('no user config at all → the schema default (off)', () => {+ expect(resolveSkillInstallReportSettings(freshHome()).enabled).toBe(false);});- test('config present but silent on the key → the schema default (on)', () => {+ test('config present but silent on the key → the schema default (off)', () => {const home = freshHome();writeUserConfig(home, 'appearance:\n theme: dark\n');- expect(resolveSkillInstallReportSettings(home).enabled).toBe(true);+ expect(resolveSkillInstallReportSettings(home).enabled).toBe(false);+ });++ test('a skillInstallReports block without the enabled leaf → the schema default (off)', () => {+ const home = freshHome();+ writeUserConfig(home, 'telemetry:\n skillInstallReports: {}\n');+ expect(resolveSkillInstallReportSettings(home).enabled).toBe(false);+ });++ test('the fallback follows the schema default rather than a literal of its own', async () => {+ vi.resetModules();+ vi.doMock('@inkeep/open-knowledge-core', async (importOriginal) => {+ const actual = await importOriginal<typeof import('@inkeep/open-knowledge-core')>();+ return {+ ...actual,+ ConfigSchema: {+ parse: () => ({ telemetry: { skillInstallReports: { enabled: true } } }),+ },+ };+ });+ try {+ const { resolveSkillInstallReportSettings: resolveWithFlippedDefault } = await import(+ './skill-install-report-config.ts'+ );+ expect(resolveWithFlippedDefault(freshHome()).enabled).toBe(true);+ const home = freshHome();+ writeUserConfig(home, 'appearance:\n theme: dark\n');+ expect(resolveWithFlippedDefault(home).enabled).toBe(true);+ } finally {+ vi.doUnmock('@inkeep/open-knowledge-core');+ vi.resetModules();+ }});test('explicit false is honored', () => {diff --git a/packages/server/src/skill-install-report-config.ts b/packages/server/src/skill-install-report-config.tsindex 82508f78a..3727ce940 100644--- a/packages/server/src/skill-install-report-config.ts+++ b/packages/server/src/skill-install-report-config.ts@@ -1,9 +1,14 @@import { existsSync, readFileSync } from 'node:fs';import { homedir } from 'node:os';+import { ConfigSchema } from '@inkeep/open-knowledge-core';import { resolveConfigPath } from '@inkeep/open-knowledge-core/server';import { parse as parseYaml } from 'yaml';import { getLogger } from './logger.ts';+function schemaDefaultEnabled(): boolean {+ return ConfigSchema.parse({}).telemetry.skillInstallReports.enabled;+}+export interface SkillInstallReportSettings {enabled: boolean;home: string;@@ -20,14 +25,14 @@ export function resolveSkillInstallReportSettings(getLogger('skills').warn({ err }, 'could not resolve the user config path; not reporting');return { enabled: false, home };}- if (!existsSync(path)) return { enabled: true, home };+ if (!existsSync(path)) return { enabled: schemaDefaultEnabled(), home };try {const raw = parseYaml(readFileSync(path, 'utf-8')) as| { telemetry?: { skillInstallReports?: { enabled?: unknown } } }| null| undefined;const value = raw?.telemetry?.skillInstallReports?.enabled;- return { enabled: typeof value === 'boolean' ? value : true, home };+ return { enabled: typeof value === 'boolean' ? value : schemaDefaultEnabled(), home };} catch (err) {getLogger('skills').warn({ err, path },diff --git a/packages/server/src/skills-sh-install-report.ts b/packages/server/src/skills-sh-install-report.tsindex ff43dbd62..29f3bed48 100644--- a/packages/server/src/skills-sh-install-report.ts+++ b/packages/server/src/skills-sh-install-report.ts@@ -60,7 +60,7 @@ export interface ReportSkillInstallDeps {env?: NodeJS.ProcessEnv;}-function envOptOut(env: NodeJS.ProcessEnv): boolean {+export function isSkillInstallReportEnvOptOut(env: NodeJS.ProcessEnv = process.env): boolean {return Boolean(env.DISABLE_TELEMETRY || env.DO_NOT_TRACK);}@@ -69,7 +69,7 @@ export async function reportSkillInstall(deps: ReportSkillInstallDeps,): Promise<readonly string[]> {const env = deps.env ?? process.env;- if (!deps.enabled || envOptOut(env)) return [];+ if (!deps.enabled || isSkillInstallReportEnvOptOut(env)) return [];if (!isPublicRepoSource(report.source.trim())) return [];const alreadyReported = await readInstallReported(deps.home).catch((err: unknown) => {