@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,22 @@
|
|
|
1
|
+
export interface ProviderAuthCaps {
|
|
2
|
+
/** pi's finished button text, e.g. "Sign in with OpenRouter". "" when pi gives none. */
|
|
3
|
+
signInLabel: string;
|
|
4
|
+
/** The account behind it, e.g. "Anthropic (Claude Pro/Max)". "" when pi gives none. */
|
|
5
|
+
providerLabel: string;
|
|
6
|
+
/** pi defines an API-key auth path for this provider (dual-auth when it also signs in). */
|
|
7
|
+
acceptsApiKey: boolean;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
/** Shape of the bits of a pi registry provider entry this module reads. */
|
|
11
|
+
export interface PiProviderAuthEntry {
|
|
12
|
+
id?: string;
|
|
13
|
+
auth?: {
|
|
14
|
+
apiKey?: unknown;
|
|
15
|
+
oauth?: { login?: unknown; name?: string; loginLabel?: string };
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export function classifyProviderAuth(provider: PiProviderAuthEntry): ProviderAuthCaps | null;
|
|
20
|
+
export function isOAuthOnly(caps: ProviderAuthCaps | undefined): boolean;
|
|
21
|
+
export const SEED_PROVIDER_AUTH_CAPS: Record<string, ProviderAuthCaps>;
|
|
22
|
+
export const SEED_OAUTH_ONLY_PROVIDERS: string[];
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What a provider's auth surface looks like, and the one predicate every layer
|
|
3
|
+
* has to agree on: does this provider authenticate ONLY by sign-in?
|
|
4
|
+
*
|
|
5
|
+
* pi models `auth.apiKey` and `auth.oauth` independently. `openai-codex` carries
|
|
6
|
+
* oauth alone; anthropic, xai, openrouter, kimi-coding, github-copilot and radius
|
|
7
|
+
* carry both. Reading "can sign in" as "has no API key" is what broke #429 --
|
|
8
|
+
* Orbit stopped showing, storing, reporting and injecting the Anthropic key the
|
|
9
|
+
* moment pi taught Anthropic to sign in. That rule now lives here once, instead
|
|
10
|
+
* of in the main process, the renderer and the CLI separately.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Classify one provider's auth surface from pi's registry entry. Returns null
|
|
15
|
+
* when the provider offers no sign-in at all. Pure, so the predicate #429 got
|
|
16
|
+
* wrong is testable without an Electron or pi runtime.
|
|
17
|
+
*/
|
|
18
|
+
export function classifyProviderAuth(provider) {
|
|
19
|
+
const oauth = provider && provider.auth && provider.auth.oauth;
|
|
20
|
+
if (!oauth || !oauth.login) return null;
|
|
21
|
+
return {
|
|
22
|
+
// Two distinct things, deliberately not collapsed: pi's loginLabel is a
|
|
23
|
+
// finished button ("Sign in with OpenRouter"), while name is the account
|
|
24
|
+
// behind it ("Anthropic (Claude Pro/Max)"). Folding them into one field
|
|
25
|
+
// renders "Sign in with Sign in with OpenRouter".
|
|
26
|
+
signInLabel: oauth.loginLabel || "",
|
|
27
|
+
providerLabel: oauth.name || "",
|
|
28
|
+
acceptsApiKey: Boolean(provider.auth.apiKey),
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Sign-in is the only way in, so there is no API key to ask for. Gates every
|
|
34
|
+
* "there is no key here" behavior: hiding the key field, masking `hasApiKey`,
|
|
35
|
+
* and skipping key injection into the brain. Dual-auth providers answer false.
|
|
36
|
+
*
|
|
37
|
+
* An unknown provider (no caps) answers false too -- offering a key field for a
|
|
38
|
+
* provider we haven't classified yet is the safe direction.
|
|
39
|
+
*/
|
|
40
|
+
export function isOAuthOnly(caps) {
|
|
41
|
+
return Boolean(caps && !caps.acceptsApiKey);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Known-good caps for the provider that ships sign-in enabled, used before the
|
|
46
|
+
* registry read lands (main, renderer) and as the CLI's static answer, which has
|
|
47
|
+
* no registry to read at all. Everything absent from it reads as "takes an API
|
|
48
|
+
* key" -- the safe default, since it offers a key field rather than hiding one.
|
|
49
|
+
*/
|
|
50
|
+
export const SEED_PROVIDER_AUTH_CAPS = {
|
|
51
|
+
"openai-codex": { signInLabel: "", providerLabel: "", acceptsApiKey: false },
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
/** The seed's sign-in-only ids. Deliberately NOT "everything that can sign in". */
|
|
55
|
+
export const SEED_OAUTH_ONLY_PROVIDERS = Object.keys(SEED_PROVIDER_AUTH_CAPS).filter((id) =>
|
|
56
|
+
isOAuthOnly(SEED_PROVIDER_AUTH_CAPS[id]),
|
|
57
|
+
);
|
package/shared/random.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Random bytes from the platform CSPRNG. Node 22+ (engines >=22.19) and workers
|
|
3
|
+
* both have globalThis.crypto, so nothing here imports `crypto`, and the brain's
|
|
4
|
+
* random ids need no Node edge.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/** @param {number} n @returns {Uint8Array} */
|
|
8
|
+
export function randomBytes(n) {
|
|
9
|
+
return globalThis.crypto.getRandomValues(new Uint8Array(n));
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/** @param {number} n bytes @returns {string} 2n lowercase hex characters */
|
|
13
|
+
export function randomHex(n) {
|
|
14
|
+
return Array.from(randomBytes(n), (b) => b.toString(16).padStart(2, "0")).join("");
|
|
15
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// Shared head + tail excerpt of a record (Orbit's notebook.md, the browser's Galaxy Page) for
|
|
2
|
+
// per-turn context. Head gives project intent and early plans; tail gives the latest activity.
|
|
3
|
+
|
|
4
|
+
export const HEAD_MAX_CHARS = 2000;
|
|
5
|
+
export const TAIL_MAX_CHARS = 4000;
|
|
6
|
+
export const ELISION_MARKER = "_(... middle elided ...)_";
|
|
7
|
+
|
|
8
|
+
/** @param {string} content @returns {{ text: string, elided: boolean }} */
|
|
9
|
+
export function excerptHeadTail(content) {
|
|
10
|
+
if (content.length <= HEAD_MAX_CHARS + TAIL_MAX_CHARS + 100) {
|
|
11
|
+
return { text: content, elided: false };
|
|
12
|
+
}
|
|
13
|
+
const head = content.slice(0, HEAD_MAX_CHARS);
|
|
14
|
+
const tail = content.slice(-TAIL_MAX_CHARS);
|
|
15
|
+
return { text: `${head}\n\n${ELISION_MARKER}\n\n${tail}`, elided: true };
|
|
16
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export type RedirectRefusalKind = "cross-origin" | "unreadable" | "unparsable" | "too-many-hops";
|
|
2
|
+
|
|
3
|
+
export declare class RedirectRefusedError extends Error {
|
|
4
|
+
readonly kind: RedirectRefusalKind;
|
|
5
|
+
readonly status: number;
|
|
6
|
+
readonly fromOrigin: string;
|
|
7
|
+
readonly toOrigin: string | null;
|
|
8
|
+
constructor(
|
|
9
|
+
message: string,
|
|
10
|
+
detail: {
|
|
11
|
+
kind: RedirectRefusalKind;
|
|
12
|
+
status: number;
|
|
13
|
+
fromOrigin: string;
|
|
14
|
+
toOrigin?: string | null;
|
|
15
|
+
},
|
|
16
|
+
);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export declare function originOf(url: string): string | null;
|
|
20
|
+
|
|
21
|
+
export interface SameOriginFetchOptions {
|
|
22
|
+
/** Defaults to `globalThis.fetch`, resolved per call. */
|
|
23
|
+
fetchImpl?: typeof fetch;
|
|
24
|
+
/** Same-origin hops to allow before giving up. Default 3. */
|
|
25
|
+
maxHops?: number;
|
|
26
|
+
/** How the server is named in error messages. Default "The server". */
|
|
27
|
+
serverLabel?: string;
|
|
28
|
+
/** How the URL setting is named in error messages. Default "the configured URL". */
|
|
29
|
+
urlSettingLabel?: string;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export declare function fetchSameOriginOnly(
|
|
33
|
+
url: string,
|
|
34
|
+
init?: RequestInit,
|
|
35
|
+
options?: SameOriginFetchOptions,
|
|
36
|
+
): Promise<Response>;
|
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
// A fetch wrapper for requests that carry a credential header.
|
|
2
|
+
//
|
|
3
|
+
// Node's fetch defaults to `redirect: "follow"`, and undici strips only
|
|
4
|
+
// `authorization`, `proxy-authorization`, `cookie` and `host` when a redirect
|
|
5
|
+
// crosses origins. A custom credential header -- Galaxy's `x-api-key` -- is forwarded
|
|
6
|
+
// intact, so a server that answers 3xx pointing at another host receives the
|
|
7
|
+
// caller's key while the caller sees an ordinary result. This takes redirects
|
|
8
|
+
// manually instead: only an exact same-origin hop is followed, everything else
|
|
9
|
+
// throws.
|
|
10
|
+
//
|
|
11
|
+
// A scheme change counts as an origin change, so http://host -> https://host is
|
|
12
|
+
// refused rather than followed. The key already went out in cleartext on the
|
|
13
|
+
// first hop; quietly following the upgrade would hide that for good, and what
|
|
14
|
+
// the user needs is to change the configured URL -- which the error says.
|
|
15
|
+
//
|
|
16
|
+
// Errors name the status and the target's ORIGIN. Never the full URL: a
|
|
17
|
+
// redirect target's path or query can carry a token, and that would end up in
|
|
18
|
+
// logs, notebooks and bug reports.
|
|
19
|
+
|
|
20
|
+
/** Statuses that carry a Location and mean "go here instead". */
|
|
21
|
+
const REDIRECT_STATUS_SET = new Set([301, 302, 303, 307, 308]);
|
|
22
|
+
|
|
23
|
+
/** Request-body headers, dropped when a redirect turns the request into a GET. */
|
|
24
|
+
const BODY_HEADERS = new Set([
|
|
25
|
+
"content-encoding",
|
|
26
|
+
"content-language",
|
|
27
|
+
"content-length",
|
|
28
|
+
"content-location",
|
|
29
|
+
"content-type",
|
|
30
|
+
]);
|
|
31
|
+
|
|
32
|
+
const DEFAULT_MAX_HOPS = 3;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* A redirect we would not follow, or could not follow safely.
|
|
36
|
+
*
|
|
37
|
+
* `kind` is what went wrong: `cross-origin` (the common one), `unreadable`
|
|
38
|
+
* (a redirect whose headers we cannot read at all), `unparsable` (a Location
|
|
39
|
+
* we can read but cannot resolve, so we cannot prove where it points) and
|
|
40
|
+
* `too-many-hops` (same-origin redirects that never settle).
|
|
41
|
+
*/
|
|
42
|
+
export class RedirectRefusedError extends Error {
|
|
43
|
+
/**
|
|
44
|
+
* @param {string} message
|
|
45
|
+
* @param {{ kind: "cross-origin" | "unreadable" | "unparsable" | "too-many-hops", status: number,
|
|
46
|
+
* fromOrigin: string, toOrigin?: string | null }} detail
|
|
47
|
+
*/
|
|
48
|
+
constructor(message, detail) {
|
|
49
|
+
super(message);
|
|
50
|
+
this.name = "RedirectRefusedError";
|
|
51
|
+
this.kind = detail.kind;
|
|
52
|
+
this.status = detail.status;
|
|
53
|
+
this.fromOrigin = detail.fromOrigin;
|
|
54
|
+
this.toOrigin = detail.toOrigin ?? null;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/** Scheme + host + port, or null when the URL will not parse. */
|
|
59
|
+
export function originOf(url) {
|
|
60
|
+
try {
|
|
61
|
+
return new URL(String(url)).origin;
|
|
62
|
+
} catch {
|
|
63
|
+
return null;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/** Headers minus the request-body ones, in whatever shape they arrived. */
|
|
68
|
+
function withoutBodyHeaders(headers) {
|
|
69
|
+
if (!headers) return headers;
|
|
70
|
+
if (typeof Headers !== "undefined" && headers instanceof Headers) {
|
|
71
|
+
const next = new Headers(headers);
|
|
72
|
+
for (const name of BODY_HEADERS) next.delete(name);
|
|
73
|
+
return next;
|
|
74
|
+
}
|
|
75
|
+
if (Array.isArray(headers)) {
|
|
76
|
+
return headers.filter(([name]) => !BODY_HEADERS.has(String(name).toLowerCase()));
|
|
77
|
+
}
|
|
78
|
+
return Object.fromEntries(
|
|
79
|
+
Object.entries(headers).filter(([name]) => !BODY_HEADERS.has(name.toLowerCase())),
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* The init for the next hop, applying the method rewrite fetch itself would:
|
|
85
|
+
* 301/302 turn a POST into a GET, 303 turns anything but GET/HEAD into a GET,
|
|
86
|
+
* and 307/308 preserve both method and body.
|
|
87
|
+
*/
|
|
88
|
+
function initForNextHop(init, status) {
|
|
89
|
+
const method = String(init.method ?? "GET").toUpperCase();
|
|
90
|
+
const rewrite =
|
|
91
|
+
((status === 301 || status === 302) && method === "POST") ||
|
|
92
|
+
(status === 303 && method !== "GET" && method !== "HEAD");
|
|
93
|
+
if (!rewrite) return init;
|
|
94
|
+
const next = { ...init, method: "GET", headers: withoutBodyHeaders(init.headers) };
|
|
95
|
+
delete next.body;
|
|
96
|
+
return next;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* `undefined` when the response's headers cannot be read at all, `null` when
|
|
101
|
+
* they can and carry no Location, otherwise the Location value. The first two
|
|
102
|
+
* are not the same thing: one means we do not know where the server is
|
|
103
|
+
* pointing, the other means it is not pointing anywhere.
|
|
104
|
+
*/
|
|
105
|
+
function readLocation(response) {
|
|
106
|
+
const get = response.headers?.get;
|
|
107
|
+
if (typeof get !== "function") return undefined;
|
|
108
|
+
return response.headers.get("location") || null;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Release an intermediate response we are not returning. Without this the
|
|
113
|
+
* body of every hop -- and of the redirect we refuse -- sits on its socket
|
|
114
|
+
* until the GC gets to it, which on a server that pads its 3xx bodies costs a
|
|
115
|
+
* connection and a buffer per call.
|
|
116
|
+
*/
|
|
117
|
+
function discard(response) {
|
|
118
|
+
try {
|
|
119
|
+
const cancelled = response?.body?.cancel?.();
|
|
120
|
+
if (cancelled && typeof cancelled.catch === "function") cancelled.catch(() => {});
|
|
121
|
+
} catch {
|
|
122
|
+
// Already consumed, already errored, or not a real Response: nothing to do.
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Fetch `url`, following redirects only while they stay on the same origin.
|
|
128
|
+
*
|
|
129
|
+
* @param {string} url
|
|
130
|
+
* @param {RequestInit} [init]
|
|
131
|
+
* @param {{ fetchImpl?: typeof fetch, maxHops?: number, serverLabel?: string,
|
|
132
|
+
* urlSettingLabel?: string }} [options]
|
|
133
|
+
* @returns {Promise<Response>}
|
|
134
|
+
*/
|
|
135
|
+
export async function fetchSameOriginOnly(url, init = {}, options = {}) {
|
|
136
|
+
// Resolved per call, not per module load, so a test (or a caller that
|
|
137
|
+
// injects one) can swap the implementation.
|
|
138
|
+
const fetchImpl = options.fetchImpl ?? globalThis.fetch;
|
|
139
|
+
// NaN or Infinity here would quietly turn the hop limit off.
|
|
140
|
+
const maxHops =
|
|
141
|
+
Number.isInteger(options.maxHops) && options.maxHops >= 0 ? options.maxHops : DEFAULT_MAX_HOPS;
|
|
142
|
+
const serverLabel = options.serverLabel ?? "The server";
|
|
143
|
+
const urlSettingLabel = options.urlSettingLabel ?? "the configured URL";
|
|
144
|
+
const startOrigin = originOf(url) ?? String(url);
|
|
145
|
+
|
|
146
|
+
let currentUrl = String(url);
|
|
147
|
+
let currentInit = { ...init, redirect: "manual" };
|
|
148
|
+
|
|
149
|
+
for (let hop = 0; ; hop++) {
|
|
150
|
+
const response = await fetchImpl(currentUrl, currentInit);
|
|
151
|
+
const status = response?.status;
|
|
152
|
+
// Not a redirect at all: the caller's normal status handling owns it.
|
|
153
|
+
if (!REDIRECT_STATUS_SET.has(status)) return response;
|
|
154
|
+
|
|
155
|
+
const location = readLocation(response);
|
|
156
|
+
if (location === undefined) {
|
|
157
|
+
discard(response);
|
|
158
|
+
throw new RedirectRefusedError(
|
|
159
|
+
`${serverLabel} answered HTTP ${status} but where it was pointing could not be read, so the request was refused and no credentials were sent onward.`,
|
|
160
|
+
{ kind: "unreadable", status, fromOrigin: startOrigin },
|
|
161
|
+
);
|
|
162
|
+
}
|
|
163
|
+
// A 3xx with no Location points nowhere, so there is nothing to refuse --
|
|
164
|
+
// the caller's `!response.ok` branch reports it the way it always has.
|
|
165
|
+
if (location === null) return response;
|
|
166
|
+
|
|
167
|
+
let target;
|
|
168
|
+
try {
|
|
169
|
+
target = new URL(location, currentUrl);
|
|
170
|
+
} catch {
|
|
171
|
+
discard(response);
|
|
172
|
+
throw new RedirectRefusedError(
|
|
173
|
+
`${serverLabel} answered HTTP ${status} with a redirect target that could not be read, so the request was refused and no credentials were sent to it.`,
|
|
174
|
+
{ kind: "unparsable", status, fromOrigin: startOrigin },
|
|
175
|
+
);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
if (target.origin !== startOrigin) {
|
|
179
|
+
discard(response);
|
|
180
|
+
throw new RedirectRefusedError(
|
|
181
|
+
crossOriginMessage(serverLabel, urlSettingLabel, status, startOrigin, target.origin),
|
|
182
|
+
{
|
|
183
|
+
kind: "cross-origin",
|
|
184
|
+
status,
|
|
185
|
+
fromOrigin: startOrigin,
|
|
186
|
+
toOrigin: target.origin,
|
|
187
|
+
},
|
|
188
|
+
);
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
if (hop >= maxHops) {
|
|
192
|
+
discard(response);
|
|
193
|
+
throw new RedirectRefusedError(
|
|
194
|
+
`${serverLabel} redirected the request more than ${maxHops} times within ${startOrigin} without ever settling, so the request was given up on.`,
|
|
195
|
+
{ kind: "too-many-hops", status, fromOrigin: startOrigin, toOrigin: target.origin },
|
|
196
|
+
);
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
// Userinfo is dropped before re-issuing. It does not change the origin, so
|
|
200
|
+
// a Location carrying it would pass the check above and then die inside
|
|
201
|
+
// fetch with a TypeError that quotes the whole URL back -- path, query and
|
|
202
|
+
// all -- which is the one thing these errors must never do.
|
|
203
|
+
target.username = "";
|
|
204
|
+
target.password = "";
|
|
205
|
+
|
|
206
|
+
discard(response);
|
|
207
|
+
currentInit = initForNextHop(currentInit, status);
|
|
208
|
+
currentUrl = target.toString();
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
/**
|
|
213
|
+
* Two different sentences, because the two cases need opposite fixes: a bare
|
|
214
|
+
* scheme change is the user's own URL one edit away from correct, while a
|
|
215
|
+
* different host usually means the URL points at a proxy or a sign-in page.
|
|
216
|
+
*/
|
|
217
|
+
function crossOriginMessage(serverLabel, urlSettingLabel, status, fromOrigin, toOrigin) {
|
|
218
|
+
const prefix =
|
|
219
|
+
`${serverLabel} redirected the request (HTTP ${status}) to ${toOrigin}, which is a different ` +
|
|
220
|
+
`origin than the configured ${fromOrigin}. The request was refused and no credentials were ` +
|
|
221
|
+
`sent to it.`;
|
|
222
|
+
const sameHost = hostAndPort(fromOrigin) === hostAndPort(toOrigin);
|
|
223
|
+
return sameHost
|
|
224
|
+
? `${prefix} Set ${urlSettingLabel} to ${toOrigin}.`
|
|
225
|
+
: `${prefix} Check that ${urlSettingLabel} points at the server itself rather than a proxy or a sign-in page.`;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
function hostAndPort(origin) {
|
|
229
|
+
try {
|
|
230
|
+
const parsed = new URL(origin);
|
|
231
|
+
return `${parsed.hostname}:${parsed.port}`;
|
|
232
|
+
} catch {
|
|
233
|
+
return origin;
|
|
234
|
+
}
|
|
235
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
// Generated by scripts/sync-skills.mjs. Do not hand-edit; run `npm run sync:skills`.
|
|
2
|
+
export const SKILLS_PIN: {
|
|
3
|
+
repo: string;
|
|
4
|
+
/** Commit the bundled content was vendored from. Tags move; this does not. */
|
|
5
|
+
commit: string;
|
|
6
|
+
commitDate: string | null;
|
|
7
|
+
tag: string | null;
|
|
8
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// Generated by scripts/sync-skills.mjs. Do not hand-edit; run `npm run sync:skills`.
|
|
2
|
+
// The commit the bundled skill content was vendored from, for a shell to show
|
|
3
|
+
// beside a bundled repo. `tag` is a label only; the commit is the pin.
|
|
4
|
+
export const SKILLS_PIN = {
|
|
5
|
+
repo: "galaxyproject/agentic-plugins",
|
|
6
|
+
commit: "aa4da4bd68eb00e360dfd5aa6e998feb5de0ac49",
|
|
7
|
+
commitDate: "2026-09-17",
|
|
8
|
+
tag: null,
|
|
9
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export const SKILLS_SURFACE_ID: "loom";
|
|
2
|
+
export function selectSkills<T extends { surfaces: string[] }>(entries: T[], surface?: string): T[];
|
|
3
|
+
export interface SkillsRouterRepo {
|
|
4
|
+
name: string;
|
|
5
|
+
label?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface SkillsRouterEntry {
|
|
8
|
+
path: string;
|
|
9
|
+
name: string;
|
|
10
|
+
description: string;
|
|
11
|
+
whenToUse?: string;
|
|
12
|
+
}
|
|
13
|
+
export function renderSkillsRouter(
|
|
14
|
+
repos: readonly SkillsRouterRepo[],
|
|
15
|
+
entriesByRepo: ReadonlyMap<string, readonly SkillsRouterEntry[]>,
|
|
16
|
+
options: { freshness?: string; defaultRepoPhrase: string; defaultRepo?: string | null },
|
|
17
|
+
): string;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
// The skills router both shells put in the system prompt: which repos exist, what each offers this
|
|
2
|
+
// surface, and the exact skills_fetch call for it. The em dashes are model-visible bytes the
|
|
3
|
+
// browser's prompt snapshots pin, so they stay.
|
|
4
|
+
|
|
5
|
+
/** The surface tag Orbit and the browser claim. A skill opts in with `surfaces: [loom]`. */
|
|
6
|
+
export const SKILLS_SURFACE_ID = "loom";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Tag-or-all: if any entry is tagged for this surface, keep only those; else keep all.
|
|
10
|
+
* @template {{ surfaces: string[] }} T
|
|
11
|
+
* @param {T[]} entries
|
|
12
|
+
* @param {string} [surface]
|
|
13
|
+
* @returns {T[]}
|
|
14
|
+
*/
|
|
15
|
+
export function selectSkills(entries, surface = SKILLS_SURFACE_ID) {
|
|
16
|
+
const tagged = entries.filter((e) => e.surfaces.includes(surface));
|
|
17
|
+
return tagged.length ? tagged : entries;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* @param {{ name: string, label?: string }[]} repos
|
|
22
|
+
* @param {Map<string, { path: string, name: string, description: string, whenToUse?: string }[]>} entriesByRepo
|
|
23
|
+
* @param {{ freshness?: string, defaultRepoPhrase: string, defaultRepo?: string | null }} options
|
|
24
|
+
* `defaultRepo` is the repo a `repo`-less fetch reaches, when that is not simply the first one
|
|
25
|
+
* listed; null means none does, so every fetch line names its repo.
|
|
26
|
+
* @returns {string}
|
|
27
|
+
*/
|
|
28
|
+
export function renderSkillsRouter(
|
|
29
|
+
repos,
|
|
30
|
+
entriesByRepo,
|
|
31
|
+
{ freshness, defaultRepoPhrase, defaultRepo: defaultRepoOption },
|
|
32
|
+
) {
|
|
33
|
+
if (repos.length === 0) return "";
|
|
34
|
+
const lines = [
|
|
35
|
+
"## Skills repositories (operational know-how)",
|
|
36
|
+
"",
|
|
37
|
+
"Use the `skills_fetch({ repo, path })` tool to load a skill on demand. " +
|
|
38
|
+
"**Don't guess operational patterns from training data — fetch the relevant " +
|
|
39
|
+
`skill first.** ${freshness ? `${freshness} ` : ""}When \`repo\` is omitted, ` +
|
|
40
|
+
`${defaultRepoPhrase} is used.`,
|
|
41
|
+
"",
|
|
42
|
+
"### Configured repos",
|
|
43
|
+
"",
|
|
44
|
+
...repos.map((r) => `- **${r.name}**${r.label ? ` — ${r.label}` : ""}`),
|
|
45
|
+
"",
|
|
46
|
+
];
|
|
47
|
+
const defaultRepo = defaultRepoOption === undefined ? repos[0].name : defaultRepoOption;
|
|
48
|
+
for (const r of repos) {
|
|
49
|
+
const entries = entriesByRepo.get(r.name) ?? [];
|
|
50
|
+
if (entries.length === 0) continue;
|
|
51
|
+
lines.push(`### ${r.name} skills`, "");
|
|
52
|
+
for (const e of entries) {
|
|
53
|
+
const repoArg = r.name === defaultRepo ? "" : `repo: "${r.name}", `;
|
|
54
|
+
lines.push(
|
|
55
|
+
`- **${e.name}** — ${e.description} → \`skills_fetch({ ${repoArg}path: "${e.path}" })\``,
|
|
56
|
+
);
|
|
57
|
+
if (e.whenToUse) lines.push(` When to use: ${e.whenToUse}`);
|
|
58
|
+
}
|
|
59
|
+
lines.push("");
|
|
60
|
+
}
|
|
61
|
+
lines.push("Read the SKILL.md fully before acting on what it teaches.", "");
|
|
62
|
+
return lines.join("\n");
|
|
63
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export type NormalizeName = (
|
|
2
|
+
name: string,
|
|
3
|
+
args: Record<string, unknown>,
|
|
4
|
+
) => { name: string; args: Record<string, unknown> } | null;
|
|
5
|
+
export interface SraCall {
|
|
6
|
+
key: string;
|
|
7
|
+
historyId: string;
|
|
8
|
+
toolId: string;
|
|
9
|
+
runs: string[] | undefined;
|
|
10
|
+
mapped: boolean;
|
|
11
|
+
fileList: boolean;
|
|
12
|
+
}
|
|
13
|
+
export interface SraBlock {
|
|
14
|
+
reason: string;
|
|
15
|
+
call: SraCall;
|
|
16
|
+
runs: string[];
|
|
17
|
+
cause: "mapped-import" | "duplicate-accession" | "split-batch";
|
|
18
|
+
}
|
|
19
|
+
export function parseObject(value: unknown): Record<string, unknown> | null;
|
|
20
|
+
export function stable(value: unknown): string;
|
|
21
|
+
export function flatten(inputs: Record<string, unknown>): Record<string, unknown>;
|
|
22
|
+
export function accessions(value: unknown): string[] | undefined;
|
|
23
|
+
export function sraCall(
|
|
24
|
+
name: unknown,
|
|
25
|
+
input: unknown,
|
|
26
|
+
options?: { normalizeName?: NormalizeName },
|
|
27
|
+
): SraCall | null;
|
|
28
|
+
export class SraImportGate {
|
|
29
|
+
constructor(options: { remediation: (runs: string[]) => string; normalizeName?: NormalizeName });
|
|
30
|
+
clear(): void;
|
|
31
|
+
observe(calls: Iterable<{ id: string; name: string; arguments: unknown }>): void;
|
|
32
|
+
block(id: string, name: string, args: unknown): SraBlock | undefined;
|
|
33
|
+
check(id: string, name: string, args: unknown): string | undefined;
|
|
34
|
+
}
|