@farming-labs/docs 0.2.52 → 0.2.53

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/dist/agent-2t4kZLGo.mjs +10 -0
  2. package/dist/{agent-CaOBIVFy.mjs → agent-BMxMpEa0.mjs} +194 -22
  3. package/dist/agent-contract-b0akaPcg.mjs +573 -0
  4. package/dist/agent-export--X9Go-wj.mjs +853 -0
  5. package/dist/{agents-DjhjZaNP.mjs → agents-CW-zTNKP.mjs} +6 -5
  6. package/dist/cli/index.mjs +43 -28
  7. package/dist/client/react.d.mts +1 -1
  8. package/dist/{cloud-ask-ai-DcMe6xOf.d.mts → cloud-ask-ai-CMzYVzVX.d.mts} +1 -1
  9. package/dist/{cloud-C_Ok9rC5.mjs → cloud-zs0qAnKJ.mjs} +3 -3
  10. package/dist/{codeblocks-z9iT794h.mjs → codeblocks-DWM4IJPL.mjs} +9 -12
  11. package/dist/{dev-Tm9Ss4D6.mjs → dev-DFeVU2Ui.mjs} +2 -2
  12. package/dist/docs-cloud-server.d.mts +2 -2
  13. package/dist/docs-cloud-server.mjs +1 -1
  14. package/dist/{doctor-O9o9kjN8.mjs → doctor-CkM5tKdD.mjs} +36 -24
  15. package/dist/{downgrade-CYEaOctn.mjs → downgrade-Dj_KXV11.mjs} +2 -2
  16. package/dist/i18n-CAlj1ADU.mjs +40 -0
  17. package/dist/index.d.mts +139 -3
  18. package/dist/index.mjs +7 -5
  19. package/dist/{init-Ch5On0zm.mjs → init-Cmz-oqnp.mjs} +3 -3
  20. package/dist/{mcp-DuCPNHS-.mjs → mcp-B4Q1PN93.mjs} +9 -5
  21. package/dist/mcp.d.mts +102 -4
  22. package/dist/mcp.mjs +1446 -66
  23. package/dist/{package-version-C8PigBZk.mjs → package-version-DxnTZH4m.mjs} +1 -1
  24. package/dist/{reading-time-CPAy1SWO.mjs → reading-time-BuK2YL23.mjs} +278 -33
  25. package/dist/{review-lm3dt7yy.mjs → review-BEsbm0l2.mjs} +38 -3
  26. package/dist/{robots-DV7u4Ire.mjs → robots-BOwkq9du.mjs} +5 -4
  27. package/dist/{robots-XVPs9lVz.mjs → robots-C6uQG-fS.mjs} +1 -1
  28. package/dist/{search-BWuU70B0.mjs → search-CJNLkdjX.mjs} +174 -79
  29. package/dist/{search-DFEhf9-s.d.mts → search-CTu6Bvq-.d.mts} +3 -1
  30. package/dist/{search-B6nEkx86.mjs → search-CtAXkk_J.mjs} +5 -4
  31. package/dist/server.d.mts +5 -5
  32. package/dist/server.mjs +8 -7
  33. package/dist/{sitemap-BEiKy4Iy.mjs → sitemap-OPb8EdNe.mjs} +6 -5
  34. package/dist/{sitemap-server-xEHtDUDB.mjs → sitemap-server-DnilMEiZ.mjs} +1 -1
  35. package/dist/{templates-uaauJcTO.mjs → templates-Bty9M6lA.mjs} +11 -5
  36. package/dist/{types-XqGLsmOD.d.mts → types-CdKu8KmO.d.mts} +118 -2
  37. package/dist/{upgrade-DzQtpgJM.mjs → upgrade-BNdBB9tQ.mjs} +2 -2
  38. package/package.json +1 -1
  39. package/dist/agent-DXDOMJBw.mjs +0 -9
  40. /package/dist/{cloud-ask-ai-Cl-xaV8j.mjs → cloud-ask-ai-BFlx8VMO.mjs} +0 -0
  41. /package/dist/{config-tiQCZ46q.mjs → config-DhIyFsy9.mjs} +0 -0
  42. /package/dist/{errors-CW1LnxaQ.mjs → errors-BxfYhp1L.mjs} +0 -0
  43. /package/dist/{review-B7goPYUb.mjs → review-BHdy75TE.mjs} +0 -0
  44. /package/dist/{utils-D-xTRNuh.mjs → utils-CMZTjRQT.mjs} +0 -0
