dart_minify 0.2.1
dart_minify: ^0.2.1 copied to clipboard
Semantic context packing and structured edit application for Dart agents.
Changelog #
0.2.1 #
- Add the opt-in liveday benchmark for comparing raw Dart and focused packs across installed coding CLIs, plus one recorded sample and pack-vs-raw charts. The pack arm is read-only context and does not request a DMP reply.
- Publish a
balanced-v1savings table in the README from the checked-in medium-commerce scenario. statsreports compact-versus-packpackSavingsand accepts pack focus flags (--symbol,--declaration,--task,--max-tokens,--max-bytes).DartMinifyWorkflow.applyparses planned sources and analyzes the affected closure by default.- CI compares
medium_scenario.dartstdout with the canonical JSON on stable Dart. - Removed unused
ValidationResult/ValidationIssuetypes. Protocol and path validation still throw their dedicated exceptions. - Removed the unused
isWithinCanonicalRoothelper and the leftover.llm.min.dartgenerated-file suffix. computeContentHashnow reusessha256String.- Dropped the unused
encodeCanonicalJsonalias. - Require
dart_style3.x for formatting compatibility. - Skip unparsable files and redundant cache rebuilds during indexing.
- Format edits with the project Dart version and compact packed declaration source.
- Reserve the empty dictionary in the protocol.
- Default CLI verification tests off and analysis on during apply.
0.2.0 #
This is a breaking redesign from a whole-file minifier into a bidirectional, provider-agnostic agent codec.
Added #
- Analyzer-backed, deterministic source compaction with significant-token equivalence and structured malformed-source diagnostics.
- Content-addressed Dart and Flutter project indexes with stable file and declaration IDs, dependency relationships, hashes, and cache invalidation.
- Task-focused packs with explicit inclusion reasons, hard budgets, dependency stubs, and incremental session state.
- Provider-neutral first-turn and follow-up instruction preambles with project/base/session identity descriptors and measured overhead.
- Canonical protocol v2 in compact text and JSON forms.
- Declaration, directive, and file edit operations anchored by stable IDs, fingerprints, and expected base hashes.
- Atomic multi-file preflight and application with dry-run previews and local transaction records.
- Opt-in apply-time semantic closure analysis over planned in-memory sources, with pre-existing analyzer errors subtracted from the failure set.
- Parse, format, analyze, test, and custom-command verification with normalized diagnostics and focused repair-pack selection.
- The
index,pack,apply,verify,stats, anddoctorcommand surface, including per-command help and injected-stdin support where applicable. - CI coverage for Dart 3.9 and latest stable Dart, formatting, analysis, tests, coverage artifacts, and package publication validation.
Changed #
- Raised the minimum Dart SDK to 3.9.
- Narrowed analyzer support to the tested 8.x API family.
- Redefined statistics to separate raw bytes, lexical tokens, estimated model tokens, and compact-protocol overhead.
- Kept machine-readable stdout separate from progress and diagnostic stderr.
- Moved local cache and session state under
.dart_minify/; recoverable transaction journals remain at the project root as.dart_minify.transaction.*, with transaction-owned temporary files beside their targets for same-filesystem replacement.
Fixed #
- Preserve significant token boundaries for separated operators such as
- -and for tokens separated only by removed comments. - Correctly preserve raw, triple, interpolated, escaped, multiline, and Unicode string contents through analyzer tokenization.
- Reject malformed Dart, corrupt/truncated protocol input, unsupported protocol versions, duplicate operations, stale bases, and unsafe paths explicitly.
- Use canonical containment checks instead of lexical path-prefix checks.
- Preflight every file operation before committing any source change.
Removed #
- The
minify,expand,lossy-build, andapply-lossycommands. - Framed
<<<DART_MINIFY_FILE:...>>>payloads and whole-source reverse maps. - The build-runner builder,
build.yaml, and the package'sbuildandbuild_runnerdependencies. .llm.min.dart,.llm.map.json, and lossy-manifest source workflows.- Both 0.1.x symbol-renaming strategies and regex-based reverse renaming.
See the migration guide for command and artifact replacements.
0.1.1 #
- Prepare package for pub.flutter-io.cn publishing.
- Pin local Flutter toolchain via
.fvmrc(3.41.4) for consistent development. - Improve package metadata in
pubspec.yaml(homepage/repository/issues/docs/topics). - Rewrite README for clearer purpose, quickstart, and command guidance.
- Add runnable examples under
example/(CLI flow and Dart wrapper). - Add MIT
LICENSE.
0.1.0 #
- Initial release of
dart_minifyCLI. - Added
minify,expand,stats,doctor,lossy-build, andapply-lossy.