molecule-ai[bot]
e73b53e464
feat(mcp): add structured pino logging with AsyncLocalStorage context (KI-001) ( #6 )
...
Replace all console.log/error with structured JSON logging via pino.
Every log entry automatically carries toolName, requestId, and workspaceId
from the current AsyncLocalStorage scope — no need to thread context.
Changes:
- package.json: add pino@^9.6.0, pino-pretty@^13.0.0
- src/utils/context.ts: new — AsyncLocalStorage context + getContext/withContext/runWithContext
- src/utils/logger.ts: new — info/warn/error/debug helpers, JSON output in prod, pretty in dev
- src/api.ts: both console.error → logError(...)
- src/index.ts: all console.error → logInfo/logWarn/logError(...)
- known-issues.md: mark KI-001 resolved
Co-authored-by: Molecule AI SDK-Dev <sdk-dev@agents.moleculesai.app>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-22 18:37:40 +00:00
molecule-ai[bot]
a16dff9f41
test(api): add Jest unit tests for apiCall, platformGet, toMcpResult, isApiError ( #4 )
...
* docs: add CLAUDE.md for agent onboarding
Inherits platform conventions from molecule-core:
- Cron discipline and triage rules
- Build/test commands (npm, Jest)
- MCP tool conventions (snake_case, error codes, streaming)
- TypeScript conventions (strict mode, async/await, Zod)
- Release process (npm publish via tag workflow)
- Notes test.txt artifact for removal
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* docs: add known-issues.md, .claude/settings.json; remove test.txt artifact
- known-issues.md: 5 entries (KI-001 structured logging, KI-002 input schema
validation missing, KI-003 test.txt artifact, KI-004 no rate limiting,
KI-005 streaming cancellation)
- .claude/settings.json: permissions for npm/npx/node tools, PreToolUse
Bash hook, cleanupPeriodDays 30
- test.txt: remove 5-byte debug artifact from repo root
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* docs: add CLAUDE.md known-issues ref, known-issues.md, .claude/settings.json
- CLAUDE.md: add known-issues.md reference in Known Issues section
- known-issues.md: 5 entries (KI-001 main.go, KI-002 API client,
KI-003 go.sum, KI-004 goreleaser, KI-005 no tests)
- .claude/settings.json: permissions for go/goreleaser tools,
PreToolUse Bash hook, cleanupPeriodDays 30
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat(mcp): add platformGet() with retry-on-429 for all GET tool calls
Add platformGet() in src/api.ts — a GET helper that automatically retries
on HTTP 429 (Too Many Requests). Retry strategy:
- Honour Retry-After header (seconds → ms, rounded up).
- Exponential backoff with ±25% jitter when absent (1 s, 2 s, 4 s).
- Max 30 s per wait; up to 3 retries.
- Returns RATE_LIMITED error after exhausting retries.
All 37 GET calls across the 12 tool modules now use platformGet()
instead of apiCall("GET", …). POST/PUT/PATCH/DELETE keep apiCall
(non-idempotent). platformGet is re-exported from src/index.ts.
Also:
- Correct KI-002 (MCP SDK already validates input schemas — no code change needed).
- Close KI-003 (test.txt was already removed).
- Mark KI-004 as resolved.
🤖 Generated with [Claude Code](https://claude.com/claude-code )
* test(api): add Jest unit tests for apiCall, platformGet, toMcpResult, isApiError
Covers:
- toMcpResult / toMcpText: correct content envelope wrapping
- isApiError: type guard across all ApiError shapes
- apiCall: 2xx JSON, non-2xx, network failure, POST body, headers
- platformGet: 2xx, non-2xx non-429, network failure, 429 Retry-After
- 429 retry: Retry-After header parsing, 30s cap, RATE_LIMITED exhaustion
Also fixes a bug in platformGet where a 429 response after exhausting
retries fell through to "HTTP 429" instead of returning RATE_LIMITED.
Added explicit return after the non-ok check so exhaustion returns correctly.
🤖 Generated with [Claude Code](https://claude.ai/claude-code )
---------
Co-authored-by: Molecule AI SDK-Dev <sdk-dev@agents.moleculesai.app>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: Molecule AI Plugin-Dev <plugin-dev@agents.moleculesai.app>
2026-04-21 06:17:36 +00:00
c7642e92e1
feat(mcp): add platformGet() with retry-on-429 for all GET tool calls
...
Add platformGet() in src/api.ts — a GET helper that automatically retries
on HTTP 429 (Too Many Requests). Retry strategy:
- Honour Retry-After header (seconds → ms, rounded up).
- Exponential backoff with ±25% jitter when absent (1 s, 2 s, 4 s).
- Max 30 s per wait; up to 3 retries.
- Returns RATE_LIMITED error after exhausting retries.
All 37 GET calls across the 12 tool modules now use platformGet()
instead of apiCall("GET", …). POST/PUT/PATCH/DELETE keep apiCall
(non-idempotent). platformGet is re-exported from src/index.ts.
Also:
- Correct KI-002 (MCP SDK already validates input schemas — no code change needed).
- Close KI-003 (test.txt was already removed).
- Mark KI-004 as resolved.
🤖 Generated with [Claude Code](https://claude.com/claude-code )
2026-04-21 01:15:47 +00:00
6bf6661c5e
docs: add known-issues.md, .claude/settings.json; remove test.txt artifact
...
- known-issues.md: 5 entries (KI-001 structured logging, KI-002 input schema
validation missing, KI-003 test.txt artifact, KI-004 no rate limiting,
KI-005 streaming cancellation)
- .claude/settings.json: permissions for npm/npx/node tools, PreToolUse
Bash hook, cleanupPeriodDays 30
- test.txt: remove 5-byte debug artifact from repo root
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-21 01:14:28 +00:00
molecule-ai[bot]
b4221056e5
docs: add CLAUDE.md, known-issues.md, .claude/settings.json; remove test.txt ( #2 )
...
* docs: add CLAUDE.md for agent onboarding
Inherits platform conventions from molecule-core:
- Cron discipline and triage rules
- Build/test commands (npm, Jest)
- MCP tool conventions (snake_case, error codes, streaming)
- TypeScript conventions (strict mode, async/await, Zod)
- Release process (npm publish via tag workflow)
- Notes test.txt artifact for removal
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* docs: add known-issues.md, .claude/settings.json; remove test.txt artifact
- known-issues.md: 5 entries (KI-001 structured logging, KI-002 input schema
validation missing, KI-003 test.txt artifact, KI-004 no rate limiting,
KI-005 streaming cancellation)
- .claude/settings.json: permissions for npm/npx/node tools, PreToolUse
Bash hook, cleanupPeriodDays 30
- test.txt: remove 5-byte debug artifact from repo root
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* docs: add CLAUDE.md known-issues ref, known-issues.md, .claude/settings.json
- CLAUDE.md: add known-issues.md reference in Known Issues section
- known-issues.md: 5 entries (KI-001 main.go, KI-002 API client,
KI-003 go.sum, KI-004 goreleaser, KI-005 no tests)
- .claude/settings.json: permissions for go/goreleaser tools,
PreToolUse Bash hook, cleanupPeriodDays 30
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Molecule AI SDK-Dev <sdk-dev@agents.moleculesai.app>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-20 23:10:39 +00:00