@@ -246,12 +246,62 @@ type DocsRelatedItem = string;
246
246
  interface ResolvedDocsRelatedLink {
247
247
  href: string;
248
248
  }
249
+ interface PageAgentAppliesTo {
250
+ /** Framework name or names this task applies to, for example `"nextjs"`. */
251
+ framework?: string | string[];
252
+ /** Version range or ranges this task applies to, for example `">=16"`. */
253
+ version?: string | string[];
254
+ /** Package name or names this task applies to, for example `"@farming-labs/next"`. */
255
+ package?: string | string[];
256
+ }
257
+ interface PageAgentCommand {
258
+ /** Exact command an agent may run. */
259
+ run: string;
260
+ /** Optional working directory, relative to the project root unless documented otherwise. */
261
+ cwd?: string;
262
+ /** Short explanation of what the command does. */
263
+ description?: string;
264
+ }
265
+ interface PageAgentVerification {
266
+ /** Human-readable verification step. */
267
+ description?: string;
268
+ /** Optional command used to verify the result. */
269
+ run?: string;
270
+ /** Observable result that indicates success. */
271
+ expect?: string;
272
+ }
273
+ interface PageAgentFailureMode {
274
+ /** Symptom an agent may observe. */
275
+ symptom: string;
276
+ /** Recovery guidance for the symptom. */
277
+ resolution?: string;
278
+ }
249
279
  interface PageAgentFrontmatter {
250
280
  /**
251
281
  * Approximate output token target for machine-readable compaction on this page.
252
282
  * Used by `docs agent compact` as a per-page override.
253
283
  */
254
284
  tokenBudget?: number;
285
+ /** Concrete task the page helps an agent complete. */
286
+ task?: string;
287
+ /** Observable end state the agent should reach. */
288
+ outcome?: string;
289
+ /** Framework, version, and package applicability constraints. */
290
+ appliesTo?: PageAgentAppliesTo;
291
+ /** Conditions or setup that must already be true. */
292
+ prerequisites?: string[];
293
+ /** Files the task is expected to read or change. */
294
+ files?: string[];
295
+ /** Commands the task may require. Strings are supported as a concise shorthand. */
296
+ commands?: Array<string | PageAgentCommand>;
297
+ /** Material state changes or external effects the task can cause. */
298
+ sideEffects?: string[];
299
+ /** Checks that prove the task completed successfully. */
300
+ verification?: Array<string | PageAgentVerification>;
301
+ /** Steps that restore the previous state when the task must be undone. */
302
+ rollback?: string[];
303
+ /** Common symptoms and optional recovery guidance. */
304
+ failureModes?: Array<string | PageAgentFailureMode>;
255
305
  }
