@yasaswy.nagavolu/agents 0.32.1 → 0.34.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/README.md +62 -0
- package/bin/cli.js +144 -25
- package/content/manifest.json +315 -2
- package/content/manifest.schema.json +62 -4
- package/content/mcps/chrome_devtools_gate.js +438 -0
- package/content/mcps/mcps.json +13 -0
- package/content/proxy/README.md +2 -0
- package/content/proxy/chrome_devtools_guard.py +200 -0
- package/content/proxy/chrome_profile_lock.py +170 -0
- package/content/skills/README.md +2 -0
- package/content/skills/gmail-reader/README.md +82 -0
- package/content/skills/gmail-reader/SKILL.md +69 -0
- package/content/skills/gmail-reader/gmail_reader/__init__.py +12 -0
- package/content/skills/gmail-reader/gmail_reader/__main__.py +3 -0
- package/content/skills/gmail-reader/gmail_reader/client.py +150 -0
- package/content/skills/gmail-reader/gmail_reader/commands.py +115 -0
- package/content/skills/gmail-reader/gmail_reader/credentials.py +62 -0
- package/content/skills/gmail-reader/gmail_reader/htmltext.py +126 -0
- package/content/skills/gmail-reader/gmail_reader/oauth.py +277 -0
- package/content/skills/gmail-reader/gmail_reader/purchases/__init__.py +11 -0
- package/content/skills/gmail-reader/gmail_reader/purchases/data/accounts.json +155 -0
- package/content/skills/gmail-reader/gmail_reader/purchases/data/brands.json +115 -0
- package/content/skills/gmail-reader/gmail_reader/purchases/data/durable.json +571 -0
- package/content/skills/gmail-reader/gmail_reader/purchases/data/vendors.json +716 -0
- package/content/skills/gmail-reader/gmail_reader/purchases/data.py +46 -0
- package/content/skills/gmail-reader/gmail_reader/purchases/durable.py +51 -0
- package/content/skills/gmail-reader/gmail_reader/purchases/parse.py +589 -0
- package/content/skills/gmail-reader/gmail_reader/purchases/proof.py +138 -0
- package/content/skills/gmail-reader/gmail_reader/purchases/scan.py +293 -0
- package/content/skills/gmail-reader/gmail_reader/scope.py +27 -0
- package/content/skills/gmail-reader/gmail_reader/testing.py +69 -0
- package/content/skills/gmail-reader/gmail_reader/version.py +3 -0
- package/content/skills/gmail-reader/pyproject.toml +19 -0
- package/content/skills/gmail-reader/tests/conftest.py +43 -0
- package/content/skills/gmail-reader/tests/gmail_home_guard.py +19 -0
- package/content/skills/gmail-reader/tests/receipt_fixtures.py +145 -0
- package/content/skills/gmail-reader/tests/test_commands.py +108 -0
- package/content/skills/gmail-reader/tests/test_durable.py +132 -0
- package/content/skills/gmail-reader/tests/test_oauth.py +170 -0
- package/content/skills/gmail-reader/tests/test_prices.py +95 -0
- package/content/skills/gmail-reader/tests/test_proof.py +103 -0
- package/content/skills/gmail-reader/tests/test_purchase_parsers.py +223 -0
- package/content/skills/gmail-reader/tests/test_readonly.py +199 -0
- package/content/skills/gmail-reader/tests/test_recall.py +180 -0
- package/content/skills/gmail-reader/tests/test_returns.py +106 -0
- package/content/skills/gmail-reader/tests/test_scan.py +143 -0
- package/content/skills/gmail-reader/tests/test_secrets_isolation.py +35 -0
- package/content/skills/gmail-reader/tests/test_setup_docs.py +15 -0
- package/content/skills/gmail-reader/tests/test_source_filter.py +94 -0
- package/content/skills/gmail-reader/tests/test_version.py +33 -0
- package/content/skills/html-mocker/audit.js +10 -4
- package/content/skills/html-mocker/tests/test_audit.py +15 -0
- package/content/skills/make-space/tests/conftest.py +1 -96
- package/content/skills/make-space/tests/make_space_support.py +99 -0
- package/content/skills/make-space/tests/test_make_space.py +2 -2
- package/content/skills/make-space/tests/test_scratch_cleanup.py +1 -1
- package/content/skills/make-space/tests/test_worktree_audit.py +1 -1
- package/content/skills/resale/.dockerignore +7 -0
- package/content/skills/resale/CONTRACTS.md +257 -0
- package/content/skills/resale/README.md +422 -0
- package/content/skills/resale/SKILL.md +104 -0
- package/content/skills/resale/container/.gitkeep +0 -0
- package/content/skills/resale/container/Dockerfile +17 -0
- package/content/skills/resale/container/docker-compose.yml +83 -0
- package/content/skills/resale/container/empty.env +1 -0
- package/content/skills/resale/container/no-file/.gitkeep +0 -0
- package/content/skills/resale/prompts/comps_review.md +19 -0
- package/content/skills/resale/resale/__init__.py +3 -0
- package/content/skills/resale/resale/__main__.py +60 -0
- package/content/skills/resale/resale/analysis/__init__.py +4 -0
- package/content/skills/resale/resale/analysis/bundle.py +63 -0
- package/content/skills/resale/resale/analysis/commands.py +119 -0
- package/content/skills/resale/resale/analysis/gather.py +84 -0
- package/content/skills/resale/resale/analysis/runner.py +65 -0
- package/content/skills/resale/resale/analysis/stats.py +287 -0
- package/content/skills/resale/resale/api_client.py +34 -0
- package/content/skills/resale/resale/cadence/__init__.py +8 -0
- package/content/skills/resale/resale/cadence/budget.py +97 -0
- package/content/skills/resale/resale/cadence/schedule.py +64 -0
- package/content/skills/resale/resale/comps/__init__.py +4 -0
- package/content/skills/resale/resale/comps/commands.py +86 -0
- package/content/skills/resale/resale/comps/depreciation.json +26 -0
- package/content/skills/resale/resale/comps/depreciation.py +64 -0
- package/content/skills/resale/resale/comps/market_parse.py +184 -0
- package/content/skills/resale/resale/comps/market_value.py +106 -0
- package/content/skills/resale/resale/comps/ranking.py +69 -0
- package/content/skills/resale/resale/comps/relevance.py +85 -0
- package/content/skills/resale/resale/comps/retailers.py +46 -0
- package/content/skills/resale/resale/comps/review_runner.py +200 -0
- package/content/skills/resale/resale/comps/specs.py +122 -0
- package/content/skills/resale/resale/comps/trusted_retailers.json +186 -0
- package/content/skills/resale/resale/conditions.py +110 -0
- package/content/skills/resale/resale/contracts/__init__.py +151 -0
- package/content/skills/resale/resale/contracts/comp_decisions.schema.json +22 -0
- package/content/skills/resale/resale/contracts/event.schema.json +19 -0
- package/content/skills/resale/resale/contracts/item_specs.schema.json +29 -0
- package/content/skills/resale/resale/contracts/observation_batch.schema.json +50 -0
- package/content/skills/resale/resale/contracts/reader_state.schema.json +40 -0
- package/content/skills/resale/resale/contracts/reader_targets.schema.json +28 -0
- package/content/skills/resale/resale/contracts/review_decisions.schema.json +19 -0
- package/content/skills/resale/resale/credentials.py +80 -0
- package/content/skills/resale/resale/db/__init__.py +6 -0
- package/content/skills/resale/resale/db/migrate.py +72 -0
- package/content/skills/resale/resale/db/migrations/0001_init.sql +188 -0
- package/content/skills/resale/resale/db/migrations/0002_service.sql +37 -0
- package/content/skills/resale/resale/db/migrations/0003_image_url.sql +1 -0
- package/content/skills/resale/resale/db/migrations/0004_own_listings_nextdoor.sql +60 -0
- package/content/skills/resale/resale/db/migrations/0005_item_hidden.sql +2 -0
- package/content/skills/resale/resale/db/migrations/0006_market_snapshots.sql +56 -0
- package/content/skills/resale/resale/db/migrations/0007_item_price_proof.sql +4 -0
- package/content/skills/resale/resale/db/migrations/0008_market_trust.sql +4 -0
- package/content/skills/resale/resale/db/migrations/0009_item_paid_source.sql +1 -0
- package/content/skills/resale/resale/db/migrations/0010_analysis.sql +30 -0
- package/content/skills/resale/resale/db/migrations/0011_item_images.sql +25 -0
- package/content/skills/resale/resale/db/migrations/0012_page_images.sql +6 -0
- package/content/skills/resale/resale/db/migrations/0013_display_name_inbox.sql +9 -0
- package/content/skills/resale/resale/db/migrations/0014_listing_drafts.sql +16 -0
- package/content/skills/resale/resale/db/migrations/0015_post_kit.sql +14 -0
- package/content/skills/resale/resale/db/migrations/0016_comps_review.sql +12 -0
- package/content/skills/resale/resale/db/migrations/0017_search_terms.sql +1 -0
- package/content/skills/resale/resale/db/retention.py +17 -0
- package/content/skills/resale/resale/db/single_writer.py +37 -0
- package/content/skills/resale/resale/http_util.py +22 -0
- package/content/skills/resale/resale/inventory/__init__.py +10 -0
- package/content/skills/resale/resale/inventory/bundles.py +24 -0
- package/content/skills/resale/resale/inventory/lifecycle.py +42 -0
- package/content/skills/resale/resale/portal/__init__.py +1 -0
- package/content/skills/resale/resale/portal/bundles.py +51 -0
- package/content/skills/resale/resale/portal/layout.py +201 -0
- package/content/skills/resale/resale/portal/market_cells.py +119 -0
- package/content/skills/resale/resale/portal/names.py +35 -0
- package/content/skills/resale/resale/portal/panel.py +65 -0
- package/content/skills/resale/resale/portal/photos.py +111 -0
- package/content/skills/resale/resale/portal/tablesort.py +58 -0
- package/content/skills/resale/resale/portal/views_analysis.py +302 -0
- package/content/skills/resale/resale/portal/views_items.py +561 -0
- package/content/skills/resale/resale/portal/views_misc.py +93 -0
- package/content/skills/resale/resale/portal/views_postkit.py +237 -0
- package/content/skills/resale/resale/portal/views_reader.py +51 -0
- package/content/skills/resale/resale/portal/views_search.py +55 -0
- package/content/skills/resale/resale/postkit/__init__.py +5 -0
- package/content/skills/resale/resale/postkit/drafts.py +222 -0
- package/content/skills/resale/resale/postkit/groups.py +45 -0
- package/content/skills/resale/resale/postkit/platforms.py +113 -0
- package/content/skills/resale/resale/postkit/posting.py +65 -0
- package/content/skills/resale/resale/postkit/pricing.py +87 -0
- package/content/skills/resale/resale/postkit/text.py +224 -0
- package/content/skills/resale/resale/publisher/__init__.py +1 -0
- package/content/skills/resale/resale/publisher/adapters/__init__.py +10 -0
- package/content/skills/resale/resale/publisher/adapters/browser.py +70 -0
- package/content/skills/resale/resale/publisher/adapters/draft.py +46 -0
- package/content/skills/resale/resale/publisher/adapters/ebay.py +126 -0
- package/content/skills/resale/resale/publisher/adapters/forms.py +182 -0
- package/content/skills/resale/resale/publisher/allowlist.py +100 -0
- package/content/skills/resale/resale/publisher/api.py +203 -0
- package/content/skills/resale/resale/publisher/apply.py +82 -0
- package/content/skills/resale/resale/publisher/chrome_profile_lock.py +170 -0
- package/content/skills/resale/resale/publisher/client.py +87 -0
- package/content/skills/resale/resale/publisher/commands.py +301 -0
- package/content/skills/resale/resale/publisher/ebay_auth.py +109 -0
- package/content/skills/resale/resale/publisher/pricing.py +103 -0
- package/content/skills/resale/resale/publisher/profile_lock.py +15 -0
- package/content/skills/resale/resale/publisher/proposals.py +171 -0
- package/content/skills/resale/resale/publisher/review.py +225 -0
- package/content/skills/resale/resale/receipts/__init__.py +19 -0
- package/content/skills/resale/resale/receipts/commands.py +168 -0
- package/content/skills/resale/resale/receipts/intake.py +117 -0
- package/content/skills/resale/resale/receipts/links.py +50 -0
- package/content/skills/resale/resale/receipts/reader_link.py +66 -0
- package/content/skills/resale/resale/receipts/review.py +127 -0
- package/content/skills/resale/resale/receipts/store.py +335 -0
- package/content/skills/resale/resale/service/__init__.py +1 -0
- package/content/skills/resale/resale/service/app.py +80 -0
- package/content/skills/resale/resale/service/backup.py +398 -0
- package/content/skills/resale/resale/service/budget.py +31 -0
- package/content/skills/resale/resale/service/commands.py +208 -0
- package/content/skills/resale/resale/service/comp_gate.py +98 -0
- package/content/skills/resale/resale/service/comps_refresh.py +16 -0
- package/content/skills/resale/resale/service/comps_review.py +191 -0
- package/content/skills/resale/resale/service/comps_sanity.py +31 -0
- package/content/skills/resale/resale/service/comps_service.py +129 -0
- package/content/skills/resale/resale/service/display_names.py +69 -0
- package/content/skills/resale/resale/service/drafts.py +170 -0
- package/content/skills/resale/resale/service/ebay_follow.py +19 -0
- package/content/skills/resale/resale/service/ebay_poller.py +235 -0
- package/content/skills/resale/resale/service/fetch.py +80 -0
- package/content/skills/resale/resale/service/ingest.py +60 -0
- package/content/skills/resale/resale/service/integrations.py +20 -0
- package/content/skills/resale/resale/service/inventory_ops.py +255 -0
- package/content/skills/resale/resale/service/market.py +296 -0
- package/content/skills/resale/resale/service/multipart.py +36 -0
- package/content/skills/resale/resale/service/pageimage.py +83 -0
- package/content/skills/resale/resale/service/photo_inbox.py +141 -0
- package/content/skills/resale/resale/service/photos.py +138 -0
- package/content/skills/resale/resale/service/queries.py +109 -0
- package/content/skills/resale/resale/service/reader_state.py +37 -0
- package/content/skills/resale/resale/service/scheduler.py +242 -0
- package/content/skills/resale/resale/service/search_terms_plan.py +80 -0
- package/content/skills/resale/resale/service/server.py +740 -0
- package/content/skills/resale/resale/service/stock_photos.py +207 -0
- package/content/skills/resale/resale/service/store.py +111 -0
- package/content/skills/resale/resale/service/websearch.py +91 -0
- package/content/skills/resale/resale/settings.py +234 -0
- package/content/skills/resale/resale/sources/__init__.py +6 -0
- package/content/skills/resale/resale/sources/astromart.py +110 -0
- package/content/skills/resale/resale/sources/browser.py +59 -0
- package/content/skills/resale/resale/sources/cards.py +76 -0
- package/content/skills/resale/resale/sources/client.py +58 -0
- package/content/skills/resale/resale/sources/cloudynights.py +38 -0
- package/content/skills/resale/resale/sources/commands.py +112 -0
- package/content/skills/resale/resale/sources/completeness.py +17 -0
- package/content/skills/resale/resale/sources/craigslist.py +71 -0
- package/content/skills/resale/resale/sources/ebay.py +172 -0
- package/content/skills/resale/resale/sources/events.py +46 -0
- package/content/skills/resale/resale/sources/facebook.py +40 -0
- package/content/skills/resale/resale/sources/guards.py +37 -0
- package/content/skills/resale/resale/sources/hostlog.py +18 -0
- package/content/skills/resale/resale/sources/htmlparse.py +97 -0
- package/content/skills/resale/resale/sources/httppage.py +44 -0
- package/content/skills/resale/resale/sources/login_window.py +47 -0
- package/content/skills/resale/resale/sources/logins.py +90 -0
- package/content/skills/resale/resale/sources/model.py +118 -0
- package/content/skills/resale/resale/sources/notify.py +175 -0
- package/content/skills/resale/resale/sources/offerup.py +39 -0
- package/content/skills/resale/resale/sources/readonly.py +56 -0
- package/content/skills/resale/resale/sources/readonly_lint.py +86 -0
- package/content/skills/resale/resale/sources/runner.py +424 -0
- package/content/skills/resale/resale/sources/timeparse.py +55 -0
- package/content/skills/resale/resale/sources/transport.py +16 -0
- package/content/skills/resale/settings.example.env +69 -0
- package/content/skills/resale/tasks/.gitkeep +0 -0
- package/content/skills/resale/tasks/_bootstrap.py +23 -0
- package/content/skills/resale/tasks/comps_review_task.py +21 -0
- package/content/skills/resale/tasks/notifier_task.py +14 -0
- package/content/skills/resale/tasks/reader_task.py +19 -0
- package/content/skills/resale/tasks/task_items.json +50 -0
- package/content/skills/resale/tests/analysis_support.py +31 -0
- package/content/skills/resale/tests/conftest.py +74 -0
- package/content/skills/resale/tests/fixtures/edit_pages/astromart.html +12 -0
- package/content/skills/resale/tests/fixtures/edit_pages/cloudynights.html +12 -0
- package/content/skills/resale/tests/fixtures/edit_pages/craigslist.html +12 -0
- package/content/skills/resale/tests/fixtures/edit_pages/craigslist_step2.html +6 -0
- package/content/skills/resale/tests/fixtures/edit_pages/facebook.html +20 -0
- package/content/skills/resale/tests/fixtures/edit_pages/facebook_insights.html +1 -0
- package/content/skills/resale/tests/fixtures/reader/astromart_category.html +74 -0
- package/content/skills/resale/tests/fixtures/reader/astromart_detail_loggedout.html +332 -0
- package/content/skills/resale/tests/fixtures/reader/astromart_empty.html +431 -0
- package/content/skills/resale/tests/fixtures/reader/astromart_paged.html +1492 -0
- package/content/skills/resale/tests/fixtures/reader/astromart_search.html +114 -0
- package/content/skills/resale/tests/fixtures/reader/cloudynights_challenge.html +1 -0
- package/content/skills/resale/tests/fixtures/reader/craigslist_detail.html +290 -0
- package/content/skills/resale/tests/fixtures/reader/craigslist_empty.html +78 -0
- package/content/skills/resale/tests/fixtures/reader/craigslist_search.html +1 -0
- package/content/skills/resale/tests/fixtures/reader/facebook_detail.html +2 -0
- package/content/skills/resale/tests/fixtures/reader/facebook_empty.html +266 -0
- package/content/skills/resale/tests/fixtures/reader/facebook_search.html +1 -0
- package/content/skills/resale/tests/fixtures/reader/offerup_detail.html +5 -0
- package/content/skills/resale/tests/fixtures/reader/offerup_empty.html +1 -0
- package/content/skills/resale/tests/fixtures/reader/offerup_results_live.html +1 -0
- package/content/skills/resale/tests/fixtures/reader/offerup_search.html +1 -0
- package/content/skills/resale/tests/postkit_support.py +58 -0
- package/content/skills/resale/tests/publisher_helpers.py +143 -0
- package/content/skills/resale/tests/resale_home_guard.py +19 -0
- package/content/skills/resale/tests/service_support.py +98 -0
- package/content/skills/resale/tests/test_analysis_service.py +326 -0
- package/content/skills/resale/tests/test_analysis_stats.py +166 -0
- package/content/skills/resale/tests/test_backup.py +351 -0
- package/content/skills/resale/tests/test_bundle.py +332 -0
- package/content/skills/resale/tests/test_cadence.py +134 -0
- package/content/skills/resale/tests/test_candidates_review.py +246 -0
- package/content/skills/resale/tests/test_comps.py +68 -0
- package/content/skills/resale/tests/test_comps_relevance.py +45 -0
- package/content/skills/resale/tests/test_comps_review.py +443 -0
- package/content/skills/resale/tests/test_comps_review_task.py +221 -0
- package/content/skills/resale/tests/test_comps_specs.py +74 -0
- package/content/skills/resale/tests/test_conditions.py +68 -0
- package/content/skills/resale/tests/test_contracts.py +146 -0
- package/content/skills/resale/tests/test_db.py +183 -0
- package/content/skills/resale/tests/test_display_names_apply.py +79 -0
- package/content/skills/resale/tests/test_ebay_live_quality.py +224 -0
- package/content/skills/resale/tests/test_founder_hide.py +120 -0
- package/content/skills/resale/tests/test_isolation.py +35 -0
- package/content/skills/resale/tests/test_lifecycle.py +48 -0
- package/content/skills/resale/tests/test_market_parse.py +113 -0
- package/content/skills/resale/tests/test_market_service.py +332 -0
- package/content/skills/resale/tests/test_market_trust.py +138 -0
- package/content/skills/resale/tests/test_market_value.py +107 -0
- package/content/skills/resale/tests/test_photo_inbox.py +147 -0
- package/content/skills/resale/tests/test_photos_fetch.py +84 -0
- package/content/skills/resale/tests/test_photos_service.py +264 -0
- package/content/skills/resale/tests/test_portal_bundle_fold.py +95 -0
- package/content/skills/resale/tests/test_portal_bundles.py +65 -0
- package/content/skills/resale/tests/test_portal_candidates.py +131 -0
- package/content/skills/resale/tests/test_portal_inplace.py +126 -0
- package/content/skills/resale/tests/test_portal_market.py +133 -0
- package/content/skills/resale/tests/test_portal_names.py +86 -0
- package/content/skills/resale/tests/test_portal_photos.py +150 -0
- package/content/skills/resale/tests/test_portal_postkit.py +181 -0
- package/content/skills/resale/tests/test_portal_sort.py +90 -0
- package/content/skills/resale/tests/test_portal_split.py +211 -0
- package/content/skills/resale/tests/test_portal_theme.py +95 -0
- package/content/skills/resale/tests/test_postkit.py +528 -0
- package/content/skills/resale/tests/test_publisher_allowlist.py +91 -0
- package/content/skills/resale/tests/test_publisher_api.py +155 -0
- package/content/skills/resale/tests/test_publisher_apply.py +190 -0
- package/content/skills/resale/tests/test_publisher_commands.py +168 -0
- package/content/skills/resale/tests/test_publisher_ebay.py +125 -0
- package/content/skills/resale/tests/test_publisher_forms.py +181 -0
- package/content/skills/resale/tests/test_publisher_pricing.py +72 -0
- package/content/skills/resale/tests/test_publisher_proposals.py +109 -0
- package/content/skills/resale/tests/test_publisher_review.py +121 -0
- package/content/skills/resale/tests/test_purchase_search.py +90 -0
- package/content/skills/resale/tests/test_reader_link.py +53 -0
- package/content/skills/resale/tests/test_reader_lint.py +38 -0
- package/content/skills/resale/tests/test_reader_live_pages.py +61 -0
- package/content/skills/resale/tests/test_reader_model.py +59 -0
- package/content/skills/resale/tests/test_reader_notify.py +222 -0
- package/content/skills/resale/tests/test_reader_parsers.py +134 -0
- package/content/skills/resale/tests/test_reader_query.py +63 -0
- package/content/skills/resale/tests/test_reader_runner.py +487 -0
- package/content/skills/resale/tests/test_reader_state_portal.py +98 -0
- package/content/skills/resale/tests/test_receipts_intake.py +483 -0
- package/content/skills/resale/tests/test_retailers.py +24 -0
- package/content/skills/resale/tests/test_returns_intake.py +69 -0
- package/content/skills/resale/tests/test_search_terms.py +71 -0
- package/content/skills/resale/tests/test_search_terms_apply.py +76 -0
- package/content/skills/resale/tests/test_service_comps.py +98 -0
- package/content/skills/resale/tests/test_service_delete.py +126 -0
- package/content/skills/resale/tests/test_service_ebay.py +235 -0
- package/content/skills/resale/tests/test_service_gmail.py +61 -0
- package/content/skills/resale/tests/test_service_http.py +333 -0
- package/content/skills/resale/tests/test_service_ingest.py +48 -0
- package/content/skills/resale/tests/test_service_main.py +127 -0
- package/content/skills/resale/tests/test_service_migrations.py +38 -0
- package/content/skills/resale/tests/test_settings.py +150 -0
- package/content/skills/resale/tests/test_single_writer.py +53 -0
- package/content/skills/ship-the-code/SKILL.md +2 -2
- package/content/skills/ship-the-code/ship.py +115 -20
- package/content/skills/ship-the-code/tests/test_ship.py +4 -4
- package/content/skills/ship-the-code/tests/test_ship_containers.py +127 -0
- package/content/skills/ship-the-code/tests/test_ship_order.py +4 -2
- package/content/skills/ship-the-code/tests/test_ship_worktree_push.py +191 -0
- package/lib/bundleBackup.js +84 -0
- package/lib/bundleHeartbeat.js +41 -0
- package/lib/bundleRuntime.js +108 -0
- package/lib/bundleRuntimeStep.js +50 -0
- package/lib/bundleSettings.js +130 -0
- package/lib/claims.js +2 -1
- package/lib/codex.js +2 -1
- package/lib/components.js +5 -1
- package/lib/containerItems.js +189 -0
- package/lib/doctor.js +23 -5
- package/lib/hiddenTask/register_hidden_task.ps1 +69 -0
- package/lib/install.js +3 -2
- package/lib/itemKinds.js +13 -0
- package/lib/manifest.js +61 -1
- package/lib/mcpWiring.js +8 -7
- package/lib/menu.js +5 -1
- package/lib/pathTokens.js +21 -0
- package/lib/prerequisites.js +43 -0
- package/lib/runner/dockerChecks.js +1 -1
- package/lib/runner/stableCli.js +2 -2
- package/lib/secretFiles.js +97 -0
- package/lib/secretsPrompt.js +46 -13
- package/lib/secretsSet.js +28 -10
- package/lib/taskItems.js +171 -0
- package/lib/uninstall.js +5 -1
- package/lib/update.js +3 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -76,6 +76,9 @@ agents-cli install
|
|
|
76
76
|
non-interactively (`--yes` required to confirm). A bundle that declares
|
|
77
77
|
`deps` (e.g. `litellm`) also runs that dependency's component flow —
|
|
78
78
|
see [Components (LiteLLM-backed bundles)](#components-litellm-backed-bundles)
|
|
79
|
+
below. A `deps` entry that names another bundle (for example `resale`
|
|
80
|
+
depends on `gmail-reader`) installs that bundle first, as its own bundle with
|
|
81
|
+
its own secrets; update and uninstall treat it as a separate bundle.
|
|
79
82
|
below. After files are installed, hooks wired, and any component set up,
|
|
80
83
|
the CLI prompts (in a TTY) for any secret the bundle (or its component)
|
|
81
84
|
declares that isn't already set — see [Secrets](#secrets) below. `--yes`
|
|
@@ -278,6 +281,10 @@ testing) right after files are installed:
|
|
|
278
281
|
Context7's HTTP MCP works keylessly (rate-limited), so installing without
|
|
279
282
|
`CONTEXT7_API_KEY` set writes a `context7` entry with no `headers` key at
|
|
280
283
|
all, instead of blocking the install or writing a broken template string.
|
|
284
|
+
- **Per-machine paths.** `{{TARGET}}` (the install base, normally
|
|
285
|
+
`~/.claude`) and `{{HOME}}` may appear anywhere inside a string, for example
|
|
286
|
+
`"--userDataDir", "{{TARGET}}/resale/chrome-profile"`; they are replaced with
|
|
287
|
+
this machine's real paths when the entry is written.
|
|
281
288
|
- **Uninstall.** `agents-cli uninstall` removes exactly the `mcpServers`
|
|
282
289
|
entries this bundle wired (tracked per-bundle on the ledger). An entry
|
|
283
290
|
hand-edited since install (its current value no longer matches what was
|
|
@@ -420,6 +427,57 @@ is the `AGENTS_ENV_DIR` environment variable if set, else `~/.claude`. A real
|
|
|
420
427
|
environment variable always wins, so exporting a secret in your shell (or CI)
|
|
421
428
|
works with no `agents.env` file at all.
|
|
422
429
|
|
|
430
|
+
## Bundle runtime: containers, scheduled tasks, settings, file secrets
|
|
431
|
+
|
|
432
|
+
A bundle can run something after install, not only copy files. All four pieces
|
|
433
|
+
are declared in `manifest.json` and work for any bundle:
|
|
434
|
+
|
|
435
|
+
| Declaration | What `install` / `update` does | Uninstall | `doctor` |
|
|
436
|
+
|---|---|---|---|
|
|
437
|
+
| `kind: "container"` item, wiring `{project, containers[], envFile?, healthTimeoutS?}` | `docker compose -p <project> -f <deployed compose file> up -d --build`, then waits for the named containers to be running and healthy. The compose file must set `restart: unless-stopped` (or `always`) so Docker brings it back after a reboot. | `docker compose down` first, named volumes kept | docker engine, Docker Desktop start-at-sign-in, per container state, health and restart policy |
|
|
438
|
+
| `kind: "task"` item, wiring `{name, exe, args[], workingDirectory?, description?, logonDelay?, repeat?, keepRunning?}` | Registers a hidden Windows logon task (no elevation, `conhost --headless`, never a window) through `lib/hiddenTask/register_hidden_task.ps1`. Idempotent; windows and the default `~/.claude` install only. | task removed | task exists, enabled, same command line, running when `keepRunning` |
|
|
439
|
+
| bundle `settings: {example, target}` | The shipped example file (`KEY=default`, the comment above a key is its prompt, `(optional)` in it marks the key optional) is copied to `<target-dir>/<target>` once, each value is prompted in a terminal (Enter keeps), new example keys are appended on later runs, values you set are never overwritten. `--no-secrets` skips the prompts. | file kept | file exists, required keys have a value |
|
|
440
|
+
| secret `type: "file"` (plus `fileName`, `required`) | You give a path; a copy is stored owner-only in `<target-dir>/secret-files/` and its path is recorded under the secret name in `agents.env`. Non-interactive: pipe the path into `agents-cli secrets --set <NAME>`. | `secrets --remove <NAME>` also deletes the stored copy | listed in `secrets --list` and doctor, file existence checked |
|
|
441
|
+
|
|
442
|
+
`container` and `task` items ship no file of their own: `path` names a file
|
|
443
|
+
another item of the bundle copies (the compose file, the script a task runs),
|
|
444
|
+
and `args` / `workingDirectory` accept `{{TARGET}}` and `{{HOME}}`.
|
|
445
|
+
|
|
446
|
+
**Generated file secrets.** A file secret with `generated: true` (for example an
|
|
447
|
+
OAuth token written by the bundle's own consent command) is not prompted for at
|
|
448
|
+
install. The command writes it to `<target-dir>/secret-files/<fileName>`; that
|
|
449
|
+
path counts as set even without an `agents.env` entry, is passed to compose by
|
|
450
|
+
name, and shows in `secrets --list` and doctor.
|
|
451
|
+
|
|
452
|
+
**Fail closed.** Nothing starts while a `required` secret has no value or a
|
|
453
|
+
required settings key is empty; the install says which and how to fix it, and
|
|
454
|
+
re-running `agents-cli install --bundle <key> --yes` starts everything once the
|
|
455
|
+
values exist. The compose process sees the install base as
|
|
456
|
+
`AGENTS_TARGET_BASE`, the settings file path as `AGENTS_BUNDLE_SETTINGS` and
|
|
457
|
+
every secret the bundle declares as an environment variable, so a compose file
|
|
458
|
+
can use `${NAME}` interpolation.
|
|
459
|
+
|
|
460
|
+
**Backup.** A bundle whose service writes a nightly backup declares
|
|
461
|
+
`"backup": {"dirSetting", "defaultDir", "pattern", "maxAgeHours"}` in the manifest. `dirSetting` is the key in the bundle's
|
|
462
|
+
settings file that holds the host folder (`~` expands; empty falls back to `<install base>/<defaultDir>`). Install creates
|
|
463
|
+
the folder (default install only) and compose receives it as `AGENTS_BUNDLE_BACKUP_DIR` to bind-mount; compose also gets
|
|
464
|
+
the PC's IANA time zone as `AGENTS_HOST_TZ`. `doctor` reports a finding when the folder is missing, holds no file matching
|
|
465
|
+
`pattern`, or the newest match is older than `maxAgeHours`.
|
|
466
|
+
|
|
467
|
+
**Heartbeat.** A bundle whose hidden task keeps a state file declares
|
|
468
|
+
`"heartbeat": {"label", "file", "maxAgeHours"}` (`file` relative to the install base). `doctor` reports a finding when
|
|
469
|
+
the file is missing, older than `maxAgeHours`, or its `last_status` is `failed` (with `last_error`).
|
|
470
|
+
|
|
471
|
+
**Switches.** `--no-containers` (or `AGENTS_CLI_NO_CONTAINERS=1`) and
|
|
472
|
+
`--no-scheduled-tasks` (or `AGENTS_CLI_NO_SCHEDULED_TASKS=1`). Containers and
|
|
473
|
+
tasks are machine-wide, so they are only managed for the default `~/.claude`
|
|
474
|
+
install, never for a scratch `--target-dir`. `doctor --fix` re-runs the start
|
|
475
|
+
for a bundle whose runtime check found a problem.
|
|
476
|
+
|
|
477
|
+
If Docker is missing, stopped or not set to start at sign-in, the install and
|
|
478
|
+
`doctor` say so in plain words (with the Docker Desktop download link or the
|
|
479
|
+
setting to tick) instead of failing with a Docker error.
|
|
480
|
+
|
|
423
481
|
## Updating
|
|
424
482
|
|
|
425
483
|
```bash
|
|
@@ -427,6 +485,10 @@ agents-cli update --yes # every bundle recorded in the ledger
|
|
|
427
485
|
agents-cli update --bundle <key> --yes # one bundle
|
|
428
486
|
```
|
|
429
487
|
|
|
488
|
+
`update` also installs any prerequisite bundle (a bundle named in `deps`, resolved
|
|
489
|
+
transitively) that an installed bundle needs and the machine lacks, with the same steps
|
|
490
|
+
as `install --bundle`. `doctor` reports a missing prerequisite bundle.
|
|
491
|
+
|
|
430
492
|
Once this package is published, the real npx flow (nothing to install first)
|
|
431
493
|
is:
|
|
432
494
|
|
package/bin/cli.js
CHANGED
|
@@ -12,7 +12,7 @@ const pkg = JSON.parse(
|
|
|
12
12
|
const { installBundle, defaultTargetBase, InstallError } = require('../lib/install');
|
|
13
13
|
const { uninstallBundle, UninstallError } = require('../lib/uninstall');
|
|
14
14
|
const { isTestRun } = require('../lib/testRun');
|
|
15
|
-
const { loadManifest, findBundle, ManifestError } = require('../lib/manifest');
|
|
15
|
+
const { loadManifest, findBundle, withBundleDeps, missingBundleDeps, ManifestError } = require('../lib/manifest');
|
|
16
16
|
const { loadLedger, saveLedger, bundleKeysInLedger, LedgerError } = require('../lib/ledger');
|
|
17
17
|
const { updateBundles, UpdateError } = require('../lib/update');
|
|
18
18
|
const { formatVersionBanner } = require('../lib/version-banner');
|
|
@@ -50,6 +50,9 @@ const pwshStore = require('../lib/pwshStore');
|
|
|
50
50
|
const { staleCheckoutGate } = require('../lib/staleCheckout');
|
|
51
51
|
const releaseLock = require('../lib/releaseLock');
|
|
52
52
|
const claudeProfile = require('../lib/claudeProfile');
|
|
53
|
+
const { promptBundleSettingsStep, activateBundlesStep } = require('../lib/bundleRuntimeStep');
|
|
54
|
+
const secretFiles = require('../lib/secretFiles');
|
|
55
|
+
const { declaredSecrets } = require('../lib/secretsSet');
|
|
53
56
|
|
|
54
57
|
const PACKAGE_ROOT = path.join(__dirname, '..');
|
|
55
58
|
// One styler for the whole process: colors on only for a real TTY stdout
|
|
@@ -121,7 +124,9 @@ Flags for install:
|
|
|
121
124
|
--target-dir <path> Install target base, default ~/.claude (use for testing)
|
|
122
125
|
--target-config <path> MCP config file to wire into, default the sibling .claude.json
|
|
123
126
|
next to --target-dir (use for testing)
|
|
124
|
-
--no-secrets Skip secret prompting for this install (--yes alone does not skip it)
|
|
127
|
+
--no-secrets Skip secret and bundle-settings prompting for this install (--yes alone does not skip it)
|
|
128
|
+
--no-containers Do not start a bundle's containers (docker compose up) after the install
|
|
129
|
+
--no-scheduled-tasks Do not register a bundle's hidden Windows scheduled tasks
|
|
125
130
|
|
|
126
131
|
Flags for uninstall:
|
|
127
132
|
--bundle <key> Bundle to uninstall (required)
|
|
@@ -133,6 +138,8 @@ Flags for uninstall:
|
|
|
133
138
|
Flags for secrets:
|
|
134
139
|
--bundle <key> Limit to one bundle's declared secrets (default: every installed bundle)
|
|
135
140
|
--list List secret names + set/missing status instead of prompting
|
|
141
|
+
--set <NAME> Store one secret from a pipe or a masked prompt; for a file secret the value is the file's path
|
|
142
|
+
--remove <NAME> Remove one secret (a file secret's stored copy is deleted too)
|
|
136
143
|
--target-dir <path> Install target base, default ~/.claude (use for testing)
|
|
137
144
|
|
|
138
145
|
Flags for update:
|
|
@@ -146,6 +153,7 @@ Flags for update:
|
|
|
146
153
|
--keep-mine Non-interactive: resolve every file conflict by keeping your on-disk version
|
|
147
154
|
--repair Also restore files whose source did not change but whose deployed copy differs from the
|
|
148
155
|
install record (normally kept as local edits); use when doctor reports drift
|
|
156
|
+
--no-secrets Skip secret and settings prompting for a dependency bundle this update installs
|
|
149
157
|
--allow-stale Update even when this checkout is behind origin's default branch (default: refused;
|
|
150
158
|
doctor checks ledger hashes, not source drift, so it cannot catch a stale deploy)
|
|
151
159
|
|
|
@@ -247,7 +255,7 @@ deletes or modifies anything; deciding what to do about a finding is a separate
|
|
|
247
255
|
}
|
|
248
256
|
|
|
249
257
|
function parseInstallArgs(argv) {
|
|
250
|
-
const args = { bundle: null, yes: false, targetDir: null, targetConfig: null, advanced: false, noSecrets: false, noScheduledTasks: false, profile: 'public' };
|
|
258
|
+
const args = { bundle: null, yes: false, targetDir: null, targetConfig: null, advanced: false, noSecrets: false, noScheduledTasks: false, noContainers: false, profile: 'public' };
|
|
251
259
|
for (let i = 0; i < argv.length; i += 1) {
|
|
252
260
|
const arg = argv[i];
|
|
253
261
|
if (arg === '--bundle') {
|
|
@@ -270,6 +278,8 @@ function parseInstallArgs(argv) {
|
|
|
270
278
|
i += 1;
|
|
271
279
|
} else if (arg === '--no-scheduled-tasks') {
|
|
272
280
|
args.noScheduledTasks = true;
|
|
281
|
+
} else if (arg === '--no-containers') {
|
|
282
|
+
args.noContainers = true;
|
|
273
283
|
} else {
|
|
274
284
|
throw new InstallError(`Unknown install flag: ${arg}`);
|
|
275
285
|
}
|
|
@@ -588,7 +598,7 @@ function fetchLatestVersion(pkgName, { timeoutMs = 1500 } = {}) {
|
|
|
588
598
|
});
|
|
589
599
|
}
|
|
590
600
|
|
|
591
|
-
async function runInteractiveMenu({ advanced, targetDir, targetConfig, noSecrets, noScheduledTasks, profile, captureSelection = false }) {
|
|
601
|
+
async function runInteractiveMenu({ advanced, targetDir, targetConfig, noSecrets, noScheduledTasks, noContainers, profile, captureSelection = false }) {
|
|
592
602
|
const { manifest, manifestPath } = loadManifest(PACKAGE_ROOT);
|
|
593
603
|
const repoRoot = path.dirname(manifestPath);
|
|
594
604
|
const candidateBundles = advanced ? advancedMenuBundles(manifest, profile) : basicMenuBundles(manifest, profile);
|
|
@@ -669,12 +679,22 @@ async function runInteractiveMenu({ advanced, targetDir, targetConfig, noSecrets
|
|
|
669
679
|
}
|
|
670
680
|
}
|
|
671
681
|
|
|
682
|
+
const baseDir = targetDir || defaultTargetBase();
|
|
683
|
+
await promptBundleSettingsStep({ bundles: installedBundles, repoRoot, targetBase: baseDir, noSecrets, log: console.log, mark });
|
|
672
684
|
await promptForMissingSecrets({
|
|
673
685
|
bundles: installedBundles,
|
|
674
|
-
targetBase:
|
|
686
|
+
targetBase: baseDir,
|
|
675
687
|
noSecrets,
|
|
676
688
|
manifest,
|
|
677
689
|
});
|
|
690
|
+
activateBundlesStep({
|
|
691
|
+
selections: installedResults.map(({ bundle, itemPaths }) => ({ bundle, itemPaths })),
|
|
692
|
+
repoRoot,
|
|
693
|
+
targetBase: baseDir,
|
|
694
|
+
noScheduledTasks,
|
|
695
|
+
noContainers,
|
|
696
|
+
mark,
|
|
697
|
+
});
|
|
678
698
|
|
|
679
699
|
if (installedBundles.length > 0) {
|
|
680
700
|
runSelfProfileStepsIfNeeded({ profile, targetDir });
|
|
@@ -707,6 +727,7 @@ async function runInstall(argv, { captureSelection = false } = {}) {
|
|
|
707
727
|
targetConfig: args.targetConfig,
|
|
708
728
|
noSecrets: args.noSecrets,
|
|
709
729
|
noScheduledTasks: args.noScheduledTasks,
|
|
730
|
+
noContainers: args.noContainers,
|
|
710
731
|
profile: args.profile,
|
|
711
732
|
captureSelection,
|
|
712
733
|
});
|
|
@@ -718,25 +739,16 @@ async function runInstall(argv, { captureSelection = false } = {}) {
|
|
|
718
739
|
}
|
|
719
740
|
|
|
720
741
|
try {
|
|
721
|
-
const { manifest } = loadManifest(PACKAGE_ROOT);
|
|
742
|
+
const { manifest, manifestPath } = loadManifest(PACKAGE_ROOT);
|
|
743
|
+
const repoRoot = path.dirname(manifestPath);
|
|
722
744
|
const bundle = findBundle(manifest, args.bundle);
|
|
723
|
-
const
|
|
724
|
-
|
|
725
|
-
bundleTitle: bundle ? bundle.title : args.bundle,
|
|
726
|
-
targetDir: args.targetDir,
|
|
727
|
-
targetConfig: args.targetConfig,
|
|
728
|
-
});
|
|
729
|
-
await promptForMissingSecrets({
|
|
730
|
-
bundles: bundle ? [bundle] : [],
|
|
731
|
-
targetBase: args.targetDir || defaultTargetBase(),
|
|
732
|
-
noSecrets: args.noSecrets,
|
|
733
|
-
manifest,
|
|
734
|
-
});
|
|
745
|
+
const installKeys = bundle ? withBundleDeps(manifest, [args.bundle]) : [args.bundle];
|
|
746
|
+
const { results, result } = await installBundleChain({ manifest, repoRoot, installKeys, args });
|
|
735
747
|
runSelfProfileStepsIfNeeded({ profile: args.profile, targetDir: args.targetDir });
|
|
736
748
|
runMemSamplerStep({ targetDir: args.targetDir, noScheduledTasks: args.noScheduledTasks });
|
|
737
|
-
printPythonSyncIssues(
|
|
738
|
-
printModVersionWarnings(
|
|
739
|
-
await runRunnerBannerStep({ bundleKeys:
|
|
749
|
+
printPythonSyncIssues(results);
|
|
750
|
+
printModVersionWarnings(installKeys, result.targetBase);
|
|
751
|
+
await runRunnerBannerStep({ bundleKeys: installKeys, targetDir: args.targetDir });
|
|
740
752
|
return 0;
|
|
741
753
|
} catch (err) {
|
|
742
754
|
if (err instanceof InstallError || err instanceof ManifestError || err instanceof LedgerError || err instanceof WiringError) {
|
|
@@ -747,6 +759,27 @@ async function runInstall(argv, { captureSelection = false } = {}) {
|
|
|
747
759
|
}
|
|
748
760
|
}
|
|
749
761
|
|
|
762
|
+
/** Install `installKeys` (prerequisites first) with every install step: files, settings, secrets, tasks, containers. */
|
|
763
|
+
async function installBundleChain({ manifest, repoRoot, installKeys, args }) {
|
|
764
|
+
const results = installKeys.map((key) => {
|
|
765
|
+
const target = findBundle(manifest, key);
|
|
766
|
+
return installOneBundle({
|
|
767
|
+
bundleKey: key,
|
|
768
|
+
bundleTitle: target ? target.title : key,
|
|
769
|
+
targetDir: args.targetDir,
|
|
770
|
+
targetConfig: args.targetConfig,
|
|
771
|
+
});
|
|
772
|
+
});
|
|
773
|
+
const bundles = installKeys.map((key) => findBundle(manifest, key)).filter(Boolean);
|
|
774
|
+
const baseDir = args.targetDir || defaultTargetBase();
|
|
775
|
+
await promptBundleSettingsStep({ bundles, repoRoot, targetBase: baseDir, noSecrets: args.noSecrets, log: console.log, mark });
|
|
776
|
+
await promptForMissingSecrets({ bundles, targetBase: baseDir, noSecrets: args.noSecrets, manifest });
|
|
777
|
+
if (bundles.length > 0) {
|
|
778
|
+
activateBundlesStep({ selections: bundles.map((b) => ({ bundle: b })), repoRoot, targetBase: baseDir, noScheduledTasks: args.noScheduledTasks, noContainers: args.noContainers, mark });
|
|
779
|
+
}
|
|
780
|
+
return { results, result: results[results.length - 1] };
|
|
781
|
+
}
|
|
782
|
+
|
|
750
783
|
async function runRunnerBannerStep({ bundleKeys, targetDir }) {
|
|
751
784
|
if (!bundleKeys.includes('runner')) return;
|
|
752
785
|
try {
|
|
@@ -833,6 +866,9 @@ async function runUninstall(argv) {
|
|
|
833
866
|
`${result.mcpKeptUserEdited.join(', ')}`
|
|
834
867
|
);
|
|
835
868
|
}
|
|
869
|
+
for (const entry of [...result.runtime.containers, ...result.runtime.tasks]) {
|
|
870
|
+
if (!['blocked'].includes(entry.action)) console.log(` ${mark(entry.action === 'failed' ? 'fail' : 'ok')} ${entry.message}`);
|
|
871
|
+
}
|
|
836
872
|
for (const component of result.components || []) {
|
|
837
873
|
if (component.kept) {
|
|
838
874
|
console.log(` Component "${component.key}": still depended on by another installed bundle — left as-is.`);
|
|
@@ -952,12 +988,14 @@ async function runSecrets(argv) {
|
|
|
952
988
|
|
|
953
989
|
if (args.remove) {
|
|
954
990
|
const name = args.remove;
|
|
991
|
+
const fileSecret = [...declaredSecrets(manifest).values()].find((sec) => sec.name === name && secretFiles.isFileSecret(sec));
|
|
955
992
|
const removal = removeSecret(targetBase, name);
|
|
993
|
+
if (removal.existed && fileSecret && secretFiles.removeSecretFile(targetBase, removal.value)) console.log(`Deleted the stored copy ${removal.value}.`);
|
|
956
994
|
if (!removal.existed) {
|
|
957
995
|
console.error(`${name} is not set in ${envPath(targetBase)} — nothing to remove.`);
|
|
958
996
|
return 1;
|
|
959
997
|
}
|
|
960
|
-
console.log(`Removed ${name} (was ${maskValue(removal.value)}) from ${envPath(targetBase)}.`);
|
|
998
|
+
console.log(`Removed ${name} (was ${fileSecret ? removal.value : maskValue(removal.value)}) from ${envPath(targetBase)}.`);
|
|
961
999
|
if (removal.warning) {
|
|
962
1000
|
console.log(` Warning: ${removal.warning}`);
|
|
963
1001
|
}
|
|
@@ -1042,7 +1080,12 @@ async function runSecrets(argv) {
|
|
|
1042
1080
|
if (args.list) {
|
|
1043
1081
|
console.log(`Secrets for ${bundles.map((b) => b.key).join(', ')} (status only — values are never shown):`);
|
|
1044
1082
|
for (const secret of declared) {
|
|
1045
|
-
|
|
1083
|
+
if (secretFiles.isFileSecret(secret)) {
|
|
1084
|
+
const st = secretFiles.secretStatus(secret, targetBase);
|
|
1085
|
+
console.log(` ${secret.name} (file${secret.required ? ', required' : ''}${secret.generated ? ', written by the bundle after install' : ''}): ${st.status === 'file-missing' ? `missing - ${st.path} does not exist` : st.status}`);
|
|
1086
|
+
} else {
|
|
1087
|
+
console.log(` ${secret.name}${secret.required ? ' (required)' : ''}: ${isResolved(secret.name, targetBase) ? 'set' : 'missing'}`);
|
|
1088
|
+
}
|
|
1046
1089
|
}
|
|
1047
1090
|
return 0;
|
|
1048
1091
|
}
|
|
@@ -1054,8 +1097,26 @@ async function runSecrets(argv) {
|
|
|
1054
1097
|
return 0;
|
|
1055
1098
|
}
|
|
1056
1099
|
|
|
1100
|
+
/** After an update: top up each updated bundle's settings file and re-run its idempotent task/container start. */
|
|
1101
|
+
function refreshBundleRuntime({ result, args, json, skipKeys = [] }) {
|
|
1102
|
+
const { manifest, manifestPath } = loadManifest(PACKAGE_ROOT);
|
|
1103
|
+
const repoRoot = path.dirname(manifestPath);
|
|
1104
|
+
const targetBase = result.targetBase;
|
|
1105
|
+
const selections = result.bundles.filter((b) => !skipKeys.includes(b.bundle)).map((b) => findBundle(manifest, b.bundle)).filter(Boolean).map((bundle) => ({ bundle }));
|
|
1106
|
+
for (const { bundle } of selections) require('../lib/bundleSettings').ensureSettingsFile({ bundle, repoRoot, targetBase });
|
|
1107
|
+
return activateBundlesStep({
|
|
1108
|
+
selections,
|
|
1109
|
+
repoRoot,
|
|
1110
|
+
targetBase,
|
|
1111
|
+
noScheduledTasks: args.noScheduledTasks,
|
|
1112
|
+
noContainers: args.noContainers,
|
|
1113
|
+
log: json ? () => {} : console.log,
|
|
1114
|
+
mark,
|
|
1115
|
+
});
|
|
1116
|
+
}
|
|
1117
|
+
|
|
1057
1118
|
function parseUpdateArgs(argv) {
|
|
1058
|
-
const args = { bundle: null, yes: false, targetDir: null, targetConfig: null, json: false, theirs: false, keepMine: false, noScheduledTasks: false, allowStale: false, repair: false };
|
|
1119
|
+
const args = { bundle: null, yes: false, targetDir: null, targetConfig: null, json: false, theirs: false, keepMine: false, noScheduledTasks: false, noContainers: false, noSecrets: false, allowStale: false, repair: false };
|
|
1059
1120
|
for (let i = 0; i < argv.length; i += 1) {
|
|
1060
1121
|
const arg = argv[i];
|
|
1061
1122
|
if (arg === '--bundle') {
|
|
@@ -1077,6 +1138,10 @@ function parseUpdateArgs(argv) {
|
|
|
1077
1138
|
args.keepMine = true;
|
|
1078
1139
|
} else if (arg === '--no-scheduled-tasks') {
|
|
1079
1140
|
args.noScheduledTasks = true;
|
|
1141
|
+
} else if (arg === '--no-containers') {
|
|
1142
|
+
args.noContainers = true;
|
|
1143
|
+
} else if (arg === '--no-secrets') {
|
|
1144
|
+
args.noSecrets = true;
|
|
1080
1145
|
} else if (arg === '--allow-stale') {
|
|
1081
1146
|
args.allowStale = true;
|
|
1082
1147
|
} else if (arg === '--repair') {
|
|
@@ -1129,6 +1194,25 @@ function summarizeComponentUpdate(c) {
|
|
|
1129
1194
|
return `Component "${c.component}": ${parts.join(', ') || 'no changes'}.`;
|
|
1130
1195
|
}
|
|
1131
1196
|
|
|
1197
|
+
/** Install the prerequisite bundles that the installed (or `--bundle`) bundles need but the machine lacks, exactly as `install --bundle` does. */
|
|
1198
|
+
async function installMissingDeps(args) {
|
|
1199
|
+
const { manifest, manifestPath } = loadManifest(PACKAGE_ROOT);
|
|
1200
|
+
const targetBase = args.targetDir || defaultTargetBase();
|
|
1201
|
+
const installed = new Set(bundleKeysInLedger(loadLedger(targetBase, pkg.version)));
|
|
1202
|
+
const roots = args.bundle ? [args.bundle].filter((key) => installed.has(key)) : [...installed];
|
|
1203
|
+
const missing = missingBundleDeps(manifest, roots).filter((key) => !installed.has(key));
|
|
1204
|
+
if (missing.length === 0) return [];
|
|
1205
|
+
const realLog = console.log;
|
|
1206
|
+
if (args.json) console.log = (...parts) => console.error(...parts);
|
|
1207
|
+
try {
|
|
1208
|
+
console.log(`Installing missing dependency bundle(s): ${missing.join(', ')}`);
|
|
1209
|
+
await installBundleChain({ manifest, repoRoot: path.dirname(manifestPath), installKeys: missing, args });
|
|
1210
|
+
} finally {
|
|
1211
|
+
console.log = realLog;
|
|
1212
|
+
}
|
|
1213
|
+
return missing;
|
|
1214
|
+
}
|
|
1215
|
+
|
|
1132
1216
|
async function runUpdate(argv) {
|
|
1133
1217
|
let args;
|
|
1134
1218
|
try {
|
|
@@ -1148,6 +1232,7 @@ async function runUpdate(argv) {
|
|
|
1148
1232
|
try {
|
|
1149
1233
|
const stale = staleCheckoutGate(path.dirname(loadManifest(PACKAGE_ROOT).manifestPath), { allowStale: args.allowStale });
|
|
1150
1234
|
if (stale !== null) return stale;
|
|
1235
|
+
const installedDeps = await installMissingDeps(args);
|
|
1151
1236
|
const result = await updateBundles({
|
|
1152
1237
|
packageRoot: PACKAGE_ROOT,
|
|
1153
1238
|
bundleKey: args.bundle,
|
|
@@ -1158,7 +1243,9 @@ async function runUpdate(argv) {
|
|
|
1158
1243
|
mcpConfigPath: args.targetConfig,
|
|
1159
1244
|
});
|
|
1160
1245
|
|
|
1246
|
+
result.installedDeps = installedDeps;
|
|
1161
1247
|
result.memSampler = runMemSamplerStep({ targetDir: args.targetDir, noScheduledTasks: args.noScheduledTasks, quiet: true });
|
|
1248
|
+
result.runtime = refreshBundleRuntime({ result, args, json: args.json, skipKeys: installedDeps });
|
|
1162
1249
|
|
|
1163
1250
|
if (args.json) {
|
|
1164
1251
|
console.log(JSON.stringify(result, null, 2));
|
|
@@ -1447,6 +1534,16 @@ async function withProjectHookStep(argv, run, { healBypass = false } = {}) {
|
|
|
1447
1534
|
return code;
|
|
1448
1535
|
}
|
|
1449
1536
|
|
|
1537
|
+
/** doctor --fix: re-run the idempotent task/container start for every bundle whose runtime check found a problem. */
|
|
1538
|
+
function fixBundleRuntimes(result, { json }) {
|
|
1539
|
+
const broken = (result.bundleRuntimes || []).filter((b) => !b.healthy).map((b) => b.bundle);
|
|
1540
|
+
if (broken.length === 0) return [];
|
|
1541
|
+
const { manifest, manifestPath } = loadManifest(PACKAGE_ROOT);
|
|
1542
|
+
const selections = broken.map((key) => findBundle(manifest, key)).filter(Boolean).map((bundle) => ({ bundle }));
|
|
1543
|
+
activateBundlesStep({ selections, repoRoot: path.dirname(manifestPath), targetBase: result.targetBase, log: json ? () => {} : console.log, mark });
|
|
1544
|
+
return broken;
|
|
1545
|
+
}
|
|
1546
|
+
|
|
1450
1547
|
function runDoctor(argv) {
|
|
1451
1548
|
let args;
|
|
1452
1549
|
try {
|
|
@@ -1457,10 +1554,15 @@ function runDoctor(argv) {
|
|
|
1457
1554
|
}
|
|
1458
1555
|
|
|
1459
1556
|
try {
|
|
1460
|
-
|
|
1557
|
+
let result = checkHealth({
|
|
1461
1558
|
packageRoot: PACKAGE_ROOT,
|
|
1462
1559
|
targetBase: args.targetDir,
|
|
1463
1560
|
});
|
|
1561
|
+
const fixedRuntimes = args.fix ? fixBundleRuntimes(result, { json: args.json }) : [];
|
|
1562
|
+
if (fixedRuntimes.length > 0) {
|
|
1563
|
+
result = checkHealth({ packageRoot: PACKAGE_ROOT, targetBase: args.targetDir });
|
|
1564
|
+
result.runtimeFixed = fixedRuntimes;
|
|
1565
|
+
}
|
|
1464
1566
|
|
|
1465
1567
|
const scope = {
|
|
1466
1568
|
cwd: process.cwd(),
|
|
@@ -1560,6 +1662,21 @@ function runDoctor(argv) {
|
|
|
1560
1662
|
for (const f of p.findings) console.log(` ${mark('skip')} ${f}`);
|
|
1561
1663
|
};
|
|
1562
1664
|
|
|
1665
|
+
const printBundleRuntimes = () => {
|
|
1666
|
+
for (const b of result.bundleRuntimes || []) {
|
|
1667
|
+
console.log(`\nBundle "${b.bundle}" runtime:`);
|
|
1668
|
+
for (const sec of b.secrets) console.log(` secret ${sec.name} (${sec.type}${sec.required ? ', required' : ''}): ${sec.status}`);
|
|
1669
|
+
if (b.settings) console.log(` settings ${b.settings.file}: ${b.settings.status}${b.settings.missing.length ? ` (missing ${b.settings.missing.join(', ')})` : ''}`);
|
|
1670
|
+
for (const c of b.containers) {
|
|
1671
|
+
console.log(` container project ${c.project}: docker ${c.docker.state}, start at sign-in ${c.autostart.status}`);
|
|
1672
|
+
for (const k of c.containers) console.log(` ${k.name}: ${k.state}${k.health ? `/${k.health}` : ''}, restart ${k.restart || 'no'}`);
|
|
1673
|
+
}
|
|
1674
|
+
for (const t of b.tasks) console.log(` task ${t.name}: ${t.state}${t.reason ? ` (${t.reason})` : ''}${t.matches === false ? ' (differs from the manifest)' : ''}`);
|
|
1675
|
+
for (const f of b.findings) console.log(` ${mark('fail')} ${f}`);
|
|
1676
|
+
if (b.healthy) console.log(` ${mark('ok')} healthy`);
|
|
1677
|
+
}
|
|
1678
|
+
};
|
|
1679
|
+
|
|
1563
1680
|
const printRoutingMod = () => {
|
|
1564
1681
|
if (!result.routingMod) return;
|
|
1565
1682
|
console.log('\nModel routing:');
|
|
@@ -1577,6 +1694,7 @@ function runDoctor(argv) {
|
|
|
1577
1694
|
printMemorySafety();
|
|
1578
1695
|
printPortal();
|
|
1579
1696
|
printPwshStore();
|
|
1697
|
+
printBundleRuntimes();
|
|
1580
1698
|
printModeDrift();
|
|
1581
1699
|
return 0;
|
|
1582
1700
|
}
|
|
@@ -1601,6 +1719,7 @@ function runDoctor(argv) {
|
|
|
1601
1719
|
printMemorySafety();
|
|
1602
1720
|
printPortal();
|
|
1603
1721
|
printPwshStore();
|
|
1722
|
+
printBundleRuntimes();
|
|
1604
1723
|
printProjectHooks();
|
|
1605
1724
|
printPythonLaunchReport(py);
|
|
1606
1725
|
printModeDrift();
|