@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,226 @@
|
|
|
1
|
+
/** Per-provider credentials + preferred model. */
|
|
2
|
+
export interface LlmProviderConfig {
|
|
3
|
+
/** Plaintext API key. Orbit migrates this to apiKeyEncrypted on startup. */
|
|
4
|
+
apiKey?: string;
|
|
5
|
+
/** Base64 ciphertext produced by Electron safeStorage. Orbit-only. */
|
|
6
|
+
apiKeyEncrypted?: string;
|
|
7
|
+
model?: string;
|
|
8
|
+
/**
|
|
9
|
+
* Base URL for a user-supplied endpoint (e.g. Jetstream, vLLM, Ollama, an
|
|
10
|
+
* Anthropic-compatible gateway). Presence marks this entry as a custom
|
|
11
|
+
* provider: the brain registers it in ~/.pi/agent/models.json and supplies
|
|
12
|
+
* the key at runtime via --api-key.
|
|
13
|
+
*
|
|
14
|
+
* What the URL should include depends on `api` -- see there.
|
|
15
|
+
*/
|
|
16
|
+
baseUrl?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Wire format the endpoint speaks. `openai-completions` (the default, and
|
|
19
|
+
* the only shape Loom used to support) or `anthropic-messages`, for a gateway
|
|
20
|
+
* that fronts the Anthropic Messages API -- Argo, LiteLLM in anthropic mode,
|
|
21
|
+
* a Bedrock proxy. Ignored unless `baseUrl` is set.
|
|
22
|
+
*
|
|
23
|
+
* The two want different base URLs, because their SDKs append different
|
|
24
|
+
* paths: `openai-completions` wants the version segment included
|
|
25
|
+
* (`https://host/v1`), `anthropic-messages` wants it left off
|
|
26
|
+
* (`https://host`, and the client appends `/v1/messages`).
|
|
27
|
+
*/
|
|
28
|
+
api?: string;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export interface OrbitConfig {
|
|
32
|
+
/**
|
|
33
|
+
* Opaque beta-tester code (e.g. "orbit-007"). When set, it rides along on
|
|
34
|
+
* feedback submissions so the team can attribute reports to a tester. Not a
|
|
35
|
+
* secret and not PII -- the code<->identity map lives outside the app. Also
|
|
36
|
+
* settable per-session via the LOOM_TESTER_ID env var.
|
|
37
|
+
*/
|
|
38
|
+
testerId?: string;
|
|
39
|
+
/**
|
|
40
|
+
* Automatic observation collection for the community knowledge loop.
|
|
41
|
+
* Opt-in by design: `ask` (the default) shows the exact payload and sends
|
|
42
|
+
* nothing without a confirm, `auto` sends silently and logs what it sent,
|
|
43
|
+
* `off` collects nothing. `ORBIT_OBSERVATIONS=off` / `LOOM_OBSERVATIONS=off`
|
|
44
|
+
* hard-disables it for a managed deployment; no env value can turn it on.
|
|
45
|
+
*/
|
|
46
|
+
observations?: {
|
|
47
|
+
/** Off by default, and off whatever this says while `lessons.enabled` is not true. */
|
|
48
|
+
mode?: "off" | "ask" | "auto";
|
|
49
|
+
/**
|
|
50
|
+
* 32 lowercase hex, random, generated on first need. Pseudonymous, not a
|
|
51
|
+
* secret and not a user id -- it exists so the Worker can rate-limit and so
|
|
52
|
+
* a row can be retracted. The Worker only ever stores a monthly-rotating
|
|
53
|
+
* HMAC of it.
|
|
54
|
+
*/
|
|
55
|
+
installToken?: string;
|
|
56
|
+
/** ISO timestamp of the one-time "here is a real sample payload" consent. */
|
|
57
|
+
autoAcknowledgedAt?: string;
|
|
58
|
+
};
|
|
59
|
+
llm?: {
|
|
60
|
+
/** Name of the currently-active provider, e.g. "anthropic". */
|
|
61
|
+
active: string;
|
|
62
|
+
/** One entry per configured provider. */
|
|
63
|
+
providers: Record<string, LlmProviderConfig>;
|
|
64
|
+
};
|
|
65
|
+
galaxy?: {
|
|
66
|
+
active: string | null;
|
|
67
|
+
profiles: Record<
|
|
68
|
+
string,
|
|
69
|
+
{
|
|
70
|
+
url: string;
|
|
71
|
+
/** Plaintext API key. Orbit migrates to apiKeyEncrypted on startup. */
|
|
72
|
+
apiKey?: string;
|
|
73
|
+
/** Base64 ciphertext produced by Electron safeStorage. Orbit-only. */
|
|
74
|
+
apiKeyEncrypted?: string;
|
|
75
|
+
}
|
|
76
|
+
>;
|
|
77
|
+
};
|
|
78
|
+
defaultCwd?: string;
|
|
79
|
+
/** When false, all update checks (CLI notice + Orbit auto-update/banner) are disabled. Default true. */
|
|
80
|
+
updateCheck?: boolean;
|
|
81
|
+
/**
|
|
82
|
+
* Execution mode gate. Independent of whether Galaxy credentials are
|
|
83
|
+
* configured.
|
|
84
|
+
* - \`cloud\` (default): agent decides per-plan whether each step runs
|
|
85
|
+
* locally or on Galaxy. Plan routing tags (\`[remote]\`/\`[hybrid]\`/\`[local]\`)
|
|
86
|
+
* describe the resulting mix.
|
|
87
|
+
* - \`local\`: project is sandboxed to local execution. The agent must not
|
|
88
|
+
* propose Galaxy steps even though the Galaxy tools are registered.
|
|
89
|
+
*/
|
|
90
|
+
executionMode?: "local" | "cloud";
|
|
91
|
+
/**
|
|
92
|
+
* Skill repositories. Each entry points at a GitHub repo following the
|
|
93
|
+
* Claude-Code skills convention (top-level AGENTS.md router + nested
|
|
94
|
+
* SKILL.md files). The agent fetches them on demand via the
|
|
95
|
+
* \`skills_fetch\` tool. The list is seeded with \`galaxy-skills\` if
|
|
96
|
+
* absent. Set \`enabled: false\` to keep an entry without using it.
|
|
97
|
+
*/
|
|
98
|
+
skills?: {
|
|
99
|
+
repos: Array<SkillRepo>;
|
|
100
|
+
};
|
|
101
|
+
/**
|
|
102
|
+
* Subsystem flags (including legacy settings). Defaults are documented per
|
|
103
|
+
* field; matching env vars override per-session.
|
|
104
|
+
*/
|
|
105
|
+
experiments?: {
|
|
106
|
+
/** Register the experimental team_dispatch tool and its prompt guidance. */
|
|
107
|
+
teamDispatch?: boolean;
|
|
108
|
+
/**
|
|
109
|
+
* Hand a finished Galaxy run back to the agent automatically instead of
|
|
110
|
+
* only toasting the user. On by default; false (or LOOM_AUTO_RESUME=0)
|
|
111
|
+
* disables automatic verification and investigation turns.
|
|
112
|
+
*/
|
|
113
|
+
autoResume?: boolean;
|
|
114
|
+
/**
|
|
115
|
+
* Consecutive automatic follow-up turns allowed without user input before
|
|
116
|
+
* they pause (default 3). Stopping a turn also pauses them.
|
|
117
|
+
*/
|
|
118
|
+
autoResumeMaxTurns?: number;
|
|
119
|
+
/**
|
|
120
|
+
* Register the experimental session-index tools (chat_search,
|
|
121
|
+
* chat_session_context, chat_find_tool_calls) that query Pi's JSONL
|
|
122
|
+
* session corpus via a SQLite+FTS5 mirror at ~/.loom/sessions-index.db.
|
|
123
|
+
*/
|
|
124
|
+
sessionIndex?: boolean;
|
|
125
|
+
};
|
|
126
|
+
/**
|
|
127
|
+
* Terminal/display preferences for the loom CLI.
|
|
128
|
+
*/
|
|
129
|
+
ui?: {
|
|
130
|
+
/**
|
|
131
|
+
* Orbit visual theme. Missing or invalid values resolve to "dark" so
|
|
132
|
+
* existing installs keep the pre-theme appearance.
|
|
133
|
+
*/
|
|
134
|
+
theme?: "light" | "dark";
|
|
135
|
+
/**
|
|
136
|
+
* Show the model's "thinking" blocks in the interactive terminal. Off by
|
|
137
|
+
* default -- loom hides them (writes pi's `hideThinkingBlock`) to keep the
|
|
138
|
+
* chat readable. Set true to restore pi's reasoning stream persistently.
|
|
139
|
+
* For a one-off, pi's built-in Ctrl+T toggles thinking live in-session.
|
|
140
|
+
* Terminal-only: Orbit and headless (--print) launches don't touch it.
|
|
141
|
+
*/
|
|
142
|
+
showThinking?: boolean;
|
|
143
|
+
};
|
|
144
|
+
/**
|
|
145
|
+
* Evidence gate for plan-step completion. Watches writes to `notebook.md`
|
|
146
|
+
* for a plan step flipping `- [ ]` -> `- [x]` while the `loom-invocation`
|
|
147
|
+
* block bound to that step still reads `status: in_progress` -- a verified
|
|
148
|
+
* result claimed for a run Galaxy says has not finished.
|
|
149
|
+
*
|
|
150
|
+
* `deny` (default) blocks the write and tells the agent to leave the step
|
|
151
|
+
* pending, mark it `- [!]`, or re-poll; the user clears a step with
|
|
152
|
+
* `/override`. `warn` allows the write. Both record the decision to
|
|
153
|
+
* `activity.jsonl` (see docs/evidence-gate-audit.md). `off` disables it.
|
|
154
|
+
* Also settable per-session via `LOOM_EVIDENCE_GATE`.
|
|
155
|
+
*/
|
|
156
|
+
evidenceGate?: {
|
|
157
|
+
mode?: "off" | "warn" | "deny";
|
|
158
|
+
};
|
|
159
|
+
/**
|
|
160
|
+
* Local-execution safety gate (exec-guard). Secure by default: the gate is
|
|
161
|
+
* enabled, never bypassed, and trusts nothing until the user says otherwise.
|
|
162
|
+
*/
|
|
163
|
+
/**
|
|
164
|
+
* Recorded lessons -- short notes on situations that go wrong -- read from
|
|
165
|
+
* the corpus shipped with Orbit plus `~/.loom/lessons/<namespace>/<slug>.md`.
|
|
166
|
+
* Retrieval is entirely local, so no query ever leaves the machine.
|
|
167
|
+
*
|
|
168
|
+
* Off unless `enabled` is exactly `true` (the `/lessons on` command writes
|
|
169
|
+
* it after a confirm). Off means every lesson surface is silent -- no inline
|
|
170
|
+
* hints, no /execute note, no reproduction index, no `lessons_search`
|
|
171
|
+
* results, /lesson and lesson_propose refuse -- and the observation
|
|
172
|
+
* collector is off whatever `observations.mode` says. `LOOM_LESSONS=off`
|
|
173
|
+
* wins over the config; `LOOM_LESSONS=on` stands in for `enabled: true`
|
|
174
|
+
* where nobody can write the config (CI, the eval runner) and enables
|
|
175
|
+
* reading only. `suppress` is the per-lesson version -- a suppressed id is
|
|
176
|
+
* never matched, searched or listed.
|
|
177
|
+
*/
|
|
178
|
+
lessons?: {
|
|
179
|
+
enabled?: boolean;
|
|
180
|
+
suppress?: string[];
|
|
181
|
+
};
|
|
182
|
+
guardian?: {
|
|
183
|
+
/** Master switch. When false the gate is fully off (advanced escape hatch). */
|
|
184
|
+
enabled?: boolean;
|
|
185
|
+
/**
|
|
186
|
+
* Turn the gate into a pass-through (allow everything). Human-only: the
|
|
187
|
+
* agent can never set this, because writing ~/.orbit/config.json is itself
|
|
188
|
+
* gated. Also settable via --dangerously-bypass-permissions / env.
|
|
189
|
+
*/
|
|
190
|
+
dangerouslyBypassPermissions?: boolean;
|
|
191
|
+
/** Project dirs the user has chosen to trust (relaxes routine-bash prompts). */
|
|
192
|
+
trustedWorkspaces?: string[];
|
|
193
|
+
/** Extra absolute roots treated as inside the workspace jail. */
|
|
194
|
+
extraWorkspaceRoots?: string[];
|
|
195
|
+
/** Record of the one-time local-execution consent. */
|
|
196
|
+
consentAcknowledged?: { version: string; at: string } | null;
|
|
197
|
+
/**
|
|
198
|
+
* Opt-in bash sandbox: run allowed bash inside an OS sandbox (sandbox-exec /
|
|
199
|
+
* bubblewrap) so bash writes are confined to the workspace and its network is
|
|
200
|
+
* limited. Off by default (it restricts bash network); also settable via
|
|
201
|
+
* --sandbox / LOOM_SANDBOX. File-tool writes are confined by the gate regardless.
|
|
202
|
+
*/
|
|
203
|
+
sandbox?: boolean;
|
|
204
|
+
};
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
export interface SkillRepo {
|
|
208
|
+
/** Stable identifier used by the agent in \`skills_fetch({ repo: "..." })\`. */
|
|
209
|
+
name: string;
|
|
210
|
+
/** GitHub repo URL, e.g. \`https://github.com/galaxyproject/galaxy-skills\`. */
|
|
211
|
+
url: string;
|
|
212
|
+
/** Branch / ref to fetch from. Defaults to \`main\`. */
|
|
213
|
+
branch?: string;
|
|
214
|
+
/** When false the repo is kept in config but not advertised to the agent. */
|
|
215
|
+
enabled?: boolean;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
export function getConfigDir(): string;
|
|
219
|
+
export function getConfigPath(): string;
|
|
220
|
+
export function loadConfig(): OrbitConfig;
|
|
221
|
+
export function saveConfig(config: OrbitConfig): void;
|
|
222
|
+
/** The skills repos a fresh config is seeded with, and the definition of a bundled repo. */
|
|
223
|
+
export const DEFAULT_SKILLS: ReadonlyArray<Required<SkillRepo>>;
|
|
224
|
+
export function isBundledSkillRepo(repo: { name?: string; url?: string; branch?: string }): boolean;
|
|
225
|
+
export const ALLOWED_SKILLS_PREFIX: string;
|
|
226
|
+
export function isAllowedSkillUrl(url: string): boolean;
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
import fs from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { resolveConfigPath, resolveStateDir } from "./state-dir.js";
|
|
4
|
+
import { installedConfigSource } from "./config-source.js";
|
|
5
|
+
|
|
6
|
+
export const DEFAULT_SKILLS = [
|
|
7
|
+
{
|
|
8
|
+
name: "galaxy-skills",
|
|
9
|
+
url: "https://github.com/galaxyproject/galaxy-skills",
|
|
10
|
+
branch: "main",
|
|
11
|
+
enabled: true,
|
|
12
|
+
},
|
|
13
|
+
];
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Allowlist for skill-repo URLs. The agent treats fetched SKILL.md
|
|
17
|
+
* content as authoritative instructions, so an arbitrary third-party
|
|
18
|
+
* repo is a prompt-injection vector. For the alpha release we limit
|
|
19
|
+
* skill repos to github.com/galaxyproject/* — Galaxy-controlled,
|
|
20
|
+
* auditable. To relax, edit this constant or replace
|
|
21
|
+
* isAllowedSkillUrl() with a more permissive predicate.
|
|
22
|
+
*/
|
|
23
|
+
export const ALLOWED_SKILLS_PREFIX = "https://github.com/galaxyproject/";
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* A configured repo reads from the package when it is one of the defaults and is
|
|
27
|
+
* still pointed at that default's URL and branch. Anything else -- another
|
|
28
|
+
* branch, another URL, a repo we do not ship -- is fetched, which is what the
|
|
29
|
+
* skill-author workflow of pointing Orbit at a branch depends on. Lives here
|
|
30
|
+
* because the brain and the Preferences table have to agree on the answer.
|
|
31
|
+
*/
|
|
32
|
+
export function isBundledSkillRepo(repo) {
|
|
33
|
+
if (!repo || typeof repo.name !== "string") return false;
|
|
34
|
+
const preset = DEFAULT_SKILLS.find((d) => d.name === repo.name);
|
|
35
|
+
if (!preset) return false;
|
|
36
|
+
const norm = (u) =>
|
|
37
|
+
String(u ?? "")
|
|
38
|
+
.trim()
|
|
39
|
+
.replace(/\.git$/, "")
|
|
40
|
+
.replace(/\/+$/, "")
|
|
41
|
+
.toLowerCase();
|
|
42
|
+
if (!norm(repo.url) || norm(repo.url) !== norm(preset.url)) return false;
|
|
43
|
+
const branch = (repo.branch ?? "").trim() || "main";
|
|
44
|
+
return branch === (preset.branch || "main");
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
const VALID_UI_THEMES = new Set(["light", "dark"]);
|
|
48
|
+
|
|
49
|
+
export function isAllowedSkillUrl(url) {
|
|
50
|
+
if (typeof url !== "string") return false;
|
|
51
|
+
let parsed;
|
|
52
|
+
try {
|
|
53
|
+
parsed = new URL(url.trim());
|
|
54
|
+
} catch {
|
|
55
|
+
return false;
|
|
56
|
+
}
|
|
57
|
+
if (parsed.protocol !== "https:") return false;
|
|
58
|
+
if (parsed.hostname.toLowerCase() !== "github.com") return false;
|
|
59
|
+
const cleaned = parsed.pathname
|
|
60
|
+
.toLowerCase()
|
|
61
|
+
.replace(/\.git\/*$/, "")
|
|
62
|
+
.replace(/\/+$/, "");
|
|
63
|
+
if (!cleaned.startsWith("/galaxyproject/")) return false;
|
|
64
|
+
// Require at least owner + repo segments (no /galaxyproject alone).
|
|
65
|
+
return cleaned.split("/").filter(Boolean).length >= 2;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export function getConfigDir() {
|
|
69
|
+
return resolveStateDir();
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export function getConfigPath() {
|
|
73
|
+
return resolveConfigPath();
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export function loadConfig() {
|
|
77
|
+
const source = installedConfigSource();
|
|
78
|
+
let raw = {};
|
|
79
|
+
if (source) {
|
|
80
|
+
// Cloned: writeProfiles and the other writers mutate what loadConfig returns.
|
|
81
|
+
raw = structuredClone(source.load() ?? {});
|
|
82
|
+
} else {
|
|
83
|
+
const p = getConfigPath();
|
|
84
|
+
if (fs.existsSync(p)) {
|
|
85
|
+
try {
|
|
86
|
+
raw = JSON.parse(fs.readFileSync(p, "utf-8"));
|
|
87
|
+
} catch {
|
|
88
|
+
raw = {};
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
// Migrate flat llm shape (pre-multi-provider) → {active, providers} map.
|
|
93
|
+
// Old: { llm: { provider, apiKey?, apiKeyEncrypted?, model? } }
|
|
94
|
+
// New: { llm: { active, providers: { [provider]: { apiKey?, apiKeyEncrypted?, model? } } } }
|
|
95
|
+
//
|
|
96
|
+
// Additive on purpose: if a config has BOTH old top-level fields and a
|
|
97
|
+
// partial providers map (which can happen if any caller wrote a half-
|
|
98
|
+
// migrated shape), fold the orphan fields into the right provider entry
|
|
99
|
+
// instead of silently leaving them as unreachable plaintext on disk.
|
|
100
|
+
if (raw.llm) {
|
|
101
|
+
const llm = raw.llm;
|
|
102
|
+
const orphanProvider = llm.provider || llm.active || "anthropic";
|
|
103
|
+
const providers = { ...(llm.providers || {}) };
|
|
104
|
+
const existing = providers[orphanProvider] || {};
|
|
105
|
+
const merged = { ...existing };
|
|
106
|
+
// Encrypted wins if both legacy fields are present -- the plaintext
|
|
107
|
+
// form is the less-safe one, and a half-migrated config that ended up
|
|
108
|
+
// with both shouldn't drop the encrypted blob.
|
|
109
|
+
if (llm.apiKeyEncrypted && !merged.apiKey && !merged.apiKeyEncrypted) {
|
|
110
|
+
merged.apiKeyEncrypted = llm.apiKeyEncrypted;
|
|
111
|
+
}
|
|
112
|
+
if (llm.apiKey && !merged.apiKey && !merged.apiKeyEncrypted) {
|
|
113
|
+
merged.apiKey = llm.apiKey;
|
|
114
|
+
}
|
|
115
|
+
if (llm.model && !merged.model) merged.model = llm.model;
|
|
116
|
+
if (merged.apiKey || merged.apiKeyEncrypted || merged.model) {
|
|
117
|
+
providers[orphanProvider] = merged;
|
|
118
|
+
}
|
|
119
|
+
raw.llm = { active: llm.active || orphanProvider, providers };
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
// Lazy-seed default skills repo if the user hasn't configured any. This
|
|
123
|
+
// also re-seeds galaxy-skills if every repo was removed manually — feels
|
|
124
|
+
// less surprising than silently leaving it absent.
|
|
125
|
+
if (!raw.skills || !Array.isArray(raw.skills.repos) || raw.skills.repos.length === 0) {
|
|
126
|
+
raw.skills = { repos: [...DEFAULT_SKILLS] };
|
|
127
|
+
}
|
|
128
|
+
// Default execution mode: cloud (agent decides per-plan). Local sandboxes
|
|
129
|
+
// the project to local-only execution regardless of Galaxy credentials.
|
|
130
|
+
if (raw.executionMode !== "local" && raw.executionMode !== "cloud") {
|
|
131
|
+
raw.executionMode = "cloud";
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
// Guardian (local-execution safety) defaults. Secure by default: enabled,
|
|
135
|
+
// never bypassed, nothing trusted. Only relaxed by explicit user action.
|
|
136
|
+
const g = raw.guardian && typeof raw.guardian === "object" ? raw.guardian : {};
|
|
137
|
+
raw.guardian = {
|
|
138
|
+
enabled: g.enabled !== false,
|
|
139
|
+
dangerouslyBypassPermissions: g.dangerouslyBypassPermissions === true,
|
|
140
|
+
trustedWorkspaces: Array.isArray(g.trustedWorkspaces) ? g.trustedWorkspaces : [],
|
|
141
|
+
extraWorkspaceRoots: Array.isArray(g.extraWorkspaceRoots) ? g.extraWorkspaceRoots : [],
|
|
142
|
+
consentAcknowledged:
|
|
143
|
+
g.consentAcknowledged && typeof g.consentAcknowledged === "object"
|
|
144
|
+
? g.consentAcknowledged
|
|
145
|
+
: null,
|
|
146
|
+
sandbox: g.sandbox === true,
|
|
147
|
+
};
|
|
148
|
+
// Update checks are on by default; an explicit false (set in config or via
|
|
149
|
+
// the CLI's --no-update-check) silences the CLI notice + Orbit's checks.
|
|
150
|
+
if (typeof raw.updateCheck !== "boolean") {
|
|
151
|
+
raw.updateCheck = true;
|
|
152
|
+
}
|
|
153
|
+
const ui = raw.ui && typeof raw.ui === "object" && !Array.isArray(raw.ui) ? raw.ui : {};
|
|
154
|
+
raw.ui = {
|
|
155
|
+
...ui,
|
|
156
|
+
theme: VALID_UI_THEMES.has(ui.theme) ? ui.theme : "dark",
|
|
157
|
+
};
|
|
158
|
+
return raw;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
export function saveConfig(config) {
|
|
162
|
+
const source = installedConfigSource();
|
|
163
|
+
if (source) {
|
|
164
|
+
if (!source.save)
|
|
165
|
+
throw new Error("The config is supplied by the shell here and can't be changed.");
|
|
166
|
+
source.save(config);
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
169
|
+
const dest = getConfigPath();
|
|
170
|
+
fs.mkdirSync(path.dirname(dest), { recursive: true });
|
|
171
|
+
// Atomic write: never leave a half-written ~/.orbit/config.json behind.
|
|
172
|
+
// A power-loss / process-kill mid-write would otherwise truncate the
|
|
173
|
+
// config and lose the user's API keys + skills + profiles. The .tmp
|
|
174
|
+
// file lives next to the dest so the rename is on the same filesystem.
|
|
175
|
+
const tmp = `${dest}.tmp`;
|
|
176
|
+
const fd = fs.openSync(tmp, "w", 0o600);
|
|
177
|
+
try {
|
|
178
|
+
fs.writeSync(fd, JSON.stringify(config, null, 2) + "\n");
|
|
179
|
+
fs.fsyncSync(fd);
|
|
180
|
+
} finally {
|
|
181
|
+
fs.closeSync(fd);
|
|
182
|
+
}
|
|
183
|
+
fs.renameSync(tmp, dest);
|
|
184
|
+
// fs.openSync mode applies to the tmp file. Tighten the final path too,
|
|
185
|
+
// including the case where an existing file had looser permissions.
|
|
186
|
+
try {
|
|
187
|
+
fs.chmodSync(dest, 0o600);
|
|
188
|
+
} catch {}
|
|
189
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
type EnvLike = Record<string, string | undefined>;
|
|
2
|
+
|
|
3
|
+
export const WARN_ON_LEGACY_ENV: boolean;
|
|
4
|
+
export const DESKTOP_SHELL_KIND: "orbit";
|
|
5
|
+
|
|
6
|
+
export function currentEnvName(name: string): string;
|
|
7
|
+
export function legacyEnvNames(name: string): string[];
|
|
8
|
+
export function envNames(name: string): string[];
|
|
9
|
+
export function readEnv(name: string, env?: EnvLike): string | undefined;
|
|
10
|
+
export function writeEnv(env: EnvLike, name: string, value: string): void;
|
|
11
|
+
export function mirrorToLegacyEnv(env: EnvLike, name: string): void;
|
|
12
|
+
export function isDesktopShell(env?: EnvLike): boolean;
|
|
13
|
+
export function _setLegacyEnvWarnings(enabled: boolean): void;
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Env var names are moving from LOOM_* to ORBIT_*. Every read goes through
|
|
3
|
+
* readEnv("MODE"), which returns ORBIT_MODE if set, else the legacy LOOM_MODE.
|
|
4
|
+
*
|
|
5
|
+
* Writers (a shell setting env for the brain it spawns, the CLI translating a
|
|
6
|
+
* flag) use writeEnv, which sets BOTH spellings. Setting only the legacy name
|
|
7
|
+
* would let an ambient ORBIT_ twin -- forwarded by the brain-env prefix list --
|
|
8
|
+
* silently outrank a value the shell set on purpose (e.g. LOCAL_EXEC=on).
|
|
9
|
+
* The legacy name is still written because an older bundle only reads LOOM_*.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
// On since the rename release: a LOOM_* name still works, but says so once per
|
|
13
|
+
// variable so shells, Dockerfiles and tool wrappers get moved over.
|
|
14
|
+
export const WARN_ON_LEGACY_ENV = true;
|
|
15
|
+
let warnEnabled = WARN_ON_LEGACY_ENV;
|
|
16
|
+
|
|
17
|
+
// Names whose legacy spelling isn't simply LOOM_<name>: ORBIT_BIN already
|
|
18
|
+
// meant the desktop binary, and LOOM_BIN would be ambiguous once the CLI is
|
|
19
|
+
// also called orbit.
|
|
20
|
+
const LEGACY_ALIASES = {
|
|
21
|
+
DESKTOP_BIN: ["ORBIT_BIN"],
|
|
22
|
+
CORE_BIN: ["LOOM_BIN"],
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
/** Value written for SHELL_KIND by a desktop/web shell. Old bundles only know "orbit". */
|
|
26
|
+
export const DESKTOP_SHELL_KIND = "orbit";
|
|
27
|
+
|
|
28
|
+
const warned = new Set();
|
|
29
|
+
|
|
30
|
+
/** @param {string} name logical name without prefix, e.g. "MODE" */
|
|
31
|
+
export function currentEnvName(name) {
|
|
32
|
+
return `ORBIT_${name}`;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/** @param {string} name */
|
|
36
|
+
export function legacyEnvNames(name) {
|
|
37
|
+
return LEGACY_ALIASES[name] ?? [`LOOM_${name}`];
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/** Every spelling of a logical name, canonical first. */
|
|
41
|
+
export function envNames(name) {
|
|
42
|
+
return [currentEnvName(name), ...legacyEnvNames(name)];
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function warnLegacy(legacy, current) {
|
|
46
|
+
if (!warnEnabled || warned.has(legacy)) return;
|
|
47
|
+
warned.add(legacy);
|
|
48
|
+
try {
|
|
49
|
+
process.stderr.write(`${legacy} is deprecated; set ${current} instead.\n`);
|
|
50
|
+
} catch {
|
|
51
|
+
/* stderr closed -- nothing useful to do */
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* @param {string} name
|
|
57
|
+
* @param {Record<string, string | undefined>} [env]
|
|
58
|
+
* @returns {string | undefined}
|
|
59
|
+
*/
|
|
60
|
+
export function readEnv(name, env = process.env) {
|
|
61
|
+
const current = currentEnvName(name);
|
|
62
|
+
const v = env[current];
|
|
63
|
+
if (v !== undefined) return v;
|
|
64
|
+
for (const legacy of legacyEnvNames(name)) {
|
|
65
|
+
const lv = env[legacy];
|
|
66
|
+
if (lv !== undefined) {
|
|
67
|
+
warnLegacy(legacy, current);
|
|
68
|
+
return lv;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
return undefined;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* @param {Record<string, string | undefined>} env
|
|
76
|
+
* @param {string} name
|
|
77
|
+
* @param {string} value
|
|
78
|
+
*/
|
|
79
|
+
export function writeEnv(env, name, value) {
|
|
80
|
+
for (const n of envNames(name)) env[n] = value;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Copy an ORBIT_ value onto its legacy name when the legacy name is unset, for
|
|
85
|
+
* consumers that can only look up one fixed name -- pi resolves a custom
|
|
86
|
+
* provider's apiKey from the env var models.json names (LOOM_ACTIVE_LLM_API_KEY),
|
|
87
|
+
* and older bundles only read LOOM_*. A legacy value that is already set is
|
|
88
|
+
* left alone: whoever set it did so on purpose. An empty value counts as unset
|
|
89
|
+
* on both sides -- `LOOM_ACTIVE_LLM_API_KEY=` left over in a container or shell
|
|
90
|
+
* profile would otherwise shadow the real ORBIT_ key.
|
|
91
|
+
*
|
|
92
|
+
* @param {Record<string, string | undefined>} env
|
|
93
|
+
* @param {string} name
|
|
94
|
+
*/
|
|
95
|
+
export function mirrorToLegacyEnv(env, name) {
|
|
96
|
+
const v = env[currentEnvName(name)];
|
|
97
|
+
if (!v) return;
|
|
98
|
+
const legacy = legacyEnvNames(name);
|
|
99
|
+
if (legacy.some((n) => env[n])) return;
|
|
100
|
+
for (const n of legacy) env[n] = v;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Is the brain running under the desktop/web renderer rather than the CLI?
|
|
105
|
+
* "desktop" is the new spelling of the value; "orbit" stays accepted.
|
|
106
|
+
*
|
|
107
|
+
* @param {Record<string, string | undefined>} [env]
|
|
108
|
+
*/
|
|
109
|
+
export function isDesktopShell(env = process.env) {
|
|
110
|
+
const kind = readEnv("SHELL_KIND", env);
|
|
111
|
+
return kind === "orbit" || kind === "desktop";
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/** Test-only: toggle the legacy-name warning and forget which names already warned. */
|
|
115
|
+
export function _setLegacyEnvWarnings(enabled) {
|
|
116
|
+
warnEnabled = enabled;
|
|
117
|
+
warned.clear();
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/** Test seam: back to the shipped default, with the once-per-name memory cleared. */
|
|
121
|
+
export function _resetLegacyEnvWarnings() {
|
|
122
|
+
warnEnabled = WARN_ON_LEGACY_ENV;
|
|
123
|
+
warned.clear();
|
|
124
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
export const OrbitWidgetKey: {
|
|
2
|
+
readonly Plan: "plan";
|
|
3
|
+
readonly Steps: "steps";
|
|
4
|
+
readonly Results: "results";
|
|
5
|
+
readonly Parameters: "parameters";
|
|
6
|
+
readonly Notebook: "notebook";
|
|
7
|
+
readonly PlanView: "plan-view";
|
|
8
|
+
readonly Activity: "activity";
|
|
9
|
+
readonly GalaxyLive: "galaxy-live";
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export interface ShellActivityEvent {
|
|
13
|
+
timestamp: string;
|
|
14
|
+
kind: string;
|
|
15
|
+
source: string;
|
|
16
|
+
payload: Record<string, unknown>;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface ShellStep {
|
|
20
|
+
id: string;
|
|
21
|
+
name: string;
|
|
22
|
+
description: string;
|
|
23
|
+
status: "pending" | "in_progress" | "completed" | "failed" | "skipped";
|
|
24
|
+
dependsOn: string[];
|
|
25
|
+
result?: string;
|
|
26
|
+
command?: string;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export interface ResultBlock {
|
|
30
|
+
stepName?: string;
|
|
31
|
+
type: "markdown" | "table" | "image" | "file";
|
|
32
|
+
content?: string;
|
|
33
|
+
headers?: string[];
|
|
34
|
+
rows?: string[][];
|
|
35
|
+
path?: string;
|
|
36
|
+
caption?: string;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export interface ParameterOption {
|
|
40
|
+
label: string;
|
|
41
|
+
value: string;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export interface ParameterSpec {
|
|
45
|
+
name: string;
|
|
46
|
+
type: "text" | "integer" | "float" | "boolean" | "select" | "file";
|
|
47
|
+
label: string;
|
|
48
|
+
help: string;
|
|
49
|
+
value: string | number | boolean;
|
|
50
|
+
min?: number;
|
|
51
|
+
max?: number;
|
|
52
|
+
step?: number;
|
|
53
|
+
options?: ParameterOption[];
|
|
54
|
+
fileFilter?: string;
|
|
55
|
+
usedBy?: string[];
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export interface ParameterGroup {
|
|
59
|
+
title: string;
|
|
60
|
+
description: string;
|
|
61
|
+
params: ParameterSpec[];
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export interface ParameterFormPayload {
|
|
65
|
+
planId: string;
|
|
66
|
+
title: string;
|
|
67
|
+
description: string;
|
|
68
|
+
groups: ParameterGroup[];
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export function encodeMarkdownWidget(markdown: string): string[];
|
|
72
|
+
export function decodeMarkdownWidget(lines: string[] | undefined): string;
|
|
73
|
+
export function encodeJsonWidget<T>(value: T): string[];
|
|
74
|
+
export function decodeJsonWidget<T>(lines: string[] | undefined): T;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export const OrbitWidgetKey = {
|
|
2
|
+
Plan: "plan",
|
|
3
|
+
Steps: "steps",
|
|
4
|
+
Results: "results",
|
|
5
|
+
Parameters: "parameters",
|
|
6
|
+
Notebook: "notebook",
|
|
7
|
+
PlanView: "plan-view",
|
|
8
|
+
Activity: "activity",
|
|
9
|
+
// JSON, not markdown: the live Galaxy history projection (shared/galaxy-live-contract).
|
|
10
|
+
GalaxyLive: "galaxy-live",
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export function encodeMarkdownWidget(markdown) {
|
|
14
|
+
return [markdown];
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export function decodeMarkdownWidget(lines) {
|
|
18
|
+
return (lines || []).join("\n");
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export function encodeJsonWidget(value) {
|
|
22
|
+
return [JSON.stringify(value)];
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export function decodeJsonWidget(lines) {
|
|
26
|
+
if (!lines || lines.length === 0) {
|
|
27
|
+
throw new Error("Widget payload missing");
|
|
28
|
+
}
|
|
29
|
+
return JSON.parse(lines[0]);
|
|
30
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function pageContentHash(body: string): string;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// The version token of a Galaxy page as the record store sees it. Galaxy's page PUT carries no
|
|
2
|
+
// precondition and its GET no etag, so the client hashes the body it read and compares before it
|
|
3
|
+
// writes. Must stay byte-identical to galaxy-ops' `contentHash`: the model's own `update_page`
|
|
4
|
+
// in the browser compares against that function, and the two sides have to agree on what "the
|
|
5
|
+
// page I was shown" is. browser/core/src/agent/page-content-hash.test.ts is the tripwire.
|
|
6
|
+
|
|
7
|
+
/** djb2 over the code points of a page body, as eight hex digits.
|
|
8
|
+
* @param {string} body @returns {string} */
|
|
9
|
+
export function pageContentHash(body) {
|
|
10
|
+
let h = 5381;
|
|
11
|
+
for (const c of body) h = (h * 33 + c.codePointAt(0)) >>> 0;
|
|
12
|
+
return h.toString(16).padStart(8, "0");
|
|
13
|
+
}
|