@agentskit/doc-bridge 1.0.2 → 1.2.1

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 (80) hide show
  1. package/CHANGELOG.md +50 -0
  2. package/CONTRIBUTING.md +8 -0
  3. package/README.md +114 -17
  4. package/SECURITY.md +1 -1
  5. package/action.yml +23 -26
  6. package/dist/cli/program.js +1241 -309
  7. package/dist/cli/program.js.map +1 -1
  8. package/dist/config/index.d.ts +1 -1
  9. package/dist/config/index.js +338 -13
  10. package/dist/config/index.js.map +1 -1
  11. package/dist/{index-CPUJbTbg.d.ts → index-DGI9TBLE.d.ts} +906 -11
  12. package/dist/index.d.ts +65 -11
  13. package/dist/index.js +1084 -171
  14. package/dist/index.js.map +1 -1
  15. package/docs/DOGFOOD-ROUND2.md +5 -0
  16. package/docs/DOGFOOD-ROUND3.md +5 -0
  17. package/docs/DOGFOOD-V1.md +5 -0
  18. package/docs/DOGFOOD.md +5 -0
  19. package/docs/MARKETPLACE-ECOSYSTEM-PLAN.md +16 -0
  20. package/docs/MARKETPLACE.md +39 -0
  21. package/docs/POSITIONING.md +5 -0
  22. package/docs/RELEASE.md +26 -19
  23. package/docs/agent-corpus/INDEX.md +10 -0
  24. package/docs/agent-corpus/OVERVIEW.md +9 -0
  25. package/docs/agent-corpus/chat.md +10 -0
  26. package/docs/agent-corpus/cli.md +10 -0
  27. package/docs/agent-corpus/conformance.md +10 -0
  28. package/docs/agent-corpus/doc-bridge.md +10 -0
  29. package/docs/agent-corpus/doctor.md +10 -0
  30. package/docs/agent-corpus/gates.md +10 -0
  31. package/docs/agent-corpus/mcp.md +10 -0
  32. package/docs/agent-corpus/memory.md +10 -0
  33. package/docs/agent-corpus/query.md +10 -0
  34. package/docs/chat-and-rag.md +34 -0
  35. package/docs/examples.md +5 -0
  36. package/docs/for-agents.md +31 -0
  37. package/docs/getting-started.md +32 -2
  38. package/docs/index.md +23 -0
  39. package/docs/landing/assets/doc-bridge-hero.webp +0 -0
  40. package/docs/landing/assets/doc-bridge-surfaces.webp +0 -0
  41. package/docs/landing/assets/doc-bridge-two-way.webp +0 -0
  42. package/docs/landing/index.html +70 -10
  43. package/docs/mcp.md +5 -0
  44. package/docs/meta.json +20 -0
  45. package/docs/ollama-demo.md +6 -1
  46. package/docs/playbook/doc-bridge-pattern.md +4 -2
  47. package/docs/query.md +34 -0
  48. package/docs/recipes/index-pipeline.md +7 -2
  49. package/docs/schemas/agent-handoff-v1.md +5 -0
  50. package/docs/schemas/doc-bridge-index-v1.md +5 -0
  51. package/docs/schemas/memory-candidate-v1.md +15 -1
  52. package/docs/skills/doc-bridge.md +6 -1
  53. package/docs/spec/cli.md +6 -0
  54. package/docs/spec/config-v1.md +56 -6
  55. package/docs/spec/documentation-standard-v1.md +136 -0
  56. package/docs/spec/playbook-feedback.md +5 -0
  57. package/docs/spec/registry-agents.md +5 -0
  58. package/ecosystem-claims.json +187 -0
  59. package/ecosystem-upstream.json +9 -0
  60. package/ecosystem.json +235 -0
  61. package/examples/verify-handoff.mjs +5 -0
  62. package/package.json +46 -4
  63. package/scripts/check-ecosystem-upstream.mjs +50 -0
  64. package/src/cli/program.ts +36 -3
  65. package/src/config/index.ts +7 -1
  66. package/src/config/load-config.ts +4 -14
  67. package/src/config/schema.ts +91 -0
  68. package/src/conformance/documentation-standard-v1.ts +502 -0
  69. package/src/conformance/ecosystem-contract.ts +175 -0
  70. package/src/gates/run-gates.ts +33 -4
  71. package/src/index-builder/human-adapters/core.ts +12 -5
  72. package/src/index-builder/human-adapters/docusaurus.ts +29 -44
  73. package/src/index-builder/human-adapters/index.ts +15 -3
  74. package/src/index-builder/scan-corpus.ts +6 -6
  75. package/src/index.ts +17 -0
  76. package/src/lib/bounded-text.ts +25 -0
  77. package/src/lib/paths.ts +20 -2
  78. package/src/lib/static-js-literal.ts +261 -0
  79. package/src/lib/walk.ts +23 -4
  80. package/src/version.ts +1 -1
