@galaxyproject/orbit 0.0.0 → 0.9.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 +123 -0
- package/LICENSE +21 -0
- package/README.md +760 -5
- package/bin/legacy-mcp-config.js +363 -0
- package/bin/orbit.js +810 -0
- package/bin/pi-extension-path.d.ts +4 -0
- package/bin/pi-extension-path.js +44 -0
- package/bin/provider-auth.d.ts +22 -0
- package/bin/provider-auth.js +77 -0
- package/bin/thinking-pref.js +38 -0
- package/bin/update-check.d.ts +15 -0
- package/bin/update-check.js +137 -0
- package/extensions/cli-update/index.ts +32 -0
- package/extensions/orbit/activity-hooks.ts +141 -0
- package/extensions/orbit/activity.ts +116 -0
- package/extensions/orbit/agent-dir.ts +11 -0
- package/extensions/orbit/auto-resume.ts +352 -0
- package/extensions/orbit/config.ts +3 -0
- package/extensions/orbit/confusables.ts +1 -0
- package/extensions/orbit/context.ts +957 -0
- package/extensions/orbit/dashboard-commands.ts +191 -0
- package/extensions/orbit/dashboard-store.ts +473 -0
- package/extensions/orbit/dashboard-tools.ts +1185 -0
- package/extensions/orbit/empty-completion.ts +99 -0
- package/extensions/orbit/evidence-gate.ts +1276 -0
- package/extensions/orbit/evidence-override-command.ts +294 -0
- package/extensions/orbit/exec-guard/bash-risk.ts +1408 -0
- package/extensions/orbit/exec-guard/gate.ts +181 -0
- package/extensions/orbit/exec-guard/guardian-config.ts +54 -0
- package/extensions/orbit/exec-guard/index.ts +1 -0
- package/extensions/orbit/exec-guard/model-tier.ts +36 -0
- package/extensions/orbit/exec-guard/path-jail.ts +54 -0
- package/extensions/orbit/exec-guard/policy.ts +342 -0
- package/extensions/orbit/exec-guard/runtime-state.ts +15 -0
- package/extensions/orbit/exec-guard/sensitive-read.ts +525 -0
- package/extensions/orbit/exec-guard/types.ts +42 -0
- package/extensions/orbit/execution-commands.ts +134 -0
- package/extensions/orbit/feedback-command.ts +81 -0
- package/extensions/orbit/feedback.ts +96 -0
- package/extensions/orbit/galaxy-api.test.ts +122 -0
- package/extensions/orbit/galaxy-api.ts +606 -0
- package/extensions/orbit/galaxy-artifact-link-guidance.ts +5 -0
- package/extensions/orbit/galaxy-destructive-gate.ts +113 -0
- package/extensions/orbit/galaxy-enrich.ts +1108 -0
- package/extensions/orbit/galaxy-failure.ts +101 -0
- package/extensions/orbit/galaxy-fixture.ts +126 -0
- package/extensions/orbit/galaxy-history-guard.ts +233 -0
- package/extensions/orbit/galaxy-job-block.ts +347 -0
- package/extensions/orbit/galaxy-job-ops.ts +288 -0
- package/extensions/orbit/galaxy-live-source.ts +929 -0
- package/extensions/orbit/galaxy-markdown-adapter.ts +248 -0
- package/extensions/orbit/galaxy-op-policy.ts +332 -0
- package/extensions/orbit/galaxy-ops-tools.ts +326 -0
- package/extensions/orbit/galaxy-output-store.ts +80 -0
- package/extensions/orbit/galaxy-output.ts +346 -0
- package/extensions/orbit/galaxy-page-binding.ts +222 -0
- package/extensions/orbit/galaxy-page-markdown-guidance.ts +15 -0
- package/extensions/orbit/galaxy-page-ops.ts +159 -0
- package/extensions/orbit/galaxy-page-sync.test.ts +417 -0
- package/extensions/orbit/galaxy-page-sync.ts +318 -0
- package/extensions/orbit/galaxy-pages-api.ts +203 -0
- package/extensions/orbit/galaxy-pages-sync.ts +409 -0
- package/extensions/orbit/galaxy-poll-guard.ts +189 -0
- package/extensions/orbit/galaxy-poller.ts +706 -0
- package/extensions/orbit/galaxy-provenance.ts +623 -0
- package/extensions/orbit/galaxy-reconcile.ts +956 -0
- package/extensions/orbit/galaxy-recovery.ts +176 -0
- package/extensions/orbit/galaxy-repeat-guard.ts +55 -0
- package/extensions/orbit/galaxy-submission-capture.ts +707 -0
- package/extensions/orbit/galaxy-submission.ts +502 -0
- package/extensions/orbit/galaxy-tool-source.ts +78 -0
- package/extensions/orbit/galaxy-tool-wrap.ts +234 -0
- package/extensions/orbit/galaxy-udt-block.ts +127 -0
- package/extensions/orbit/galaxy-upload-tus.ts +334 -0
- package/extensions/orbit/galaxy-upload.ts +300 -0
- package/extensions/orbit/galaxy-version-capture.ts +65 -0
- package/extensions/orbit/git.ts +173 -0
- package/extensions/orbit/harness-block-fields.ts +597 -0
- package/extensions/orbit/index.ts +593 -0
- package/extensions/orbit/init-gate.ts +284 -0
- package/extensions/orbit/instructions-command.ts +136 -0
- package/extensions/orbit/invocation-failure-hint.ts +57 -0
- package/extensions/orbit/iwc-plan-check.ts +94 -0
- package/extensions/orbit/lesson-command.ts +303 -0
- package/extensions/orbit/lesson-hint.ts +245 -0
- package/extensions/orbit/lesson-nudge.ts +106 -0
- package/extensions/orbit/lessons/compose.ts +177 -0
- package/extensions/orbit/lessons/counters.ts +120 -0
- package/extensions/orbit/lessons/enabled.ts +116 -0
- package/extensions/orbit/lessons/matcher.ts +346 -0
- package/extensions/orbit/lessons/paths.ts +286 -0
- package/extensions/orbit/lessons/pi-event-contract.ts +105 -0
- package/extensions/orbit/lessons/propose-replay.ts +103 -0
- package/extensions/orbit/lessons/propose-tool.ts +222 -0
- package/extensions/orbit/lessons/propose.ts +502 -0
- package/extensions/orbit/lessons/replay.ts +89 -0
- package/extensions/orbit/lessons/reproduction-index.ts +83 -0
- package/extensions/orbit/lessons/search-tool.ts +99 -0
- package/extensions/orbit/lessons/search.ts +136 -0
- package/extensions/orbit/lessons/store.ts +415 -0
- package/extensions/orbit/lessons/text.ts +36 -0
- package/extensions/orbit/lessons/types.ts +69 -0
- package/extensions/orbit/lessons/user-dir.ts +24 -0
- package/extensions/orbit/lessons/user-lesson.ts +88 -0
- package/extensions/orbit/lessons/wrapper.ts +61 -0
- package/extensions/orbit/lessons-command.ts +147 -0
- package/extensions/orbit/local-exec.ts +39 -0
- package/extensions/orbit/mcp-output.ts +179 -0
- package/extensions/orbit/mcp-servers.test.ts +24 -0
- package/extensions/orbit/mcp-servers.ts +25 -0
- package/extensions/orbit/model-script.ts +351 -0
- package/extensions/orbit/notebook-anchors.ts +342 -0
- package/extensions/orbit/notebook-writer.ts +863 -0
- package/extensions/orbit/observation-allowlists.ts +1109 -0
- package/extensions/orbit/observation-replay.ts +148 -0
- package/extensions/orbit/observation-triggers.ts +563 -0
- package/extensions/orbit/observation-ui.ts +175 -0
- package/extensions/orbit/observations-command.ts +421 -0
- package/extensions/orbit/observations-config.ts +200 -0
- package/extensions/orbit/observations.ts +1381 -0
- package/extensions/orbit/profiles.ts +270 -0
- package/extensions/orbit/progress-updates.ts +95 -0
- package/extensions/orbit/proposal-commands.ts +882 -0
- package/extensions/orbit/provenance-fs-file.ts +59 -0
- package/extensions/orbit/provenance-fs.ts +32 -0
- package/extensions/orbit/provenance-memory-fs.ts +59 -0
- package/extensions/orbit/record-store-file.ts +177 -0
- package/extensions/orbit/record-store-page.ts +77 -0
- package/extensions/orbit/record-store-seam.ts +47 -0
- package/extensions/orbit/record-store.ts +149 -0
- package/extensions/orbit/registry-carrier.ts +107 -0
- package/extensions/orbit/registry-eligibility.ts +95 -0
- package/extensions/orbit/registry-evaluation.ts +403 -0
- package/extensions/orbit/registry-evaluator.ts +519 -0
- package/extensions/orbit/registry-import.ts +91 -0
- package/extensions/orbit/registry-lock.ts +221 -0
- package/extensions/orbit/registry-memory-fs.ts +42 -0
- package/extensions/orbit/registry-page-carrier.ts +103 -0
- package/extensions/orbit/registry-proposal.ts +1348 -0
- package/extensions/orbit/registry-runtime.ts +234 -0
- package/extensions/orbit/registry-schema.ts +735 -0
- package/extensions/orbit/registry-submitter.ts +59 -0
- package/extensions/orbit/registry-templates.ts +346 -0
- package/extensions/orbit/registry.ts +476 -0
- package/extensions/orbit/sandbox/index.ts +120 -0
- package/extensions/orbit/sandbox/sandbox-bash.ts +93 -0
- package/extensions/orbit/sandbox/sandbox-config.ts +87 -0
- package/extensions/orbit/sandbox/sandbox-init-message.ts +28 -0
- package/extensions/orbit/secret-redaction.ts +247 -0
- package/extensions/orbit/session-index/cwd.ts +18 -0
- package/extensions/orbit/session-index/db.ts +56 -0
- package/extensions/orbit/session-index/indexer.ts +154 -0
- package/extensions/orbit/session-index/is-enabled.ts +17 -0
- package/extensions/orbit/session-index/parse.ts +254 -0
- package/extensions/orbit/session-index/query.ts +209 -0
- package/extensions/orbit/session-index/schema.ts +72 -0
- package/extensions/orbit/session-index/tools.ts +152 -0
- package/extensions/orbit/session-lifecycle.ts +321 -0
- package/extensions/orbit/skill-triggers.ts +159 -0
- package/extensions/orbit/skills-command.ts +48 -0
- package/extensions/orbit/skills-discovery.ts +435 -0
- package/extensions/orbit/skills.ts +84 -0
- package/extensions/orbit/sra-import-gate.ts +77 -0
- package/extensions/orbit/state.ts +265 -0
- package/extensions/orbit/submission-replay.ts +147 -0
- package/extensions/orbit/sync-command.ts +157 -0
- package/extensions/orbit/teams/critic-parser.ts +93 -0
- package/extensions/orbit/teams/dispatcher.ts +210 -0
- package/extensions/orbit/teams/is-enabled.ts +22 -0
- package/extensions/orbit/teams/tool.ts +187 -0
- package/extensions/orbit/teams/types.ts +57 -0
- package/extensions/orbit/teams/validate.ts +42 -0
- package/extensions/orbit/tester-id-command.ts +133 -0
- package/extensions/orbit/tools-sync.ts +279 -0
- package/extensions/orbit/tools.ts +1300 -0
- package/extensions/orbit/types.ts +41 -0
- package/extensions/orbit/ui-bridge.ts +55 -0
- package/extensions/orbit/ulid.ts +60 -0
- package/extensions/orbit/user-instructions.ts +388 -0
- package/extensions/orbit/vendor/skills/_catalog.json +68 -0
- package/extensions/orbit/vendor/skills/_manifest.json +1106 -0
- package/extensions/orbit/vendor/skills/advance-galaxy-draft-step/SKILL.md +112 -0
- package/extensions/orbit/vendor/skills/advance-galaxy-draft-step/_provenance.json +218 -0
- package/extensions/orbit/vendor/skills/advance-galaxy-draft-step/_required_tools.json +33 -0
- package/extensions/orbit/vendor/skills/advance-galaxy-draft-step/_verify.json +4 -0
- package/extensions/orbit/vendor/skills/advance-galaxy-draft-step/references/cli/add.json +50 -0
- package/extensions/orbit/vendor/skills/advance-galaxy-draft-step/references/cli/draft-extract.json +51 -0
- package/extensions/orbit/vendor/skills/advance-galaxy-draft-step/references/cli/draft-next-step.json +42 -0
- package/extensions/orbit/vendor/skills/advance-galaxy-draft-step/references/cli/draft-validate.json +140 -0
- package/extensions/orbit/vendor/skills/advance-galaxy-draft-step/references/cli/list.json +32 -0
- package/extensions/orbit/vendor/skills/advance-galaxy-draft-step/references/notes/galaxy-tool-job-failure-reference.md +137 -0
- package/extensions/orbit/vendor/skills/advance-galaxy-draft-step/references/notes/open-requirements-ledger.md +173 -0
- package/extensions/orbit/vendor/skills/advance-galaxy-draft-step/references/schemas/galaxy-tool-summary.schema.json +175 -0
- package/extensions/orbit/vendor/skills/advance-galaxy-draft-step/references/schemas/galaxy-workflow-draft.schema.json +2727 -0
- package/extensions/orbit/vendor/skills/apply-galaxy-workflow-changeset/SKILL.md +82 -0
- package/extensions/orbit/vendor/skills/apply-galaxy-workflow-changeset/_provenance.json +133 -0
- package/extensions/orbit/vendor/skills/apply-galaxy-workflow-changeset/_required_tools.json +16 -0
- package/extensions/orbit/vendor/skills/apply-galaxy-workflow-changeset/_verify.json +4 -0
- package/extensions/orbit/vendor/skills/apply-galaxy-workflow-changeset/references/cli/draft-validate.json +140 -0
- package/extensions/orbit/vendor/skills/apply-galaxy-workflow-changeset/references/notes/galaxy-workflow-draft-format.md +135 -0
- package/extensions/orbit/vendor/skills/apply-galaxy-workflow-changeset/references/notes/open-requirements-ledger.md +173 -0
- package/extensions/orbit/vendor/skills/apply-galaxy-workflow-changeset/references/schemas/galaxy-workflow-draft.schema.json +2727 -0
- package/extensions/orbit/vendor/skills/changeset-to-galaxy-test-plan/SKILL.md +84 -0
- package/extensions/orbit/vendor/skills/changeset-to-galaxy-test-plan/_provenance.json +166 -0
- package/extensions/orbit/vendor/skills/changeset-to-galaxy-test-plan/_verify.json +29 -0
- package/extensions/orbit/vendor/skills/changeset-to-galaxy-test-plan/references/notes/galaxy-workflow-testability-design.md +136 -0
- package/extensions/orbit/vendor/skills/changeset-to-galaxy-test-plan/references/notes/iwc-shortcuts-anti-patterns.md +357 -0
- package/extensions/orbit/vendor/skills/changeset-to-galaxy-test-plan/references/notes/iwc-test-data-conventions.md +308 -0
- package/extensions/orbit/vendor/skills/changeset-to-galaxy-test-plan/references/notes/planemo-asserts-idioms.md +246 -0
- package/extensions/orbit/vendor/skills/changeset-to-galaxy-test-plan/references/notes/planemo-workflow-test-architecture.md +151 -0
- package/extensions/orbit/vendor/skills/changeset-to-galaxy-test-plan/references/schemas/galaxy-workflow-test-plan.schema.json +552 -0
- package/extensions/orbit/vendor/skills/changeset-to-galaxy-test-plan/references/schemas/summary-galaxy-workflow.schema.json +687 -0
- package/extensions/orbit/vendor/skills/changeset-to-galaxy-test-plan/references/schemas/tests-format.schema.json +7328 -0
- package/extensions/orbit/vendor/skills/compare-against-iwc-exemplar/SKILL.md +127 -0
- package/extensions/orbit/vendor/skills/compare-against-iwc-exemplar/_provenance.json +198 -0
- package/extensions/orbit/vendor/skills/compare-against-iwc-exemplar/_required_tools.json +16 -0
- package/extensions/orbit/vendor/skills/compare-against-iwc-exemplar/_verify.json +4 -0
- package/extensions/orbit/vendor/skills/compare-against-iwc-exemplar/references/cli/convert.json +123 -0
- package/extensions/orbit/vendor/skills/compare-against-iwc-exemplar/references/notes/galaxy-data-flow-draft-contract.md +129 -0
- package/extensions/orbit/vendor/skills/compare-against-iwc-exemplar/references/notes/iwc-shortcuts-anti-patterns.md +357 -0
- package/extensions/orbit/vendor/skills/compare-against-iwc-exemplar/references/notes/iwc-test-data-conventions.md +308 -0
- package/extensions/orbit/vendor/skills/compare-against-iwc-exemplar/references/notes/open-requirements-ledger.md +173 -0
- package/extensions/orbit/vendor/skills/debug-galaxy-workflow-output/SKILL.md +73 -0
- package/extensions/orbit/vendor/skills/debug-galaxy-workflow-output/_provenance.json +160 -0
- package/extensions/orbit/vendor/skills/debug-galaxy-workflow-output/_verify.json +4 -0
- package/extensions/orbit/vendor/skills/debug-galaxy-workflow-output/references/notes/galaxy-collection-semantics.md +43 -0
- package/extensions/orbit/vendor/skills/debug-galaxy-workflow-output/references/notes/galaxy-collection-semantics.yml +1250 -0
- package/extensions/orbit/vendor/skills/debug-galaxy-workflow-output/references/notes/galaxy-tool-job-failure-reference.md +137 -0
- package/extensions/orbit/vendor/skills/debug-galaxy-workflow-output/references/notes/galaxy-workflow-invocation-failure-reference.md +138 -0
- package/extensions/orbit/vendor/skills/debug-galaxy-workflow-output/references/notes/iwc-shortcuts-anti-patterns.md +357 -0
- package/extensions/orbit/vendor/skills/debug-galaxy-workflow-output/references/notes/nextflow-operators-to-galaxy-collection-recipes.md +98 -0
- package/extensions/orbit/vendor/skills/debug-galaxy-workflow-output/references/notes/planemo-asserts-idioms.md +246 -0
- package/extensions/orbit/vendor/skills/debug-galaxy-workflow-output/references/notes/planemo-workflow-test-architecture.md +151 -0
- package/extensions/orbit/vendor/skills/discover-shed-tool/SKILL.md +174 -0
- package/extensions/orbit/vendor/skills/discover-shed-tool/_provenance.json +130 -0
- package/extensions/orbit/vendor/skills/discover-shed-tool/_required_tools.json +18 -0
- package/extensions/orbit/vendor/skills/discover-shed-tool/_verify.json +17 -0
- package/extensions/orbit/vendor/skills/discover-shed-tool/references/cli/tool-revisions.json +48 -0
- package/extensions/orbit/vendor/skills/discover-shed-tool/references/cli/tool-search.json +95 -0
- package/extensions/orbit/vendor/skills/discover-shed-tool/references/cli/tool-versions.json +39 -0
- package/extensions/orbit/vendor/skills/discover-shed-tool/references/notes/component-tool-shed-search.md +230 -0
- package/extensions/orbit/vendor/skills/discover-shed-tool/references/schemas/galaxy-tool-discovery.schema.json +231 -0
- package/extensions/orbit/vendor/skills/implement-galaxy-workflow-test/SKILL.md +93 -0
- package/extensions/orbit/vendor/skills/implement-galaxy-workflow-test/_provenance.json +201 -0
- package/extensions/orbit/vendor/skills/implement-galaxy-workflow-test/_required_tools.json +28 -0
- package/extensions/orbit/vendor/skills/implement-galaxy-workflow-test/_verify.json +17 -0
- package/extensions/orbit/vendor/skills/implement-galaxy-workflow-test/references/cli/planemo.md +44 -0
- package/extensions/orbit/vendor/skills/implement-galaxy-workflow-test/references/cli/validate-tests.json +40 -0
- package/extensions/orbit/vendor/skills/implement-galaxy-workflow-test/references/notes/galaxy-workflow-testability-design.md +136 -0
- package/extensions/orbit/vendor/skills/implement-galaxy-workflow-test/references/notes/iwc-shortcuts-anti-patterns.md +357 -0
- package/extensions/orbit/vendor/skills/implement-galaxy-workflow-test/references/notes/iwc-test-data-conventions.md +308 -0
- package/extensions/orbit/vendor/skills/implement-galaxy-workflow-test/references/notes/planemo-asserts-idioms.md +246 -0
- package/extensions/orbit/vendor/skills/implement-galaxy-workflow-test/references/notes/planemo-workflow-test-architecture.md +151 -0
- package/extensions/orbit/vendor/skills/implement-galaxy-workflow-test/references/schemas/galaxy-workflow-test-plan.schema.json +552 -0
- package/extensions/orbit/vendor/skills/implement-galaxy-workflow-test/references/schemas/tests-format.schema.json +7328 -0
- package/extensions/orbit/vendor/skills/interview-to-galaxy-workflow-changeset/SKILL.md +81 -0
- package/extensions/orbit/vendor/skills/interview-to-galaxy-workflow-changeset/_provenance.json +93 -0
- package/extensions/orbit/vendor/skills/interview-to-galaxy-workflow-changeset/_verify.json +17 -0
- package/extensions/orbit/vendor/skills/interview-to-galaxy-workflow-changeset/references/notes/open-requirements-ledger.md +173 -0
- package/extensions/orbit/vendor/skills/interview-to-galaxy-workflow-changeset/references/schemas/summary-galaxy-workflow.schema.json +687 -0
- package/extensions/orbit/vendor/skills/pipeline-update-interview-to-galaxy/SKILL.md +81 -0
- package/extensions/orbit/vendor/skills/pipeline-update-interview-to-galaxy/_assembly.json +23 -0
- package/extensions/orbit/vendor/skills/run-workflow-test/SKILL.md +79 -0
- package/extensions/orbit/vendor/skills/run-workflow-test/_provenance.json +125 -0
- package/extensions/orbit/vendor/skills/run-workflow-test/_required_tools.json +28 -0
- package/extensions/orbit/vendor/skills/run-workflow-test/_verify.json +4 -0
- package/extensions/orbit/vendor/skills/run-workflow-test/references/cli/planemo.md +44 -0
- package/extensions/orbit/vendor/skills/run-workflow-test/references/cli/validate-tests.json +40 -0
- package/extensions/orbit/vendor/skills/run-workflow-test/references/notes/galaxy-workflow-invocation-failure-reference.md +138 -0
- package/extensions/orbit/vendor/skills/run-workflow-test/references/notes/planemo-asserts-idioms.md +246 -0
- package/extensions/orbit/vendor/skills/run-workflow-test/references/notes/planemo-workflow-test-architecture.md +151 -0
- package/extensions/orbit/vendor/skills/run-workflow-test/references/schemas/tests-format.schema.json +7328 -0
- package/extensions/orbit/vendor/skills/skills/LICENSE +21 -0
- package/extensions/orbit/vendor/skills/skills/collection-manipulation/README.md +39 -0
- package/extensions/orbit/vendor/skills/skills/collection-manipulation/SKILL.md +892 -0
- package/extensions/orbit/vendor/skills/skills/collection-manipulation/references/api-patterns.md +927 -0
- package/extensions/orbit/vendor/skills/skills/collection-manipulation/references/apply-rules.md +1482 -0
- package/extensions/orbit/vendor/skills/skills/collection-manipulation/references/test-patterns.md +996 -0
- package/extensions/orbit/vendor/skills/skills/collection-manipulation/references/tools.md +609 -0
- package/extensions/orbit/vendor/skills/skills/galaxy-data-libraries/SKILL.md +170 -0
- package/extensions/orbit/vendor/skills/skills/galaxy-integration/README.md +162 -0
- package/extensions/orbit/vendor/skills/skills/galaxy-integration/SKILL.md +99 -0
- package/extensions/orbit/vendor/skills/skills/galaxy-integration/examples/README.md +119 -0
- package/extensions/orbit/vendor/skills/skills/galaxy-integration/examples/tool-checking.md +419 -0
- package/extensions/orbit/vendor/skills/skills/galaxy-integration/examples/workflow-testing.md +617 -0
- package/extensions/orbit/vendor/skills/skills/galaxy-integration/galaxy-integration.md +614 -0
- package/extensions/orbit/vendor/skills/skills/galaxy-integration/jupyterlite/SKILL.md +144 -0
- package/extensions/orbit/vendor/skills/skills/galaxy-integration/jupyterlite/examples/average_col3.ipynb +68 -0
- package/extensions/orbit/vendor/skills/skills/galaxy-integration/jupyterlite/examples/extract_sample_metadata.ipynb +190 -0
- package/extensions/orbit/vendor/skills/skills/galaxy-integration/jupyterlite/examples/variant_annotation.ipynb +816 -0
- package/extensions/orbit/vendor/skills/skills/galaxy-integration/jupyterlite/examples/vcp_variant_map.ipynb +443 -0
- package/extensions/orbit/vendor/skills/skills/galaxy-integration/scripts/README.md +165 -0
- package/extensions/orbit/vendor/skills/skills/galaxy-integration/scripts/galaxy_tool_checker.py +521 -0
- package/extensions/orbit/vendor/skills/skills/galaxy-mcp-reference/SKILL.md +128 -0
- package/extensions/orbit/vendor/skills/skills/galaxy-mcp-reference/gotchas.md +135 -0
- package/extensions/orbit/vendor/skills/skills/galaxy-mcp-reference/history-access.md +132 -0
- package/extensions/orbit/vendor/skills/skills/reproduciblify/SKILL.md +146 -0
- package/extensions/orbit/vendor/skills/skills/reproduciblify/references/directives.yml +496 -0
- package/extensions/orbit/vendor/skills/skills/udt-authoring/SKILL.md +245 -0
- package/extensions/orbit/vendor/skills/skills/udt-authoring/examples/01-minimal-echo.yml +27 -0
- package/extensions/orbit/vendor/skills/skills/udt-authoring/examples/02-single-data-in-out.yml +27 -0
- package/extensions/orbit/vendor/skills/skills/udt-authoring/examples/03-multiple-data-js.yml +28 -0
- package/extensions/orbit/vendor/skills/skills/udt-authoring/examples/04-select-integer-boolean.yml +41 -0
- package/extensions/orbit/vendor/skills/skills/udt-authoring/examples/05-resource-requirements.yml +25 -0
- package/extensions/orbit/vendor/skills/skills/udt-authoring/examples/06-biocontainer-tool.yml +38 -0
- package/extensions/orbit/vendor/skills/skills/udt-authoring/examples/07-inline-python-script.yml +56 -0
- package/extensions/orbit/vendor/skills/skills/udt-authoring/examples/08-configfile-script.yml +74 -0
- package/extensions/orbit/vendor/skills/skills/udt-authoring/references/common-mistakes.md +76 -0
- package/extensions/orbit/vendor/skills/skills/udt-authoring/references/schema-reference.md +155 -0
- package/extensions/orbit/vendor/skills/skills/udt-authoring/references/templating.md +196 -0
- package/extensions/orbit/vendor/skills/skills/udt-authoring/scripts/validate.py +109 -0
- package/extensions/orbit/vendor/skills/skills/workflow-reports/README.md +71 -0
- package/extensions/orbit/vendor/skills/skills/workflow-reports/SKILL.md +190 -0
- package/extensions/orbit/vendor/skills/skills/workflow-reports/examples/histology-staining.md +145 -0
- package/extensions/orbit/vendor/skills/skills/workflow-reports/examples/tissue-microarray-analysis.md +176 -0
- package/extensions/orbit/vendor/skills/skills/workflow-reports/references/directives.md +415 -0
- package/extensions/orbit/vendor/skills/summarize-galaxy-workflow/SKILL.md +98 -0
- package/extensions/orbit/vendor/skills/summarize-galaxy-workflow/_provenance.json +93 -0
- package/extensions/orbit/vendor/skills/summarize-galaxy-workflow/_required_tools.json +28 -0
- package/extensions/orbit/vendor/skills/summarize-galaxy-workflow/_verify.json +17 -0
- package/extensions/orbit/vendor/skills/summarize-galaxy-workflow/references/cli/convert.json +123 -0
- package/extensions/orbit/vendor/skills/summarize-galaxy-workflow/references/cli/foundry.md +25 -0
- package/extensions/orbit/vendor/skills/summarize-galaxy-workflow/references/cli/validate.json +142 -0
- package/extensions/orbit/vendor/skills/summarize-galaxy-workflow/references/schemas/summary-galaxy-workflow.schema.json +687 -0
- package/extensions/orbit/vendor/skills/validate-galaxy-workflow/SKILL.md +74 -0
- package/extensions/orbit/vendor/skills/validate-galaxy-workflow/_provenance.json +71 -0
- package/extensions/orbit/vendor/skills/validate-galaxy-workflow/_required_tools.json +16 -0
- package/extensions/orbit/vendor/skills/validate-galaxy-workflow/_verify.json +4 -0
- package/extensions/orbit/vendor/skills/validate-galaxy-workflow/references/cli/validate.json +142 -0
- package/extensions/orbit/vendor/skills/validate-galaxy-workflow/references/notes/galaxy-workflow-invocation-failure-reference.md +138 -0
- package/extensions/orbit/vendor/skills/validate-galaxy-workflow/references/notes/galaxy-workflow-testability-design.md +136 -0
- package/extensions/orbit/vendor-skills.ts +283 -0
- package/extensions/orbit/workspace-state-dir.ts +46 -0
- package/extensions/orbit-handoff/index.ts +73 -0
- package/extensions/orbit-handoff/orbit-launcher.ts +142 -0
- package/extensions/whats-new/index.ts +98 -0
- package/lessons/LICENSE +17 -0
- package/lessons/README.md +117 -0
- package/lessons/SCHEMA.md +187 -0
- package/lessons/build-snapshot.mjs +311 -0
- package/lessons/data/downloaded-file-is-not-what-its-extension-says.md +61 -0
- package/lessons/galaxy-api/403-history-is-a-hard-stop.md +57 -0
- package/lessons/galaxy-api/collection-into-single-dataset-input.md +61 -0
- package/lessons/galaxy-api/connectedvalue-in-command-line.md +62 -0
- package/lessons/galaxy-api/hid-is-not-an-id.md +59 -0
- package/lessons/galaxy-api/invoke-workflow-inputs-not-params.md +60 -0
- package/lessons/galaxy-api/repeat-param-pipe-keys.md +63 -0
- package/lessons/galaxy-api/run-tool-returns-on-submit.md +61 -0
- package/lessons/galaxy-tools/reference-index-not-on-server.md +62 -0
- package/lessons/log.md +42 -0
- package/lessons/reproduction/input-population-mismatch.md +59 -0
- package/lessons/reproduction/methods-text-vs-executed-parameters.md +62 -0
- package/lessons/snapshot.json +1004 -0
- package/lessons/stats/de-contrast-direction-and-sample-labels.md +63 -0
- package/lessons/stats/na-coerced-to-zero-in-filters.md +59 -0
- package/lessons/validate.mjs +1219 -0
- package/package.json +103 -5
- package/shared/agent-prompt.d.ts +8 -0
- package/shared/agent-prompt.js +15 -0
- package/shared/approval-prompt.d.ts +4 -0
- package/shared/approval-prompt.js +61 -0
- package/shared/brain-env.d.ts +14 -0
- package/shared/brain-env.js +108 -0
- package/shared/brain-exit.d.ts +20 -0
- package/shared/brain-exit.js +149 -0
- package/shared/capability-profile.d.ts +16 -0
- package/shared/capability-profile.js +75 -0
- package/shared/config-source.d.ts +13 -0
- package/shared/config-source.js +17 -0
- package/shared/confusables.d.ts +3 -0
- package/shared/confusables.js +93 -0
- package/shared/custom-provider.d.ts +45 -0
- package/shared/custom-provider.js +169 -0
- package/shared/dashboard-contract.d.ts +123 -0
- package/shared/dashboard-contract.js +560 -0
- package/shared/dashboard-layout-store.d.ts +44 -0
- package/shared/dashboard-layout-store.js +281 -0
- package/shared/feedback-contract.d.ts +61 -0
- package/shared/feedback-contract.js +146 -0
- package/shared/galaxy-artifact-links.d.ts +30 -0
- package/shared/galaxy-artifact-links.js +166 -0
- package/shared/galaxy-credentials.d.ts +26 -0
- package/shared/galaxy-credentials.js +71 -0
- package/shared/galaxy-destructive.d.ts +21 -0
- package/shared/galaxy-destructive.js +269 -0
- package/shared/galaxy-guidance.d.ts +2 -0
- package/shared/galaxy-guidance.js +53 -0
- package/shared/galaxy-live-contract.d.ts +92 -0
- package/shared/galaxy-live-contract.js +180 -0
- package/shared/galaxy-page-cells.d.ts +2 -0
- package/shared/galaxy-page-cells.js +22 -0
- package/shared/galaxy-tool-family.d.ts +5 -0
- package/shared/galaxy-tool-family.js +27 -0
- package/shared/galaxy-url.d.ts +1 -0
- package/shared/galaxy-url.js +48 -0
- package/shared/gtn.d.ts +31 -0
- package/shared/gtn.js +253 -0
- package/shared/handled-prompt.d.ts +3 -0
- package/shared/handled-prompt.js +26 -0
- package/shared/known-provider.d.ts +11 -0
- package/shared/known-provider.js +89 -0
- package/shared/lesson-hint-marker.d.ts +7 -0
- package/shared/lesson-hint-marker.js +32 -0
- package/shared/lesson-rules.d.ts +150 -0
- package/shared/lesson-rules.js +203 -0
- package/shared/malformed-object-ids.d.ts +1 -0
- package/shared/malformed-object-ids.js +37 -0
- package/shared/markdown-sections.d.ts +10 -0
- package/shared/markdown-sections.js +118 -0
- package/shared/notebook-fences.d.ts +12 -0
- package/shared/notebook-fences.js +53 -0
- package/shared/observation-contract.d.ts +91 -0
- package/shared/observation-contract.js +544 -0
- package/shared/orbit-config.d.ts +226 -0
- package/shared/orbit-config.js +189 -0
- package/shared/orbit-env.d.ts +13 -0
- package/shared/orbit-env.js +124 -0
- package/shared/orbit-shell-contract.d.ts +74 -0
- package/shared/orbit-shell-contract.js +30 -0
- package/shared/page-content-hash.d.ts +1 -0
- package/shared/page-content-hash.js +13 -0
- package/shared/pi-default-model.d.ts +7 -0
- package/shared/pi-default-model.js +41 -0
- package/shared/prompt-blocks.d.ts +87 -0
- package/shared/prompt-blocks.js +898 -0
- package/shared/provider-auth-caps.d.ts +22 -0
- package/shared/provider-auth-caps.js +57 -0
- package/shared/random.d.ts +2 -0
- package/shared/random.js +15 -0
- package/shared/record-excerpt.d.ts +4 -0
- package/shared/record-excerpt.js +16 -0
- package/shared/redirect-guard.d.ts +36 -0
- package/shared/redirect-guard.js +235 -0
- package/shared/skills-pin.d.ts +8 -0
- package/shared/skills-pin.js +9 -0
- package/shared/skills-router.d.ts +17 -0
- package/shared/skills-router.js +63 -0
- package/shared/sra-import.d.ts +34 -0
- package/shared/sra-import.js +206 -0
- package/shared/state-dir.d.ts +21 -0
- package/shared/state-dir.js +240 -0
- package/shared/team-dispatch-contract.d.ts +28 -0
- package/shared/team-dispatch-contract.js +1 -0
- package/shared/truncate-middle.d.ts +11 -0
- package/shared/truncate-middle.js +68 -0
- package/shared/version-compare.d.ts +10 -0
- package/shared/version-compare.js +74 -0
- package/shared/whats-new.d.ts +31 -0
- package/shared/whats-new.js +83 -0
- package/shared/wsl.d.ts +10 -0
- package/shared/wsl.js +24 -0
|
@@ -0,0 +1,593 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Orbit — Galaxy co-scientist extension for Pi.dev.
|
|
3
|
+
*
|
|
4
|
+
* Brain-side runtime that supports markdown-driven Galaxy bioinformatics
|
|
5
|
+
* analyses. The notebook (`notebook.md`) is the durable record; plans live
|
|
6
|
+
* inside it as markdown sections; Galaxy invocations are tracked via
|
|
7
|
+
* `loom-invocation` YAML blocks.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
11
|
+
import { registerPlanTools } from "./tools";
|
|
12
|
+
import { registerGalaxyUploadTool } from "./galaxy-upload";
|
|
13
|
+
import { registerNotebookSyncTools } from "./tools-sync";
|
|
14
|
+
import { registerSyncCommand } from "./sync-command";
|
|
15
|
+
import { registerSkillsCommand } from "./skills-command";
|
|
16
|
+
import { setupContextInjection, formatConnectionStatus } from "./context";
|
|
17
|
+
import { setupUIBridge } from "./ui-bridge";
|
|
18
|
+
import { registerSessionLifecycle } from "./session-lifecycle";
|
|
19
|
+
import { registerCommandsAsUserInput } from "./auto-resume";
|
|
20
|
+
import { registerActivityHooks } from "./activity-hooks";
|
|
21
|
+
import { registerSubmissionCapture } from "./galaxy-submission-capture";
|
|
22
|
+
import { isSubmissionReplayEnabled, registerSubmissionReplay } from "./submission-replay";
|
|
23
|
+
import { isObservationReplayEnabled, registerObservationReplay } from "./observation-replay";
|
|
24
|
+
import { registerCaptureFollowThrough } from "./galaxy-reconcile";
|
|
25
|
+
import { isGalaxyFixtureEnabled, registerGalaxyFixture } from "./galaxy-fixture";
|
|
26
|
+
import { isModelScriptEnabled, registerModelScript } from "./model-script";
|
|
27
|
+
import { registerExecutionCommands } from "./execution-commands";
|
|
28
|
+
import { registerDashboardTools } from "./dashboard-tools";
|
|
29
|
+
import { registerDashboardCommands } from "./dashboard-commands";
|
|
30
|
+
import { registerFeedbackCommand } from "./feedback-command";
|
|
31
|
+
import { registerLessonProposals } from "./lesson-command";
|
|
32
|
+
import { registerLessonsCommand } from "./lessons-command";
|
|
33
|
+
import { registerTesterIdCommand } from "./tester-id-command";
|
|
34
|
+
import { registerInstructionsCommand } from "./instructions-command";
|
|
35
|
+
import { registerTeamTools } from "./teams/tool";
|
|
36
|
+
import { isTeamDispatchEnabled } from "./teams/is-enabled";
|
|
37
|
+
import { registerSessionIndexTools } from "./session-index/tools";
|
|
38
|
+
import { isSessionIndexEnabled } from "./session-index/is-enabled";
|
|
39
|
+
import { registerSkillTriggers } from "./skill-triggers";
|
|
40
|
+
import { registerIwcPlanCheck } from "./iwc-plan-check";
|
|
41
|
+
import { registerEmptyCompletionCheck } from "./empty-completion";
|
|
42
|
+
import { registerSraImportGate } from "./sra-import-gate";
|
|
43
|
+
import { registerGalaxyRepeatGuard } from "./galaxy-repeat-guard";
|
|
44
|
+
import { registerGalaxyHistoryGuard } from "./galaxy-history-guard";
|
|
45
|
+
import { registerEvidenceGate } from "./evidence-gate";
|
|
46
|
+
import { registerEvidenceOverrideCommand } from "./evidence-override-command";
|
|
47
|
+
import { registerProposalCommands } from "./proposal-commands";
|
|
48
|
+
import { registerExecGuard } from "./exec-guard";
|
|
49
|
+
import { registerSandbox } from "./sandbox";
|
|
50
|
+
import { isLocalExecDisabled } from "./local-exec";
|
|
51
|
+
import { capabilityProfile } from "../../shared/capability-profile.js";
|
|
52
|
+
import { galaxyCredentials } from "./galaxy-api";
|
|
53
|
+
import { registerSecretRedaction } from "./secret-redaction";
|
|
54
|
+
import { registerLessonHint } from "./lesson-hint";
|
|
55
|
+
import { registerLessonsSearchTool } from "./lessons/search-tool";
|
|
56
|
+
import { isLessonReplayEnabled, registerLessonReplay } from "./lessons/replay";
|
|
57
|
+
import { registerObservationTriggers } from "./observation-triggers";
|
|
58
|
+
import { registerObservationsCommand } from "./observations-command";
|
|
59
|
+
import { registerMcpOutputRecovery } from "./mcp-output";
|
|
60
|
+
import { registerOrbitMcpServers } from "./mcp-servers";
|
|
61
|
+
import { registerGalaxyVersionCapture } from "./galaxy-version-capture";
|
|
62
|
+
import type { GalaxyToolFamily } from "../../shared/galaxy-tool-family.js";
|
|
63
|
+
import { registerGalaxyTools } from "./galaxy-tool-source";
|
|
64
|
+
import { registerGalaxyDestructiveGate } from "./galaxy-destructive-gate";
|
|
65
|
+
import { registerGalaxyOpPolicy } from "./galaxy-op-policy";
|
|
66
|
+
import { registerGalaxyRecovery } from "./galaxy-recovery";
|
|
67
|
+
import { registerGalaxyPollGuard } from "./galaxy-poll-guard";
|
|
68
|
+
import { registerProgressUpdates } from "./progress-updates";
|
|
69
|
+
import { recordStore } from "./record-store";
|
|
70
|
+
import {
|
|
71
|
+
getState,
|
|
72
|
+
getNotebookPath,
|
|
73
|
+
getNotebookWidgetMode,
|
|
74
|
+
setNotebookWidgetMode,
|
|
75
|
+
reemitNotebookIfChanged,
|
|
76
|
+
} from "./state";
|
|
77
|
+
import {
|
|
78
|
+
loadProfiles,
|
|
79
|
+
saveProfile,
|
|
80
|
+
switchProfile,
|
|
81
|
+
profileNameFromUrl,
|
|
82
|
+
normalizeGalaxyUrl,
|
|
83
|
+
} from "./profiles";
|
|
84
|
+
import { OrbitWidgetKey, encodeMarkdownWidget } from "../../shared/orbit-shell-contract.js";
|
|
85
|
+
|
|
86
|
+
/** Status-bar label for a Galaxy tool -- galaxy-ops' or Orbit's own -- else undefined. */
|
|
87
|
+
function galaxyToolLabel(
|
|
88
|
+
toolName: string | undefined,
|
|
89
|
+
family: GalaxyToolFamily,
|
|
90
|
+
): string | undefined {
|
|
91
|
+
const bare = family.toolName(toolName) ?? toolName?.match(/^galaxy_(.+)/)?.[1];
|
|
92
|
+
return bare?.replace(/_/g, " ");
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export default function galaxyAnalystExtension(pi: ExtensionAPI): void {
|
|
96
|
+
// Before anything registers a command, so every one of them counts as user
|
|
97
|
+
// input for the automatic follow-up cap.
|
|
98
|
+
registerCommandsAsUserInput(pi);
|
|
99
|
+
const profile = capabilityProfile();
|
|
100
|
+
// The shell's Galaxy tools go in first, so every guard below is handed their names.
|
|
101
|
+
const family = registerGalaxyTools(pi);
|
|
102
|
+
// Local-execution safety gate + opt-in bash sandbox. Both only make sense
|
|
103
|
+
// when the brain has a local execution surface. A shell that runs the brain
|
|
104
|
+
// with no local exec -- the web/container remote shell (and eventually native
|
|
105
|
+
// Windows remote-only) -- sets LOOM_LOCAL_EXEC=off and supplies its own
|
|
106
|
+
// authoritative tool_call gate (web-mode-gate). Registering exec-guard there
|
|
107
|
+
// is redundant, and its interactive approval prompts have no human to answer
|
|
108
|
+
// in a headless container, so they would hang the agent on the first gated
|
|
109
|
+
// action. Skipping both keeps the shell's gate the single tool_call authority.
|
|
110
|
+
// Shells WITH a local exec surface (desktop, CLI) set LOOM_LOCAL_EXEC
|
|
111
|
+
// authoritatively at spawn so an ambient value can't toggle this off here.
|
|
112
|
+
if (profile.files) {
|
|
113
|
+
// Register the gate first so its tool_call decision is the authoritative
|
|
114
|
+
// boundary before anything else runs.
|
|
115
|
+
registerExecGuard(pi);
|
|
116
|
+
// The opt-in bash sandbox layers an OS sandbox UNDER the gate (the gate still
|
|
117
|
+
// decides allow/ask/deny; the sandbox only contains an allowed command's blast
|
|
118
|
+
// radius). Default-on file-write confinement lives in the gate itself.
|
|
119
|
+
registerSandbox(pi);
|
|
120
|
+
}
|
|
121
|
+
// exec-guard confirms a history delete only where it is registered (a files
|
|
122
|
+
// surface), and never reads galaxy-ops' destructiveHint, so the Galaxy tools
|
|
123
|
+
// get their own confirm; with files, exec-guard keeps update_history and this
|
|
124
|
+
// one asks only about the hinted tools. The remote container says LOCAL_EXEC=off
|
|
125
|
+
// in env, and its web-mode-gate refuses a history delete outright, so asking
|
|
126
|
+
// first would only ask about a call it then blocks.
|
|
127
|
+
registerGalaxyDestructiveGate(pi, family, {
|
|
128
|
+
classifyArgs: !profile.files && !isLocalExecDisabled(process.env),
|
|
129
|
+
});
|
|
130
|
+
registerGalaxyOpPolicy(pi);
|
|
131
|
+
// Data-shaped backstop to the path-shaped gate: scrub known secret VALUES out
|
|
132
|
+
// of tool OUTPUT before it returns to the model, so an approved/slipped read
|
|
133
|
+
// (or an `env` dump) can't push API keys into the provider's logs (#183).
|
|
134
|
+
// Passive and prompt-free, so it stays on even when a remote shell owns the
|
|
135
|
+
// tool_call boundary and the gate above is skipped.
|
|
136
|
+
// Inspect saved MCP output before redaction so its previews receive the same
|
|
137
|
+
// secret scrubbing as ordinary tool results (including in remote shells).
|
|
138
|
+
// Only pi's MCP layer truncates to a file, so it goes wherever an MCP server
|
|
139
|
+
// does: that is brc-analytics, and the Galaxy tools keep their own
|
|
140
|
+
// galaxy_read_output.
|
|
141
|
+
if (profile.mcpServers) registerMcpOutputRecovery(pi, family);
|
|
142
|
+
registerGalaxyRecovery(pi, family);
|
|
143
|
+
registerGalaxyPollGuard(pi, family);
|
|
144
|
+
registerProgressUpdates(pi, family);
|
|
145
|
+
registerSecretRedaction(pi);
|
|
146
|
+
// AFTER redaction, deliberately. pi runs tool_result handlers in
|
|
147
|
+
// registration order and each sees the previous one's rewrite, so the
|
|
148
|
+
// collector reads the content the model actually gets -- reading the raw
|
|
149
|
+
// result would put an API key one normalization away from the wire.
|
|
150
|
+
registerObservationTriggers(pi, family);
|
|
151
|
+
// After the triggers, whose session_start forgets the last session's version.
|
|
152
|
+
registerGalaxyVersionCapture(pi, family);
|
|
153
|
+
// AFTER redaction and after the observation triggers. pi feeds each
|
|
154
|
+
// tool_result handler the previous one's content, so anything registered
|
|
155
|
+
// after the hint reads it as part of the result -- a Galaxy error with no
|
|
156
|
+
// text of its own would get Orbit's hint as its error signature (the triggers
|
|
157
|
+
// also drop hint blocks themselves, so this is the first line of defence).
|
|
158
|
+
// Lesson text is redacted where it is rendered, so it needs nothing from the
|
|
159
|
+
// redactor. After the oversized-output recovery, so it lands after the
|
|
160
|
+
// preview the model actually reads.
|
|
161
|
+
registerLessonHint(pi);
|
|
162
|
+
|
|
163
|
+
// brc-analytics is the one MCP server Orbit brings; a shell with no MCP layer
|
|
164
|
+
// at all (the browser worker) says so with mcpServers.
|
|
165
|
+
if (profile.mcpServers) registerOrbitMcpServers(pi);
|
|
166
|
+
|
|
167
|
+
setupUIBridge(pi);
|
|
168
|
+
registerSessionLifecycle(pi);
|
|
169
|
+
registerActivityHooks(pi);
|
|
170
|
+
// Auto-registration of Galaxy submissions. Mode-independent on purpose: it
|
|
171
|
+
// must not live inside the exec-guard, which is skipped entirely when
|
|
172
|
+
// LOOM_LOCAL_EXEC=off (the web/container shell), and capture has to work
|
|
173
|
+
// there too. Registered after the session lifecycle so the notebook path is
|
|
174
|
+
// already set by the time anything can fire.
|
|
175
|
+
registerSubmissionCapture(pi, family);
|
|
176
|
+
// Eval-only seam: replays recorded submission results through the hook above
|
|
177
|
+
// so the Tier-1 scenarios can pin capture behavior without a model. Off
|
|
178
|
+
// unless LOOM_SUBMISSION_REPLAY names a file inside the session directory.
|
|
179
|
+
if (isSubmissionReplayEnabled()) {
|
|
180
|
+
registerSubmissionReplay(pi);
|
|
181
|
+
}
|
|
182
|
+
// The same eval-only seam for the lesson hint, which fires on tool_result and
|
|
183
|
+
// so needs a model turn that Tier-1 scenarios don't have.
|
|
184
|
+
if (isLessonReplayEnabled()) {
|
|
185
|
+
registerLessonReplay(pi);
|
|
186
|
+
}
|
|
187
|
+
// Eval-only seam, same shape and the same containment rule as the submission
|
|
188
|
+
// replay above. Registered here rather than with the triggers because its
|
|
189
|
+
// session_start handler needs the notebook path the session lifecycle sets.
|
|
190
|
+
if (isObservationReplayEnabled()) {
|
|
191
|
+
registerObservationReplay(pi);
|
|
192
|
+
}
|
|
193
|
+
// ── Capture, part two (#473): reconcile + enrichment ──────────────────────
|
|
194
|
+
// Everything that happens to a recorded run after the submit: reconcile on
|
|
195
|
+
// session start, every Nth poller tick and on /reconcile; per-job enrichment
|
|
196
|
+
// off the same queue. After the replay seam so a replayed session's blocks
|
|
197
|
+
// are on disk before the first reconcile.
|
|
198
|
+
// Provenance records and the reconcile cursor go through the provenance fs
|
|
199
|
+
// (galaxy-provenance.ts), which is in memory under a page notebook, so this
|
|
200
|
+
// registers under every profile.
|
|
201
|
+
registerCaptureFollowThrough(pi);
|
|
202
|
+
// Eval-only seam: answers Galaxy calls from a recorded fixture so the Tier-1
|
|
203
|
+
// scenarios can drive reconcile and enrichment without a server. Off unless
|
|
204
|
+
// LOOM_GALAXY_FIXTURE names a file inside the session directory.
|
|
205
|
+
if (isGalaxyFixtureEnabled()) {
|
|
206
|
+
registerGalaxyFixture(pi);
|
|
207
|
+
}
|
|
208
|
+
// Eval-only seam: a scripted model, so a Tier-1 scenario can make the tool
|
|
209
|
+
// calls a model would and pi's own tool_call path decides them. Off unless
|
|
210
|
+
// LOOM_MODEL_SCRIPT is set; the file it names must be inside the session
|
|
211
|
+
// directory, and while it's set the session never reaches a real model.
|
|
212
|
+
if (isModelScriptEnabled()) {
|
|
213
|
+
registerModelScript(pi);
|
|
214
|
+
}
|
|
215
|
+
// ── end capture, part two ─────────────────────────────────────────────────
|
|
216
|
+
|
|
217
|
+
registerPlanTools(pi, family);
|
|
218
|
+
// Uploads a LOCAL file; without a file surface there is nothing to upload.
|
|
219
|
+
if (profile.files) {
|
|
220
|
+
registerGalaxyUploadTool(pi, family);
|
|
221
|
+
}
|
|
222
|
+
registerNotebookSyncTools(pi, family);
|
|
223
|
+
registerSyncCommand(pi);
|
|
224
|
+
registerSkillsCommand(pi);
|
|
225
|
+
registerExecutionCommands(pi);
|
|
226
|
+
// The terminal registers these because it writes the layout file for the
|
|
227
|
+
// next desktop session; a worker has neither a file nor a pane to show it in.
|
|
228
|
+
// Two ifs, not one block, so the tool order between them does not move.
|
|
229
|
+
if (profile.ui !== "worker") {
|
|
230
|
+
registerDashboardTools(pi);
|
|
231
|
+
}
|
|
232
|
+
registerLessonsSearchTool(pi);
|
|
233
|
+
if (profile.ui !== "worker") {
|
|
234
|
+
registerDashboardCommands(pi);
|
|
235
|
+
}
|
|
236
|
+
registerFeedbackCommand(pi);
|
|
237
|
+
registerObservationsCommand(pi);
|
|
238
|
+
registerLessonProposals(pi);
|
|
239
|
+
registerLessonsCommand(pi);
|
|
240
|
+
registerTesterIdCommand(pi);
|
|
241
|
+
registerInstructionsCommand(pi);
|
|
242
|
+
registerSkillTriggers(pi, family);
|
|
243
|
+
registerIwcPlanCheck(pi, family);
|
|
244
|
+
registerEmptyCompletionCheck(pi);
|
|
245
|
+
registerEvidenceGate(pi, family);
|
|
246
|
+
registerSraImportGate(pi, family);
|
|
247
|
+
registerGalaxyRepeatGuard(pi, family);
|
|
248
|
+
registerGalaxyHistoryGuard(pi, family);
|
|
249
|
+
registerEvidenceOverrideCommand(pi);
|
|
250
|
+
// ── Approval registry (#476): the model proposes with loom_propose; the user
|
|
251
|
+
// approves with /approve (or revokes, or lists with /pending). The registry
|
|
252
|
+
// itself is opened and closed by the session lifecycle.
|
|
253
|
+
registerProposalCommands(pi);
|
|
254
|
+
// ── end approval registry
|
|
255
|
+
if (isTeamDispatchEnabled()) {
|
|
256
|
+
registerTeamTools(pi);
|
|
257
|
+
}
|
|
258
|
+
if (isSessionIndexEnabled()) {
|
|
259
|
+
registerSessionIndexTools(pi);
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
setupContextInjection(pi);
|
|
263
|
+
|
|
264
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
265
|
+
// /connect — Galaxy connection with profile support
|
|
266
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
267
|
+
pi.registerCommand("connect", {
|
|
268
|
+
description:
|
|
269
|
+
"Connect to Galaxy server. Use /connect to pick a profile or add a new one, /connect <name> to switch.",
|
|
270
|
+
handler: async (args, ctx) => {
|
|
271
|
+
// In a curated remote shell (no local exec) the Galaxy connection is pinned
|
|
272
|
+
// to operator-injected env; the user must not repoint it or overwrite the
|
|
273
|
+
// injected key. Slash commands are dispatched from browser input before the
|
|
274
|
+
// model runs and bypass the tool_call gate, so guard here -- without it a
|
|
275
|
+
// remote client could /connect to an attacker host or a cloud-metadata URL
|
|
276
|
+
// (SSRF) and overwrite GALAXY_URL/GALAXY_API_KEY in-process.
|
|
277
|
+
if (isLocalExecDisabled()) {
|
|
278
|
+
ctx.ui.notify(
|
|
279
|
+
"Galaxy connection is managed by the host in remote mode and can't be changed here.",
|
|
280
|
+
"info",
|
|
281
|
+
);
|
|
282
|
+
return;
|
|
283
|
+
}
|
|
284
|
+
const { profiles, active } = loadProfiles();
|
|
285
|
+
const profileNames = Object.keys(profiles);
|
|
286
|
+
const current = galaxyCredentials();
|
|
287
|
+
|
|
288
|
+
// The Galaxy tools read the credentials on every call, so setting the env is the whole
|
|
289
|
+
// switch; the reload resets what this session holds about the old server, such as its
|
|
290
|
+
// current history. Every shell that reaches here has a reload: the only
|
|
291
|
+
// command ctx without one is the browser's, which has no files and returned above.
|
|
292
|
+
const reloadSession = () => ctx.reload();
|
|
293
|
+
|
|
294
|
+
const requestedName = args?.trim();
|
|
295
|
+
if (requestedName) {
|
|
296
|
+
if (switchProfile(requestedName)) {
|
|
297
|
+
ctx.ui.notify(`Switched to ${requestedName} (${profiles[requestedName].url})`, "info");
|
|
298
|
+
await reloadSession();
|
|
299
|
+
} else {
|
|
300
|
+
ctx.ui.notify(
|
|
301
|
+
`Unknown profile "${requestedName}". Use /profiles to see available profiles.`,
|
|
302
|
+
"warning",
|
|
303
|
+
);
|
|
304
|
+
}
|
|
305
|
+
return;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
if (profileNames.length > 1) {
|
|
309
|
+
const choices = profileNames.map((name) => {
|
|
310
|
+
const marker = name === active ? "* " : " ";
|
|
311
|
+
return `${marker}${name} (${profiles[name].url})`;
|
|
312
|
+
});
|
|
313
|
+
choices.push(" Add new server...");
|
|
314
|
+
|
|
315
|
+
const selection = await ctx.ui.select("Select Galaxy server", choices);
|
|
316
|
+
if (selection === undefined || selection === null) {
|
|
317
|
+
ctx.ui.notify("Connection cancelled", "warning");
|
|
318
|
+
return;
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
const selectedIndex =
|
|
322
|
+
typeof selection === "number" ? selection : choices.indexOf(selection);
|
|
323
|
+
|
|
324
|
+
if (selectedIndex >= 0 && selectedIndex < profileNames.length) {
|
|
325
|
+
const name = profileNames[selectedIndex];
|
|
326
|
+
switchProfile(name);
|
|
327
|
+
ctx.ui.notify(`Switched to ${name} (${profiles[name].url})`, "info");
|
|
328
|
+
await reloadSession();
|
|
329
|
+
return;
|
|
330
|
+
}
|
|
331
|
+
} else if (profileNames.length === 1 && active && current.url && current.apiKey) {
|
|
332
|
+
ctx.ui.notify(`Connecting to ${current.url}...`, "info");
|
|
333
|
+
await reloadSession();
|
|
334
|
+
return;
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
const galaxyUrlInput = await ctx.ui.input("Galaxy Server URL", "https://usegalaxy.org");
|
|
338
|
+
if (!galaxyUrlInput) {
|
|
339
|
+
ctx.ui.notify("Connection cancelled", "warning");
|
|
340
|
+
return;
|
|
341
|
+
}
|
|
342
|
+
// Accept a bare host ("test.galaxyproject.org") by defaulting to https://
|
|
343
|
+
// instead of rejecting it as an invalid URL.
|
|
344
|
+
const galaxyUrl = normalizeGalaxyUrl(galaxyUrlInput);
|
|
345
|
+
|
|
346
|
+
ctx.ui.notify(
|
|
347
|
+
"To get your API key: Log into Galaxy → User → Preferences → Manage API Key",
|
|
348
|
+
"info",
|
|
349
|
+
);
|
|
350
|
+
const apiKey = await ctx.ui.input("Galaxy API Key");
|
|
351
|
+
if (!apiKey) {
|
|
352
|
+
ctx.ui.notify("Connection cancelled - API key required", "warning");
|
|
353
|
+
return;
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
const name = profileNameFromUrl(galaxyUrl);
|
|
357
|
+
saveProfile(name, galaxyUrl, apiKey);
|
|
358
|
+
|
|
359
|
+
process.env.GALAXY_URL = galaxyUrl;
|
|
360
|
+
process.env.GALAXY_API_KEY = apiKey;
|
|
361
|
+
|
|
362
|
+
ctx.ui.notify(`Saved profile "${name}" and connecting to ${galaxyUrl}...`, "info");
|
|
363
|
+
await reloadSession();
|
|
364
|
+
},
|
|
365
|
+
});
|
|
366
|
+
|
|
367
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
368
|
+
// /profiles — list saved Galaxy server profiles
|
|
369
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
370
|
+
pi.registerCommand("profiles", {
|
|
371
|
+
description: "List saved Galaxy server profiles",
|
|
372
|
+
handler: async (_args, ctx) => {
|
|
373
|
+
const { profiles, active } = loadProfiles();
|
|
374
|
+
const names = Object.keys(profiles);
|
|
375
|
+
|
|
376
|
+
if (names.length === 0) {
|
|
377
|
+
ctx.ui.notify("No saved profiles. Use /connect to add one.", "info");
|
|
378
|
+
return;
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
const lines: string[] = ["Galaxy Server Profiles", ""];
|
|
382
|
+
for (const name of names) {
|
|
383
|
+
const marker = name === active ? "*" : " ";
|
|
384
|
+
lines.push(` ${marker} ${name} (${profiles[name].url})`);
|
|
385
|
+
}
|
|
386
|
+
lines.push("");
|
|
387
|
+
lines.push("Use /connect <name> to switch, or /connect to add a new server.");
|
|
388
|
+
|
|
389
|
+
ctx.ui.notify(lines.join("\n"), "info");
|
|
390
|
+
},
|
|
391
|
+
});
|
|
392
|
+
|
|
393
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
394
|
+
// /status — Galaxy connection + notebook path
|
|
395
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
396
|
+
pi.registerCommand("status", {
|
|
397
|
+
description: "Show Galaxy connection and notebook status",
|
|
398
|
+
handler: async (_args, ctx) => {
|
|
399
|
+
const lines: string[] = [];
|
|
400
|
+
lines.push("🔬 Orbit Status");
|
|
401
|
+
lines.push("");
|
|
402
|
+
for (const line of formatConnectionStatus(ctx)) {
|
|
403
|
+
lines.push(line);
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
lines.push("");
|
|
407
|
+
const notebookPath = getNotebookPath();
|
|
408
|
+
if (notebookPath) {
|
|
409
|
+
lines.push(`📓 Notebook: ${notebookPath}`);
|
|
410
|
+
} else {
|
|
411
|
+
lines.push("📓 No notebook (cwd has no notebook.md)");
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
ctx.ui.notify(lines.join("\n"), "info");
|
|
415
|
+
},
|
|
416
|
+
});
|
|
417
|
+
|
|
418
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
419
|
+
// /notebook — view current notebook content
|
|
420
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
421
|
+
pi.registerCommand("notebook", {
|
|
422
|
+
description: "Toggle the notebook panel",
|
|
423
|
+
handler: async (_args, ctx) => {
|
|
424
|
+
// Open → close. Marks "hidden" so the panel doesn't auto-reopen on the
|
|
425
|
+
// next notebook write (see ui-bridge); a second /notebook reopens it.
|
|
426
|
+
if (getNotebookWidgetMode() === "open") {
|
|
427
|
+
ctx.ui.setWidget(OrbitWidgetKey.Notebook, undefined);
|
|
428
|
+
setNotebookWidgetMode("hidden");
|
|
429
|
+
return;
|
|
430
|
+
}
|
|
431
|
+
const notebookPath = getNotebookPath();
|
|
432
|
+
const store = notebookPath ? recordStore(notebookPath) : null;
|
|
433
|
+
if (store && (await store.stat()) !== null) {
|
|
434
|
+
try {
|
|
435
|
+
const { content } = await store.read();
|
|
436
|
+
const header = `> \`${store.label}\`\n\n`;
|
|
437
|
+
ctx.ui.setWidget(OrbitWidgetKey.Notebook, encodeMarkdownWidget(header + content));
|
|
438
|
+
setNotebookWidgetMode("open");
|
|
439
|
+
} catch (err) {
|
|
440
|
+
ctx.ui.notify(`Failed to read notebook: ${err}`, "error");
|
|
441
|
+
}
|
|
442
|
+
return;
|
|
443
|
+
}
|
|
444
|
+
ctx.ui.notify(
|
|
445
|
+
"No notebook in cwd. A new notebook.md is created automatically on session start.",
|
|
446
|
+
"info",
|
|
447
|
+
);
|
|
448
|
+
},
|
|
449
|
+
});
|
|
450
|
+
|
|
451
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
452
|
+
// /compact — manually compact the conversation to reclaim context
|
|
453
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
454
|
+
// Guards a second Orbit /compact from racing the first: pi's compact() has no
|
|
455
|
+
// internal concurrency guard (it just resets its abort controller), so a
|
|
456
|
+
// concurrent call orphans the in-flight run. This only covers Orbit-initiated
|
|
457
|
+
// compactions -- pi's own auto-compaction isn't observable from an extension
|
|
458
|
+
// (ExtensionContext exposes no isCompacting), so that race is left to pi.
|
|
459
|
+
// Cleared in both completion callbacks and on a synchronous compact() throw.
|
|
460
|
+
let compactionInFlight = false;
|
|
461
|
+
pi.registerCommand("compact", {
|
|
462
|
+
description:
|
|
463
|
+
"Compact the conversation to free up context. Optional: /compact <instructions> to steer the summary.",
|
|
464
|
+
handler: async (args, ctx) => {
|
|
465
|
+
// No UI (e.g. headless RPC consumers) -> skip notifications; still compact.
|
|
466
|
+
// Wrapped because ctx.ui/hasUI assert an active context and can throw if the
|
|
467
|
+
// session was swapped while a compaction was in flight; a dropped toast is fine.
|
|
468
|
+
const notify = (msg: string, level: "info" | "warning" | "error") => {
|
|
469
|
+
try {
|
|
470
|
+
if (ctx.hasUI) ctx.ui.notify(msg, level);
|
|
471
|
+
} catch {
|
|
472
|
+
/* stale context after a session swap -- nothing to show */
|
|
473
|
+
}
|
|
474
|
+
};
|
|
475
|
+
|
|
476
|
+
if (compactionInFlight) {
|
|
477
|
+
notify("A compaction is already running.", "warning");
|
|
478
|
+
return;
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
const before = ctx.getContextUsage();
|
|
482
|
+
const beforeStr = before?.tokens != null ? `${before.tokens.toLocaleString()} tokens` : "?";
|
|
483
|
+
// The notebook is the durable record (snapshotted on session_before_compact),
|
|
484
|
+
// so the summary can drop verbose tool chatter without losing project state.
|
|
485
|
+
const customInstructions =
|
|
486
|
+
args.trim() ||
|
|
487
|
+
"Preserve the current analysis plan, decisions, and Galaxy invocation state. " +
|
|
488
|
+
"Verbose tool outputs and dataset previews can be dropped — the notebook holds the durable record.";
|
|
489
|
+
|
|
490
|
+
compactionInFlight = true;
|
|
491
|
+
notify(`Compacting (was ${beforeStr})…`, "info");
|
|
492
|
+
try {
|
|
493
|
+
ctx.compact({
|
|
494
|
+
customInstructions,
|
|
495
|
+
onComplete: (result) => {
|
|
496
|
+
compactionInFlight = false;
|
|
497
|
+
// getContextUsage() reads null right after compaction (pi only learns the
|
|
498
|
+
// new size on the next model response), so report the authoritative
|
|
499
|
+
// before-count from the result; the footer shows the new size next turn.
|
|
500
|
+
notify(
|
|
501
|
+
`✅ Compacted (was ${result.tokensBefore.toLocaleString()} tokens). New size shows after the next turn.`,
|
|
502
|
+
"info",
|
|
503
|
+
);
|
|
504
|
+
},
|
|
505
|
+
onError: (err) => {
|
|
506
|
+
compactionInFlight = false;
|
|
507
|
+
notify(`Compaction failed: ${err.message}`, "error");
|
|
508
|
+
},
|
|
509
|
+
});
|
|
510
|
+
} catch (err) {
|
|
511
|
+
// ctx.compact() asserts an active context synchronously and can throw
|
|
512
|
+
// before either callback runs; reset the guard so /compact isn't wedged.
|
|
513
|
+
compactionInFlight = false;
|
|
514
|
+
notify(`Compaction failed: ${err instanceof Error ? err.message : String(err)}`, "error");
|
|
515
|
+
}
|
|
516
|
+
},
|
|
517
|
+
});
|
|
518
|
+
|
|
519
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
520
|
+
// Tool execution lifecycle: show status when Galaxy tools run
|
|
521
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
522
|
+
const toolStartTimes = new Map<string, number>();
|
|
523
|
+
|
|
524
|
+
pi.on("tool_execution_start", async (event, ctx) => {
|
|
525
|
+
const label = galaxyToolLabel(event.toolName, family);
|
|
526
|
+
if (label) {
|
|
527
|
+
toolStartTimes.set(event.toolName, Date.now());
|
|
528
|
+
ctx.ui.setStatus("galaxy-tool", `🔧 Running ${label}...`);
|
|
529
|
+
}
|
|
530
|
+
});
|
|
531
|
+
|
|
532
|
+
pi.on("tool_execution_end", async (event, ctx) => {
|
|
533
|
+
// Re-sync the Notebook panel after any tool. A bash write to notebook.md
|
|
534
|
+
// can slip past the single-file watcher -- an atomic temp-and-rename save
|
|
535
|
+
// (`sed -i`, editors) swaps the inode, and a plain truncate can race the
|
|
536
|
+
// watcher's awaitWriteFinish window. This is content-guarded so it only
|
|
537
|
+
// emits on a real change and is a no-op otherwise. #253
|
|
538
|
+
await reemitNotebookIfChanged();
|
|
539
|
+
|
|
540
|
+
const label = galaxyToolLabel(event.toolName, family);
|
|
541
|
+
if (label) {
|
|
542
|
+
const startTime = toolStartTimes.get(event.toolName);
|
|
543
|
+
if (startTime) {
|
|
544
|
+
const elapsed = ((Date.now() - startTime) / 1000).toFixed(1);
|
|
545
|
+
ctx.ui.setStatus("galaxy-tool", `✓ ${label} (${elapsed}s)`);
|
|
546
|
+
toolStartTimes.delete(event.toolName);
|
|
547
|
+
setTimeout(() => {
|
|
548
|
+
// pi throws on a ctx captured before a reload or session switch (/connect,
|
|
549
|
+
// /new); uncaught, that takes the whole brain down three seconds later.
|
|
550
|
+
try {
|
|
551
|
+
ctx.ui.setStatus("galaxy-tool", "");
|
|
552
|
+
} catch {
|
|
553
|
+
// The session that showed the label is gone, and its status with it.
|
|
554
|
+
}
|
|
555
|
+
}, 3000);
|
|
556
|
+
} else {
|
|
557
|
+
ctx.ui.setStatus("galaxy-tool", "");
|
|
558
|
+
}
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
if (family.toolName(event.toolName) === "create_history" && !event.isError) {
|
|
562
|
+
try {
|
|
563
|
+
const resultText =
|
|
564
|
+
typeof event.result === "string" ? event.result : JSON.stringify(event.result);
|
|
565
|
+
const match = resultText.match(/"id":\s*"([^"]+)"/);
|
|
566
|
+
if (match) {
|
|
567
|
+
const state = getState();
|
|
568
|
+
state.currentHistoryId = match[1];
|
|
569
|
+
}
|
|
570
|
+
} catch {
|
|
571
|
+
/* ignore */
|
|
572
|
+
}
|
|
573
|
+
}
|
|
574
|
+
});
|
|
575
|
+
|
|
576
|
+
pi.on("tool_result", async (event) => {
|
|
577
|
+
if (family.toolName(event.toolName) === "create_history") {
|
|
578
|
+
try {
|
|
579
|
+
const firstContent = event.content?.[0];
|
|
580
|
+
const resultText = firstContent && "text" in firstContent ? firstContent.text : undefined;
|
|
581
|
+
if (resultText) {
|
|
582
|
+
const match = resultText.match(/"id":\s*"([^"]+)"/);
|
|
583
|
+
if (match) {
|
|
584
|
+
const state = getState();
|
|
585
|
+
state.currentHistoryId = match[1];
|
|
586
|
+
}
|
|
587
|
+
}
|
|
588
|
+
} catch {
|
|
589
|
+
/* ignore */
|
|
590
|
+
}
|
|
591
|
+
}
|
|
592
|
+
});
|
|
593
|
+
}
|