@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,284 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Precondition check for /execute and /run.
|
|
3
|
+
*
|
|
4
|
+
* Galaxy workflows can run for hours and cost real compute, so the cost of
|
|
5
|
+
* a bad launch is high. This gate runs before the slash command tells the
|
|
6
|
+
* agent to work, catching the cheap failures (no plan; stale Galaxy creds;
|
|
7
|
+
* step without acceptance criteria) up front so we don't burn an
|
|
8
|
+
* invocation on a half-formed input.
|
|
9
|
+
*
|
|
10
|
+
* Two-layer policy:
|
|
11
|
+
* - **Hard fail** -- env-broken cases (no notebook; plan needs Galaxy but
|
|
12
|
+
* no active connection). The slash command does not send the agent
|
|
13
|
+
* prompt. The user gets a remediation message in chat.
|
|
14
|
+
* - **Soft fail** -- everything else. The slash command still sends the
|
|
15
|
+
* prompt, but the prompt carries the failure list so the agent can
|
|
16
|
+
* resolve with the user before invoking anything.
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
import { getNotebookPath, getCurrentHistoryId } from "./state.js";
|
|
20
|
+
import { recordStore } from "./record-store.js";
|
|
21
|
+
import { isLocalShellDisabled } from "./local-exec.js";
|
|
22
|
+
import { getGalaxyConfig } from "./galaxy-api.js";
|
|
23
|
+
|
|
24
|
+
export type Routing = "local" | "hybrid" | "remote" | "unknown";
|
|
25
|
+
|
|
26
|
+
/** Whether Galaxy can take this plan's work: the tools reach it whenever credentials are configured. */
|
|
27
|
+
function galaxyReady(): boolean {
|
|
28
|
+
return getGalaxyConfig() !== null;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/** `[galaxy]` is the old spelling of `[remote]`; existing notebooks still use it. */
|
|
32
|
+
export function normalizeRouting(tag: string | undefined): Routing {
|
|
33
|
+
const t = tag?.toLowerCase();
|
|
34
|
+
if (!t) return "unknown";
|
|
35
|
+
return t === "galaxy" ? "remote" : (t as Routing);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// Same spelling the evidence gate matches steps on, so an anchor captured
|
|
39
|
+
// here and an anchor written into a block are the same string.
|
|
40
|
+
const STEP_ANCHOR = /\{#([^}]+)\}/;
|
|
41
|
+
|
|
42
|
+
export interface ParsedPlanRef {
|
|
43
|
+
title: string;
|
|
44
|
+
routing: Routing;
|
|
45
|
+
nextStep: {
|
|
46
|
+
line: number;
|
|
47
|
+
raw: string;
|
|
48
|
+
descriptionLength: number;
|
|
49
|
+
/**
|
|
50
|
+
* The step's `{#plan-a-step-3}` anchor without the braces or the hash,
|
|
51
|
+
* matching how `notebook_anchor` is spelled in the invocation and job
|
|
52
|
+
* blocks. Absent when the step carries no anchor.
|
|
53
|
+
*/
|
|
54
|
+
anchor?: string;
|
|
55
|
+
} | null;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export interface GateFailure {
|
|
59
|
+
name: "notebook" | "plan" | "galaxy_connection" | "history" | "acceptance" | "local_exec";
|
|
60
|
+
severity: "hard" | "soft";
|
|
61
|
+
remediation: string;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export interface GateResult {
|
|
65
|
+
ok: boolean;
|
|
66
|
+
hardFailed: boolean;
|
|
67
|
+
failures: GateFailure[];
|
|
68
|
+
plan: ParsedPlanRef | null;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export interface ProjectContext {
|
|
72
|
+
historyId?: string;
|
|
73
|
+
galaxyUrl?: string;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Find the most recent `## Plan X: <title> [routing]` section. Returns
|
|
78
|
+
* the heading info plus the first pending (`- [ ]`) step in that section.
|
|
79
|
+
* Returns null if no plan heading is present.
|
|
80
|
+
*/
|
|
81
|
+
export function parseMostRecentPlan(content: string): ParsedPlanRef | null {
|
|
82
|
+
const lines = content.split("\n");
|
|
83
|
+
let latestPlanLine = -1;
|
|
84
|
+
let latestPlanTitle = "";
|
|
85
|
+
let latestPlanRouting: Routing = "unknown";
|
|
86
|
+
|
|
87
|
+
for (let i = 0; i < lines.length; i++) {
|
|
88
|
+
const m = lines[i].match(
|
|
89
|
+
/^##\s+Plan\s+([^:]+):\s*(.+?)(?:\s*\[(local|galaxy|hybrid|remote)\])?\s*$/i,
|
|
90
|
+
);
|
|
91
|
+
if (m) {
|
|
92
|
+
latestPlanLine = i;
|
|
93
|
+
latestPlanTitle = `${m[1].trim()}: ${m[2].trim()}`;
|
|
94
|
+
latestPlanRouting = normalizeRouting(m[3]);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
if (latestPlanLine === -1) return null;
|
|
99
|
+
|
|
100
|
+
// Find first `- [ ]` line within the plan section (until the next `## ` h2).
|
|
101
|
+
let nextStep: ParsedPlanRef["nextStep"] = null;
|
|
102
|
+
for (let i = latestPlanLine + 1; i < lines.length; i++) {
|
|
103
|
+
if (/^##\s+/.test(lines[i])) break; // next section
|
|
104
|
+
const stepMatch = lines[i].match(/^\s*-\s+\[\s\]\s+(.*)$/);
|
|
105
|
+
if (stepMatch) {
|
|
106
|
+
const anchor = stepMatch[1].match(STEP_ANCHOR)?.[1]?.trim();
|
|
107
|
+
nextStep = {
|
|
108
|
+
line: i,
|
|
109
|
+
raw: stepMatch[1],
|
|
110
|
+
descriptionLength: measureStepDescription(stepMatch[1]),
|
|
111
|
+
...(anchor ? { anchor } : {}),
|
|
112
|
+
};
|
|
113
|
+
break;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
return { title: latestPlanTitle, routing: latestPlanRouting, nextStep };
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* Heuristic: does the step have anything beyond a bare `**Title**`? Strips
|
|
122
|
+
* the leading number, the bold-wrapped title, the optional `{#anchor}`,
|
|
123
|
+
* and any em-dash separator, then counts what remains. Used by the
|
|
124
|
+
* acceptance-criteria check.
|
|
125
|
+
*/
|
|
126
|
+
function measureStepDescription(raw: string): number {
|
|
127
|
+
const stripped = raw
|
|
128
|
+
.replace(/^\d+\.\s*/, "")
|
|
129
|
+
.replace(/\*\*[^*]+\*\*/, "")
|
|
130
|
+
.replace(/\{#[^}]+\}/, "")
|
|
131
|
+
.replace(/^[\s—\-:|]+/, "")
|
|
132
|
+
.trim();
|
|
133
|
+
return stripped.length;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* Parse the optional `## Project context` block. The block is plain
|
|
138
|
+
* key-value lines beneath the heading, terminated by the next `## ` h2 or
|
|
139
|
+
* EOF. Today this only carries `history_id` and `galaxy_url`; future
|
|
140
|
+
* fields can join the same shape.
|
|
141
|
+
*/
|
|
142
|
+
export function parseProjectContext(content: string): ProjectContext | null {
|
|
143
|
+
const lines = content.split("\n");
|
|
144
|
+
const startIdx = lines.findIndex((l) => /^##\s+Project\s+context\s*$/i.test(l));
|
|
145
|
+
if (startIdx === -1) return null;
|
|
146
|
+
|
|
147
|
+
const ctx: ProjectContext = {};
|
|
148
|
+
for (let i = startIdx + 1; i < lines.length; i++) {
|
|
149
|
+
if (/^##\s+/.test(lines[i])) break;
|
|
150
|
+
const m = lines[i].match(/^([a-z_]+):\s*(.+)$/i);
|
|
151
|
+
if (!m) continue;
|
|
152
|
+
const key = m[1].toLowerCase();
|
|
153
|
+
const value = m[2].trim();
|
|
154
|
+
if (key === "history_id") ctx.historyId = value;
|
|
155
|
+
else if (key === "galaxy_url") ctx.galaxyUrl = value;
|
|
156
|
+
}
|
|
157
|
+
return ctx;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* Run the precondition checks. Pure of side effects -- the caller (the
|
|
162
|
+
* /execute or /run handler) decides whether to notify, whether to still
|
|
163
|
+
* send the agent prompt, etc.
|
|
164
|
+
*/
|
|
165
|
+
export async function checkPreconditions(): Promise<GateResult> {
|
|
166
|
+
const failures: GateFailure[] = [];
|
|
167
|
+
|
|
168
|
+
const nbPath = getNotebookPath();
|
|
169
|
+
const store = nbPath ? recordStore(nbPath) : null;
|
|
170
|
+
if (!store || (await store.stat()) === null) {
|
|
171
|
+
return {
|
|
172
|
+
ok: false,
|
|
173
|
+
hardFailed: true,
|
|
174
|
+
failures: [
|
|
175
|
+
{
|
|
176
|
+
name: "notebook",
|
|
177
|
+
severity: "hard",
|
|
178
|
+
remediation: "No notebook open in this directory.",
|
|
179
|
+
},
|
|
180
|
+
],
|
|
181
|
+
plan: null,
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
let content: string;
|
|
186
|
+
try {
|
|
187
|
+
({ content } = await store.read());
|
|
188
|
+
} catch {
|
|
189
|
+
return {
|
|
190
|
+
ok: false,
|
|
191
|
+
hardFailed: true,
|
|
192
|
+
failures: [
|
|
193
|
+
{
|
|
194
|
+
name: "notebook",
|
|
195
|
+
severity: "hard",
|
|
196
|
+
remediation: `Could not read ${nbPath}.`,
|
|
197
|
+
},
|
|
198
|
+
],
|
|
199
|
+
plan: null,
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
const plan = parseMostRecentPlan(content);
|
|
204
|
+
|
|
205
|
+
if (!plan || !plan.nextStep) {
|
|
206
|
+
failures.push({
|
|
207
|
+
name: "plan",
|
|
208
|
+
severity: "soft",
|
|
209
|
+
remediation: plan
|
|
210
|
+
? `Plan "${plan.title}" has no pending (\`- [ ]\`) steps. Ask the user whether to draft a follow-up plan or pick a different one.`
|
|
211
|
+
: `No plan section in ${nbPath}. Don't auto-draft one -- ask the user what they want to work on first.`,
|
|
212
|
+
});
|
|
213
|
+
return { ok: false, hardFailed: false, failures, plan };
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
const needsGalaxy = plan.routing === "hybrid" || plan.routing === "remote";
|
|
217
|
+
|
|
218
|
+
let hardFailed = false;
|
|
219
|
+
|
|
220
|
+
// A plan whose routing requires a local execution leg can't run when the
|
|
221
|
+
// shell removed bash (Windows remote-only). unknown is included because an
|
|
222
|
+
// untagged plan falls back to local. remote has no local leg and passes
|
|
223
|
+
// untouched. This is the user-facing "re-tag your plan" affordance -- the
|
|
224
|
+
// actual containment is the removed bash tool, not this gate.
|
|
225
|
+
const needsLocalShell =
|
|
226
|
+
plan.routing === "local" || plan.routing === "hybrid" || plan.routing === "unknown";
|
|
227
|
+
if (needsLocalShell && isLocalShellDisabled()) {
|
|
228
|
+
hardFailed = true;
|
|
229
|
+
failures.push({
|
|
230
|
+
name: "local_exec",
|
|
231
|
+
severity: "hard",
|
|
232
|
+
remediation: `Plan "${plan.title}" needs local execution, unavailable on Windows (remote-only) -- re-tag the plan \`[remote]\`, or enable local power mode (future).`,
|
|
233
|
+
});
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
if (needsGalaxy && !galaxyReady()) {
|
|
237
|
+
hardFailed = true;
|
|
238
|
+
failures.push({
|
|
239
|
+
name: "galaxy_connection",
|
|
240
|
+
severity: "hard",
|
|
241
|
+
remediation: `Plan "${plan.title}" routes to Galaxy but there's no active connection. Run /connect to (re)authenticate.`,
|
|
242
|
+
});
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
if (needsGalaxy && !getCurrentHistoryId()) {
|
|
246
|
+
const ctx = parseProjectContext(content);
|
|
247
|
+
if (!ctx?.historyId) {
|
|
248
|
+
failures.push({
|
|
249
|
+
name: "history",
|
|
250
|
+
severity: "soft",
|
|
251
|
+
remediation:
|
|
252
|
+
"No Galaxy history selected for this project. Ask the user which history to use, or create a fresh one before invoking workflows.",
|
|
253
|
+
});
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
// Acceptance-criteria heuristic: a step with no description beyond the
|
|
258
|
+
// bold title is a poor target. Loose threshold (>= 8 chars of remaining
|
|
259
|
+
// text after stripping number/title/anchor) so well-formed plans pass
|
|
260
|
+
// and only truly-empty ones trip.
|
|
261
|
+
if (plan.nextStep.descriptionLength < 8) {
|
|
262
|
+
failures.push({
|
|
263
|
+
name: "acceptance",
|
|
264
|
+
severity: "soft",
|
|
265
|
+
remediation: `Step on line ${plan.nextStep.line + 1} has no description beyond its title. Confirm the acceptance criteria with the user before running.`,
|
|
266
|
+
});
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
return {
|
|
270
|
+
ok: failures.length === 0,
|
|
271
|
+
hardFailed,
|
|
272
|
+
failures,
|
|
273
|
+
plan,
|
|
274
|
+
};
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
/**
|
|
278
|
+
* Render the failure list as a short markdown bullet list, suitable for
|
|
279
|
+
* embedding in either the chat notification or the agent prompt.
|
|
280
|
+
*/
|
|
281
|
+
export function renderFailures(failures: GateFailure[]): string {
|
|
282
|
+
if (failures.length === 0) return "";
|
|
283
|
+
return failures.map((f) => `- **${f.name}**: ${f.remediation}`).join("\n");
|
|
284
|
+
}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* /instructions -- show which ORBIT.md / LOOM.md files this session actually loaded.
|
|
3
|
+
*
|
|
4
|
+
* Without this, "why isn't it listening to me" is undebuggable: the ancestor
|
|
5
|
+
* walk means an instructions file three directories up can be steering the session with
|
|
6
|
+
* nothing on screen to say so.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import * as fs from "fs";
|
|
10
|
+
import * as path from "path";
|
|
11
|
+
import type { ExtensionAPI, ExtensionContext } from "@earendil-works/pi-coding-agent";
|
|
12
|
+
import { piAgentDir } from "./agent-dir.js";
|
|
13
|
+
import {
|
|
14
|
+
discoverInstructionFiles,
|
|
15
|
+
INIT_INSTRUCTIONS_FILENAME,
|
|
16
|
+
INSTRUCTIONS_FILENAMES,
|
|
17
|
+
type InstructionFile,
|
|
18
|
+
} from "./user-instructions.js";
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Shown in the terminal after `init`, deliberately NOT written into the file.
|
|
22
|
+
*
|
|
23
|
+
* An earlier design seeded the file with `#`-prefixed example lines and called
|
|
24
|
+
* them comments. Markdown has no comment syntax -- those are headings, and the
|
|
25
|
+
* loader injects whatever is in the file -- so an untouched template would have
|
|
26
|
+
* silently activated "prefer IWC workflows" and the rest as real preferences.
|
|
27
|
+
* The file starts empty; the guidance lives here.
|
|
28
|
+
*/
|
|
29
|
+
export const AUTHORING_GUIDANCE = [
|
|
30
|
+
"Write one preference per line, in plain sentences. For example:",
|
|
31
|
+
"",
|
|
32
|
+
" Always end an analysis with a visualization.",
|
|
33
|
+
" Prefer IWC workflows over hand-assembled tool chains.",
|
|
34
|
+
" Use HISAT2 for RNA-seq alignment, not bowtie.",
|
|
35
|
+
"",
|
|
36
|
+
"Edits load on your next message -- no restart needed.",
|
|
37
|
+
].join("\n");
|
|
38
|
+
|
|
39
|
+
function label(scope: InstructionFile["scope"]): string {
|
|
40
|
+
return scope === "global" ? "Global " : "Project";
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export function formatInstructionsListing(files: InstructionFile[]): string {
|
|
44
|
+
if (files.length === 0) {
|
|
45
|
+
return [
|
|
46
|
+
"No standing instructions loaded.",
|
|
47
|
+
"",
|
|
48
|
+
`Create one with /instructions init -> ${path.join(piAgentDir(), INIT_INSTRUCTIONS_FILENAME)}`,
|
|
49
|
+
`or /instructions init project -> ${INIT_INSTRUCTIONS_FILENAME} in this directory`,
|
|
50
|
+
].join("\n");
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
const lines: string[] = ["Standing instructions loaded this session:", ""];
|
|
54
|
+
for (const file of files) {
|
|
55
|
+
if (file.error) {
|
|
56
|
+
lines.push(`${label(file.scope)} ${file.path}`);
|
|
57
|
+
lines.push(` !! could not be read: ${file.error}`);
|
|
58
|
+
lines.push("");
|
|
59
|
+
continue;
|
|
60
|
+
}
|
|
61
|
+
const count = file.content.split("\n").length;
|
|
62
|
+
const suffix = file.truncated ? ", truncated at the size cap" : "";
|
|
63
|
+
lines.push(
|
|
64
|
+
`${label(file.scope)} ${file.path} (${count} line${count === 1 ? "" : "s"}${suffix})`,
|
|
65
|
+
);
|
|
66
|
+
for (const line of file.content.split("\n")) lines.push(` ${line}`);
|
|
67
|
+
if (file.shadowed) lines.push(` (ignoring ${file.shadowed} -- remove one of the two)`);
|
|
68
|
+
lines.push("");
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
if (files.some((f) => f.scope === "workspace")) {
|
|
72
|
+
lines.push(
|
|
73
|
+
"Project files travel with the directory, so they steer preferences only --",
|
|
74
|
+
"they cannot grant permissions or skip confirmations.",
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
return lines.join("\n").trimEnd();
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/** Where `init` should point in `dir`: any instructions file already there,
|
|
82
|
+
* so init never plants a second file beside one the user already has. */
|
|
83
|
+
export function initTargetIn(dir: string): string {
|
|
84
|
+
for (const name of INSTRUCTIONS_FILENAMES) {
|
|
85
|
+
const candidate = path.join(dir, name);
|
|
86
|
+
if (fs.existsSync(candidate)) return candidate;
|
|
87
|
+
}
|
|
88
|
+
return path.join(dir, INIT_INSTRUCTIONS_FILENAME);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/** Create an EMPTY file if it isn't there. Returns what happened so the caller
|
|
92
|
+
* can tell the user rather than silently doing nothing. */
|
|
93
|
+
export function ensureInstructionsFile(filePath: string): { created: boolean; error?: string } {
|
|
94
|
+
try {
|
|
95
|
+
if (fs.existsSync(filePath)) return { created: false };
|
|
96
|
+
fs.mkdirSync(path.dirname(filePath), { recursive: true });
|
|
97
|
+
fs.writeFileSync(filePath, "");
|
|
98
|
+
return { created: true };
|
|
99
|
+
} catch (err) {
|
|
100
|
+
return { created: false, error: String(err) };
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export function registerInstructionsCommand(pi: ExtensionAPI): void {
|
|
105
|
+
pi.registerCommand("instructions", {
|
|
106
|
+
description: `Show the ${INIT_INSTRUCTIONS_FILENAME} standing instructions loaded this session (init to create one).`,
|
|
107
|
+
handler: async (args: string | undefined, ctx: ExtensionContext) => {
|
|
108
|
+
const argv = (args ?? "").trim().split(/\s+/).filter(Boolean);
|
|
109
|
+
|
|
110
|
+
if (argv.length === 0) {
|
|
111
|
+
ctx.ui.notify(formatInstructionsListing(discoverInstructionFiles()), "info");
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
if (argv[0] !== "init") {
|
|
116
|
+
ctx.ui.notify(
|
|
117
|
+
"Usage: /instructions show what's loaded\n" +
|
|
118
|
+
` /instructions init create your global ${INIT_INSTRUCTIONS_FILENAME}\n` +
|
|
119
|
+
` /instructions init project create ${INIT_INSTRUCTIONS_FILENAME} in this directory`,
|
|
120
|
+
"warning",
|
|
121
|
+
);
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
const target = initTargetIn(argv[1] === "project" ? process.cwd() : piAgentDir());
|
|
126
|
+
|
|
127
|
+
const result = ensureInstructionsFile(target);
|
|
128
|
+
if (result.error) {
|
|
129
|
+
ctx.ui.notify(`Could not create ${target}: ${result.error}`, "error");
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
const opener = result.created ? `Created ${target} (empty).` : `${target} already exists.`;
|
|
133
|
+
ctx.ui.notify(`${opener}\n\n${AUTHORING_GUIDANCE}`, "info");
|
|
134
|
+
},
|
|
135
|
+
});
|
|
136
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Failed-invocation triage hint.
|
|
3
|
+
*
|
|
4
|
+
* The background poller queues automatic investigation when an invocation
|
|
5
|
+
* fails. A manual check can observe the transition first, so it also needs
|
|
6
|
+
* an agent-facing nudge in the tool result from
|
|
7
|
+
* `galaxy_invocation_check_all` / `_check_one`, which carries `autoAction:
|
|
8
|
+
* "failed"` for anything that just transitioned. The hook is a row in
|
|
9
|
+
* `skill-triggers.ts`; this module holds the hint and the detector.
|
|
10
|
+
*
|
|
11
|
+
* Shape follows the lesson from #210/#249: a deterministic nudge cannot depend
|
|
12
|
+
* on a pull for the part that makes it actionable. So the *imperative* is
|
|
13
|
+
* inline and complete -- report it now, read invocation messages and job detail
|
|
14
|
+
* separately, don't infer the cause from job counts. Only the interpretation
|
|
15
|
+
* *depth* is a pull: the reason-code table and the API-surface map are
|
|
16
|
+
* reference material that can't be inlined into a hint, and they are bundled
|
|
17
|
+
* with Orbit rather than fetched, so the pointer resolves offline.
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
import { VENDOR_REPO_NAME } from "./vendor-skills";
|
|
21
|
+
|
|
22
|
+
// Bundled paths mirror the cast's own layout upstream, so the string handed to
|
|
23
|
+
// the model here is the same string a live fetch of that cast would use.
|
|
24
|
+
const CAST_NOTES = "debug-galaxy-workflow-output/references/notes";
|
|
25
|
+
export const INVOCATION_FAILURE_REFERENCE = `${CAST_NOTES}/galaxy-workflow-invocation-failure-reference.md`;
|
|
26
|
+
export const JOB_FAILURE_REFERENCE = `${CAST_NOTES}/galaxy-tool-job-failure-reference.md`;
|
|
27
|
+
|
|
28
|
+
// Distinctive opening, so the hint can't be mistaken for Galaxy's own output.
|
|
29
|
+
const HINT_MARKER = "[loom] A Galaxy workflow invocation just failed";
|
|
30
|
+
|
|
31
|
+
export const INVOCATION_FAILED_HINT =
|
|
32
|
+
`${HINT_MARKER} — report it to the user now rather than waiting to be asked, ` +
|
|
33
|
+
"and establish the cause before proposing a fix. Invocation state and job state " +
|
|
34
|
+
"are different questions: the invocation says whether Galaxy could schedule and " +
|
|
35
|
+
"drive the workflow, the jobs say whether the tools succeeded. Job error counts " +
|
|
36
|
+
"alone do not identify the failure — read the invocation's structured messages " +
|
|
37
|
+
"and the failing job's detail. Do not mark the plan step complete, and do not " +
|
|
38
|
+
"guess a repair from the summary above.\n" +
|
|
39
|
+
`For what the invocation message reasons and states mean: ` +
|
|
40
|
+
`\`skills_fetch({ repo: "${VENDOR_REPO_NAME}", path: "${INVOCATION_FAILURE_REFERENCE}" })\`. ` +
|
|
41
|
+
`For job-level evidence (exit codes, job_messages, tool vs job streams): ` +
|
|
42
|
+
`\`skills_fetch({ repo: "${VENDOR_REPO_NAME}", path: "${JOB_FAILURE_REFERENCE}" })\`.`;
|
|
43
|
+
|
|
44
|
+
/** True when a check-invocations result reports at least one fresh `failed` transition. */
|
|
45
|
+
export function hasFailedTransition(text: string): boolean {
|
|
46
|
+
let parsed: unknown;
|
|
47
|
+
try {
|
|
48
|
+
parsed = JSON.parse(text);
|
|
49
|
+
} catch {
|
|
50
|
+
// Not the JSON summary (an error string, a truncated result) — stay quiet
|
|
51
|
+
// rather than regex-matching "failed" out of arbitrary prose.
|
|
52
|
+
return false;
|
|
53
|
+
}
|
|
54
|
+
const results = (parsed as { results?: unknown })?.results;
|
|
55
|
+
if (!Array.isArray(results)) return false;
|
|
56
|
+
return results.some((r) => (r as { autoAction?: unknown })?.autoAction === "failed");
|
|
57
|
+
}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Enforce the IWC-first rule for plan drafts.
|
|
3
|
+
*
|
|
4
|
+
* The prompt tells the model to check the IWC registry before drafting a plan,
|
|
5
|
+
* and on a weaker model that holds about half the time: the rest draft from
|
|
6
|
+
* memory, often as a hand-assembled [local] pipeline, when a maintained
|
|
7
|
+
* workflow would have covered it. So when a turn ends with a plan draft and
|
|
8
|
+
* nothing in the session has consulted IWC, send one follow-up asking the
|
|
9
|
+
* model to check and revise. Once per session: if the model checks and still
|
|
10
|
+
* prefers its draft, that's its call.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import path from "node:path";
|
|
14
|
+
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
15
|
+
import { appendActivityEvent } from "./activity";
|
|
16
|
+
import { deliverAutoFollowUp } from "./auto-resume";
|
|
17
|
+
import { activeGalaxyStatus } from "./profiles";
|
|
18
|
+
import { getNotebookPath } from "./state";
|
|
19
|
+
import type { GalaxyToolFamily } from "../../shared/galaxy-tool-family.js";
|
|
20
|
+
|
|
21
|
+
export const iwcTools = (family: GalaxyToolFamily): ReadonlySet<string> =>
|
|
22
|
+
new Set(
|
|
23
|
+
[
|
|
24
|
+
"recommend_iwc_workflows",
|
|
25
|
+
"search_iwc_workflows",
|
|
26
|
+
"get_iwc_workflow_details",
|
|
27
|
+
"get_iwc_workflows",
|
|
28
|
+
].map((tool) => family.tool(tool)),
|
|
29
|
+
);
|
|
30
|
+
|
|
31
|
+
export const iwcPlanNudge = (family: GalaxyToolFamily): string =>
|
|
32
|
+
"[Orbit check] That plan was drafted without checking the IWC workflow registry. Call " +
|
|
33
|
+
`\`${family.tool("recommend_iwc_workflows")}\` with the analysis goal now. If a workflow (or a short ` +
|
|
34
|
+
"chain of them) covers it and fits the user's data, revise the draft to run it on Galaxy; " +
|
|
35
|
+
"if nothing fits, or the user asked for something else, keep the draft and say you " +
|
|
36
|
+
"checked. It is still a draft: don't write it to the notebook or run anything.";
|
|
37
|
+
|
|
38
|
+
// A ```plan fence or a bare plan heading, the two shapes the plan gate accepts.
|
|
39
|
+
const PLAN_DRAFT_RE = /^\s*(?:```plan\b|##\s+Plan\s+[A-Za-z0-9]+\s*[:-])/m;
|
|
40
|
+
|
|
41
|
+
type Message = { role: string; content?: unknown };
|
|
42
|
+
|
|
43
|
+
/** Did any assistant message in this run draft a plan? */
|
|
44
|
+
export function draftsPlan(messages: readonly Message[]): boolean {
|
|
45
|
+
return messages.some(
|
|
46
|
+
(m) =>
|
|
47
|
+
m.role === "assistant" &&
|
|
48
|
+
Array.isArray(m.content) &&
|
|
49
|
+
m.content.some(
|
|
50
|
+
(c: { type?: string; text?: unknown }) =>
|
|
51
|
+
c?.type === "text" && typeof c.text === "string" && PLAN_DRAFT_RE.test(c.text),
|
|
52
|
+
),
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export function isIwcLookup(toolName: string, family: GalaxyToolFamily): boolean {
|
|
57
|
+
return iwcTools(family).has(toolName);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export function registerIwcPlanCheck(pi: ExtensionAPI, family: GalaxyToolFamily): void {
|
|
61
|
+
let consulted = false;
|
|
62
|
+
let nudged = false;
|
|
63
|
+
|
|
64
|
+
pi.on("session_start", async () => {
|
|
65
|
+
consulted = false;
|
|
66
|
+
nudged = false;
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
pi.on("tool_execution_start", async (event) => {
|
|
70
|
+
if (isIwcLookup(event.toolName, family)) consulted = true;
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
pi.on("agent_end", async (event) => {
|
|
74
|
+
if (consulted || nudged) return;
|
|
75
|
+
const last = [...event.messages].reverse().find((m) => m.role === "assistant");
|
|
76
|
+
if (last && "stopReason" in last && last.stopReason === "aborted") return;
|
|
77
|
+
if (activeGalaxyStatus() !== "usable") return;
|
|
78
|
+
// A restricted tool set (e.g. --tools read,write,edit) can't act on it.
|
|
79
|
+
if (!pi.getActiveTools().includes(family.tool("recommend_iwc_workflows"))) return;
|
|
80
|
+
if (!draftsPlan(event.messages as Message[])) return;
|
|
81
|
+
|
|
82
|
+
nudged = true;
|
|
83
|
+
if (!deliverAutoFollowUp(iwcPlanNudge(family), { dropOnStop: true })) return;
|
|
84
|
+
const notebook = getNotebookPath();
|
|
85
|
+
if (notebook) {
|
|
86
|
+
appendActivityEvent(path.dirname(notebook), {
|
|
87
|
+
timestamp: new Date().toISOString(),
|
|
88
|
+
kind: "plan.iwc_check",
|
|
89
|
+
source: "loom",
|
|
90
|
+
payload: {},
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
}
|