package/src/lib/walk.ts CHANGED
@@ -1,19 +1,34 @@
1
- import { readdirSync, statSync } from 'node:fs'
1
+ import { lstatSync, readdirSync, realpathSync } from 'node:fs'
2
2
  import { join } from 'node:path'
3
3
 
4
4
  import { toPosix } from './paths.js'
5
5
 
6
6
  const DEFAULT_SKIP = new Set(['node_modules', '.git', 'dist', 'coverage', '.doc-bridge'])
7
+ const DEFAULT_MAX_FILES = 10_000
7
8
 
8
9
  export const walkFiles = (
9
10
  root: string,
10
- opts?: { readonly extensions?: readonly string[]; readonly skipDirs?: ReadonlySet<string> },
11
+ opts?: {
12
+ readonly extensions?: readonly string[]
13
+ readonly skipDirs?: ReadonlySet<string>
14
+ readonly maxFiles?: number
15
+ },
11
16
  ): string[] => {
12
17
  const extensions = opts?.extensions ?? ['.md']
13
18
  const skip = opts?.skipDirs ?? DEFAULT_SKIP
14
19
  const out: string[] = []
20
+ const visited = new Set<string>()
15
21
 
16
22
  const visit = (dir: string) => {
23
+ let canonicalDir: string
24
+ try {
25
+ canonicalDir = realpathSync.native(dir)
26
+ } catch {
27
+ return
28
+ }
29
+ if (visited.has(canonicalDir)) return
30
+ visited.add(canonicalDir)
31
+
17
32
  let entries: string[] = []
18
33
  try {
19
34
  entries = readdirSync(dir)
@@ -24,10 +39,11 @@ export const walkFiles = (
24
39
  const abs = join(dir, name)
25
40
  let st
26
41
  try {
27
- st = statSync(abs)
42
+ st = lstatSync(abs)
28
43
  } catch {
29
44
  continue
30
45
  }
46
+ if (st.isSymbolicLink()) continue
31
47
  if (st.isDirectory()) {
32
48
  if (skip.has(name)) continue
33
49
  visit(abs)
@@ -35,6 +51,9 @@ export const walkFiles = (
35
51
  }
36
52
  if (!st.isFile()) continue
37
53
  if (extensions.some((ext) => name.endsWith(ext))) {
54
+ if (out.length >= (opts?.maxFiles ?? DEFAULT_MAX_FILES)) {
55
+ throw new Error(`Documentation corpus exceeds the ${opts?.maxFiles ?? DEFAULT_MAX_FILES} file limit.`)
56
+ }
38
57
  out.push(toPosix(abs))
39
58
  }
40
59
  }
@@ -42,4 +61,4 @@ export const walkFiles = (
42
61
 
43
62
  visit(root)
44
63
  return out.sort()
45
- }
64
+ }
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const PACKAGE_VERSION = '1.0.2'
1
+ export const PACKAGE_VERSION = '1.2.1'