@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,180 @@
|
|
|
1
|
+
// Shell-neutral wire shape for the live Galaxy history panel.
|
|
2
|
+
//
|
|
3
|
+
// The brain is the only process that holds GALAXY_URL/GALAXY_API_KEY in every
|
|
4
|
+
// shell -- Orbit injects them after decrypting safeStorage, the CLI resolves
|
|
5
|
+
// them from a profile, the web server forwards them from its env -- so it is
|
|
6
|
+
// the only place a Galaxy read can happen once and reach both renderers. What
|
|
7
|
+
// crosses to a renderer is this projection and nothing else: no key, no full
|
|
8
|
+
// server URL, no dataset bytes, and no Galaxy-authored HTML (notably `peek`,
|
|
9
|
+
// which is HTML, is deliberately absent).
|
|
10
|
+
|
|
11
|
+
export const GALAXY_LIVE_SCHEMA_VERSION = 1;
|
|
12
|
+
|
|
13
|
+
/** Cap on rows crossing the channel. A 5k-dataset history must not become a
|
|
14
|
+
* 5k-element setWidget push on a 15s timer. */
|
|
15
|
+
export const GALAXY_LIVE_MAX_ITEMS = 200;
|
|
16
|
+
|
|
17
|
+
/** Cap on a single dataset name. Galaxy names are user-supplied and unbounded. */
|
|
18
|
+
export const GALAXY_LIVE_MAX_NAME = 200;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Cap on every other Galaxy-supplied string on the wire: encoded ids, the
|
|
22
|
+
* update_time, the extension.
|
|
23
|
+
*
|
|
24
|
+
* Capping the row COUNT is not capping the payload. A server that answers with
|
|
25
|
+
* a hundred-thousand-character id per row turns 200 rows into twenty megabytes
|
|
26
|
+
* on one stdout line, every tick -- the cap the row limit was written to
|
|
27
|
+
* enforce, defeated by a field nobody thought of as text. Everything from
|
|
28
|
+
* Galaxy that reaches the wire goes through a clamp.
|
|
29
|
+
*/
|
|
30
|
+
export const GALAXY_LIVE_MAX_TOKEN = 64;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Galaxy dataset states we model. Anything else collapses to "other" so a new
|
|
34
|
+
* server-side state never crashes a widget written against an older build.
|
|
35
|
+
* Source: galaxy.model.Dataset.states.
|
|
36
|
+
* @typedef {"new"|"upload"|"queued"|"running"|"ok"|"empty"|"error"|"paused"|"setting_metadata"|"failed_metadata"|"deferred"|"discarded"|"other"} GalaxyLiveState
|
|
37
|
+
*/
|
|
38
|
+
|
|
39
|
+
export const GALAXY_LIVE_STATES = /** @type {const} */ ([
|
|
40
|
+
"new",
|
|
41
|
+
"upload",
|
|
42
|
+
"queued",
|
|
43
|
+
"running",
|
|
44
|
+
"ok",
|
|
45
|
+
"empty",
|
|
46
|
+
"error",
|
|
47
|
+
"paused",
|
|
48
|
+
"setting_metadata",
|
|
49
|
+
"failed_metadata",
|
|
50
|
+
"deferred",
|
|
51
|
+
"discarded",
|
|
52
|
+
"other",
|
|
53
|
+
]);
|
|
54
|
+
|
|
55
|
+
/** States that mean Galaxy is still working. Drives the "is anything running"
|
|
56
|
+
* headline and the poll cadence. */
|
|
57
|
+
export const GALAXY_LIVE_ACTIVE_STATES = /** @type {const} */ ([
|
|
58
|
+
"new",
|
|
59
|
+
"upload",
|
|
60
|
+
"queued",
|
|
61
|
+
"running",
|
|
62
|
+
"setting_metadata",
|
|
63
|
+
]);
|
|
64
|
+
|
|
65
|
+
/** Why there is nothing to show. The renderer maps these to a sentence; the
|
|
66
|
+
* brain never sends prose, so the two shells cannot drift. */
|
|
67
|
+
export const GALAXY_LIVE_UNAVAILABLE = /** @type {const} */ ([
|
|
68
|
+
"not-configured",
|
|
69
|
+
"no-history",
|
|
70
|
+
"unreachable",
|
|
71
|
+
// 401: the key itself is rejected. 403: the key is fine, this history is not
|
|
72
|
+
// yours. Telling someone to re-enter a working key is its own kind of wrong.
|
|
73
|
+
"unauthorized",
|
|
74
|
+
"forbidden",
|
|
75
|
+
]);
|
|
76
|
+
|
|
77
|
+
/** @param {unknown} s @returns {GalaxyLiveState} */
|
|
78
|
+
export function normalizeState(s) {
|
|
79
|
+
return typeof s === "string" && /** @type {readonly string[]} */ (GALAXY_LIVE_STATES).includes(s)
|
|
80
|
+
? /** @type {GalaxyLiveState} */ (s)
|
|
81
|
+
: "other";
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/** @param {GalaxyLiveState} s */
|
|
85
|
+
export function isActiveState(s) {
|
|
86
|
+
return /** @type {readonly string[]} */ (GALAXY_LIVE_ACTIVE_STATES).includes(s);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Clamp a Galaxy-authored string to a fixed length. Not a security control --
|
|
91
|
+
* the renderer must still use textContent -- but it keeps one pathological
|
|
92
|
+
* name from dominating the payload.
|
|
93
|
+
* @param {unknown} v @param {number} max @returns {string}
|
|
94
|
+
*/
|
|
95
|
+
export function clampText(v, max = GALAXY_LIVE_MAX_NAME) {
|
|
96
|
+
if (typeof v !== "string") return "";
|
|
97
|
+
return v.length <= max ? v : v.slice(0, max - 1) + "…";
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Make an arbitrary decoded value into a payload the renderer can draw, or
|
|
102
|
+
* null if it cannot be made into one. Never throws.
|
|
103
|
+
*
|
|
104
|
+
* The brain ships on npm independently of the Orbit build, so a newer brain
|
|
105
|
+
* talking to an older shell is a supported configuration and a payload that
|
|
106
|
+
* does not match this build's idea of the shape is a thing that will happen.
|
|
107
|
+
* Without this, `history.items` arriving as a string threw out of the render
|
|
108
|
+
* and the host turned the panel into a sticky error card that only a click
|
|
109
|
+
* recovers. Same reasoning as `normalizeState`, one level up.
|
|
110
|
+
*
|
|
111
|
+
* @param {unknown} raw
|
|
112
|
+
* @returns {import("./galaxy-live-contract.js").GalaxyLivePayload | null}
|
|
113
|
+
*/
|
|
114
|
+
export function normalizeGalaxyLivePayload(raw) {
|
|
115
|
+
if (!raw || typeof raw !== "object" || Array.isArray(raw)) return null;
|
|
116
|
+
const p = /** @type {Record<string, unknown>} */ (raw);
|
|
117
|
+
if (p.version !== GALAXY_LIVE_SCHEMA_VERSION) return null;
|
|
118
|
+
|
|
119
|
+
const unavailable =
|
|
120
|
+
typeof p.unavailable === "string" &&
|
|
121
|
+
/** @type {readonly string[]} */ (GALAXY_LIVE_UNAVAILABLE).includes(p.unavailable)
|
|
122
|
+
? /** @type {import("./galaxy-live-contract.js").GalaxyLiveUnavailable} */ (p.unavailable)
|
|
123
|
+
: undefined;
|
|
124
|
+
// A reason this build has never heard of is still a reason: keep the panel
|
|
125
|
+
// out of the rows branch rather than dropping the payload on the floor.
|
|
126
|
+
const unknownReason = p.unavailable !== undefined && unavailable === undefined;
|
|
127
|
+
|
|
128
|
+
return {
|
|
129
|
+
version: GALAXY_LIVE_SCHEMA_VERSION,
|
|
130
|
+
serverHost:
|
|
131
|
+
typeof p.serverHost === "string" ? clampText(p.serverHost, GALAXY_LIVE_MAX_TOKEN) : null,
|
|
132
|
+
history: normalizeHistory(p.history, unknownReason),
|
|
133
|
+
...(unavailable ? { unavailable } : unknownReason ? { unavailable: "unreachable" } : {}),
|
|
134
|
+
updatedAt: typeof p.updatedAt === "string" ? clampText(p.updatedAt, GALAXY_LIVE_MAX_TOKEN) : "",
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
/** @param {unknown} raw @param {boolean} forceNull */
|
|
139
|
+
function normalizeHistory(raw, forceNull) {
|
|
140
|
+
if (forceNull || !raw || typeof raw !== "object" || Array.isArray(raw)) return null;
|
|
141
|
+
const h = /** @type {Record<string, unknown>} */ (raw);
|
|
142
|
+
const items = Array.isArray(h.items) ? h.items.map(normalizeItem).filter(Boolean) : [];
|
|
143
|
+
const counts = {};
|
|
144
|
+
if (h.counts && typeof h.counts === "object" && !Array.isArray(h.counts)) {
|
|
145
|
+
for (const [state, n] of Object.entries(h.counts)) {
|
|
146
|
+
if (normalizeState(state) === state && typeof n === "number" && Number.isFinite(n)) {
|
|
147
|
+
counts[state] = Math.max(0, Math.floor(n));
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
return {
|
|
152
|
+
id: clampText(h.id, GALAXY_LIVE_MAX_TOKEN),
|
|
153
|
+
name: clampText(h.name) || "Untitled history",
|
|
154
|
+
updateTime: clampText(h.updateTime, GALAXY_LIVE_MAX_TOKEN),
|
|
155
|
+
counts,
|
|
156
|
+
countsComplete: h.countsComplete !== false,
|
|
157
|
+
items: items.slice(0, GALAXY_LIVE_MAX_ITEMS),
|
|
158
|
+
truncated: typeof h.truncated === "number" && h.truncated > 0 ? Math.floor(h.truncated) : 0,
|
|
159
|
+
truncatedExact: h.truncatedExact !== false,
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
/** @param {unknown} raw */
|
|
164
|
+
function normalizeItem(raw) {
|
|
165
|
+
if (!raw || typeof raw !== "object" || Array.isArray(raw)) return null;
|
|
166
|
+
const i = /** @type {Record<string, unknown>} */ (raw);
|
|
167
|
+
/** @type {import("./galaxy-live-contract.js").GalaxyLiveItem} */
|
|
168
|
+
const item = {
|
|
169
|
+
id: clampText(i.id, GALAXY_LIVE_MAX_TOKEN),
|
|
170
|
+
hid: typeof i.hid === "number" && Number.isFinite(i.hid) ? i.hid : 0,
|
|
171
|
+
name: clampText(i.name),
|
|
172
|
+
state: normalizeState(i.state),
|
|
173
|
+
extension: clampText(i.extension, 32),
|
|
174
|
+
kind: i.kind === "collection" ? "collection" : "dataset",
|
|
175
|
+
};
|
|
176
|
+
if (typeof i.elementCount === "number" && Number.isFinite(i.elementCount)) {
|
|
177
|
+
item.elementCount = i.elementCount;
|
|
178
|
+
}
|
|
179
|
+
return item;
|
|
180
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// The fenced cells a Galaxy page renders. Galaxy's client splits a page at every ``` line and
|
|
2
|
+
// shows any other cell type as an error (`Markdown/parse.ts`, `Sections/SectionWrapper.vue`); its
|
|
3
|
+
// server refuses such a page outright (`validate_galaxy_markdown_fence_types`).
|
|
4
|
+
|
|
5
|
+
export const PAGE_CELL_TYPES = ["galaxy", "markdown", "vega", "visualization", "vitessce"];
|
|
6
|
+
|
|
7
|
+
/** Why Galaxy would not render `content` as a page, in its own words, or undefined.
|
|
8
|
+
* @param {string} content @returns {string | undefined} */
|
|
9
|
+
export function pageContentProblem(content) {
|
|
10
|
+
for (const line of content.split("\n")) {
|
|
11
|
+
const stripped = line.trim();
|
|
12
|
+
if (!stripped.startsWith("```")) continue;
|
|
13
|
+
const type = stripped.slice(3);
|
|
14
|
+
if (type && !PAGE_CELL_TYPES.includes(type)) {
|
|
15
|
+
return (
|
|
16
|
+
`Unsupported fenced block type [${type}]. Fenced blocks must be one of ` +
|
|
17
|
+
`${PAGE_CELL_TYPES.join(", ")}; for a plain code block, use ~~~ fences instead of \`\`\`.`
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
return undefined;
|
|
22
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How a shell names its Galaxy tools to the model, so a guard can ask "is this
|
|
3
|
+
* run_tool?" without knowing which tools that shell registered. Every shell
|
|
4
|
+
* runs galaxy-ops in-process under the operations' own names (`run_tool`,
|
|
5
|
+
* `get_dataset_details`, ...); Orbit's own Galaxy tools (galaxy_job_record,
|
|
6
|
+
* galaxy_upload_local_file, ...) are a different family and keep their names.
|
|
7
|
+
*
|
|
8
|
+
* @typedef {object} GalaxyToolFamily
|
|
9
|
+
* @property {(tool: string) => string} tool the model-facing name for a Galaxy tool
|
|
10
|
+
* @property {(toolName: string | undefined) => string | undefined} toolName
|
|
11
|
+
* the Galaxy tool behind a model-facing name, or undefined when it isn't one
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Bare names carry no marker, so a family has to be told which names are
|
|
16
|
+
* Galaxy's; anything else (bash, read, a shell's own tools) isn't Galaxy.
|
|
17
|
+
*
|
|
18
|
+
* @param {Iterable<string>} tools the Galaxy tool names the shell registered
|
|
19
|
+
* @returns {Readonly<GalaxyToolFamily>}
|
|
20
|
+
*/
|
|
21
|
+
export function bareFamily(tools) {
|
|
22
|
+
const known = new Set(tools);
|
|
23
|
+
return Object.freeze({
|
|
24
|
+
tool: (tool) => tool,
|
|
25
|
+
toolName: (toolName) => (toolName !== undefined && known.has(toolName) ? toolName : undefined),
|
|
26
|
+
});
|
|
27
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function normalizeGalaxyUrl(url: string): string;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The one spelling of a user-supplied Galaxy server URL.
|
|
3
|
+
*
|
|
4
|
+
* Every Galaxy client Orbit uses (galaxy-ops, the brain's own requests, the
|
|
5
|
+
* desktop's current-user check) appends `/api/...` to the server root, so a
|
|
6
|
+
* URL that already ends in `/api` -- what the Galaxy API docs show, and what
|
|
7
|
+
* people paste -- turned every call into a `/api/api/...` 404 with nothing
|
|
8
|
+
* pointing at the setting. Users also type a bare host (#264, #297).
|
|
9
|
+
*
|
|
10
|
+
* So: trim, default a scheme-less URL to https://, drop any query or fragment
|
|
11
|
+
* (clients append to the URL as a string, so `https://host/?x=1` turned into
|
|
12
|
+
* `https://host/?x=1/api/...` -- one is only ever there from pasting a browser
|
|
13
|
+
* address), trailing slashes, and trailing `/api` path segments. A subpath
|
|
14
|
+
* deployment (`https://example.org/galaxy/api`) keeps its prefix.
|
|
15
|
+
*
|
|
16
|
+
* Every shell normalizes again on the way through, so this has to be
|
|
17
|
+
* idempotent. That is why every trailing `/api` goes, not just one: stripping
|
|
18
|
+
* one would turn `host/api/api` into `host/api` on the first pass and `host` on
|
|
19
|
+
* the next, so the footer and the requests would name different servers. The
|
|
20
|
+
* cost is that a Galaxy mounted under a literal `/api` prefix can't be
|
|
21
|
+
* configured -- but `host/api` is already ambiguous between that and an API
|
|
22
|
+
* root, and no normalizer that accepts a pasted API root can tell them apart.
|
|
23
|
+
* Only lowercase `/api` is Galaxy's API root; a prefix spelled `/API` is kept.
|
|
24
|
+
*
|
|
25
|
+
* Explicit schemes, including http:// for loopback, are kept as typed; whether
|
|
26
|
+
* they are safe to send a key to is the validators' call, not this one's.
|
|
27
|
+
*/
|
|
28
|
+
|
|
29
|
+
const HAS_SCHEME = /^[a-zA-Z][a-zA-Z0-9+.-]*:\/\//;
|
|
30
|
+
const HAS_HOST = /^[a-zA-Z][a-zA-Z0-9+.-]*:\/\/[^\s/]/;
|
|
31
|
+
// Only a path segment: `https://api` is a host called "api", not an API root.
|
|
32
|
+
const API_ROOT = /^([a-zA-Z][a-zA-Z0-9+.-]*:\/\/[^/]+(?:\/.*)?)\/api$/;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* @param {string} url
|
|
36
|
+
* @returns {string}
|
|
37
|
+
*/
|
|
38
|
+
export function normalizeGalaxyUrl(url) {
|
|
39
|
+
// Cut before trimming: whitespace in front of the `?` would otherwise be left
|
|
40
|
+
// on the end for the next pass to find, and the passes would disagree.
|
|
41
|
+
const trimmed = url.split(/[?#]/, 1)[0].trim();
|
|
42
|
+
// A scheme-relative "//host" would otherwise become "https:////host".
|
|
43
|
+
const withScheme = HAS_SCHEME.test(trimmed) ? trimmed : `https://${trimmed.replace(/^\/+/, "")}`;
|
|
44
|
+
let out = withScheme.replace(/[\s/]+$/, "");
|
|
45
|
+
for (let m = API_ROOT.exec(out); m; m = API_ROOT.exec(out)) out = m[1].replace(/[\s/]+$/, "");
|
|
46
|
+
// Nothing left where the host goes: say so with blank, not a bare "https:".
|
|
47
|
+
return HAS_HOST.test(out) ? out : "";
|
|
48
|
+
}
|
package/shared/gtn.d.ts
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export const GTN_HOST: string;
|
|
2
|
+
export const GTN_BASE: string;
|
|
3
|
+
export const GTN_API: string;
|
|
4
|
+
|
|
5
|
+
export interface GtnTopic {
|
|
6
|
+
name: string | null;
|
|
7
|
+
title: string | null;
|
|
8
|
+
summary: string | null;
|
|
9
|
+
}
|
|
10
|
+
export interface GtnTutorial {
|
|
11
|
+
title: string | null;
|
|
12
|
+
url: string;
|
|
13
|
+
id: string | null;
|
|
14
|
+
level: string | null;
|
|
15
|
+
time_estimation: string | null;
|
|
16
|
+
objectives: (string | null)[];
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export function gtnPageText(html: string): string;
|
|
20
|
+
export function gtnTopics(
|
|
21
|
+
data: unknown,
|
|
22
|
+
): { count: number; topics: GtnTopic[]; hint: string } | undefined;
|
|
23
|
+
export function gtnTutorials(
|
|
24
|
+
data: unknown,
|
|
25
|
+
query?: string,
|
|
26
|
+
):
|
|
27
|
+
| { topic: string | null; count: number; query?: string; tutorials: GtnTutorial[]; hint: string }
|
|
28
|
+
| undefined;
|
|
29
|
+
export function gtnUrl(
|
|
30
|
+
url: string,
|
|
31
|
+
): { url: URL; problem?: never } | { url?: never; problem: string };
|
package/shared/gtn.js
ADDED
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
// Galaxy Training Network discovery, the part both shells share: where the GTN API is, how a
|
|
2
|
+
// topic or tutorial listing is read, which urls gtn_fetch may follow, and how a tutorial page is
|
|
3
|
+
// reduced to text. The reduction is a small scanner rather than an HTML parser so it loads in a
|
|
4
|
+
// browser worker, and it degrades on malformed markup instead of leaking a script body.
|
|
5
|
+
|
|
6
|
+
export const GTN_HOST = "training.galaxyproject.org";
|
|
7
|
+
export const GTN_BASE = `https://${GTN_HOST}`;
|
|
8
|
+
export const GTN_API = `${GTN_BASE}/training-material/api`;
|
|
9
|
+
|
|
10
|
+
/** Chrome that carries no tutorial content, dropped whole. */
|
|
11
|
+
const DROP_TAGS = new Set(["script", "style", "nav", "header", "footer", "aside", "noscript"]);
|
|
12
|
+
/** Elements with no end tag. */
|
|
13
|
+
const VOID_TAGS = new Set([
|
|
14
|
+
"area",
|
|
15
|
+
"base",
|
|
16
|
+
"br",
|
|
17
|
+
"col",
|
|
18
|
+
"embed",
|
|
19
|
+
"hr",
|
|
20
|
+
"img",
|
|
21
|
+
"input",
|
|
22
|
+
"link",
|
|
23
|
+
"meta",
|
|
24
|
+
"param",
|
|
25
|
+
"source",
|
|
26
|
+
"track",
|
|
27
|
+
"wbr",
|
|
28
|
+
]);
|
|
29
|
+
/** Most specific first: the first one present wins. */
|
|
30
|
+
const CONTENT_REGIONS = ["main", "article", "tutorial-content"];
|
|
31
|
+
const RAW_TEXT = new Set(["script", "style"]);
|
|
32
|
+
/** @type {Record<string, string>} */
|
|
33
|
+
const ENTITIES = {
|
|
34
|
+
amp: "&",
|
|
35
|
+
apos: "'",
|
|
36
|
+
copy: "©",
|
|
37
|
+
gt: ">",
|
|
38
|
+
hellip: "…",
|
|
39
|
+
ldquo: "“",
|
|
40
|
+
lsquo: "‘",
|
|
41
|
+
lt: "<",
|
|
42
|
+
mdash: "—",
|
|
43
|
+
nbsp: " ",
|
|
44
|
+
ndash: "–",
|
|
45
|
+
quot: '"',
|
|
46
|
+
rarr: "→",
|
|
47
|
+
rdquo: "”",
|
|
48
|
+
reg: "®",
|
|
49
|
+
rsquo: "’",
|
|
50
|
+
times: "×",
|
|
51
|
+
};
|
|
52
|
+
const TAG =
|
|
53
|
+
/<!--[\s\S]*?-->|<[!?][^>]*>|<\/([a-zA-Z][^\s/>]*)[^>]*>|<([a-zA-Z][^\s/>]*)((?:[^>"']|"[^"]*"|'[^']*')*)>/g;
|
|
54
|
+
const CLASS_ATTR = /(?:^|\s)class\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+))/gi;
|
|
55
|
+
|
|
56
|
+
/** @param {string} text */
|
|
57
|
+
function unescape(text) {
|
|
58
|
+
return text.replace(/&(#[0-9]+|#[xX][0-9a-fA-F]+|[a-zA-Z][a-zA-Z0-9]*);?/g, (match, ref) => {
|
|
59
|
+
if (ref.startsWith("#")) {
|
|
60
|
+
const code =
|
|
61
|
+
ref[1] === "x" || ref[1] === "X" ? parseInt(ref.slice(2), 16) : parseInt(ref.slice(1), 10);
|
|
62
|
+
return code > 0 && code <= 0x10ffff ? String.fromCodePoint(code) : match;
|
|
63
|
+
}
|
|
64
|
+
return ENTITIES[ref] ?? match;
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/** @param {string} attrs */
|
|
69
|
+
function classOf(attrs) {
|
|
70
|
+
const matches = [...attrs.matchAll(CLASS_ATTR)];
|
|
71
|
+
const last = matches[matches.length - 1];
|
|
72
|
+
return last ? unescape(last[1] ?? last[2] ?? last[3] ?? "") : "";
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* The page's text, and the text inside each content region.
|
|
77
|
+
* @param {string} html
|
|
78
|
+
*/
|
|
79
|
+
function extract(html) {
|
|
80
|
+
/** @type {string[]} */
|
|
81
|
+
const chunks = [];
|
|
82
|
+
/** @type {Record<string, string[]>} */
|
|
83
|
+
const regions = {};
|
|
84
|
+
/** @type {[string, number][]} */
|
|
85
|
+
const open = [];
|
|
86
|
+
let depth = 0;
|
|
87
|
+
/** @type {number | undefined} */
|
|
88
|
+
let skipUntil;
|
|
89
|
+
|
|
90
|
+
/** @param {string} tag @param {string} attrs */
|
|
91
|
+
const start = (tag, attrs) => {
|
|
92
|
+
if (VOID_TAGS.has(tag)) return;
|
|
93
|
+
depth += 1;
|
|
94
|
+
if (skipUntil !== undefined) return;
|
|
95
|
+
if (DROP_TAGS.has(tag)) {
|
|
96
|
+
skipUntil = depth;
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
let name = CONTENT_REGIONS.includes(tag) ? tag : undefined;
|
|
100
|
+
if (!name && classOf(attrs).split(/\s+/).includes("tutorial-content")) {
|
|
101
|
+
name = "tutorial-content";
|
|
102
|
+
}
|
|
103
|
+
// Only the outermost occurrence of a region is captured.
|
|
104
|
+
if (name && !(name in regions)) {
|
|
105
|
+
regions[name] = [];
|
|
106
|
+
open.push([name, depth]);
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
/** @param {string} tag */
|
|
110
|
+
const end = (tag) => {
|
|
111
|
+
if (VOID_TAGS.has(tag)) return;
|
|
112
|
+
if (skipUntil !== undefined && depth <= skipUntil) skipUntil = undefined;
|
|
113
|
+
while (open.length && open[open.length - 1][1] >= depth) open.pop();
|
|
114
|
+
depth = Math.max(0, depth - 1);
|
|
115
|
+
};
|
|
116
|
+
/** @param {string} text */
|
|
117
|
+
const data = (text) => {
|
|
118
|
+
if (!text || skipUntil !== undefined) return;
|
|
119
|
+
chunks.push(text);
|
|
120
|
+
for (const [name] of open) regions[name].push(text);
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
let at = 0;
|
|
124
|
+
TAG.lastIndex = 0;
|
|
125
|
+
for (let match = TAG.exec(html); match; match = TAG.exec(html)) {
|
|
126
|
+
data(unescape(html.slice(at, match.index)));
|
|
127
|
+
at = TAG.lastIndex;
|
|
128
|
+
const [, closing, opening, attrs = ""] = match;
|
|
129
|
+
if (closing) {
|
|
130
|
+
end(closing.toLowerCase());
|
|
131
|
+
} else if (opening) {
|
|
132
|
+
const tag = opening.toLowerCase();
|
|
133
|
+
start(tag, attrs);
|
|
134
|
+
if (attrs.trimEnd().endsWith("/")) {
|
|
135
|
+
end(tag);
|
|
136
|
+
} else if (RAW_TEXT.has(tag)) {
|
|
137
|
+
const close = html.slice(at).search(new RegExp(`</${tag}[\\s>/]`, "i"));
|
|
138
|
+
const stop = close < 0 ? html.length : at + close;
|
|
139
|
+
data(html.slice(at, stop));
|
|
140
|
+
TAG.lastIndex = at = stop;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
data(unescape(html.slice(at)));
|
|
145
|
+
return { chunks, regions };
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/** @param {string} text */
|
|
149
|
+
function normalize(text) {
|
|
150
|
+
/** @type {string[]} */
|
|
151
|
+
const out = [];
|
|
152
|
+
let blanks = 0;
|
|
153
|
+
for (const line of text.replace(/\r\n/g, "\n").split("\n")) {
|
|
154
|
+
const collapsed = line.split(/\s+/).filter(Boolean).join(" ");
|
|
155
|
+
if (collapsed) {
|
|
156
|
+
out.push(collapsed);
|
|
157
|
+
blanks = 0;
|
|
158
|
+
} else {
|
|
159
|
+
blanks += 1;
|
|
160
|
+
if (blanks < 2) out.push("");
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
return out.join("\n").trim();
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* Reduce a GTN page to readable text, preferring its most specific region.
|
|
168
|
+
* @param {string} html @returns {string}
|
|
169
|
+
*/
|
|
170
|
+
export function gtnPageText(html) {
|
|
171
|
+
const { chunks, regions } = extract(html);
|
|
172
|
+
for (const name of CONTENT_REGIONS) {
|
|
173
|
+
const chunk = regions[name];
|
|
174
|
+
if (chunk && chunk.join("").trim()) return normalize(chunk.join(""));
|
|
175
|
+
}
|
|
176
|
+
return normalize(chunks.join(""));
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
/** @param {unknown} value @returns {value is Record<string, any>} */
|
|
180
|
+
const isRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* The topics listing as the GTN API answers it, or undefined when the payload isn't one.
|
|
184
|
+
* @param {unknown} data
|
|
185
|
+
*/
|
|
186
|
+
export function gtnTopics(data) {
|
|
187
|
+
if (!isRecord(data)) return undefined;
|
|
188
|
+
const topics = Object.values(data)
|
|
189
|
+
.filter(isRecord)
|
|
190
|
+
.map((t) => ({ name: t.name ?? null, title: t.title ?? null, summary: t.summary ?? null }));
|
|
191
|
+
return {
|
|
192
|
+
count: topics.length,
|
|
193
|
+
topics,
|
|
194
|
+
hint: "Use gtn_search with a topic name to list its tutorials.",
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
/**
|
|
199
|
+
* A topic's tutorials as the GTN API answers them, filtered on title and objectives when a query
|
|
200
|
+
* is given, or undefined when the payload isn't a topic.
|
|
201
|
+
* @param {unknown} data @param {string} [query]
|
|
202
|
+
*/
|
|
203
|
+
export function gtnTutorials(data, query) {
|
|
204
|
+
if (!isRecord(data)) return undefined;
|
|
205
|
+
let tutorials = (Array.isArray(data.materials) ? data.materials : [])
|
|
206
|
+
.filter(isRecord)
|
|
207
|
+
.map((m) => {
|
|
208
|
+
const url = typeof m.url === "string" ? m.url : "";
|
|
209
|
+
return {
|
|
210
|
+
title: m.title ?? null,
|
|
211
|
+
url: url.startsWith("/") ? `${GTN_BASE}${url}` : url,
|
|
212
|
+
id: m.id || m.tutorial_name || null,
|
|
213
|
+
level: m.level ?? null,
|
|
214
|
+
time_estimation: m.time_estimation ?? null,
|
|
215
|
+
objectives: /** @type {(string | null)[]} */ (m.objectives || []),
|
|
216
|
+
};
|
|
217
|
+
});
|
|
218
|
+
if (query) {
|
|
219
|
+
const needle = query.toLowerCase();
|
|
220
|
+
tutorials = tutorials.filter(
|
|
221
|
+
(t) =>
|
|
222
|
+
String(t.title || "")
|
|
223
|
+
.toLowerCase()
|
|
224
|
+
.includes(needle) || t.objectives.some((o) => (o || "").toLowerCase().includes(needle)),
|
|
225
|
+
);
|
|
226
|
+
}
|
|
227
|
+
return {
|
|
228
|
+
topic: data.title ?? null,
|
|
229
|
+
count: tutorials.length,
|
|
230
|
+
...(query ? { query } : {}),
|
|
231
|
+
tutorials,
|
|
232
|
+
hint: "Use gtn_fetch with a tutorial URL to read its full content.",
|
|
233
|
+
};
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
/**
|
|
237
|
+
* The parsed url when gtn_fetch may follow it: http(s) on the GTN host, nothing else (a userinfo
|
|
238
|
+
* trick or another scheme is refused). Otherwise the reason.
|
|
239
|
+
* @param {string} url @returns {{ url: URL } | { problem: string }}
|
|
240
|
+
*/
|
|
241
|
+
export function gtnUrl(url) {
|
|
242
|
+
let parsed;
|
|
243
|
+
try {
|
|
244
|
+
parsed = new URL(url);
|
|
245
|
+
} catch {
|
|
246
|
+
parsed = undefined;
|
|
247
|
+
}
|
|
248
|
+
const host = parsed?.hostname ?? "";
|
|
249
|
+
if (!parsed || !["http:", "https:"].includes(parsed.protocol) || host !== GTN_HOST) {
|
|
250
|
+
return { problem: `Only URLs on ${GTN_HOST} are allowed. Got: ${host || url}` };
|
|
251
|
+
}
|
|
252
|
+
return { url: parsed };
|
|
253
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* pi (0.99+) answers a prompt that an extension command consumed with
|
|
3
|
+
* `{disposition: "handled"}` and starts no turn for it -- so no agent_end
|
|
4
|
+
* follows to clear the thinking state the send path set, or to stand down the
|
|
5
|
+
* shell's stall watchdog.
|
|
6
|
+
*
|
|
7
|
+
* @param {Record<string, unknown>} event
|
|
8
|
+
*/
|
|
9
|
+
export function isHandledPrompt(event) {
|
|
10
|
+
const data = /** @type {{ disposition?: unknown } | undefined} */ (event.data);
|
|
11
|
+
return event.command === "prompt" && event.success !== false && data?.disposition === "handled";
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* A prompt response after which no turn is coming: either a command consumed
|
|
16
|
+
* it, or preflight rejected it.
|
|
17
|
+
*
|
|
18
|
+
* @param {Record<string, unknown>} event
|
|
19
|
+
*/
|
|
20
|
+
export function promptStartsNoTurn(event) {
|
|
21
|
+
return (
|
|
22
|
+
event.type === "response" &&
|
|
23
|
+
event.command === "prompt" &&
|
|
24
|
+
(event.success === false || isHandledPrompt(event))
|
|
25
|
+
);
|
|
26
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export function modelsJsonProviders(modelsPath: string): string[];
|
|
2
|
+
|
|
3
|
+
export function isKnownProvider(
|
|
4
|
+
provider: string,
|
|
5
|
+
builtIn: Iterable<string>,
|
|
6
|
+
extra?: Iterable<string>,
|
|
7
|
+
): boolean;
|
|
8
|
+
|
|
9
|
+
export function userExtensionsMayRegisterProviders(agentDir: string, cwd: string): boolean;
|
|
10
|
+
|
|
11
|
+
export function unknownProviderMessage(provider: string): string;
|