Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,15 @@
},
"main": "dist/index.js",
"bin": {
"atlas": "dist/atlas-cli.js",
"pathfinder": "dist/cli.js"
},
"publishConfig": {
"access": "public"
},
"scripts": {
"build": "tsc",
"prepublishOnly": "npm run build",
"start": "node dist/index.js",
"dev": "tsx watch src/index.ts",
"seed-index": "tsx scripts/seed-index.ts",
Expand Down
23 changes: 23 additions & 0 deletions pathfinder.example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,19 @@ sources:
# target_tokens: 600
# overlap_tokens: 50

# ── Atlas source (agent-facing codebase knowledge cache) ──
# Seed knowledge is durable; generated Atlas pages are disposable Pathfinder cache.
# - name: atlas
# type: atlas
# seed_path: .pathfinder/atlas/seed
# cache_namespace: my-project
# repositories:
# - repo_url: https://github.com/your-org/your-repo.git
# refs: ["main"]
# chunk:
# target_tokens: 800
# overlap_tokens: 80

# ── Slack source (requires SLACK_BOT_TOKEN + OPENAI_API_KEY) ──
# - name: community
# type: slack
Expand Down Expand Up @@ -121,6 +134,16 @@ tools:
# description: "Browse and search community Q&A"
# sources: [community]

# ── Atlas search tool ──
# - name: atlas-search
# type: search
# description: "Search Atlas codebase knowledge."
# source: atlas
# default_limit: 5
# max_limit: 20
# result_format: raw
# search_mode: hybrid

# Required for search tools (omit for bash-only mode)
embedding:
provider: openai
Expand Down
19 changes: 19 additions & 0 deletions src/__tests__/analytics-endpoints.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,25 @@ describe("analyticsAuth middleware", () => {
expect(next).not.toHaveBeenCalled();
});

it("returns 503 when root config read fails before auth options are built", () => {
mockGetConfigFn.mockImplementation(() => {
throw new Error("bad root config");
});
const res = mockRes();
const next = vi.fn();
const consoleSpy = vi.spyOn(console, "error").mockImplementation(() => {});

analyticsAuth({ headers: {} } as never, res as never, next);

expect(res.status).toHaveBeenCalledWith(503);
expect(res.json).toHaveBeenCalledWith({
error: "misconfigured",
error_description: "Analytics config read failed",
});
expect(next).not.toHaveBeenCalled();
consoleSpy.mockRestore();
});

it("auto-generates token, logs only a fingerprint, and requires auth", () => {
mockGetAnalyticsConfigFn.mockReturnValue({
enabled: true,
Expand Down
Loading