256
306
  interface PageSidebarFrontmatter {
257
307
  /**
@@ -1133,6 +1183,10 @@ interface DocsMcpToolsConfig {
1133
1183
  listPages?: boolean;
1134
1184
  /** Expose a `read_page` tool that returns a page by slug or URL path. */
1135
1185
  readPage?: boolean;
1186
+ /** Expose a `list_tasks` tool for pages with actionable agent contracts. */
1187
+ listTasks?: boolean;
1188
+ /** Expose a `read_task` tool that returns a page's full agent contract. */
1189
+ readTask?: boolean;
1136
1190
  /** Expose a `search_docs` tool for keyword search over page content. */
1137
1191
  searchDocs?: boolean;
1138
1192
  /** Expose a `get_navigation` tool for the docs tree. */
@@ -1141,6 +1195,65 @@ interface DocsMcpToolsConfig {
1141
1195
  getCodeExamples?: boolean;
1142
1196
  /** Expose a `get_config_schema` tool for docs.config option metadata. */
1143
1197
  getConfigSchema?: boolean;
1198
+ /** Expose deterministic `get_context` retrieval with a conservative UTF-8 byte ceiling. */
1199
+ getContext?: boolean;
1200
+ }
1201
+ /** Authenticated identity returned by an MCP authentication callback. */
1202
+ interface DocsMcpAuthPrincipal {
1203
+ /** Stable identifier for the authenticated user, service, or agent. */
1204
+ id: string;
1205
+ /** Optional authorization scopes that source adapters can inspect. */
1206
+ scopes?: string[];
1207
+ /** Additional application-specific identity claims. */
1208
+ claims?: Record<string, unknown>;
1209
+ }
1210
+ /** Context passed to an MCP Origin policy callback. */
1211
+ interface DocsMcpOriginContext {
1212
+ /** Origin header supplied by the HTTP client. */
1213
+ origin: string;
1214
+ /** Portable Web Request for the incoming MCP request. */
1215
+ request: Request;
1216
+ }
1217
+ /** Context passed to an opt-in MCP authentication callback. */
1218
+ interface DocsMcpAuthenticateContext {
1219
+ /** Portable Web Request for the incoming MCP request. */
1220
+ request: Request;
1221
+ /** Normalized pathname of the MCP endpoint being requested. */
1222
+ pathname: string;
1223
+ }
1224
+ type DocsMcpAllowedOrigins = "same-origin" | readonly string[] | ((context: DocsMcpOriginContext) => boolean | Promise<boolean>);
1225
+ type DocsMcpAuthenticateResult = DocsMcpAuthPrincipal | null | Response;
1226
+ type DocsMcpAuthenticate = (context: DocsMcpAuthenticateContext) => DocsMcpAuthenticateResult | Promise<DocsMcpAuthenticateResult>;
1227
+ /** Browser CORS response controls for an Origin already accepted by `allowedOrigins`. */
1228
+ interface DocsMcpCorsConfig {
1229
+ /** Additional request headers accepted during browser preflight. */
1230
+ allowedHeaders?: readonly string[];
1231
+ /** Additional response headers exposed to browser clients. */
1232
+ exposedHeaders?: readonly string[];
1233
+ /** Emit `Access-Control-Allow-Credentials: true`. Defaults to `false`. */
1234
+ allowCredentials?: boolean;
1235
+ /** Browser preflight cache lifetime in seconds. Defaults to 600. */
1236
+ maxAgeSeconds?: number;
1237
+ }
1238
+ /** Security controls for the Streamable HTTP MCP transport. */
1239
+ interface DocsMcpSecurityConfig {
1240
+ /**
1241
+ * Allowed values for a supplied HTTP Origin header.
1242
+ * Defaults to `"same-origin"`. Requests without Origin remain supported for non-browser clients.
1243
+ */
1244
+ allowedOrigins?: DocsMcpAllowedOrigins;
1245
+ /**
1246
+ * Optional authentication callback. HTTP MCP stays public when omitted. When present,
1247
+ * returning `null` rejects the request with 401 and returning a Response passes it through.
1248
+ */
1249
+ authenticate?: DocsMcpAuthenticate;
1250
+ /** Maximum POST body size in bytes. Defaults to 1 MiB. */
1251
+ maxBodyBytes?: number;
1252
+ /**
1253
+ * CORS responses for accepted browser Origins. Defaults to enabled with exact-Origin responses;
1254
+ * set `false` to suppress CORS headers or use an object for credential/header controls.
1255
+ */
1256
+ cors?: boolean | DocsMcpCorsConfig;
1144
1257
  }
1145
1258
  /**
1146
1259
  * Built-in MCP server configuration.
@@ -1169,6 +1282,8 @@ interface DocsMcpConfig {
1169
1282
  version?: string;
1170
1283
  /** Fine-grained tool toggles. Omitted tools stay enabled. */
1171
1284
  tools?: DocsMcpToolsConfig;
1285
+ /** Streamable HTTP security controls. Authentication is opt-in; stdio is unaffected. */
1286
+ security?: DocsMcpSecurityConfig;
1172
1287
  }
1173
1288
  type DocsSearchResultType = "page" | "heading" | "text";
