Open
Conversation
… 1A) Replace the CLI's internal ConfigManager with the SDK's MpakConfigManager across all config command handlers (set, get, list, clear). This is the first step in dogfooding the SDK within the CLI. Changes: - Add shared `mpakConfigManager` singleton in `cli/src/utils/config.ts` that reads MPAK_HOME and MPAK_REGISTRY_URL from env vars - Rewrite `config.ts` to use the SDK singleton instead of instantiating CLI's ConfigManager per handler - Rename `listPackagesWithConfig()` → `getPackageNames()` (SDK API) - Export `PackageConfig` type from SDK's barrel (`index.ts`) - Fix bug in `handleConfigGet` where non-JSON output was silently swallowed due to a nested conditional - Remove unused `ConfigSetOptions` and `ConfigClearOptions` interfaces - Add 23 end-to-end CLI tests for all config subcommands covering happy paths, --json output, and error cases Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…andling (#59 Phase 3C prereqs) Extends the Mpak facade's prepareServer() to accept both registry and local bundles via a discriminated union spec: { name, version? } for registry, { local } for local .mcpb files. This is the SDK groundwork needed before the CLI can be thinned down to a dispatcher over prepareServer(). SDK changes: - New PrepareServerSpec type replaces the old string-based packageName param - prepareLocalBundle: hash-based cache dir, mtime-aware extraction, zip bomb protection, manifest schema validation - New MpakInvalidBundleError for local bundle failures (distinct from MpakCacheCorruptedError which is for registry cache issues) - readJsonFromFile now throws generic MpakError instead of MpakCacheCorruptedError; callers wrap with context-specific errors - Helper functions: hashBundlePath, localBundleNeedsExtract - 10 new tests for local bundle path through prepareServer - All 182 tests pass, typecheck and lint clean Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace ~350 lines of inline cache management, manifest reading, command resolution, env substitution, and python detection in run.ts with a single call to mpak.prepareServer(). The CLI now only owns what it should: --local path validation, interactive config prompting (catching MpakConfigError), process spawning, signal forwarding, and the async update-check notice. SDK side: add `description` field to MpakConfigError.missingFields so the CLI can render prompt hints (e.g. "API Key (Your OpenAI API key):"). Key changes: - run.ts: delete parsePackageSpec, readManifest, resolveArgs, resolveWorkspace, substituteUserConfig, substituteEnvVars, getLocalCacheDir, localBundleNeedsExtract, findPythonCommand, gatherUserConfigValues, and all local type interfaces — all now in SDK - run.ts: use shared mpak singleton from utils/config.ts - run.ts: skip async update check when --update flag is set (just pulled latest) and log debug messages instead of silently swallowing errors - Delete old src/commands/packages/run.test.ts (tested deleted helpers) - Add tests/run.test.ts with 28 tests covering registry/local/update flows, async update check, config errors, CLI validation, process spawning, signal forwarding, and SDK error propagation Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…#59 Phase 4A+4B) Replace createClient() with mpak.client across all search/show/pull/install commands, delete cli/src/utils/client.ts, export z.input types from schemas so the SDK reuses them instead of hand-rolling duplicates, and add search command tests. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…se 4C) Drop `as string` casts on `published_at` (already typed `string | Date`), replace deprecated `fmtError` with `logger.error`, and add show.test.ts with 9 tests covering all output paths. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…Phase 4C) Replace manual fetch with mpak.client.downloadBundle() which adds SHA-256 integrity verification. Use SDK's parsePackageSpec, formatSize helper, and logger.error. Clean up partial file on error. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Migrates skills/install, skills/pull, skills/search, skills/show to SDK facade. Removes deleted utils (cache, config-manager) and their tests. Moves all tests to tests/ tree with bundles/ and skills/ subdirectories. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ase 4C) Adds logger.info (writes to stderr) and routes all status/table/progress output through it. JSON output (--json) stays on stdout via console.log, keeping stdout machine-readable. Updates all tests to assert on stderrSpy for human output and stdoutSpy for JSON. Adds unified search.ts test. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…e skill error swallow (#59 Phase 4C) - Replace hand-shaped UnifiedResult interface with Bundle | SkillSummary discriminated union - Remove .catch(() => null) on skill search (stale workaround from pre-deployment era) - Use real schema field names (latest_version, certification_level, description ?? "") - Type predicate filters for proper TS narrowing after results.filter() - Fix biome template literal warnings in table row builders - Update test: "swallows skill errors" → "logs error when skill search throws" Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ill integration tests - Rewrite registry-client.test.ts: test bundle search/show via `node dist/index.js` instead of MpakClient directly - Rewrite update-flow.test.ts: fix broken cache.js/client.js imports, test outdated/update commands as subprocesses with SDK for cache setup - Add bundle.integration.test.ts: smoke tests for bundle pull (file download + JSON metadata) - Add skill.integration.test.ts: smoke tests for skill search and show - Add helpers.ts: shared run() helper that spawns the CLI and captures stdout/stderr/exitCode Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
MpakSDK) instead of direct API calls, eliminating duplicated logicruncommand to useSDK.prepareServer, adding local bundle supportSDK.MpakConfigManagerTest plan
pnpm typecheckpassespnpm lintpassespnpm testpasses./node_modules/.bin/vitest run --config /dev/null tests/integration/bundle.integration.test.ts./node_modules/.bin/vitest run --config /dev/null tests/integration/skill.integration.test.ts🤖 Generated with Claude Code