pi-harness-runtime 0.9.22 → 0.10.0
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.
- package/CHANGELOG.md +49 -7
- package/README.md +51 -51
- package/footer-status.ts +84 -44
- package/harness/auto-compact.ts +1 -1
- package/harness/auto-quota-resume.ts +15 -12
- package/harness/autonomous-review.ts +88 -0
- package/harness/context-compact-orchestrator.ts +23 -23
- package/harness/context-window-manager.ts +5 -5
- package/harness/continue-prompt.ts +3 -3
- package/harness/e2e/minimax-quota-scraper.ts +10 -10
- package/harness/e2e/openai-quota-scraper.ts +442 -0
- package/harness/forked-summarizer.ts +4 -4
- package/harness/herdr-agents.ts +91 -0
- package/harness/index.ts +5 -5
- package/harness/loop-code-agent.ts +284 -0
- package/harness/loop-controller.ts +201 -0
- package/harness/loop-review-agent.ts +295 -0
- package/harness/loop-runtime.ts +21 -17
- package/harness/loop-types.ts +118 -0
- package/harness/notification-events.ts +3 -3
- package/harness/output-limit-handler.ts +1 -1
- package/harness/partial-recovery.ts +3 -3
- package/harness/session-memory.ts +5 -5
- package/index.ts +211 -80
- package/package.json +2 -2
- package/packages/a2a-adapter/package.json +1 -1
- package/packages/a2a-adapter/src/types.ts +5 -5
- package/packages/auth/dist/minimax-browser-auth.d.ts +89 -0
- package/packages/auth/dist/minimax-browser-auth.d.ts.map +1 -0
- package/packages/auth/dist/minimax-browser-auth.js +890 -0
- package/packages/auth/dist/minimax-browser-auth.js.map +1 -0
- package/packages/auth/dist/run-minimax-auth.d.ts +19 -0
- package/packages/auth/dist/run-minimax-auth.d.ts.map +1 -0
- package/packages/auth/dist/run-minimax-auth.js +112 -0
- package/packages/auth/dist/run-minimax-auth.js.map +1 -0
- package/packages/auth/package.json +1 -1
- package/packages/auth/tsconfig.json +9 -0
- package/packages/autonomous-refactor/package.json +1 -1
- package/packages/autonomous-runtime/dist/inbox.d.ts +3 -3
- package/packages/autonomous-runtime/dist/inbox.js +12 -12
- package/packages/autonomous-runtime/dist/lease.js +14 -14
- package/packages/autonomous-runtime/dist/types.js +1 -1
- package/packages/autonomous-runtime/package.json +1 -1
- package/packages/autonomous-runtime/src/inbox.ts +12 -12
- package/packages/autonomous-runtime/src/lease.ts +15 -15
- package/packages/autonomous-runtime/src/types.ts +13 -13
- package/packages/autonomous-runtime/tsconfig.tsbuildinfo +1 -1
- package/packages/cache-strategy/package.json +1 -1
- package/packages/capability-registry/dist/types.js +1 -1
- package/packages/capability-registry/package.json +1 -1
- package/packages/capability-registry/src/types.ts +5 -5
- package/packages/checkpoint/README.md +6 -6
- package/packages/checkpoint/dist/differ.js +2 -2
- package/packages/checkpoint/dist/engine.js +3 -3
- package/packages/checkpoint/dist/index.js +5 -5
- package/packages/checkpoint/dist/storage.js +3 -3
- package/packages/checkpoint/dist/types.js +1 -1
- package/packages/checkpoint/package.json +1 -1
- package/packages/checkpoint/src/differ.ts +2 -2
- package/packages/checkpoint/src/engine.ts +3 -3
- package/packages/checkpoint/src/index.ts +5 -5
- package/packages/checkpoint/src/storage.ts +3 -3
- package/packages/checkpoint/src/types.ts +10 -10
- package/packages/checkpoint/tsconfig.tsbuildinfo +1 -1
- package/packages/cli-plugin-sdk/package.json +1 -1
- package/packages/clipboard/dist/src/clipboard.d.ts.map +1 -1
- package/packages/clipboard/dist/src/clipboard.js +15 -7
- package/packages/clipboard/dist/src/clipboard.js.map +1 -1
- package/packages/clipboard/package.json +1 -1
- package/packages/clipboard/src/clipboard.ts +16 -9
- package/packages/code-generation/README.md +13 -13
- package/packages/code-generation/dist/faker.js +4 -4
- package/packages/code-generation/dist/generator.js +3 -3
- package/packages/code-generation/dist/index.js +3 -3
- package/packages/code-generation/dist/templates/registry.js +1 -1
- package/packages/code-generation/dist/types.js +1 -1
- package/packages/code-generation/package.json +1 -1
- package/packages/code-generation/src/faker.ts +5 -5
- package/packages/code-generation/src/generator.ts +4 -4
- package/packages/code-generation/src/index.ts +3 -3
- package/packages/code-generation/src/templates/registry.ts +1 -1
- package/packages/code-generation/src/types.ts +10 -10
- package/packages/code-generation/tsconfig.tsbuildinfo +1 -1
- package/packages/code-review/README.md +13 -13
- package/packages/code-review/dist/engine.js +3 -3
- package/packages/code-review/dist/index.js +3 -3
- package/packages/code-review/dist/types.js +1 -1
- package/packages/code-review/package.json +1 -1
- package/packages/code-review/src/engine.ts +3 -3
- package/packages/code-review/src/index.ts +3 -3
- package/packages/code-review/src/types.ts +10 -10
- package/packages/code-review/tsconfig.tsbuildinfo +1 -1
- package/packages/codex-adapter/package.json +1 -1
- package/packages/context-compiler/dist/compiler.js +1 -1
- package/packages/context-compiler/package.json +1 -1
- package/packages/context-compiler/src/compiler.ts +1 -1
- package/packages/context-compiler/src/types.ts +11 -11
- package/packages/context-compiler/test/context-compiler.test.ts +11 -11
- package/packages/context-discovery/package.json +1 -1
- package/packages/context-manager/package.json +1 -1
- package/packages/cookie-sanitizer/README.md +27 -27
- package/packages/cookie-sanitizer/package.json +1 -1
- package/packages/cost-optimizer/package.json +1 -1
- package/packages/cost-optimizer/src/types.ts +5 -5
- package/packages/dependency-analyzer/package.json +1 -1
- package/packages/django-plugin/dist/analyzer.js +7 -7
- package/packages/django-plugin/package.json +1 -1
- package/packages/django-plugin/src/analyzer.ts +7 -7
- package/packages/doc-generator/package.json +1 -1
- package/packages/evaluation-engine/dist/engine.js +9 -9
- package/packages/evaluation-engine/package.json +1 -1
- package/packages/evaluation-engine/src/engine.ts +9 -9
- package/packages/evaluation-engine/src/types.ts +3 -3
- package/packages/evaluation-runner/package.json +1 -1
- package/packages/event-bus/dist/src/herdr-bus.d.ts +121 -0
- package/packages/event-bus/dist/src/herdr-bus.d.ts.map +1 -0
- package/packages/event-bus/dist/src/herdr-bus.js +322 -0
- package/packages/event-bus/dist/src/herdr-bus.js.map +1 -0
- package/packages/event-bus/dist/src/index.d.ts +2 -0
- package/packages/event-bus/dist/src/index.d.ts.map +1 -1
- package/packages/event-bus/dist/src/index.js +1 -0
- package/packages/event-bus/dist/src/index.js.map +1 -1
- package/packages/event-bus/package.json +1 -1
- package/packages/event-bus/src/herdr-bus.ts +525 -0
- package/packages/event-bus/src/index.ts +29 -0
- package/packages/event-store/package.json +1 -1
- package/packages/experience-replay/dist/replay.js +7 -7
- package/packages/experience-replay/package.json +1 -1
- package/packages/experience-replay/src/replay.ts +7 -7
- package/packages/experience-replay/src/types.ts +5 -5
- package/packages/feedback-collector/package.json +1 -1
- package/packages/framework-detector/README.md +18 -18
- package/packages/framework-detector/dist/detector.js +3 -3
- package/packages/framework-detector/dist/index.js +3 -3
- package/packages/framework-detector/dist/signatures/registry.js +24 -24
- package/packages/framework-detector/dist/types.js +1 -1
- package/packages/framework-detector/package.json +1 -1
- package/packages/framework-detector/src/detector.ts +3 -3
- package/packages/framework-detector/src/index.ts +3 -3
- package/packages/framework-detector/src/signatures/registry.ts +24 -24
- package/packages/framework-detector/src/types.ts +7 -7
- package/packages/framework-detector/tsconfig.tsbuildinfo +1 -1
- package/packages/framework-plugin-sdk/README.md +23 -23
- package/packages/framework-plugin-sdk/dist/index.js +2 -2
- package/packages/framework-plugin-sdk/dist/manager.js +3 -3
- package/packages/framework-plugin-sdk/dist/types.js +2 -2
- package/packages/framework-plugin-sdk/package.json +1 -1
- package/packages/framework-plugin-sdk/src/index.ts +2 -2
- package/packages/framework-plugin-sdk/src/manager.ts +3 -3
- package/packages/framework-plugin-sdk/src/types.ts +10 -10
- package/packages/framework-plugin-sdk/tsconfig.tsbuildinfo +1 -1
- package/packages/frappe-plugin/dist/analyzer.js +8 -8
- package/packages/frappe-plugin/dist/types.js +1 -1
- package/packages/frappe-plugin/package.json +1 -1
- package/packages/frappe-plugin/src/analyzer.ts +8 -8
- package/packages/frappe-plugin/src/types.ts +10 -10
- package/packages/generic-web-plugin/dist/analyzer.js +5 -5
- package/packages/generic-web-plugin/package.json +1 -1
- package/packages/generic-web-plugin/src/analyzer.ts +5 -5
- package/packages/health-monitor/package.json +1 -1
- package/packages/health-monitor/src/monitor.ts +1 -1
- package/packages/intent-analyzer/package.json +1 -1
- package/packages/laravel-plugin/dist/analyzer.js +11 -11
- package/packages/laravel-plugin/package.json +1 -1
- package/packages/laravel-plugin/src/analyzer.ts +11 -11
- package/packages/learning-engine/dist/engine.js +5 -5
- package/packages/learning-engine/dist/types.js +1 -1
- package/packages/learning-engine/package.json +1 -1
- package/packages/learning-engine/src/engine.ts +5 -5
- package/packages/learning-engine/src/types.ts +6 -6
- package/packages/mcp-adapter/package.json +1 -1
- package/packages/memory-engine/dist/engine.js +8 -8
- package/packages/memory-engine/dist/types.js +2 -2
- package/packages/memory-engine/package.json +1 -1
- package/packages/memory-engine/src/engine.ts +8 -8
- package/packages/memory-engine/src/types.ts +9 -9
- package/packages/model-registry/package.json +1 -1
- package/packages/model-registry/src/types.ts +4 -4
- package/packages/nextjs-plugin/dist/analyzer.js +9 -9
- package/packages/nextjs-plugin/package.json +1 -1
- package/packages/nextjs-plugin/src/analyzer.ts +9 -9
- package/packages/notification/dist/notification-center.js +1 -1
- package/packages/notification/package.json +1 -1
- package/packages/notification/src/notification-center.ts +1 -1
- package/packages/observability/dist/alerts.js +2 -2
- package/packages/observability/dist/health.js +4 -4
- package/packages/observability/dist/index.js +6 -6
- package/packages/observability/dist/logger.js +7 -7
- package/packages/observability/dist/metrics.js +11 -11
- package/packages/observability/dist/tracer.js +3 -3
- package/packages/observability/dist/types.js +1 -1
- package/packages/observability/package.json +1 -1
- package/packages/observability/src/alerts.ts +2 -2
- package/packages/observability/src/health.ts +4 -4
- package/packages/observability/src/index.ts +6 -6
- package/packages/observability/src/logger.ts +7 -7
- package/packages/observability/src/metrics.ts +11 -11
- package/packages/observability/src/tracer.ts +3 -3
- package/packages/observability/src/types.ts +7 -7
- package/packages/observability/test/observability.test.ts +4 -4
- package/packages/observability/tsconfig.tsbuildinfo +1 -1
- package/packages/performance-optimizer/dist/optimizer.js +1 -1
- package/packages/performance-optimizer/package.json +1 -1
- package/packages/performance-optimizer/src/optimizer.ts +1 -1
- package/packages/performance-optimizer/src/types.ts +4 -4
- package/packages/privilege-broker/package.json +1 -1
- package/packages/project-analyzer/dist/analyzer.js +4 -4
- package/packages/project-analyzer/dist/index.js +8 -8
- package/packages/project-analyzer/dist/signals.js +3 -3
- package/packages/project-analyzer/dist/types.js +1 -1
- package/packages/project-analyzer/package.json +1 -1
- package/packages/project-analyzer/src/analyzer.ts +4 -4
- package/packages/project-analyzer/src/index.ts +9 -9
- package/packages/project-analyzer/src/signals.ts +4 -4
- package/packages/project-analyzer/src/types.ts +15 -15
- package/packages/project-analyzer/test/index.test.ts +17 -17
- package/packages/project-analyzer/tsconfig.tsbuildinfo +1 -1
- package/packages/projection-engine/package.json +1 -1
- package/packages/prompt-compiler/dist/section-builder.js +1 -1
- package/packages/prompt-compiler/dist/types.js +3 -3
- package/packages/prompt-compiler/package.json +1 -1
- package/packages/prompt-compiler/src/section-builder.ts +1 -1
- package/packages/prompt-compiler/src/types.ts +12 -12
- package/packages/prompt-compiler/test/prompt-compiler.test.ts +12 -12
- package/packages/prompt-versioning/package.json +1 -1
- package/packages/provider-adapter-sdk/dist/builder.js +1 -1
- package/packages/provider-adapter-sdk/dist/index.js +5 -5
- package/packages/provider-adapter-sdk/dist/registry.js +1 -1
- package/packages/provider-adapter-sdk/dist/tester.js +1 -1
- package/packages/provider-adapter-sdk/dist/types.js +1 -1
- package/packages/provider-adapter-sdk/package.json +1 -1
- package/packages/provider-adapter-sdk/src/builder.ts +1 -1
- package/packages/provider-adapter-sdk/src/index.ts +6 -6
- package/packages/provider-adapter-sdk/src/registry.ts +1 -1
- package/packages/provider-adapter-sdk/src/tester.ts +1 -1
- package/packages/provider-adapter-sdk/src/types.ts +5 -5
- package/packages/provider-adapter-sdk/tsconfig.tsbuildinfo +1 -1
- package/packages/provider-router/package.json +1 -1
- package/packages/provider-router/src/types.ts +4 -4
- package/packages/provider-selector/package.json +1 -1
- package/packages/providers/dist/deepagents-adapter.js +1 -1
- package/packages/providers/dist/provider-id.d.ts +5 -0
- package/packages/providers/dist/provider-id.d.ts.map +1 -1
- package/packages/providers/dist/provider-id.js +6 -1
- package/packages/providers/dist/provider-id.js.map +1 -1
- package/packages/providers/package.json +1 -1
- package/packages/providers/src/deepagents-adapter.ts +1 -1
- package/packages/providers/src/provider-id.ts +6 -1
- package/packages/quota-manager/dist/tui-usage-monitor.d.ts.map +1 -1
- package/packages/quota-manager/dist/tui-usage-monitor.js +0 -6
- package/packages/quota-manager/dist/tui-usage-monitor.js.map +1 -1
- package/packages/quota-manager/package.json +1 -1
- package/packages/quota-manager/src/tui-usage-monitor.ts +0 -21
- package/packages/rate-limiter/package.json +1 -1
- package/packages/react-vite-plugin/dist/analyzer.js +7 -7
- package/packages/react-vite-plugin/package.json +1 -1
- package/packages/react-vite-plugin/src/analyzer.ts +7 -7
- package/packages/release-manager/package.json +1 -1
- package/packages/requirement-compiler/dist/compiler.js +17 -17
- package/packages/requirement-compiler/dist/types.js +2 -2
- package/packages/requirement-compiler/package.json +1 -1
- package/packages/requirement-compiler/src/compiler.ts +17 -17
- package/packages/requirement-compiler/src/types.ts +21 -21
- package/packages/requirement-compiler/test/requirement-compiler.test.ts +17 -17
- package/packages/runtime/dist/command-executor.js +1 -1
- package/packages/runtime/dist/local-runtime-agent.js +1 -1
- package/packages/runtime/dist/policy-engine.js +1 -1
- package/packages/runtime/dist/runtime-api.js +1 -1
- package/packages/runtime/dist/workspace-manager.js +1 -1
- package/packages/runtime/package.json +1 -1
- package/packages/runtime/src/command-executor.ts +1 -1
- package/packages/runtime/src/local-runtime-agent.ts +1 -1
- package/packages/runtime/src/policy-engine.ts +1 -1
- package/packages/runtime/src/runtime-api.ts +1 -1
- package/packages/runtime/src/workspace-manager.ts +1 -1
- package/packages/scheduler/package.json +1 -1
- package/packages/scheduler-adapter/package.json +1 -1
- package/packages/session/README.md +18 -18
- package/packages/session/dist/history.js +3 -3
- package/packages/session/dist/index.js +5 -5
- package/packages/session/dist/manager.js +3 -3
- package/packages/session/dist/policy.js +2 -2
- package/packages/session/dist/store.js +2 -2
- package/packages/session/dist/types.js +1 -1
- package/packages/session/package.json +1 -1
- package/packages/session/src/history.ts +3 -3
- package/packages/session/src/index.ts +5 -5
- package/packages/session/src/manager.ts +3 -3
- package/packages/session/src/policy.ts +4 -4
- package/packages/session/src/store.ts +3 -3
- package/packages/session/src/types.ts +10 -10
- package/packages/session/tsconfig.tsbuildinfo +1 -1
- package/packages/session-api/package.json +1 -1
- package/packages/session-export/package.json +1 -1
- package/packages/shared-context/package.json +1 -1
- package/packages/skill-registry/package.json +1 -1
- package/packages/skill-registry/src/types.ts +4 -4
- package/packages/sprint-planner/package.json +1 -1
- package/packages/subscription-engine/package.json +1 -1
- package/packages/task-compiler/dist/compiler.js +7 -7
- package/packages/task-compiler/dist/decompose.js +11 -11
- package/packages/task-compiler/dist/file-scope.js +6 -6
- package/packages/task-compiler/dist/graph.js +6 -6
- package/packages/task-compiler/dist/index.js +2 -2
- package/packages/task-compiler/dist/types.js +5 -5
- package/packages/task-compiler/dist/validate.js +2 -2
- package/packages/task-compiler/dist/verification.js +2 -2
- package/packages/task-compiler/package.json +1 -1
- package/packages/task-compiler/src/command-policy.ts +1 -1
- package/packages/task-compiler/src/compiler.ts +7 -7
- package/packages/task-compiler/src/decompose.ts +11 -11
- package/packages/task-compiler/src/file-scope.ts +6 -6
- package/packages/task-compiler/src/graph.ts +6 -6
- package/packages/task-compiler/src/index.ts +3 -3
- package/packages/task-compiler/src/types.ts +14 -14
- package/packages/task-compiler/src/validate.ts +2 -2
- package/packages/task-compiler/src/verification.ts +2 -2
- package/packages/task-compiler/test/task-compiler.test.ts +10 -10
- package/packages/test-data-generator/README.md +13 -13
- package/packages/test-data-generator/dist/faker-adapter.js +4 -4
- package/packages/test-data-generator/dist/generator.js +3 -3
- package/packages/test-data-generator/dist/index.js +3 -3
- package/packages/test-data-generator/dist/types.js +1 -1
- package/packages/test-data-generator/package.json +1 -1
- package/packages/test-data-generator/src/faker-adapter.ts +4 -4
- package/packages/test-data-generator/src/generator.ts +3 -3
- package/packages/test-data-generator/src/index.ts +3 -3
- package/packages/test-data-generator/src/types.ts +9 -9
- package/packages/test-data-generator/tsconfig.tsbuildinfo +1 -1
- package/packages/test-generator/package.json +1 -1
- package/packages/token-estimation/package.json +1 -1
- package/packages/token-optimizer/package.json +1 -1
- package/packages/tui/package.json +1 -1
- package/packages/types/package.json +1 -1
- package/packages/types/src/agent-worker-types.ts +5 -5
- package/packages/types/src/runtime-types.ts +12 -12
- package/packages/types/tsconfig.tsbuildinfo +1 -1
- package/packages/workflow-events/package.json +1 -1
- package/packages/workspace-scanner/package.json +1 -1
- package/packages/worktree/package.json +1 -1
- package/renderer.ts +7 -7
- package/skills/harness-runtime/SKILL.md +15 -15
- package/packages/dependency-analyzer/dist/analyzer.d.ts +0 -17
- package/packages/dependency-analyzer/dist/analyzer.d.ts.map +0 -1
- package/packages/dependency-analyzer/dist/analyzer.js +0 -106
- package/packages/dependency-analyzer/dist/analyzer.js.map +0 -1
- package/packages/dependency-analyzer/dist/imports.d.ts +0 -12
- package/packages/dependency-analyzer/dist/imports.d.ts.map +0 -1
- package/packages/dependency-analyzer/dist/imports.js +0 -73
- package/packages/dependency-analyzer/dist/imports.js.map +0 -1
- package/packages/dependency-analyzer/dist/index.d.ts +0 -4
- package/packages/dependency-analyzer/dist/index.d.ts.map +0 -1
- package/packages/dependency-analyzer/dist/index.js +0 -3
- package/packages/dependency-analyzer/dist/index.js.map +0 -1
- package/packages/dependency-analyzer/dist/test/analyzer.test.js +0 -37
- package/packages/dependency-analyzer/dist/types.d.ts +0 -28
- package/packages/dependency-analyzer/dist/types.d.ts.map +0 -1
- package/packages/dependency-analyzer/dist/types.js +0 -5
- package/packages/dependency-analyzer/dist/types.js.map +0 -1
- package/packages/intent-analyzer/dist/analyzer.d.ts +0 -13
- package/packages/intent-analyzer/dist/analyzer.d.ts.map +0 -1
- package/packages/intent-analyzer/dist/analyzer.js +0 -72
- package/packages/intent-analyzer/dist/analyzer.js.map +0 -1
- package/packages/intent-analyzer/dist/index.d.ts +0 -3
- package/packages/intent-analyzer/dist/index.d.ts.map +0 -1
- package/packages/intent-analyzer/dist/index.js +0 -2
- package/packages/intent-analyzer/dist/index.js.map +0 -1
- package/packages/intent-analyzer/dist/test/analyzer.test.js +0 -56
- package/packages/intent-analyzer/dist/types.d.ts +0 -26
- package/packages/intent-analyzer/dist/types.d.ts.map +0 -1
- package/packages/intent-analyzer/dist/types.js +0 -7
- package/packages/intent-analyzer/dist/types.js.map +0 -1
- package/packages/workspace-scanner/dist/detect.d.ts +0 -3
- package/packages/workspace-scanner/dist/detect.d.ts.map +0 -1
- package/packages/workspace-scanner/dist/detect.js +0 -58
- package/packages/workspace-scanner/dist/detect.js.map +0 -1
- package/packages/workspace-scanner/dist/git.d.ts +0 -7
- package/packages/workspace-scanner/dist/git.d.ts.map +0 -1
- package/packages/workspace-scanner/dist/git.js +0 -75
- package/packages/workspace-scanner/dist/git.js.map +0 -1
- package/packages/workspace-scanner/dist/index.d.ts +0 -5
- package/packages/workspace-scanner/dist/index.d.ts.map +0 -1
- package/packages/workspace-scanner/dist/index.js +0 -4
- package/packages/workspace-scanner/dist/index.js.map +0 -1
- package/packages/workspace-scanner/dist/scanner.d.ts +0 -11
- package/packages/workspace-scanner/dist/scanner.d.ts.map +0 -1
- package/packages/workspace-scanner/dist/scanner.js +0 -46
- package/packages/workspace-scanner/dist/scanner.js.map +0 -1
- package/packages/workspace-scanner/dist/test/scanner.test.js +0 -34
- package/packages/workspace-scanner/dist/types.d.ts +0 -35
- package/packages/workspace-scanner/dist/types.d.ts.map +0 -1
- package/packages/workspace-scanner/dist/types.js +0 -5
- package/packages/workspace-scanner/dist/types.js.map +0 -1
|
@@ -8,7 +8,7 @@ import * as fs from "node:fs/promises";
|
|
|
8
8
|
import * as path from "node:path";
|
|
9
9
|
import { RESERVED_FILES } from "./types.js";
|
|
10
10
|
import { filterSecrets, AUTHORITY_PRIORITY } from "./types.js";
|
|
11
|
-
//
|
|
11
|
+
// --- YAML Frontmatter Parsing -------------------------------------------------
|
|
12
12
|
function parseFrontmatter(content) {
|
|
13
13
|
const match = content.match(/^---\n([\s\S]*?)\n---\n([\s\S]*)$/);
|
|
14
14
|
if (!match) {
|
|
@@ -62,8 +62,8 @@ function serializeFrontmatter(data) {
|
|
|
62
62
|
}
|
|
63
63
|
return lines.join("\n");
|
|
64
64
|
}
|
|
65
|
-
//
|
|
66
|
-
//
|
|
65
|
+
// --- Concept Parsing --------------------------------------------------------
|
|
66
|
+
// --- Link Extraction ---------------------------------------------------------
|
|
67
67
|
/**
|
|
68
68
|
* Extract markdown links from content
|
|
69
69
|
* Used for link validation and concept parsing
|
|
@@ -81,7 +81,7 @@ export function extractLinks(markdown) {
|
|
|
81
81
|
}
|
|
82
82
|
return links;
|
|
83
83
|
}
|
|
84
|
-
//
|
|
84
|
+
// --- Validation --------------------------------------------------------------
|
|
85
85
|
export function validateConcept(content, path) {
|
|
86
86
|
const errors = [];
|
|
87
87
|
const warnings = [];
|
|
@@ -120,7 +120,7 @@ export function validateConcept(content, path) {
|
|
|
120
120
|
warnings,
|
|
121
121
|
};
|
|
122
122
|
}
|
|
123
|
-
//
|
|
123
|
+
// --- Index Generation ---------------------------------------------------------
|
|
124
124
|
function generateIndex(concepts) {
|
|
125
125
|
const lines = [
|
|
126
126
|
"# Knowledge Index",
|
|
@@ -166,7 +166,7 @@ function generateIndex(concepts) {
|
|
|
166
166
|
}
|
|
167
167
|
return lines.join("\n");
|
|
168
168
|
}
|
|
169
|
-
//
|
|
169
|
+
// --- Search ------------------------------------------------------------------
|
|
170
170
|
function calculateRelevance(concept, query) {
|
|
171
171
|
let score = 0;
|
|
172
172
|
const matchedOn = [];
|
|
@@ -204,7 +204,7 @@ function calculateRelevance(concept, query) {
|
|
|
204
204
|
}
|
|
205
205
|
return score;
|
|
206
206
|
}
|
|
207
|
-
//
|
|
207
|
+
// --- Main Engine -------------------------------------------------------------
|
|
208
208
|
export class MemoryEngine {
|
|
209
209
|
bundle = null;
|
|
210
210
|
ensureBundle() {
|
|
@@ -501,7 +501,7 @@ export class MemoryEngine {
|
|
|
501
501
|
return lines.join("\n");
|
|
502
502
|
}
|
|
503
503
|
}
|
|
504
|
-
//
|
|
504
|
+
// --- Factory -----------------------------------------------------------------
|
|
505
505
|
export function createMemoryEngine() {
|
|
506
506
|
return new MemoryEngine();
|
|
507
507
|
}
|
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Interfaces for OKF-based knowledge management.
|
|
5
5
|
*/
|
|
6
|
-
//
|
|
6
|
+
// --- Reserved Files -----------------------------------------------------------
|
|
7
7
|
export const RESERVED_FILES = ["index.md", "log.md"];
|
|
8
8
|
export function isReservedFile(filename) {
|
|
9
9
|
return RESERVED_FILES.includes(filename);
|
|
10
10
|
}
|
|
11
|
-
//
|
|
11
|
+
// --- Secret Detection ---------------------------------------------------------
|
|
12
12
|
export const SECRET_PATTERNS = [
|
|
13
13
|
/api[_-]?key/i,
|
|
14
14
|
/password/i,
|
|
@@ -22,7 +22,7 @@ import type {
|
|
|
22
22
|
} from "./types.js";
|
|
23
23
|
import { filterSecrets, AUTHORITY_PRIORITY, type Authority } from "./types.js";
|
|
24
24
|
|
|
25
|
-
//
|
|
25
|
+
// --- YAML Frontmatter Parsing -------------------------------------------------
|
|
26
26
|
|
|
27
27
|
function parseFrontmatter(
|
|
28
28
|
content: string,
|
|
@@ -82,9 +82,9 @@ function serializeFrontmatter(data: OkfFrontmatter): string {
|
|
|
82
82
|
return lines.join("\n");
|
|
83
83
|
}
|
|
84
84
|
|
|
85
|
-
//
|
|
85
|
+
// --- Concept Parsing --------------------------------------------------------
|
|
86
86
|
|
|
87
|
-
//
|
|
87
|
+
// --- Link Extraction ---------------------------------------------------------
|
|
88
88
|
|
|
89
89
|
/**
|
|
90
90
|
* Extract markdown links from content
|
|
@@ -106,7 +106,7 @@ export function extractLinks(markdown: string): OkfLink[] {
|
|
|
106
106
|
return links;
|
|
107
107
|
}
|
|
108
108
|
|
|
109
|
-
//
|
|
109
|
+
// --- Validation --------------------------------------------------------------
|
|
110
110
|
|
|
111
111
|
export function validateConcept(
|
|
112
112
|
content: string,
|
|
@@ -155,7 +155,7 @@ export function validateConcept(
|
|
|
155
155
|
};
|
|
156
156
|
}
|
|
157
157
|
|
|
158
|
-
//
|
|
158
|
+
// --- Index Generation ---------------------------------------------------------
|
|
159
159
|
|
|
160
160
|
function generateIndex(concepts: OkfConcept[]): string {
|
|
161
161
|
const lines = [
|
|
@@ -208,7 +208,7 @@ function generateIndex(concepts: OkfConcept[]): string {
|
|
|
208
208
|
return lines.join("\n");
|
|
209
209
|
}
|
|
210
210
|
|
|
211
|
-
//
|
|
211
|
+
// --- Search ------------------------------------------------------------------
|
|
212
212
|
|
|
213
213
|
function calculateRelevance(
|
|
214
214
|
concept: OkfConcept,
|
|
@@ -261,7 +261,7 @@ function calculateRelevance(
|
|
|
261
261
|
return score;
|
|
262
262
|
}
|
|
263
263
|
|
|
264
|
-
//
|
|
264
|
+
// --- Main Engine -------------------------------------------------------------
|
|
265
265
|
|
|
266
266
|
export class MemoryEngine {
|
|
267
267
|
private bundle: KnowledgeBundle | null = null;
|
|
@@ -608,7 +608,7 @@ export class MemoryEngine {
|
|
|
608
608
|
}
|
|
609
609
|
}
|
|
610
610
|
|
|
611
|
-
//
|
|
611
|
+
// --- Factory -----------------------------------------------------------------
|
|
612
612
|
|
|
613
613
|
export function createMemoryEngine(): MemoryEngine {
|
|
614
614
|
return new MemoryEngine();
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Interfaces for OKF-based knowledge management.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
//
|
|
7
|
+
// --- OKF Concept Types ---------------------------------------------------------
|
|
8
8
|
|
|
9
9
|
export interface OkfLink {
|
|
10
10
|
href: string;
|
|
@@ -34,7 +34,7 @@ export interface OkfFrontmatter {
|
|
|
34
34
|
[key: string]: unknown;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
//
|
|
37
|
+
// --- Bundle Types -------------------------------------------------------------
|
|
38
38
|
|
|
39
39
|
export interface KnowledgeBundle {
|
|
40
40
|
path: string;
|
|
@@ -51,7 +51,7 @@ export interface KnowledgeDirectory {
|
|
|
51
51
|
subdirectories: KnowledgeDirectory[];
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
//
|
|
54
|
+
// --- Validation Types ----------------------------------------------------------
|
|
55
55
|
|
|
56
56
|
export interface ValidationError {
|
|
57
57
|
path: string;
|
|
@@ -66,7 +66,7 @@ export interface ValidationResult {
|
|
|
66
66
|
warnings: ValidationError[];
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
-
//
|
|
69
|
+
// --- Search Types -------------------------------------------------------------
|
|
70
70
|
|
|
71
71
|
export interface KnowledgeQuery {
|
|
72
72
|
text?: string;
|
|
@@ -84,7 +84,7 @@ export interface KnowledgeResult {
|
|
|
84
84
|
matchedOn: ("title" | "tags" | "type" | "body" | "authority")[];
|
|
85
85
|
}
|
|
86
86
|
|
|
87
|
-
//
|
|
87
|
+
// --- Write Types --------------------------------------------------------------
|
|
88
88
|
|
|
89
89
|
export interface WriteConceptRequest {
|
|
90
90
|
type: string;
|
|
@@ -96,7 +96,7 @@ export interface WriteConceptRequest {
|
|
|
96
96
|
links?: OkfLink[];
|
|
97
97
|
}
|
|
98
98
|
|
|
99
|
-
//
|
|
99
|
+
// --- Index Types -------------------------------------------------------------
|
|
100
100
|
|
|
101
101
|
export interface KnowledgeIndex {
|
|
102
102
|
concepts: Array<{
|
|
@@ -109,7 +109,7 @@ export interface KnowledgeIndex {
|
|
|
109
109
|
lastUpdated: string;
|
|
110
110
|
}
|
|
111
111
|
|
|
112
|
-
//
|
|
112
|
+
// --- Reserved Files -----------------------------------------------------------
|
|
113
113
|
|
|
114
114
|
export const RESERVED_FILES = ["index.md", "log.md"];
|
|
115
115
|
|
|
@@ -117,7 +117,7 @@ export function isReservedFile(filename: string): boolean {
|
|
|
117
117
|
return RESERVED_FILES.includes(filename);
|
|
118
118
|
}
|
|
119
119
|
|
|
120
|
-
//
|
|
120
|
+
// --- Secret Detection ---------------------------------------------------------
|
|
121
121
|
|
|
122
122
|
export const SECRET_PATTERNS = [
|
|
123
123
|
/api[_-]?key/i,
|
|
@@ -148,7 +148,7 @@ export function filterSecrets(content: string): string {
|
|
|
148
148
|
);
|
|
149
149
|
}
|
|
150
150
|
|
|
151
|
-
//
|
|
151
|
+
// --- Authority Types ---------------------------------------------------------
|
|
152
152
|
|
|
153
153
|
export type Authority = "approved" | "generated" | "unverified";
|
|
154
154
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Model Registry Types (RFC-0053)
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
//
|
|
5
|
+
// --- Pricing Types ---------------------------------------------------
|
|
6
6
|
|
|
7
7
|
export type Currency = "USD" | "THB";
|
|
8
8
|
|
|
@@ -15,7 +15,7 @@ export interface Pricing {
|
|
|
15
15
|
cacheWritePer1M?: number;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
//
|
|
18
|
+
// --- Model Info -------------------------------------------------------
|
|
19
19
|
|
|
20
20
|
export type ModelStatus = "active" | "deprecated" | "disabled";
|
|
21
21
|
|
|
@@ -34,7 +34,7 @@ export interface ModelInfo {
|
|
|
34
34
|
deprecatedAt?: string;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
//
|
|
37
|
+
// --- Registry Types ---------------------------------------------------
|
|
38
38
|
|
|
39
39
|
export interface ModelFilters {
|
|
40
40
|
providerId?: string;
|
|
@@ -55,7 +55,7 @@ export interface ModelRegistry {
|
|
|
55
55
|
updateStatus(providerId: string, modelId: string, status: ModelStatus): void;
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
-
//
|
|
58
|
+
// --- Event Types -----------------------------------------------------
|
|
59
59
|
|
|
60
60
|
export type ModelRegistryEvent =
|
|
61
61
|
| { type: "model.registered"; providerId: string; modelId: string }
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
import { existsSync } from "node:fs";
|
|
8
8
|
import { readdir, readFile } from "node:fs/promises";
|
|
9
9
|
import { join } from "node:path";
|
|
10
|
-
//
|
|
10
|
+
// --- Detection ---------------------------------------------------------------
|
|
11
11
|
function isNextJsWorkspace(root) {
|
|
12
12
|
return (existsSync(join(root, "next.config.js")) ||
|
|
13
13
|
existsSync(join(root, "next.config.mjs")) ||
|
|
@@ -15,7 +15,7 @@ function isNextJsWorkspace(root) {
|
|
|
15
15
|
existsSync(join(root, "app")) ||
|
|
16
16
|
existsSync(join(root, "pages")));
|
|
17
17
|
}
|
|
18
|
-
//
|
|
18
|
+
// --- Version Detection -------------------------------------------------------
|
|
19
19
|
async function detectVersion(root) {
|
|
20
20
|
try {
|
|
21
21
|
const pkg = JSON.parse(await readFile(join(root, "package.json"), "utf-8"));
|
|
@@ -29,13 +29,13 @@ async function detectVersion(root) {
|
|
|
29
29
|
return undefined;
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
|
-
//
|
|
32
|
+
// --- Router Detection -------------------------------------------------------
|
|
33
33
|
async function detectRouters(root) {
|
|
34
34
|
const hasApp = existsSync(join(root, "app"));
|
|
35
35
|
const hasPages = existsSync(join(root, "pages"));
|
|
36
36
|
return { usingAppRouter: hasApp, usingPagesRouter: hasPages };
|
|
37
37
|
}
|
|
38
|
-
//
|
|
38
|
+
// --- Config Files ------------------------------------------------------------
|
|
39
39
|
async function findConfigFiles(root) {
|
|
40
40
|
const configFiles = [
|
|
41
41
|
{ name: "next.config.js", path: join(root, "next.config.js") },
|
|
@@ -50,7 +50,7 @@ async function findConfigFiles(root) {
|
|
|
50
50
|
}
|
|
51
51
|
return configs;
|
|
52
52
|
}
|
|
53
|
-
//
|
|
53
|
+
// --- App Router Routes -----------------------------------------------------
|
|
54
54
|
async function walkAppRouter(dir, base = "") {
|
|
55
55
|
const routes = [];
|
|
56
56
|
try {
|
|
@@ -98,7 +98,7 @@ async function walkAppRouter(dir, base = "") {
|
|
|
98
98
|
}
|
|
99
99
|
return routes;
|
|
100
100
|
}
|
|
101
|
-
//
|
|
101
|
+
// --- Pages Router API Routes -------------------------------------------------
|
|
102
102
|
async function walkApiRoutes(dir, base = "") {
|
|
103
103
|
const routes = [];
|
|
104
104
|
try {
|
|
@@ -123,7 +123,7 @@ async function walkApiRoutes(dir, base = "") {
|
|
|
123
123
|
}
|
|
124
124
|
return routes;
|
|
125
125
|
}
|
|
126
|
-
//
|
|
126
|
+
// --- Middleware -------------------------------------------------------------
|
|
127
127
|
async function findMiddleware(root) {
|
|
128
128
|
const candidates = [
|
|
129
129
|
join(root, "middleware.ts"),
|
|
@@ -137,7 +137,7 @@ async function findMiddleware(root) {
|
|
|
137
137
|
}
|
|
138
138
|
return undefined;
|
|
139
139
|
}
|
|
140
|
-
//
|
|
140
|
+
// --- Environment Variables -------------------------------------------------
|
|
141
141
|
async function findEnvVars(root) {
|
|
142
142
|
const candidates = [
|
|
143
143
|
join(root, ".env.example"),
|
|
@@ -169,7 +169,7 @@ async function findEnvVars(root) {
|
|
|
169
169
|
}
|
|
170
170
|
return vars;
|
|
171
171
|
}
|
|
172
|
-
//
|
|
172
|
+
// --- Main Analyzer ---------------------------------------------------------
|
|
173
173
|
/**
|
|
174
174
|
* Analyze a Next.js workspace (RFC-0062)
|
|
175
175
|
*/
|
|
@@ -10,7 +10,7 @@ import { readdir, readFile } from "node:fs/promises";
|
|
|
10
10
|
import { join } from "node:path";
|
|
11
11
|
import type { NextJsAnalysis, AppRoute, ConfigFile } from "./types.js";
|
|
12
12
|
|
|
13
|
-
//
|
|
13
|
+
// --- Detection ---------------------------------------------------------------
|
|
14
14
|
|
|
15
15
|
function isNextJsWorkspace(root: string): boolean {
|
|
16
16
|
return (
|
|
@@ -22,7 +22,7 @@ function isNextJsWorkspace(root: string): boolean {
|
|
|
22
22
|
);
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
//
|
|
25
|
+
// --- Version Detection -------------------------------------------------------
|
|
26
26
|
|
|
27
27
|
async function detectVersion(root: string): Promise<string | undefined> {
|
|
28
28
|
try {
|
|
@@ -37,7 +37,7 @@ async function detectVersion(root: string): Promise<string | undefined> {
|
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
//
|
|
40
|
+
// --- Router Detection -------------------------------------------------------
|
|
41
41
|
|
|
42
42
|
async function detectRouters(root: string): Promise<{
|
|
43
43
|
usingAppRouter: boolean;
|
|
@@ -48,7 +48,7 @@ async function detectRouters(root: string): Promise<{
|
|
|
48
48
|
return { usingAppRouter: hasApp, usingPagesRouter: hasPages };
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
-
//
|
|
51
|
+
// --- Config Files ------------------------------------------------------------
|
|
52
52
|
|
|
53
53
|
async function findConfigFiles(root: string): Promise<ConfigFile[]> {
|
|
54
54
|
const configFiles = [
|
|
@@ -65,7 +65,7 @@ async function findConfigFiles(root: string): Promise<ConfigFile[]> {
|
|
|
65
65
|
return configs;
|
|
66
66
|
}
|
|
67
67
|
|
|
68
|
-
//
|
|
68
|
+
// --- App Router Routes -----------------------------------------------------
|
|
69
69
|
|
|
70
70
|
async function walkAppRouter(
|
|
71
71
|
dir: string,
|
|
@@ -117,7 +117,7 @@ async function walkAppRouter(
|
|
|
117
117
|
return routes;
|
|
118
118
|
}
|
|
119
119
|
|
|
120
|
-
//
|
|
120
|
+
// --- Pages Router API Routes -------------------------------------------------
|
|
121
121
|
|
|
122
122
|
async function walkApiRoutes(
|
|
123
123
|
dir: string,
|
|
@@ -144,7 +144,7 @@ async function walkApiRoutes(
|
|
|
144
144
|
return routes;
|
|
145
145
|
}
|
|
146
146
|
|
|
147
|
-
//
|
|
147
|
+
// --- Middleware -------------------------------------------------------------
|
|
148
148
|
|
|
149
149
|
async function findMiddleware(root: string): Promise<string | undefined> {
|
|
150
150
|
const candidates = [
|
|
@@ -159,7 +159,7 @@ async function findMiddleware(root: string): Promise<string | undefined> {
|
|
|
159
159
|
return undefined;
|
|
160
160
|
}
|
|
161
161
|
|
|
162
|
-
//
|
|
162
|
+
// --- Environment Variables -------------------------------------------------
|
|
163
163
|
|
|
164
164
|
async function findEnvVars(root: string): Promise<string[]> {
|
|
165
165
|
const candidates = [
|
|
@@ -192,7 +192,7 @@ async function findEnvVars(root: string): Promise<string[]> {
|
|
|
192
192
|
return vars;
|
|
193
193
|
}
|
|
194
194
|
|
|
195
|
-
//
|
|
195
|
+
// --- Main Analyzer ---------------------------------------------------------
|
|
196
196
|
|
|
197
197
|
/**
|
|
198
198
|
* Analyze a Next.js workspace (RFC-0062)
|
|
@@ -114,7 +114,7 @@ export class NotificationCenter {
|
|
|
114
114
|
listChannels() {
|
|
115
115
|
return Array.from(this.adapters.keys());
|
|
116
116
|
}
|
|
117
|
-
//
|
|
117
|
+
// --- Private Methods ------------------------------------------------
|
|
118
118
|
createAdapter(config) {
|
|
119
119
|
switch (config.type) {
|
|
120
120
|
case "telegram":
|
|
@@ -146,7 +146,7 @@ export class NotificationCenter {
|
|
|
146
146
|
return Array.from(this.adapters.keys());
|
|
147
147
|
}
|
|
148
148
|
|
|
149
|
-
//
|
|
149
|
+
// --- Private Methods ------------------------------------------------
|
|
150
150
|
|
|
151
151
|
private createAdapter(
|
|
152
152
|
config: NotificationChannelConfig,
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Alert rule evaluation and alerting.
|
|
5
5
|
*/
|
|
6
6
|
import { Logger } from "./logger.js";
|
|
7
|
-
//
|
|
7
|
+
// --- Alert Engine Class -------------------------------------------------
|
|
8
8
|
export class AlertEngine {
|
|
9
9
|
rules = new Map();
|
|
10
10
|
activeAlerts = new Map();
|
|
@@ -287,7 +287,7 @@ export class AlertEngine {
|
|
|
287
287
|
};
|
|
288
288
|
}
|
|
289
289
|
}
|
|
290
|
-
//
|
|
290
|
+
// --- Factory Function --------------------------------------------------------
|
|
291
291
|
/**
|
|
292
292
|
* Create an alert engine
|
|
293
293
|
*/
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Health check registration and monitoring.
|
|
5
5
|
*/
|
|
6
|
-
//
|
|
6
|
+
// --- Default Configuration -------------------------------------------------
|
|
7
7
|
const DEFAULT_SERVICE_NAME = "harness-runtime";
|
|
8
8
|
const DEFAULT_VERSION = "1.0.0";
|
|
9
|
-
//
|
|
9
|
+
// --- Health Monitor Class -------------------------------------------------
|
|
10
10
|
export class HealthMonitor {
|
|
11
11
|
checks = new Map();
|
|
12
12
|
version;
|
|
@@ -162,7 +162,7 @@ export class HealthMonitor {
|
|
|
162
162
|
return this.checks.get(name);
|
|
163
163
|
}
|
|
164
164
|
}
|
|
165
|
-
//
|
|
165
|
+
// --- Built-in Health Checks ------------------------------------------------
|
|
166
166
|
/**
|
|
167
167
|
* Create a basic connectivity health check
|
|
168
168
|
*/
|
|
@@ -251,7 +251,7 @@ export function createDiskSpaceHealthCheck(_name, _minFreeMB = 100) {
|
|
|
251
251
|
};
|
|
252
252
|
};
|
|
253
253
|
}
|
|
254
|
-
//
|
|
254
|
+
// --- Factory Function --------------------------------------------------------
|
|
255
255
|
/**
|
|
256
256
|
* Create a health monitor with the given service name
|
|
257
257
|
*/
|
|
@@ -4,16 +4,16 @@
|
|
|
4
4
|
* A comprehensive observability system with structured logging,
|
|
5
5
|
* distributed tracing, metrics collection, health monitoring, and alerting.
|
|
6
6
|
*/
|
|
7
|
-
//
|
|
7
|
+
// --- Logger ----------------------------------------------------------------
|
|
8
8
|
export { Logger, createLogger, defaultLogger } from "./logger.js";
|
|
9
|
-
//
|
|
9
|
+
// --- Tracer ----------------------------------------------------------------
|
|
10
10
|
export { Tracer, createTracer, SpanHandle } from "./tracer.js";
|
|
11
|
-
//
|
|
11
|
+
// --- Metrics ----------------------------------------------------------------
|
|
12
12
|
export { Metrics, createMetrics, createBuiltInMetrics, Timer, } from "./metrics.js";
|
|
13
|
-
//
|
|
13
|
+
// --- Health ----------------------------------------------------------------
|
|
14
14
|
export { HealthMonitor, createHealthMonitor, createConnectivityHealthCheck, createMemoryHealthCheck, createDiskSpaceHealthCheck, } from "./health.js";
|
|
15
|
-
//
|
|
15
|
+
// --- Alerts ----------------------------------------------------------------
|
|
16
16
|
export { AlertEngine, createAlertEngine } from "./alerts.js";
|
|
17
|
-
//
|
|
17
|
+
// --- Re-exports ------------------------------------------------------------
|
|
18
18
|
export { SDK_VERSION } from "./types.js";
|
|
19
19
|
//# sourceMappingURL=index.js.map
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
import { createWriteStream } from "node:fs";
|
|
7
7
|
import { mkdir, rename as renameAsync } from "node:fs/promises";
|
|
8
8
|
import { dirname } from "node:path";
|
|
9
|
-
//
|
|
9
|
+
// --- Level Order ------------------------------------------------------------
|
|
10
10
|
const LOG_LEVEL_ORDER = {
|
|
11
11
|
debug: 0,
|
|
12
12
|
info: 1,
|
|
@@ -14,7 +14,7 @@ const LOG_LEVEL_ORDER = {
|
|
|
14
14
|
error: 3,
|
|
15
15
|
fatal: 4,
|
|
16
16
|
};
|
|
17
|
-
//
|
|
17
|
+
// --- Default Configuration -------------------------------------------------
|
|
18
18
|
const DEFAULT_CONFIG = {
|
|
19
19
|
level: "info",
|
|
20
20
|
format: "json",
|
|
@@ -25,7 +25,7 @@ const DEFAULT_CONFIG = {
|
|
|
25
25
|
correlationIdHeader: "x-correlation-id",
|
|
26
26
|
defaultMeta: {},
|
|
27
27
|
};
|
|
28
|
-
//
|
|
28
|
+
// --- Colors for Pretty Output -----------------------------------------------
|
|
29
29
|
const COLORS = {
|
|
30
30
|
debug: "\x1b[36m", // Cyan
|
|
31
31
|
info: "\x1b[32m", // Green
|
|
@@ -34,7 +34,7 @@ const COLORS = {
|
|
|
34
34
|
fatal: "\x1b[35m", // Magenta
|
|
35
35
|
};
|
|
36
36
|
const RESET = "\x1b[0m";
|
|
37
|
-
//
|
|
37
|
+
// --- UUID Generator ---------------------------------------------------------
|
|
38
38
|
function generateId() {
|
|
39
39
|
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (c) => {
|
|
40
40
|
const r = (Math.random() * 16) | 0;
|
|
@@ -42,7 +42,7 @@ function generateId() {
|
|
|
42
42
|
return v.toString(16);
|
|
43
43
|
});
|
|
44
44
|
}
|
|
45
|
-
//
|
|
45
|
+
// --- Logger Class -----------------------------------------------------------
|
|
46
46
|
export class Logger {
|
|
47
47
|
config;
|
|
48
48
|
streams;
|
|
@@ -302,14 +302,14 @@ export class Logger {
|
|
|
302
302
|
}
|
|
303
303
|
}
|
|
304
304
|
}
|
|
305
|
-
//
|
|
305
|
+
// --- Factory Function --------------------------------------------------------
|
|
306
306
|
/**
|
|
307
307
|
* Create a logger with the given configuration
|
|
308
308
|
*/
|
|
309
309
|
export function createLogger(config) {
|
|
310
310
|
return new Logger(config);
|
|
311
311
|
}
|
|
312
|
-
//
|
|
312
|
+
// --- Default Logger ----------------------------------------------------------
|
|
313
313
|
/**
|
|
314
314
|
* Default logger instance
|
|
315
315
|
*/
|