1174
1289
  interface DocsSearchSourcePage {
@@ -1177,6 +1292,7 @@ interface DocsSearchSourcePage {
1177
1292
  content: string;
1178
1293
  description?: string;
1179
1294
  related?: ResolvedDocsRelatedLink[];
1295
+ agent?: PageAgentFrontmatter;
1180
1296
  sourcePath?: string;
1181
1297
  lastModified?: string;
1182
1298
  lastmod?: string;
@@ -2261,7 +2377,7 @@ interface DocsReviewRulesConfig {
2261
2377
  codeFenceMetadata?: DocsReviewSeverity;
2262
2378
  /** Check runnable command/code fences for package manager context. */
2263
2379
  runnableMetadata?: DocsReviewSeverity;
2264
- /** Suggest machine-facing context for implementation-heavy pages. */
2380
+ /** Validate structured page agent contracts and suggest context for implementation-heavy pages. */
2265
2381
  agentContext?: DocsReviewSeverity;
2266
2382
  }
2267
2383
  interface DocsReviewScoreConfig {
@@ -2962,4 +3078,4 @@ interface DocsConfig {
2962
3078
  og?: OGConfig;
2963
3079
  }
2964
3080
  //#endregion
2965
- export { DocsObservabilityEvent as $, ReadingTimeFormat as $t, DocsAskAIMcpConfig as A, FeedbackConfig as At, DocsCodeBlocksRunnerProvider as B, OpenDocsConfig as Bt, DocsAnalyticsSource as C, DocsTelemetryConfig as Ct, DocsAskAIFeedbackData as D, DocsTelemetryFeatures as Dt, DocsAskAIFeedbackConfig as E, DocsTelemetryEventType as Et, DocsCloudPublishConfig as F, LlmsTxtMaxCharsConfig as Ft, DocsFeedbackData as G, OpenGraphImage as Gt, DocsCodeBlocksValidationMode as H, OpenDocsProviderConfig as Ht, DocsCodeBlocksConfig as I, LlmsTxtMaxCharsMode as It, DocsMcpConfig as J, PageFrontmatter as Jt, DocsFeedbackValue as K, OrderingItem as Kt, DocsCodeBlocksPlannerConfig as L, LlmsTxtSectionConfig as Lt, DocsCloudConfig as M, GithubConfig as Mt, DocsCloudFeatureConfig as N, LastUpdatedConfig as Nt, DocsAskAIFeedbackMessage as O, DocsTelemetryFramework as Ot, DocsCloudPreviewConfig as P, LlmsTxtConfig as Pt, DocsObservabilityConfig as Q, ReadingTimeConfig as Qt, DocsCodeBlocksPlannerProvider as R, McpDocsSearchConfig as Rt, DocsAnalyticsInput as S, DocsTelemetryAgentSurface as St, DocsAskAIActionType as T, DocsTelemetryEventInput as Tt, DocsCodeBlocksValidationPolicy as U, OpenDocsProviderId as Ut, DocsCodeBlocksValidateConfig as V, OpenDocsProvider as Vt, DocsConfig as W, OpenDocsTarget as Wt, DocsMetadata as X, PageSidebarFrontmatter as Xt, DocsMcpToolsConfig as Y, PageOpenGraph as Yt, DocsNav as Z, PageTwitter as Zt, DocsAgentTraceStatus as _, DocsSearchQuery as _t, ApiReferenceRenderer as a, SidebarNode as an, DocsReviewRulesConfig as at, DocsAnalyticsEventInput as b, DocsSearchSourcePage as bt, ChangelogFrontmatter as c, SimpleDocsSearchConfig as cn, DocsRobotsConfig as ct, CopyMarkdownFormat as d, TypographyConfig as dn, DocsSearchAdapterContext as dt, ResolvedDocsRelatedLink as en, DocsObservabilityEventInput as et, CustomDocsSearchConfig as f, UIConfig as fn, DocsSearchAdapterFactory as ft, DocsAgentTraceEventType as g, DocsSearchEmbeddingsConfig as gt, DocsAgentTraceEventInput as h, DocsSearchDocument as ht, ApiReferenceConfig as i, SidebarFolderNode as in, DocsReviewConfig as it, DocsCloudApiKeyConfig as j, FontStyle as jt, DocsAskAIFeedbackValue as k, DocsTheme as kt, CodeBlockCopyData as l, ThemeToggleConfig as ln, DocsRobotsRule as lt, DocsAgentFeedbackData as m, DocsSearchConfig as mt, AgentFeedbackConfig as n, SidebarConfig as nn, DocsReviewCiConfig as nt, BreadcrumbConfig as o, SidebarPageNode as on, DocsReviewScoreConfig as ot, DocsAgentFeedbackContext as p, DocsSearchChunkingConfig as pt, DocsI18nConfig as q, PageActionsConfig as qt, AlgoliaDocsSearchConfig as r, SidebarFolderIndexBehavior as rn, DocsReviewCiMode as rt, ChangelogConfig as s, SidebarTree as sn, DocsReviewSeverity as st, AIConfig as t, SidebarComponentProps as tn, DocsRelatedItem as tt, CopyMarkdownConfig as u, TypesenseDocsSearchConfig as un, DocsSearchAdapter as ut, DocsAnalyticsConfig as v, DocsSearchResult as vt, DocsAskAIActionData as w, DocsTelemetryEvent as wt, DocsAnalyticsEventType as x, DocsSitemapConfig as xt, DocsAnalyticsEvent as y, DocsSearchResultType as yt, DocsCodeBlocksRunnerConfig as z, OGConfig as zt };
3081
+ export { DocsMcpConfig as $, OpenGraphImage as $t, DocsAskAIMcpConfig as A, DocsTelemetryAgentSurface as At, DocsCodeBlocksRunnerProvider as B, GithubConfig as Bt, DocsAnalyticsSource as C, TypesenseDocsSearchConfig as Cn, DocsSearchDocument as Ct, DocsAskAIFeedbackData as D, DocsSearchResultType as Dt, DocsAskAIFeedbackConfig as E, DocsSearchResult as Et, DocsCloudPublishConfig as F, DocsTelemetryFeatures as Ft, DocsFeedbackData as G, LlmsTxtSectionConfig as Gt, DocsCodeBlocksValidationMode as H, LlmsTxtConfig as Ht, DocsCodeBlocksConfig as I, DocsTelemetryFramework as It, DocsMcpAllowedOrigins as J, OpenDocsConfig as Jt, DocsFeedbackValue as K, McpDocsSearchConfig as Kt, DocsCodeBlocksPlannerConfig as L, DocsTheme as Lt, DocsCloudConfig as M, DocsTelemetryEvent as Mt, DocsCloudFeatureConfig as N, DocsTelemetryEventInput as Nt, DocsAskAIFeedbackMessage as O, DocsSearchSourcePage as Ot, DocsCloudPreviewConfig as P, DocsTelemetryEventType as Pt, DocsMcpAuthenticateResult as Q, OpenDocsTarget as Qt, DocsCodeBlocksPlannerProvider as R, FeedbackConfig as Rt, DocsAnalyticsInput as S, ThemeToggleConfig as Sn, DocsSearchConfig as St, DocsAskAIActionType as T, UIConfig as Tn, DocsSearchQuery as Tt, DocsCodeBlocksValidationPolicy as U, LlmsTxtMaxCharsConfig as Ut, DocsCodeBlocksValidateConfig as V, LastUpdatedConfig as Vt, DocsConfig as W, LlmsTxtMaxCharsMode as Wt, DocsMcpAuthenticate as X, OpenDocsProviderConfig as Xt, DocsMcpAuthPrincipal as Y, OpenDocsProvider as Yt, DocsMcpAuthenticateContext as Z, OpenDocsProviderId as Zt, DocsAgentTraceStatus as _, SidebarFolderNode as _n, DocsRobotsRule as _t, ApiReferenceRenderer as a, PageAgentFrontmatter as an, DocsNav as at, DocsAnalyticsEventInput as b, SidebarTree as bn, DocsSearchAdapterFactory as bt, ChangelogFrontmatter as c, PageOpenGraph as cn, DocsObservabilityEventInput as ct, CopyMarkdownFormat as d, ReadingTimeConfig as dn, DocsReviewCiMode as dt, OrderingItem as en, DocsMcpCorsConfig as et, CustomDocsSearchConfig as f, ReadingTimeFormat as fn, DocsReviewConfig as ft, DocsAgentTraceEventType as g, SidebarFolderIndexBehavior as gn, DocsRobotsConfig as gt, DocsAgentTraceEventInput as h, SidebarConfig as hn, DocsReviewSeverity as ht, ApiReferenceConfig as i, PageAgentFailureMode as in, DocsMetadata as it, DocsCloudApiKeyConfig as j, DocsTelemetryConfig as jt, DocsAskAIFeedbackValue as k, DocsSitemapConfig as kt, CodeBlockCopyData as l, PageSidebarFrontmatter as ln, DocsRelatedItem as lt, DocsAgentFeedbackData as m, SidebarComponentProps as mn, DocsReviewScoreConfig as mt, AgentFeedbackConfig as n, PageAgentAppliesTo as nn, DocsMcpSecurityConfig as nt, BreadcrumbConfig as o, PageAgentVerification as on, DocsObservabilityConfig as ot, DocsAgentFeedbackContext as p, ResolvedDocsRelatedLink as pn, DocsReviewRulesConfig as pt, DocsI18nConfig as q, OGConfig as qt, AlgoliaDocsSearchConfig as r, PageAgentCommand as rn, DocsMcpToolsConfig as rt, ChangelogConfig as s, PageFrontmatter as sn, DocsObservabilityEvent as st, AIConfig as t, PageActionsConfig as tn, DocsMcpOriginContext as tt, CopyMarkdownConfig as u, PageTwitter as un, DocsReviewCiConfig as ut, DocsAnalyticsConfig as v, SidebarNode as vn, DocsSearchAdapter as vt, DocsAskAIActionData as w, TypographyConfig as wn, DocsSearchEmbeddingsConfig as wt, DocsAnalyticsEventType as x, SimpleDocsSearchConfig as xn, DocsSearchChunkingConfig as xt, DocsAnalyticsEvent as y, SidebarPageNode as yn, DocsSearchAdapterContext as yt, DocsCodeBlocksRunnerConfig as z, FontStyle as zt };
@@ -1,5 +1,5 @@
1
- import { c as fileExists, o as exec } from "./utils-D-xTRNuh.mjs";
2
- import { a as getPackagesForFramework, c as resolveDocsPackageManager, i as frameworkFromPreset, l as validateUpgradeVersion, n as PRESETS, o as presetFromFramework, r as buildDocsPackageInstallCommand, s as resolveDocsPackageFramework, t as PACKAGES_BY_FRAMEWORK } from "./package-version-C8PigBZk.mjs";
1
+ import { c as fileExists, o as exec } from "./utils-CMZTjRQT.mjs";
2
+ import { a as getPackagesForFramework, c as resolveDocsPackageManager, i as frameworkFromPreset, l as validateUpgradeVersion, n as PRESETS, o as presetFromFramework, r as buildDocsPackageInstallCommand, s as resolveDocsPackageFramework, t as PACKAGES_BY_FRAMEWORK } from "./package-version-DxnTZH4m.mjs";
3
3
  import path from "node:path";
4
4
  import pc from "picocolors";
5
5
  import * as p from "@clack/prompts";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@farming-labs/docs",
3
- "version": "0.2.52",
3
+ "version": "0.2.53",
4
4
  "description": "Modern, flexible MDX-based docs framework — core types, config, and CLI",
5
5
  "keywords": [
6
6
  "docs",
@@ -1,9 +0,0 @@
1
- import "./reading-time-CPAy1SWO.mjs";
2
- import "./agent-CaOBIVFy.mjs";
3
- import "./search-BWuU70B0.mjs";
4
- import "./robots-XVPs9lVz.mjs";
5
- import "./sitemap-server-xEHtDUDB.mjs";
6
- import "./config-tiQCZ46q.mjs";
7
- import { a as readPageTokenBudget, i as printAgentCompactHelp, n as inspectAgentCompactionState, o as scanDocsPageTargets, r as parseAgentCompactArgs, t as compactAgentDocs } from "./codeblocks-z9iT794h.mjs";
8
-
9
- export { compactAgentDocs, parseAgentCompactArgs, printAgentCompactHelp };
File without changes