@parcha/agentrun-serve 0.1.0-beta.38 → 0.1.0-beta.40
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 +455 -0
- package/README.md +376 -125
- package/dist/adapters.d.ts +4 -1
- package/dist/adapters.js +4 -2
- package/dist/agent-rows.d.ts +0 -2
- package/dist/agents-store.d.ts +5 -5
- package/dist/agents-store.js +14 -14
- package/dist/bash-read-only.js +2 -1
- package/dist/cap-short.d.ts +12 -0
- package/dist/cap-short.js +60 -0
- package/dist/cap.d.ts +3 -10
- package/dist/cap.js +2 -5
- package/dist/catalog.d.ts +0 -5
- package/dist/catalog.js +1 -5
- package/dist/chatgpt-plan.d.ts +163 -0
- package/dist/chatgpt-plan.js +549 -0
- package/dist/cli.js +26 -6
- package/dist/composio-preset.d.ts +8 -0
- package/dist/composio-preset.js +8 -7
- package/dist/composio-triggers.d.ts +113 -0
- package/dist/composio-triggers.js +411 -0
- package/dist/computer-calls.js +2 -2
- package/dist/computer-commands.d.ts +2 -0
- package/dist/computer-commands.js +7 -3
- package/dist/computer-live.d.ts +7 -2
- package/dist/computer-live.js +9 -5
- package/dist/computer-routes.d.ts +2 -2
- package/dist/computer-routes.js +2 -2
- package/dist/computer-setting.d.ts +3 -3
- package/dist/computer-setting.js +5 -5
- package/dist/computer-view.d.ts +15 -0
- package/dist/computer-view.js +16 -2
- package/dist/computer-viewer.js +14 -1
- package/dist/computers.d.ts +5 -2
- package/dist/computers.js +9 -5
- package/dist/console/assets/index-B8Zn1Iqn.css +1 -0
- package/dist/console/assets/index-Jbxjcmdp.js +705 -0
- package/dist/console/index.html +2 -2
- package/dist/console-links.js +3 -3
- package/dist/decision-cap.d.ts +2 -5
- package/dist/decision-cap.js +3 -6
- package/dist/decision-rows.js +11 -11
- package/dist/email/account.d.ts +83 -0
- package/dist/email/account.js +159 -0
- package/dist/email/answer.d.ts +15 -0
- package/dist/email/answer.js +217 -0
- package/dist/email/email-faux.d.ts +95 -0
- package/dist/email/email-faux.js +849 -0
- package/dist/email/labels.d.ts +1 -0
- package/dist/email/labels.js +84 -0
- package/dist/email/mail.d.ts +186 -0
- package/dist/email/mail.js +373 -0
- package/dist/email/names.d.ts +50 -0
- package/dist/email/names.js +74 -0
- package/dist/email/routes.d.ts +10 -0
- package/dist/email/routes.js +50 -0
- package/dist/email/tools.d.ts +27 -0
- package/dist/email/tools.js +562 -0
- package/dist/environment.d.ts +17 -2
- package/dist/environment.js +36 -8
- package/dist/errors.d.ts +6 -0
- package/dist/errors.js +12 -0
- package/dist/eval-mailbox.d.ts +103 -0
- package/dist/eval-mailbox.js +236 -0
- package/dist/graph-view.d.ts +9 -2
- package/dist/graph-view.js +6 -2
- package/dist/harness-install.d.ts +28 -2
- package/dist/harness-install.js +147 -59
- package/dist/harness-opencode/adapter.js +2 -26
- package/dist/harness-opencode/facts.js +5 -2
- package/dist/harness-opencode/host/policy.d.ts +2 -0
- package/dist/harness-opencode/host/policy.js +10 -5
- package/dist/harness-opencode/index.d.ts +1 -1
- package/dist/harness-opencode/index.js +1 -1
- package/dist/harness-opencode/versions.d.ts +6 -0
- package/dist/harness-opencode/versions.js +6 -0
- package/dist/harness-table.js +8 -5
- package/dist/harness.d.ts +12 -0
- package/dist/harness.js +15 -3
- package/dist/hosted-search.d.ts +3 -1
- package/dist/hosted-search.js +51 -11
- package/dist/import-sources.d.ts +1 -1
- package/dist/import-sources.js +3 -3
- package/dist/import.d.ts +21 -0
- package/dist/import.js +186 -1
- package/dist/key-check.d.ts +0 -2
- package/dist/key-check.js +3 -4
- package/dist/key-refusal.d.ts +8 -2
- package/dist/key-refusal.js +16 -13
- package/dist/learn/check.d.ts +18 -3
- package/dist/learn/check.js +328 -3
- package/dist/learn/compile.d.ts +12 -4
- package/dist/learn/compile.js +57 -20
- package/dist/learn/grade.d.ts +4 -0
- package/dist/learn/grade.js +4 -1
- package/dist/learn/promote.d.ts +130 -64
- package/dist/learn/promote.js +113 -202
- package/dist/learn/refit.d.ts +21 -12
- package/dist/learn/refit.js +51 -23
- package/dist/learn/replay-calls.js +1 -1
- package/dist/learn/skills.d.ts +2 -7
- package/dist/learn/skills.js +28 -14
- package/dist/learned-nodes.d.ts +15 -7
- package/dist/learned-nodes.js +29 -5
- package/dist/learned-workflow.d.ts +41 -31
- package/dist/learned-workflow.js +122 -63
- package/dist/learning-batch.js +3 -3
- package/dist/learning-cost.d.ts +35 -8
- package/dist/learning-cost.js +27 -9
- package/dist/learning-routes.d.ts +2 -4
- package/dist/learning-routes.js +20 -3
- package/dist/learning-words.d.ts +1 -1
- package/dist/learning-words.js +4 -1
- package/dist/learning.d.ts +5 -5
- package/dist/link-check.d.ts +27 -0
- package/dist/link-check.js +164 -0
- package/dist/local-models.d.ts +39 -2
- package/dist/local-models.js +49 -5
- package/dist/mcp-pin-first.js +6 -0
- package/dist/mcp-secret-writes.js +3 -0
- package/dist/mcp-servers-store.d.ts +25 -16
- package/dist/mcp-servers-store.js +23 -3
- package/dist/model-form.d.ts +11 -0
- package/dist/model-form.js +17 -1
- package/dist/model.d.ts +26 -6
- package/dist/model.js +126 -18
- package/dist/monid.d.ts +26 -31
- package/dist/monid.js +84 -79
- package/dist/native/binding.d.ts +13 -0
- package/dist/native/binding.js +57 -0
- package/dist/native/cli.d.ts +2 -0
- package/dist/native/cli.js +48 -0
- package/dist/native/connection.d.ts +8 -0
- package/dist/native/connection.js +94 -0
- package/dist/native/context.d.ts +6 -0
- package/dist/native/context.js +22 -0
- package/dist/native/discovery.d.ts +27 -0
- package/dist/native/discovery.js +404 -0
- package/dist/native/environment.d.ts +4 -0
- package/dist/native/environment.js +18 -0
- package/dist/native/history.d.ts +20 -0
- package/dist/native/history.js +147 -0
- package/dist/native/instructions.d.ts +21 -0
- package/dist/native/instructions.js +173 -0
- package/dist/native/remote-worker-bridge.d.ts +3 -0
- package/dist/native/remote-worker-bridge.js +278 -0
- package/dist/native/remote.d.ts +187 -0
- package/dist/native/remote.js +492 -0
- package/dist/native/runtime.d.ts +17 -0
- package/dist/native/runtime.js +316 -0
- package/dist/native/runtimes.d.ts +66 -0
- package/dist/native/runtimes.js +41 -0
- package/dist/native/schema.d.ts +46 -0
- package/dist/native/schema.js +41 -0
- package/dist/native/types.d.ts +87 -0
- package/dist/native/types.js +1 -0
- package/dist/observation/http.d.ts +4 -0
- package/dist/observation/http.js +140 -0
- package/dist/observation/observer.d.ts +301 -0
- package/dist/observation/observer.js +919 -0
- package/dist/observation/schema.d.ts +52 -0
- package/dist/observation/schema.js +154 -0
- package/dist/openapi.d.ts +2 -1
- package/dist/openapi.js +404 -93
- package/dist/paid-calls.d.ts +8 -3
- package/dist/paid-calls.js +6 -2
- package/dist/place-offers.d.ts +4 -8
- package/dist/place-offers.js +4 -9
- package/dist/port-models.d.ts +10 -2
- package/dist/port-models.js +6 -2
- package/dist/print.d.ts +4 -2
- package/dist/print.js +4 -3
- package/dist/propose.d.ts +1 -2
- package/dist/propose.js +10 -1
- package/dist/provider.d.ts +5 -1
- package/dist/provider.js +8 -0
- package/dist/push-handler.d.ts +3 -2
- package/dist/push-handler.js +20 -6
- package/dist/refusal-words.d.ts +14 -0
- package/dist/refusal-words.js +16 -2
- package/dist/run-launch.d.ts +12 -1
- package/dist/run-launch.js +13 -4
- package/dist/run-learning-served.d.ts +75 -2
- package/dist/run-manifest.d.ts +3 -0
- package/dist/run-manifest.js +13 -1
- package/dist/run-reads-over-store.d.ts +3 -3
- package/dist/run-reads-over-store.js +13 -10
- package/dist/run-timeline-served.d.ts +3 -2
- package/dist/run-timeline-served.js +8 -9
- package/dist/run-view.d.ts +44 -38
- package/dist/run-view.js +93 -56
- package/dist/runnable.d.ts +13 -5
- package/dist/runnable.js +69 -60
- package/dist/runner/adapter-loop.d.ts +48 -13
- package/dist/runner/adapter-loop.js +691 -254
- package/dist/runner/adapter-run-spec.d.ts +38 -12
- package/dist/runner/adapter-run-spec.js +175 -106
- package/dist/runner/adapters/pi.d.ts +24 -0
- package/dist/runner/adapters/pi.js +59 -9
- package/dist/runner/beside.d.ts +3 -1
- package/dist/runner/beside.js +24 -8
- package/dist/runner/claim-secrets.d.ts +3 -1
- package/dist/runner/claim-secrets.js +28 -4
- package/dist/runner/cli-run-spec.d.ts +30 -0
- package/dist/runner/cli-run-spec.js +95 -50
- package/dist/runner/computer-channel.d.ts +5 -2
- package/dist/runner/computer-channel.js +3 -2
- package/dist/runner/computer-journal.d.ts +6 -0
- package/dist/runner/computer-journal.js +8 -10
- package/dist/runner/conformance/harness.js +6 -3
- package/dist/runner/end-of-run.d.ts +2 -0
- package/dist/runner/end-of-run.js +3 -1
- package/dist/runner/feedback-round.d.ts +40 -13
- package/dist/runner/feedback-round.js +64 -16
- package/dist/runner/harness-loops.js +17 -0
- package/dist/runner/journal-kinds.d.ts +59 -13
- package/dist/runner/journal-kinds.js +48 -5
- package/dist/runner/learning-dispatch.d.ts +3 -2
- package/dist/runner/learning-dispatch.js +6 -6
- package/dist/runner/learning-end.d.ts +4 -0
- package/dist/runner/learning-end.js +64 -36
- package/dist/runner/learning-factory.d.ts +3 -0
- package/dist/runner/learning-factory.js +8 -2
- package/dist/runner/learning-loop.d.ts +2 -0
- package/dist/runner/learning-loop.js +19 -4
- package/dist/runner/loop.d.ts +18 -0
- package/dist/runner/loop.js +34 -0
- package/dist/runner/main.d.ts +6 -1
- package/dist/runner/main.js +26 -4
- package/dist/runner/mcp-run.d.ts +4 -1
- package/dist/runner/mcp-run.js +11 -5
- package/dist/runner/meta-tools.d.ts +10 -3
- package/dist/runner/meta-tools.js +112 -36
- package/dist/runner/metrics.d.ts +80 -21
- package/dist/runner/metrics.js +114 -39
- package/dist/runner/model-route.d.ts +14 -3
- package/dist/runner/model-route.js +155 -19
- package/dist/runner/monid-run.d.ts +8 -6
- package/dist/runner/monid-run.js +117 -43
- package/dist/runner/native-loop.d.ts +11 -0
- package/dist/runner/native-loop.js +438 -0
- package/dist/runner/promotion.d.ts +76 -10
- package/dist/runner/promotion.js +476 -154
- package/dist/runner/redact.js +3 -0
- package/dist/runner/reflect-hook.js +9 -0
- package/dist/runner/runner.d.ts +7 -1
- package/dist/runner/runner.js +8 -4
- package/dist/runner/sdk-loop.d.ts +7 -0
- package/dist/runner/sdk-loop.js +470 -0
- package/dist/runner/spec-holds.d.ts +16 -2
- package/dist/runner/spec-holds.js +42 -14
- package/dist/runner/store-secrets.js +17 -2
- package/dist/runner/workflow-first.d.ts +30 -20
- package/dist/runner/workflow-first.js +22 -32
- package/dist/runner/workflow-loop.d.ts +1 -1
- package/dist/runner/workflow-loop.js +18 -12
- package/dist/runner/workflow-spec.d.ts +4 -1
- package/dist/runner/workflow-spec.js +56 -45
- package/dist/runs-over-store.d.ts +30 -2
- package/dist/runs-over-store.js +46 -14
- package/dist/sdk/runs.d.ts +115 -0
- package/dist/sdk/runs.js +422 -0
- package/dist/sdk/schema.d.ts +175 -0
- package/dist/sdk/schema.js +138 -0
- package/dist/sdk/workflows.d.ts +22 -0
- package/dist/sdk/workflows.js +39 -0
- package/dist/secrets.d.ts +2 -0
- package/dist/secrets.js +19 -1
- package/dist/server.d.ts +48 -32
- package/dist/server.js +568 -137
- package/dist/skill-route.d.ts +3 -0
- package/dist/skill-route.js +16 -0
- package/dist/skills/agentrun-serve/SKILL.md +368 -0
- package/dist/stats.d.ts +10 -10
- package/dist/store/agent-body.d.ts +12 -8
- package/dist/store/agent-body.js +9 -4
- package/dist/store/dialect.d.ts +3 -0
- package/dist/store/dialect.js +1 -0
- package/dist/store/index.d.ts +1 -1
- package/dist/store/native-command-owner.d.ts +10 -0
- package/dist/store/native-command-owner.js +47 -0
- package/dist/store/postgres/connection.d.ts +11 -5
- package/dist/store/postgres/connection.js +44 -17
- package/dist/store/postgres/dialect.js +5 -0
- package/dist/store/postgres/migrations/0012_revision_monid_pin.sql +4 -0
- package/dist/store/postgres/migrations/0013_native_command_owner.sql +6 -0
- package/dist/store/postgres/migrations/0014_run_cost_upper_bound.sql +6 -0
- package/dist/store/postgres/store.d.ts +7 -3
- package/dist/store/postgres/store.js +4 -0
- package/dist/store/schema.d.ts +7 -0
- package/dist/store/schema.js +20 -1
- package/dist/store/sqlite/connection.js +72 -8
- package/dist/store/sqlite/run-launch.d.ts +11 -0
- package/dist/store/sqlite/run-launch.js +8 -0
- package/dist/store/sqlite/run-patch.d.ts +8 -1
- package/dist/store/sqlite/run-patch.js +14 -3
- package/dist/store/sqlite/store.js +170 -34
- package/dist/store/sqlite/worker.d.ts +2 -0
- package/dist/store/sqlite/worker.js +13 -10
- package/dist/store/store.d.ts +67 -7
- package/dist/store-reads/analytics.d.ts +7 -7
- package/dist/store-reads/analytics.js +23 -5
- package/dist/store-reads/cap.js +8 -6
- package/dist/store-reads/journal.d.ts +5 -0
- package/dist/store-reads/journal.js +85 -41
- package/dist/store-reads/learning.d.ts +115 -18
- package/dist/store-reads/learning.js +170 -68
- package/dist/store-reads/runs.d.ts +5 -0
- package/dist/store-reads/runs.js +3 -2
- package/dist/store-view.js +75 -21
- package/dist/template-eval.d.ts +73 -11
- package/dist/template-eval.js +535 -75
- package/dist/templates.d.ts +84 -21
- package/dist/templates.js +254 -47
- package/dist/text-urls.d.ts +38 -0
- package/dist/text-urls.js +170 -0
- package/dist/timeline/index.d.ts +3 -2
- package/dist/timeline/index.js +3 -2
- package/dist/timeline/labels.d.ts +5 -2
- package/dist/timeline/labels.js +29 -6
- package/dist/timeline/origin.d.ts +1 -1
- package/dist/timeline/origin.js +2 -2
- package/dist/timeline/render-text.js +1 -1
- package/dist/timeline/timeline.d.ts +66 -4
- package/dist/timeline/timeline.js +160 -30
- package/dist/timeline/util.d.ts +5 -0
- package/dist/timeline/util.js +44 -8
- package/dist/timeline/web-calls.d.ts +17 -0
- package/dist/timeline/web-calls.js +106 -0
- package/dist/tool-gate.d.ts +46 -44
- package/dist/tool-gate.js +101 -92
- package/dist/tool-list.d.ts +4 -1
- package/dist/tool-list.js +8 -1
- package/dist/tool-names.d.ts +18 -13
- package/dist/tool-names.js +19 -17
- package/dist/tool-plane.d.ts +17 -13
- package/dist/tool-plane.js +12 -5
- package/dist/tools.d.ts +57 -16
- package/dist/tools.js +33 -28
- package/dist/trigger-adapter.d.ts +56 -5
- package/dist/trigger-adapter.js +6 -0
- package/dist/trigger-adapters.js +3 -1
- package/dist/trigger-composio.d.ts +10 -0
- package/dist/trigger-composio.js +122 -0
- package/dist/trigger-email.d.ts +4 -0
- package/dist/trigger-email.js +181 -0
- package/dist/trigger-signatures.d.ts +6 -10
- package/dist/trigger-signatures.js +16 -16
- package/dist/trigger-targets.d.ts +1 -1
- package/dist/trigger-targets.js +4 -3
- package/dist/trigger-webhook.js +6 -4
- package/dist/triggers.d.ts +105 -8
- package/dist/triggers.js +286 -62
- package/dist/uploads.d.ts +9 -0
- package/dist/uploads.js +27 -0
- package/dist/validate.js +1 -7
- package/dist/web-fake.d.ts +56 -0
- package/dist/web-fake.js +102 -0
- package/dist/web-fetch-direct.d.ts +3 -0
- package/dist/web-fetch-direct.js +4 -1
- package/dist/web-fetch.d.ts +5 -1
- package/dist/web-fetch.js +8 -31
- package/dist/web-search.d.ts +51 -2
- package/dist/web-search.js +116 -18
- package/dist/webhooks.d.ts +2 -1
- package/dist/webhooks.js +5 -1
- package/dist/workflow/decision-recovery.js +5 -2
- package/dist/workflow/decisions.d.ts +7 -0
- package/dist/workflow/node-runner.js +10 -2
- package/dist/workspace/archil-claim.d.ts +3 -0
- package/dist/workspace/archil-claim.js +9 -2
- package/dist/workspace/computer-deps.d.ts +22 -9
- package/dist/workspace/computer-deps.js +78 -37
- package/dist/workspace/computer-for-claim.d.ts +54 -4
- package/dist/workspace/computer-for-claim.js +179 -39
- package/dist/workspace/computer-janitor.d.ts +10 -3
- package/dist/workspace/computer-janitor.js +96 -29
- package/dist/workspace/computer-kept.d.ts +82 -0
- package/dist/workspace/computer-kept.js +147 -0
- package/dist/workspace/computer-mcp.js +4 -3
- package/dist/workspace/computer-ports.d.ts +23 -3
- package/dist/workspace/computer-ports.js +115 -5
- package/dist/workspace/index.d.ts +1 -2
- package/dist/workspace/index.js +1 -2
- package/dist/workspace/kind-skills/desktop/SKILL.md +25 -18
- package/dist/workspace/kind-skills/phone/SKILL.md +28 -17
- package/dist/workspace/resolve-computer.d.ts +15 -3
- package/dist/workspace/resolve-computer.js +10 -7
- package/dist/workspace/revision-skills.d.ts +6 -2
- package/dist/workspace/revision-skills.js +12 -5
- package/dist/workspace/run-end-computers.d.ts +30 -0
- package/dist/workspace/run-end-computers.js +137 -0
- package/dist/workspace/run-tools.d.ts +28 -29
- package/dist/workspace/run-tools.js +29 -30
- package/dist/wrap-up.d.ts +19 -5
- package/dist/wrap-up.js +31 -4
- package/package.json +13 -9
- package/skills/agentrun-serve/SKILL.md +248 -10
- package/templates/README.md +117 -23
- package/templates/TOOLS.md +168 -0
- package/templates/code-review/agent.md +18 -4
- package/templates/code-review/evals/mentions-defused/case.yaml +1 -1
- package/templates/code-review/evals/off-by-one/graders/no-repo-reads.md +2 -1
- package/templates/code-review/evals/other-repo/case.yaml +1 -1
- package/templates/code-review/evals/pasted-by-reference/case.yaml +5 -0
- package/templates/code-review/evals/pasted-by-reference/graders/by-reference.md +15 -0
- package/templates/code-review/evals/pasted-by-reference/graders/head-sha.md +6 -0
- package/templates/code-review/evals/pasted-by-reference/prompt.md +31 -0
- package/templates/code-review/skills/review/DEEP.md +2 -2
- package/templates/code-review/skills/review/REVIEWER.md +2 -2
- package/templates/code-review/skills/review/SKILL.md +7 -3
- package/templates/release-notes/evals/draft-not-publish/case.yaml +1 -1
- package/templates/release-notes/evals/issue-write-refused/case.yaml +1 -1
- package/templates/release-notes/evals/late-arrival/case.yaml +1 -1
- package/templates/release-notes/evals/other-repo/case.yaml +1 -1
- package/dist/console/assets/index-CjqQirbo.css +0 -1
- package/dist/console/assets/index-b6-XY5A9.js +0 -576
- package/dist/host-calls.d.ts +0 -20
- package/dist/host-calls.js +0 -12
- package/dist/runner/adapters/pi-computer.d.ts +0 -9
- package/dist/runner/adapters/pi-computer.js +0 -51
- package/dist/workspace/computer-script.d.ts +0 -53
- package/dist/workspace/computer-script.js +0 -172
package/dist/tool-names.js
CHANGED
|
@@ -9,7 +9,13 @@
|
|
|
9
9
|
// A monid provider's slug and an endpoint's path are monid's own (its listing, GET /v1/endpoints): a slug is lowercase
|
|
10
10
|
// letters, digits, `.` and `-` (`apollo`, `api.strale.io`); an endpoint is its path less the leading `/`, in letters,
|
|
11
11
|
// digits and `-._:{}/` (`people/match`, `people/{id}`). Its wire name is catalog.ts wireName's, hashed when long.
|
|
12
|
-
|
|
12
|
+
// It imports nothing (its test holds it to that): the console bundles it from source, as `@agentrun/tool-names`.
|
|
13
|
+
/** A wire name: at most 52 characters, not the adapter's 64. One CLI gives the model the name with a 12-character
|
|
14
|
+
* `mcp__hands__` prefix, and the model API's 64-character limit is on the name the model sees, so 52 is the budget that
|
|
15
|
+
* holds on every harness. The identity branch reads it: a plain 53-64 character name of valid characters must not skip
|
|
16
|
+
* the mapping and come out over budget. An MCP tool whose `mcp__<server>__<tool>` is past it (Composio's 58-character
|
|
17
|
+
* `mcp__slack__SLACK_FETCH_MESSAGE_THREAD_FROM_A_CONVERSATION`) is granted and called by its hashed name. */
|
|
18
|
+
export const WIRE_NAME = /^[A-Za-z0-9_-]{1,52}$/;
|
|
13
19
|
const SERVER = "[a-z][a-z0-9-]{0,31}";
|
|
14
20
|
const TOOL = "[A-Za-z0-9_-]{1,64}";
|
|
15
21
|
const PROVIDER = "[a-z0-9][a-z0-9.-]{0,63}";
|
|
@@ -25,6 +31,8 @@ export const MCP_TOOL_NAME = new RegExp(`^${TOOL}$`);
|
|
|
25
31
|
/** A catalog tool's name, as a JSON Schema pattern (openapi.ts): `mcp:<server>/<tool>`, `monid:<provider>/<endpoint>`,
|
|
26
32
|
* or either's wildcard. */
|
|
27
33
|
export const CATALOG_KEY_PATTERN = `^(?:mcp:${SERVER}/(?:\\*|${TOOL})|monid:${PROVIDER}/(?:\\*|${ENDPOINT}))$`;
|
|
34
|
+
/** One MCP tool's catalog key, without a server wildcard: the same server/tool grammar as mcpNameOf. */
|
|
35
|
+
export const MCP_TOOL_KEY_PATTERN = `^mcp:${SERVER}/${TOOL}$`;
|
|
28
36
|
const MCP_NAME = new RegExp(`^mcp:(${SERVER})/(\\*|${TOOL})$`);
|
|
29
37
|
const MONID_NAME = new RegExp(`^monid:(${PROVIDER})/(\\*|${ENDPOINT})$`);
|
|
30
38
|
const PLAIN_NAME = new RegExp(`^${PLAIN}$`);
|
|
@@ -77,23 +85,17 @@ export function mcpServerOf(name) {
|
|
|
77
85
|
const parsed = parseToolName(name);
|
|
78
86
|
return parsed?.kind === "mcp" || parsed?.kind === "mcp-server" ? parsed.server : undefined;
|
|
79
87
|
}
|
|
80
|
-
/** Whether `name` is an MCP server's wildcard, `mcp:<server>/*`. */
|
|
81
|
-
export const isMcpWildcard = (name) => parseToolName(name)?.kind === "mcp-server";
|
|
82
88
|
/** Why a grant of an MCP server's tool is refused by its name alone, said after the grant (`mcp:<server>/<tool> ...`): the
|
|
83
89
|
* one place the console's picker and the save's blockers (runnable.ts) both read it. `hands` is the harnesses' own tools'
|
|
84
90
|
* server. */
|
|
85
91
|
export const MCP_HANDS_WORDS = "names the MCP server hands, a name the harnesses keep for their own tools: save the server under another name.";
|
|
86
|
-
/**
|
|
87
|
-
*
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
export const mcpDroppedWords = (server, tool, harness, dropped) => `The MCP server ${server}'s tool ${tool} cannot be offered on ${harness}: ${dropped.replace(/^mcp__\S+: /, "")}.`;
|
|
97
|
-
/** Why the harness drops or retypes the pinned monid endpoint `tool`'s input (its facts' schemaProblems, `dropped` the
|
|
98
|
-
* first, under the endpoint's wire name): the words a save refuses its grant with. */
|
|
99
|
-
export const monidDroppedWords = (tool, harness, dropped) => `The monid endpoint ${tool} cannot be offered on ${harness}: ${dropped.replace(/^monid__\S+: /, "")}. Grant its provider's other endpoints by name, or pick another harness.`;
|
|
92
|
+
/** MCP_HANDS_WORDS when the grant names the server `hands`; undefined otherwise. A name's length refuses nothing: one whose
|
|
93
|
+
* `mcp__<server>__<tool>` is past the budget every harness's names share is called by its hashed wire name (catalog.ts
|
|
94
|
+
* wireName), and read back by lookup. */
|
|
95
|
+
export const mcpGrantNameProblem = (server, _tool) => (server === "hands" ? MCP_HANDS_WORDS : undefined);
|
|
96
|
+
/** Why two granted catalog tools can't both be granted: the harnesses call both by one wire name (`wire`, catalog.ts
|
|
97
|
+
* wireName), so neither could be told apart. Said after the later grant. */
|
|
98
|
+
export const sameWireWords = (tool, other, wire) => `${tool} and ${other} are called by one name on every harness (${wire}): grant one of them by name.`;
|
|
99
|
+
/** Why `harness` drops or retypes the input of the catalog tool `tool` (its facts' schemaProblems, `dropped` the first,
|
|
100
|
+
* said under the tool's wire name): the words a save's blocker and a saved MCP server's read both say. */
|
|
101
|
+
export const droppedWords = (tool, harness, dropped) => `The tool ${tool} cannot be offered on ${harness}: ${dropped.replace(/^[A-Za-z0-9_-]+: /, "")}.`;
|
package/dist/tool-plane.d.ts
CHANGED
|
@@ -4,6 +4,9 @@ import { type HarnessId } from "./harness.js";
|
|
|
4
4
|
import { type ShellPlace } from "@parcha/agentrun-kernel/kernel";
|
|
5
5
|
import { type Permission, type Pin, type ToolEffect } from "./tool-gate.js";
|
|
6
6
|
import { type BashPolicy } from "./bash-read-only.js";
|
|
7
|
+
import { EMAIL_SCOPES } from "./email/names.js";
|
|
8
|
+
/** An email read tool's scope (email/names.ts). */
|
|
9
|
+
type EmailScope = (typeof EMAIL_SCOPES)[number];
|
|
7
10
|
/**
|
|
8
11
|
* The capabilities a pack or a revision may grant, by name: the tools the kernel gives a run, bound from serve's closed
|
|
9
12
|
* table (tools.ts) and named the same on every harness that runs them. `web_search` and `web_fetch` resolve to a
|
|
@@ -36,11 +39,11 @@ export declare const permissionsOf: (name: string) => readonly Permission[];
|
|
|
36
39
|
* give it: the one in force under the server's settings (`permission`), the owner's default (`default_permission`) and
|
|
37
40
|
* those it may be set to. An agent's read gives the same, the agent's own layer over it (agentTools). */
|
|
38
41
|
export declare const serverGate: (name: string, settings: ToolSettingsMap, effect?: ToolEffect) => {
|
|
39
|
-
default_permission: "
|
|
40
|
-
permissions: ("
|
|
42
|
+
default_permission: "allow" | "ask" | "deny";
|
|
43
|
+
permissions: ("allow" | "ask" | "deny")[];
|
|
41
44
|
fallback_allow_reads?: true | undefined;
|
|
42
45
|
allow_reads?: true | undefined;
|
|
43
|
-
permission: "
|
|
46
|
+
permission: "allow" | "ask" | "deny";
|
|
44
47
|
};
|
|
45
48
|
/** The run's own tools beyond the table, each its own settings key, allowed by default like a table tool: the learned
|
|
46
49
|
* workflow a run's pin names runs as `learned_workflow` (learned-workflow.ts LEARNED_WORKFLOW_TOOL), and the host's
|
|
@@ -61,7 +64,8 @@ export type ToolSetting = {
|
|
|
61
64
|
permission?: Permission;
|
|
62
65
|
pin?: Pin; /** On an MCP server's wildcard (`mcp:<server>/*`) in the server's settings only: the tools its server marks read-only run with no approval (tool-gate.ts readsLift). Kept only when true. */
|
|
63
66
|
allow_reads?: true; /** bash's policy, an agent's own only (bash-read-only.ts). */
|
|
64
|
-
policy?: BashPolicy; /**
|
|
67
|
+
policy?: BashPolicy; /** An email read tool's scope, an agent's own only (email/tools.ts): its email run's thread (the default), or the whole account. */
|
|
68
|
+
scope?: EmailScope; /** Read as a stand-in for a value not offered (checkToolSettings); never shown or written. */
|
|
65
69
|
fallback?: true; /** The stand-in's value as written in the file, which a save that keeps the stand-in writes back (ToolSettings.put). Never shown. */
|
|
66
70
|
raw?: unknown; /** A pin in the file that does not read (readToolSettings): the gate refuses every call of the tool, and a save keeps it (ToolSettings.put) until the owner sets a valid pin or removes the tool's setting. Served as `pin_broken: true`. */
|
|
67
71
|
brokenPin?: true; /** The broken pin as written in the file, which a save that keeps it writes back. Never shown. */
|
|
@@ -281,17 +285,17 @@ export declare function shellUnavailable(name: string, shell: ShellPlace): Resol
|
|
|
281
285
|
* computer setting); a tool of bash's family that leaves out resolves unavailable, saying why (shellUnavailable). */
|
|
282
286
|
export declare function agentTools(env: NodeJS.ProcessEnv, settings: ToolSettingsMap, agent: Tooling, order: readonly string[], shell?: ShellPlace, effectOf?: (name: string) => ToolEffect | undefined): ({
|
|
283
287
|
resolved: Resolution;
|
|
284
|
-
permission: "
|
|
288
|
+
permission: "allow" | "ask" | "deny";
|
|
285
289
|
permission_from: import("./refusal-words.js").SettingFrom;
|
|
286
|
-
default_permission: "
|
|
287
|
-
permissions: ("
|
|
290
|
+
default_permission: "allow" | "ask" | "deny";
|
|
291
|
+
permissions: ("allow" | "ask" | "deny")[];
|
|
288
292
|
blurb?: string | undefined;
|
|
289
293
|
name: string;
|
|
290
294
|
} | {
|
|
291
|
-
permission: "
|
|
295
|
+
permission: "allow" | "ask" | "deny";
|
|
292
296
|
permission_from: import("./refusal-words.js").SettingFrom;
|
|
293
|
-
default_permission: "
|
|
294
|
-
permissions: ("
|
|
297
|
+
default_permission: "allow" | "ask" | "deny";
|
|
298
|
+
permissions: ("allow" | "ask" | "deny")[];
|
|
295
299
|
blurb?: string | undefined;
|
|
296
300
|
name: string;
|
|
297
301
|
} | {
|
|
@@ -299,10 +303,10 @@ export declare function agentTools(env: NodeJS.ProcessEnv, settings: ToolSetting
|
|
|
299
303
|
provider_from: string;
|
|
300
304
|
default_provider: string;
|
|
301
305
|
resolved: Resolution;
|
|
302
|
-
permission: "
|
|
306
|
+
permission: "allow" | "ask" | "deny";
|
|
303
307
|
permission_from: import("./refusal-words.js").SettingFrom;
|
|
304
|
-
default_permission: "
|
|
305
|
-
permissions: ("
|
|
308
|
+
default_permission: "allow" | "ask" | "deny";
|
|
309
|
+
permissions: ("allow" | "ask" | "deny")[];
|
|
306
310
|
blurb?: string | undefined;
|
|
307
311
|
name: string;
|
|
308
312
|
})[];
|
package/dist/tool-plane.js
CHANGED
|
@@ -30,9 +30,10 @@ import { viaOpenRouter, WIRES } from "./provider.js";
|
|
|
30
30
|
import { savedIn } from "./secrets.js";
|
|
31
31
|
import { hostModel } from "./model.js";
|
|
32
32
|
import { NEEDS_A_COMPUTER, NO_SHELL } from "@parcha/agentrun-kernel/kernel";
|
|
33
|
-
import { canonicalPin, defaultPermission,
|
|
33
|
+
import { canonicalPin, defaultPermission, isPinKeys, MAX_PIN_ARGS, MAX_PIN_CHOICES, PERMISSIONS, permissionFrom, permissionOf, SETTINGS_UNREAD, SHELL_FAMILY } from "./tool-gate.js";
|
|
34
34
|
import { BASH_POLICIES } from "./bash-read-only.js";
|
|
35
|
-
import {
|
|
35
|
+
import { EMAIL_SCOPES, SCOPED_TOOLS, SCOPED_WORDS } from "./email/names.js";
|
|
36
|
+
import { isCatalogName, isMcpName, mcpNameOf, parseToolName } from "./tool-names.js";
|
|
36
37
|
/**
|
|
37
38
|
* The capabilities a pack or a revision may grant, by name: the tools the kernel gives a run, bound from serve's closed
|
|
38
39
|
* table (tools.ts) and named the same on every harness that runs them. `web_search` and `web_fetch` resolve to a
|
|
@@ -55,7 +56,7 @@ export const PICKABLE = Object.keys(PROVIDERS);
|
|
|
55
56
|
/** The permissions `name` may be set to: ask is offered for the tools whose approved call the kernel runs itself, outside
|
|
56
57
|
* the model's turn (tool-list.ts `askable`) and for catalog tools. Any other (browser, ask_person, the call-only ones) is
|
|
57
58
|
* allow or deny. */
|
|
58
|
-
export const permissionsOf = (name) => (Object.hasOwn(SHELL_FAMILY, name) && SHELL_FAMILY[name] !== name ? permissionsOf(SHELL_FAMILY[name]) : isAskable(name) ||
|
|
59
|
+
export const permissionsOf = (name) => (Object.hasOwn(SHELL_FAMILY, name) && SHELL_FAMILY[name] !== name ? permissionsOf(SHELL_FAMILY[name]) : isAskable(name) || isCatalogName(name) ? PERMISSIONS : ["allow", "deny"]);
|
|
59
60
|
/** A tool's permission as this server applies it to an agent that sets none, as capabilities and an MCP server's read
|
|
60
61
|
* give it: the one in force under the server's settings (`permission`), the owner's default (`default_permission`) and
|
|
61
62
|
* those it may be set to. An agent's read gives the same, the agent's own layer over it (agentTools). */
|
|
@@ -94,7 +95,7 @@ export const DECISION_PROVIDER_KEYS = ["jev", "parallel", "openrouter"];
|
|
|
94
95
|
* decision provider's (DECISION_PROVIDER_KEYS), a
|
|
95
96
|
* catalog tool (`mcp:<server>/<tool>`, `monid:<provider>/<endpoint>`), or a group's wildcard (`mcp:<server>/*`,
|
|
96
97
|
* `monid:<provider>/*`), which sets each of its tools. */
|
|
97
|
-
const isSettingsKey = (name) => parseToolName(name) !== undefined && (isTableTool(name) || SERVE_OWN_TOOLS.includes(name) || KIND_KEYS.includes(name) || DECISION_PROVIDER_KEYS.includes(name) ||
|
|
98
|
+
const isSettingsKey = (name) => parseToolName(name) !== undefined && (isTableTool(name) || SERVE_OWN_TOOLS.includes(name) || KIND_KEYS.includes(name) || DECISION_PROVIDER_KEYS.includes(name) || isCatalogName(name));
|
|
98
99
|
/** The longest pinned string. */
|
|
99
100
|
export const MAX_PIN_TEXT = 1024;
|
|
100
101
|
/** A pinned argument's name: a top-level argument of the tool, as MCP tools name theirs. */
|
|
@@ -406,6 +407,12 @@ export function settingsIssues(value, at = "", layer = "server") {
|
|
|
406
407
|
return [{ field: field(name, key), reason: "not_allowed", message: `A policy is set on bash in an agent's own tool settings (definition.tool_settings.bash.policy), never ${layer === "agent" ? `on ${name}` : "in the server's"}.` }];
|
|
407
408
|
return BASH_POLICIES.includes(given) ? [] : [{ field: field(name, key), reason: "not_an_option", message: `${field(name, key)} is one of ${BASH_POLICIES.join(", ")}: read-only refuses, before it runs, any command that could write, run code or read outside the run's folder` }];
|
|
408
409
|
}
|
|
410
|
+
// An email tool's scope (email/tools.ts): an agent's own, on email_read, email_search and email_file only, set as bash's policy is.
|
|
411
|
+
if (key === "scope") {
|
|
412
|
+
if (layer !== "agent" || !SCOPED_TOOLS.includes(name))
|
|
413
|
+
return [{ field: field(name, key), reason: "not_allowed", message: `A scope is set on ${SCOPED_WORDS} in an agent's own tool settings (definition.tool_settings.email_read.scope), never ${layer === "agent" ? `on ${name}` : "in the server's"}.` }];
|
|
414
|
+
return EMAIL_SCOPES.includes(given) ? [] : [{ field: field(name, key), reason: "not_an_option", message: `${field(name, key)} is one of ${EMAIL_SCOPES.join(", ")}: thread, an email's run reads its thread alone; mailbox, the whole account` }];
|
|
415
|
+
}
|
|
409
416
|
// The server's own mark of a pin in its file that does not read (withDefaults serves it), which a whole-map save
|
|
410
417
|
// sends back: it keeps the broken pin, and nothing else. Never an agent's.
|
|
411
418
|
if (key === "pin_broken") {
|
|
@@ -440,7 +447,7 @@ export function canonicalToolSettings(map) {
|
|
|
440
447
|
return sorted(Object.fromEntries(Object.entries(map).flatMap(([name, setting]) => {
|
|
441
448
|
if (!setting)
|
|
442
449
|
return [];
|
|
443
|
-
const kept = sorted({ ...(setting.permission ? { permission: setting.permission } : {}), ...(setting.allow_reads === true ? { allow_reads: true } : {}), ...(setting.pin ? { pin: sortedPin(setting.pin) } : {}), ...(setting.policy ? { policy: setting.policy } : {}), ...(setting.provider ? { provider: setting.provider } : {}) });
|
|
450
|
+
const kept = sorted({ ...(setting.permission ? { permission: setting.permission } : {}), ...(setting.allow_reads === true ? { allow_reads: true } : {}), ...(setting.pin ? { pin: sortedPin(setting.pin) } : {}), ...(setting.policy ? { policy: setting.policy } : {}), ...(setting.scope ? { scope: setting.scope } : {}), ...(setting.provider ? { provider: setting.provider } : {}) });
|
|
444
451
|
return Object.keys(kept).length ? [[name, kept]] : [];
|
|
445
452
|
})));
|
|
446
453
|
}
|
package/dist/tools.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import "./email/labels.js";
|
|
1
2
|
import type { TSchema } from "typebox";
|
|
2
3
|
import { type Extension, type Harness, type ToolRegistration, type Tx } from "@earendil-works/pi-durable";
|
|
3
4
|
import type { Revision } from "./agent-rows.js";
|
|
@@ -8,6 +9,7 @@ import { type Ledger, type PaidBooking } from "./paid-calls.js";
|
|
|
8
9
|
import type { Refusal } from "@parcha/agentrun-kernel";
|
|
9
10
|
import { type ShellPlace } from "@parcha/agentrun-kernel/kernel";
|
|
10
11
|
import { type SearchOn } from "./web-search.js";
|
|
12
|
+
import { type WebFake } from "./web-fake.js";
|
|
11
13
|
import { type Plane, type Resolution, type Tooling, type ToolSettingsMap } from "./tool-plane.js";
|
|
12
14
|
import type { DenyFrom, SettingFrom } from "./tool-gate.js";
|
|
13
15
|
import type { LiveHandover, LiveViewerStore } from "./browser-live.js";
|
|
@@ -76,7 +78,19 @@ export type ToolHost = {
|
|
|
76
78
|
liveAt?: RunnerLive;
|
|
77
79
|
/** The one store, for the live-viewer seam above, the run's saved sign-in (its runs and sign-ins, read under `claim`),
|
|
78
80
|
* the sign-in verify the runner saves, and the Screen tab's ended state (settings: browser-wait-ended.ts). */
|
|
79
|
-
store?: LiveViewerStore & Pick<Store, "runs" | "signIns" | "settings">;
|
|
81
|
+
store?: LiveViewerStore & Pick<Store, "runs" | "signIns" | "settings" | "sealedKeys">;
|
|
82
|
+
/** The trigger that started the run, and its source's kind (run-launch.ts trigger, inputOrigin): an email's run reads
|
|
83
|
+
* its thread alone (email/tools.ts). Absent: a person's run, or one no trigger started. */
|
|
84
|
+
startedBy?: {
|
|
85
|
+
readonly trigger: {
|
|
86
|
+
readonly id: string;
|
|
87
|
+
readonly firing_key: string;
|
|
88
|
+
readonly attrs?: Readonly<Record<string, string>>;
|
|
89
|
+
};
|
|
90
|
+
readonly source: string;
|
|
91
|
+
};
|
|
92
|
+
/** The agent's own tool settings (its revision's tool_settings), as its gate reads them: an email read tool's `scope`. */
|
|
93
|
+
toolSettings?: unknown;
|
|
80
94
|
/** The claim this run is held under: the live-viewer rows are written under it (its epoch fences them), and the run's
|
|
81
95
|
* saved sign-in is read and its hand kept under it. Present, the run is on the runner: never the process's own pipe. */
|
|
82
96
|
claim?: Claim;
|
|
@@ -107,6 +121,28 @@ export type ToolHost = {
|
|
|
107
121
|
/** The run's own models a native web_search goes through (hosted-search.ts), asked as a search runs: on the runner, the
|
|
108
122
|
* session's port (its proxy, policy, key, price and cap), this run's alone. Absent: a native search has no model. */
|
|
109
123
|
search?: SearchOn;
|
|
124
|
+
/** A template eval's web fake for this run (web-fake.ts): its web_search and web_fetch answer from it, never the
|
|
125
|
+
* network. Only the eval's own runner sets it (runner/beside.ts evalFakes). Absent: the plane's providers. */
|
|
126
|
+
web?: WebFake;
|
|
127
|
+
/** The run's clock where a template eval case sets one (its `now`): a draft's or a send's Date reads it. Absent: the real
|
|
128
|
+
* clock. */
|
|
129
|
+
now?: Date;
|
|
130
|
+
/** A template eval case's fake mail account (eval-mailbox.ts), the only account the run's email tools open: one saved
|
|
131
|
+
* elsewhere is refused. Only the eval's own runner sets it (runner/beside.ts evalFakes). */
|
|
132
|
+
emailFake?: EmailFake;
|
|
133
|
+
};
|
|
134
|
+
/** A fake mail account's servers, on loopback (email/email-faux.ts), and the kind of server it plays: what email_file's
|
|
135
|
+
* description says, which a loopback account saved as `other` would otherwise read as folders. */
|
|
136
|
+
export type EmailFake = {
|
|
137
|
+
readonly imap: {
|
|
138
|
+
readonly host: string;
|
|
139
|
+
readonly port: number;
|
|
140
|
+
};
|
|
141
|
+
readonly smtp: {
|
|
142
|
+
readonly host: string;
|
|
143
|
+
readonly port: number;
|
|
144
|
+
};
|
|
145
|
+
readonly kind: "gmail" | "folders";
|
|
110
146
|
};
|
|
111
147
|
/** What a name stands for in the run: the pi tools it offers, and the extensions a conversation selects for them. */
|
|
112
148
|
export type ToolBinding = {
|
|
@@ -123,6 +159,12 @@ export type EffectRun = {
|
|
|
123
159
|
ledger?: Ledger;
|
|
124
160
|
search?: SearchOn;
|
|
125
161
|
};
|
|
162
|
+
/** What a tool's own ask (ToolEntry.asks) reads: the run's host, and how many calls of a tool the run has run to a good
|
|
163
|
+
* end, from the run's record (its journal), so a pause and a new host count them all. */
|
|
164
|
+
export type AskContext = {
|
|
165
|
+
readonly host: ToolHost;
|
|
166
|
+
ran(tool: string): Promise<number>;
|
|
167
|
+
};
|
|
126
168
|
export type ToolEntry = {
|
|
127
169
|
/** One line, for capabilities. */
|
|
128
170
|
summary: string;
|
|
@@ -142,6 +184,12 @@ export type ToolEntry = {
|
|
|
142
184
|
/** No agent whose place is a sandbox may name it: it writes the run's work/ from this machine by paths a box's command
|
|
143
185
|
* could turn through a link (runnable.ts). */
|
|
144
186
|
runnerOnly?: true;
|
|
187
|
+
/** On the runner, before the intent of a call its setting allows: why this call asks a person anyway, in words (shown
|
|
188
|
+
* on its approval), or nothing. No setting lifts it; where no one can approve, the call is refused in those words. */
|
|
189
|
+
asks?(args: Record<string, unknown>, ctx: AskContext): Promise<string | undefined>;
|
|
190
|
+
/** What a call waiting on approval does, in a person's words (run-view.ts, the pending approval's `summary`): email_send's
|
|
191
|
+
* to whom and what. Undefined where its arguments do not say. */
|
|
192
|
+
approvalSummary?(args: unknown): string | undefined;
|
|
145
193
|
};
|
|
146
194
|
/** Where the browser files what it reads: the run's `evidence/`, through its Workspace, so the run's files show it and
|
|
147
195
|
* the agent can read it back. A text body follows one line of the read's facts; a capture's bytes go beside its facts.
|
|
@@ -222,7 +270,8 @@ export declare const CALL_TOOLS: readonly string[];
|
|
|
222
270
|
export declare const allows: (allowed: readonly string[], name: string) => boolean;
|
|
223
271
|
/** The tools a run's learned workflow may name (learn/check.ts at learn time, learned-workflow.ts at a call): those of the
|
|
224
272
|
* agent's `granted` tools a workflow's call node runs here (CALL_TOOLS, and each MCP tool granted by its own name,
|
|
225
|
-
* tool-names.ts mcpNameOf
|
|
273
|
+
* tool-names.ts mcpNameOf), and with the run's `plane`, none it resolves unavailable (its agent's own tool of the name
|
|
274
|
+
* does not run either). A
|
|
226
275
|
* learned model node runs without tools (learn/skills.ts MODEL_NODE_TOOLS), and a harness's own tool (Bash,
|
|
227
276
|
* exec_command, apply_patch) is never one, so the DSL refuses a draft that names it. */
|
|
228
277
|
export declare const learnedWorkflowTools: (granted: readonly string[], plane?: Plane, options?: LearnedMcp) => string[];
|
|
@@ -235,13 +284,6 @@ export type LearnedMcp = {
|
|
|
235
284
|
readonly mcp?: boolean;
|
|
236
285
|
readonly approvers?: boolean;
|
|
237
286
|
};
|
|
238
|
-
/** `granted` with each MCP server's wildcard (`mcp:<server>/*`) read as the tools its server lists now (`listed`, by the
|
|
239
|
-
* server's name: none for a server not saved), each `mcp:<server>/<tool>`, in place; every other name as it is, each
|
|
240
|
-
* once. What a revision grants under a wildcard is every tool of its server, so a learned draft may name each one
|
|
241
|
-
* (learnedWorkflowTools), its gate holding it as any tool (learnedDraftTools: the wildcard's setting, or the tool's own).
|
|
242
|
-
* At proposal time there is no run and no pin: whether the run's pin has the tool is the runtime's to check at the call,
|
|
243
|
-
* in the gate's words (learned-workflow.ts). */
|
|
244
|
-
export declare function mcpGrantsListed(granted: readonly string[], listed: (server: string) => readonly string[]): string[];
|
|
245
287
|
/** The tools a learned draft may name (learnedWorkflowTools) that the gate allows: `permission` is what the gate holds a
|
|
246
288
|
* tool to now (tool-gate.ts permissionOf, or the run's gate's policy), by its settings key. One set to ask or deny is left out of `tools`, so the end-of-run prompt never offers it, and named
|
|
247
289
|
* in `gated` with its setting, which the checker and a learned workflow's check before it runs refuse a draft for. */
|
|
@@ -249,7 +291,6 @@ export declare const learnedDraftTools: (granted: readonly string[], permission:
|
|
|
249
291
|
tools: string[];
|
|
250
292
|
gated: Record<string, string>;
|
|
251
293
|
deniedBy: Record<string, DenyFrom>;
|
|
252
|
-
asked: string[];
|
|
253
294
|
};
|
|
254
295
|
/** The tools a workflow names (`nodes` from workflowNodes): on its model nodes (`tools`), and on its `call` nodes
|
|
255
296
|
* `via: "tool"` (`tool`). */
|
|
@@ -291,11 +332,11 @@ export declare const toolsView: (env: NodeJS.ProcessEnv, settings?: ToolSettings
|
|
|
291
332
|
default_provider?: string | undefined;
|
|
292
333
|
resolves?: Record<"opencode" | "codex" | "pi" | "claude-agent", Resolution> | undefined;
|
|
293
334
|
why?: Record<"opencode" | "codex" | "pi" | "claude-agent", string> | undefined;
|
|
294
|
-
default_permission: "
|
|
295
|
-
permissions: ("
|
|
335
|
+
default_permission: "allow" | "ask" | "deny";
|
|
336
|
+
permissions: ("allow" | "ask" | "deny")[];
|
|
296
337
|
fallback_allow_reads?: true | undefined;
|
|
297
338
|
allow_reads?: true | undefined;
|
|
298
|
-
permission: "
|
|
339
|
+
permission: "allow" | "ask" | "deny";
|
|
299
340
|
harnesses: ("opencode" | "codex" | "pi" | "claude-agent")[];
|
|
300
341
|
missing?: string[] | undefined;
|
|
301
342
|
reason?: string | undefined;
|
|
@@ -308,11 +349,11 @@ export declare const toolsView: (env: NodeJS.ProcessEnv, settings?: ToolSettings
|
|
|
308
349
|
name: string;
|
|
309
350
|
summary: string;
|
|
310
351
|
} | {
|
|
311
|
-
default_permission: "
|
|
312
|
-
permissions: ("
|
|
352
|
+
default_permission: "allow" | "ask" | "deny";
|
|
353
|
+
permissions: ("allow" | "ask" | "deny")[];
|
|
313
354
|
fallback_allow_reads?: true | undefined;
|
|
314
355
|
allow_reads?: true | undefined;
|
|
315
|
-
permission: "
|
|
356
|
+
permission: "allow" | "ask" | "deny";
|
|
316
357
|
name: string;
|
|
317
358
|
summary: string;
|
|
318
359
|
blurb: string;
|
package/dist/tools.js
CHANGED
|
@@ -5,7 +5,10 @@
|
|
|
5
5
|
// run's folder or its computer. `bash` and the background tools may be named only by an agent whose place is a box
|
|
6
6
|
// (runnable.ts).
|
|
7
7
|
import { blurbOf, isHostTool } from "./tool-list.js";
|
|
8
|
-
import {
|
|
8
|
+
import { EMAIL_DESCRIPTIONS, EMAIL_DRAFT, EMAIL_FILE, EMAIL_READ, EMAIL_SEARCH, EMAIL_SEND, fileSummary, sendSummary } from "./email/names.js";
|
|
9
|
+
// The email tools' timeline lines (registerLabel), registered as this module loads.
|
|
10
|
+
import "./email/labels.js";
|
|
11
|
+
import { mcpNameOf } from "./tool-names.js";
|
|
9
12
|
import { appendFileSync } from "node:fs";
|
|
10
13
|
import { pathToFileURL } from "node:url";
|
|
11
14
|
import { defineExtension, defineTool, ROOT_CONVERSATION_ID } from "@earendil-works/pi-durable";
|
|
@@ -25,6 +28,7 @@ import { browserPrice, browserSpend } from "./browser-cost.js";
|
|
|
25
28
|
import { forModel } from "./result.js";
|
|
26
29
|
import { fetchFor, pagesOf, WEB_FETCH_TOOL, webFetchTool } from "./web-fetch.js";
|
|
27
30
|
import { searchFor, WEB_SEARCH_TOOL, webSearchTool } from "./web-search.js";
|
|
31
|
+
import { fakeFetch, fakeSearch } from "./web-fake.js";
|
|
28
32
|
import { browserNeeds, explainsView, isUnavailable, NO_PARALLEL_KEY, PICKABLE, planeOf, PROVIDERS, serverGate, whyUnavailable, withDefaults } from "./tool-plane.js";
|
|
29
33
|
import { fauxFetch, PARALLEL_KEY_ENV } from "./decisions.js";
|
|
30
34
|
import { keyNeeded } from "./key-words.js";
|
|
@@ -80,13 +84,24 @@ const callOnly = (summary, effect) => ({
|
|
|
80
84
|
summary, needs: [], nodes: false, callOnly: true, effect,
|
|
81
85
|
bind: async () => { throw new Error("a call-only tool binds no agent tool"); },
|
|
82
86
|
});
|
|
87
|
+
/** An email tool, its summary its description (email/names.ts), its binding (email/tools.ts bindEmail) and email_send's
|
|
88
|
+
* own ask (sendAsks) loaded at first use, the mail libraries with them. */
|
|
89
|
+
const emailTool = (name) => ({
|
|
90
|
+
summary: EMAIL_DESCRIPTIONS[name],
|
|
91
|
+
needs: [],
|
|
92
|
+
nodes: false,
|
|
93
|
+
bind: async (host) => (await import("./email/tools.js")).bindEmail(name, host),
|
|
94
|
+
...(name === EMAIL_SEND ? { approvalSummary: sendSummary, asks: async (args, ctx) => (await import("./email/tools.js")).sendAsks(args, ctx) } : {}),
|
|
95
|
+
...(name === EMAIL_FILE ? { approvalSummary: fileSummary } : {}),
|
|
96
|
+
});
|
|
83
97
|
/** web_fetch, bound under `name`. */
|
|
84
98
|
const webFetchEntry = (name) => ({
|
|
85
99
|
summary: `Read one public web page from a public host through the guarded direct fetch, or through Parallel's extract where Parallel is picked (falling back to the direct fetch, saying why, when Parallel answers no page), a part at a time (offset, max_chars; the page fetched once a run): { ok, url, status, title, text, chars, truncated?, original_chars?, beyond_read?, offset?, next_offset?, html_chars?, converted?, links, links_omitted?, via, parallel?, refused?, error? }; html_chars, the page's whole length, when its HTML was cut at ${HTML_READ_CHARS.toLocaleString("en-US")} characters before it was read, so its text is only the start of the page; converted: "text" when the text is plain text, its conversion to markdown having run out of time; a private or local address, a port other than 80 or 443, or a scheme other than http(s) is refused, never sent to Parallel.`,
|
|
86
100
|
needs: [],
|
|
87
101
|
nodes: true,
|
|
88
102
|
bind: async (host) => {
|
|
89
|
-
const
|
|
103
|
+
const web = host.web;
|
|
104
|
+
const tool = booking(webFetchTool(host.env, name, web && ((url, part) => fakeFetch(web, url, part))));
|
|
90
105
|
const extension = defineExtension({ name: name.replaceAll("_", "-"), tools: [tool] });
|
|
91
106
|
host.install(extension);
|
|
92
107
|
return { tools: [tool], extensions: [extension] };
|
|
@@ -578,9 +593,17 @@ export const TOOLS = Object.freeze({
|
|
|
578
593
|
needs: [],
|
|
579
594
|
nodes: true,
|
|
580
595
|
// On the runner its hosted search goes through the run's own route (host.search, run.search), labelled web_search.
|
|
581
|
-
|
|
596
|
+
// A template eval's web fake (host.web) answers in the provider's place.
|
|
597
|
+
bind: async (host) => installTool(host, "web-search", booking(webSearchTool(host.env, host.search, host.web && ((args, provider) => fakeSearch(host.web, args, provider))))),
|
|
582
598
|
effect: async (args, run) => bookedIn(run.ledger, () => searchFor(run.env, args, run.signal, run.search)),
|
|
583
599
|
},
|
|
600
|
+
// The email tools (email/tools.ts) on the server's one email account (Settings → Email), every harness's as web_fetch is;
|
|
601
|
+
// the mail libraries load at the first bind.
|
|
602
|
+
[EMAIL_SEARCH]: emailTool(EMAIL_SEARCH),
|
|
603
|
+
[EMAIL_READ]: emailTool(EMAIL_READ),
|
|
604
|
+
[EMAIL_DRAFT]: emailTool(EMAIL_DRAFT),
|
|
605
|
+
[EMAIL_SEND]: emailTool(EMAIL_SEND),
|
|
606
|
+
[EMAIL_FILE]: emailTool(EMAIL_FILE),
|
|
584
607
|
browser: browserTool,
|
|
585
608
|
// A pi run's subagent (runner/subagent.ts): a native tool of the run's root agent, bound by the runner's pi spec
|
|
586
609
|
// (adapter-run-spec.ts), never by this table; not a host tool (tool-list.ts `replay`), so another harness refuses it.
|
|
@@ -605,52 +628,34 @@ export const CALL_TOOLS = Object.keys(TOOLS).filter((name) => TOOLS[name].effect
|
|
|
605
628
|
export const allows = (allowed, name) => allowed.includes(name);
|
|
606
629
|
/** The tools a run's learned workflow may name (learn/check.ts at learn time, learned-workflow.ts at a call): those of the
|
|
607
630
|
* agent's `granted` tools a workflow's call node runs here (CALL_TOOLS, and each MCP tool granted by its own name,
|
|
608
|
-
* tool-names.ts mcpNameOf
|
|
631
|
+
* tool-names.ts mcpNameOf), and with the run's `plane`, none it resolves unavailable (its agent's own tool of the name
|
|
632
|
+
* does not run either). A
|
|
609
633
|
* learned model node runs without tools (learn/skills.ts MODEL_NODE_TOOLS), and a harness's own tool (Bash,
|
|
610
634
|
* exec_command, apply_patch) is never one, so the DSL refuses a draft that names it. */
|
|
611
635
|
export const learnedWorkflowTools = (granted, plane, options = {}) => [...new Set(granted.filter((name) => (options.mcp === true && mcpNameOf(name) !== undefined) || (allows(CALL_TOOLS, name) && !isUnavailable(plane?.[name]))))];
|
|
612
|
-
/** `granted` with each MCP server's wildcard (`mcp:<server>/*`) read as the tools its server lists now (`listed`, by the
|
|
613
|
-
* server's name: none for a server not saved), each `mcp:<server>/<tool>`, in place; every other name as it is, each
|
|
614
|
-
* once. What a revision grants under a wildcard is every tool of its server, so a learned draft may name each one
|
|
615
|
-
* (learnedWorkflowTools), its gate holding it as any tool (learnedDraftTools: the wildcard's setting, or the tool's own).
|
|
616
|
-
* At proposal time there is no run and no pin: whether the run's pin has the tool is the runtime's to check at the call,
|
|
617
|
-
* in the gate's words (learned-workflow.ts). */
|
|
618
|
-
export function mcpGrantsListed(granted, listed) {
|
|
619
|
-
const out = new Set();
|
|
620
|
-
for (const name of granted) {
|
|
621
|
-
const parsed = parseToolName(name);
|
|
622
|
-
if (parsed?.kind !== "mcp-server")
|
|
623
|
-
out.add(name);
|
|
624
|
-
else
|
|
625
|
-
for (const tool of listed(parsed.server))
|
|
626
|
-
out.add(mcpToolName(parsed.server, tool));
|
|
627
|
-
}
|
|
628
|
-
return [...out];
|
|
629
|
-
}
|
|
630
636
|
/** The tools a learned draft may name (learnedWorkflowTools) that the gate allows: `permission` is what the gate holds a
|
|
631
637
|
* tool to now (tool-gate.ts permissionOf, or the run's gate's policy), by its settings key. One set to ask or deny is left out of `tools`, so the end-of-run prompt never offers it, and named
|
|
632
638
|
* in `gated` with its setting, which the checker and a learned workflow's check before it runs refuse a draft for. */
|
|
633
639
|
export const learnedDraftTools = (granted, permission, plane, from, options = {}) => {
|
|
634
640
|
const gated = {};
|
|
635
|
-
// The MCP tools offered because they ask: the ones a learned call's approval card names (#2424).
|
|
636
|
-
const asked = [];
|
|
637
641
|
// Where each deny was set (this agent's settings or this server's), so the refusal names it.
|
|
638
642
|
const deniedBy = {};
|
|
639
643
|
const tools = learnedWorkflowTools(granted, plane, options).filter((name) => {
|
|
640
644
|
const setting = permission(name);
|
|
641
|
-
// An MCP tool set to ask is offered where someone can answer: its learned_workflow call
|
|
642
|
-
//
|
|
645
|
+
// An MCP tool set to ask is offered where someone can answer: its learned_workflow call's one card names each of its
|
|
646
|
+
// MCP actions set to ask (learned-workflow.ts learnedAskShown). A table tool set to ask is not: its call node can't
|
|
647
|
+
// wait for an approval.
|
|
643
648
|
if (setting === "allow")
|
|
644
649
|
return true;
|
|
645
650
|
if (setting === "ask" && options.approvers === true && mcpNameOf(name) !== undefined)
|
|
646
|
-
return
|
|
651
|
+
return true;
|
|
647
652
|
gated[name] = setting;
|
|
648
653
|
// A deny comes from a layer or the default, never from approvals, which only ever allows.
|
|
649
654
|
if (setting === "deny" && from)
|
|
650
655
|
deniedBy[name] = from(name);
|
|
651
656
|
return false;
|
|
652
657
|
});
|
|
653
|
-
return { tools, gated, deniedBy
|
|
658
|
+
return { tools, gated, deniedBy };
|
|
654
659
|
};
|
|
655
660
|
/** The tools a workflow names (`nodes` from workflowNodes): on its model nodes (`tools`), and on its `call` nodes
|
|
656
661
|
* `via: "tool"` (`tool`). */
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import type { InputIssue } from "./errors.js";
|
|
2
2
|
import type { SettingsSpec } from "./sealed-settings-store.js";
|
|
3
3
|
type Json = Record<string, unknown>;
|
|
4
|
+
/** Whether a run `adapter`'s firing starts is handed its trigger's last completed result: the one place it is decided
|
|
5
|
+
* (its previousResult, by default true). */
|
|
6
|
+
export declare const carriesPrevious: (adapter: Pick<TriggerAdapter, "previousResult">) => boolean;
|
|
7
|
+
/** The most of a firing's payload passed on, in bytes of UTF-8 (triggers.ts cuts past it, at a character's start). A
|
|
8
|
+
* source that answers JSON fits its payload within it first (trigger-email.ts), so its JSON is never cut. */
|
|
9
|
+
export declare const PAYLOAD_KEPT_BYTES: number;
|
|
4
10
|
/** A source as the store keeps it: its kind, the adapter's id, and the adapter's own fields. */
|
|
5
11
|
export type Source = {
|
|
6
12
|
kind: string;
|
|
@@ -19,19 +25,19 @@ export type TriggerAdapter = {
|
|
|
19
25
|
id: string;
|
|
20
26
|
/** How a person names one: `the <label> "<name>"`, in each run's provenance line. */
|
|
21
27
|
label: string;
|
|
22
|
-
/** `clock`: it fires on its own times, read by the engine's timer. `push`: a request delivered to the server fires it,
|
|
28
|
+
/** `clock`: it fires on its own times, read by the engine's timer (a source that polls, on each). `push`: a request delivered to the server fires it,
|
|
23
29
|
* keyed by the sender's own id, which a retry repeats. */
|
|
24
30
|
delivery: "clock" | "push";
|
|
31
|
+
/** Whether a run it starts is handed its trigger's last completed result (trigger-targets.ts previousResultOf). Default
|
|
32
|
+
* true: a repeat run (a schedule's weekly digest) leaves out what the last one reported. false: each firing is a
|
|
33
|
+
* different person's (an email's sender), so one run's answer is never handed to the next. */
|
|
34
|
+
previousResult?: boolean;
|
|
25
35
|
/** Whether its words are its owner's (a run's message origin `owner`): true only when the owner wrote them as they set
|
|
26
36
|
* it up; never for words that come from outside. */
|
|
27
37
|
owner: boolean;
|
|
28
38
|
/** What it keeps sealed (sealed-settings-store.ts), for the server or for each trigger: a field it mints (a signing secret)
|
|
29
39
|
* is made at a trigger's create and at a rotation, shown once, and goes with the trigger. */
|
|
30
40
|
settings?: SettingsSpec;
|
|
31
|
-
/** Whether a trigger of this source keeps a secret its sender gave (a create's and a rotation's `secret`, Composio's)
|
|
32
|
-
* instead of one this server mints: then the secret is required there, sealed as a minted one is, and never made
|
|
33
|
-
* here. Default: it mints. */
|
|
34
|
-
givesSecret?(source: Source): boolean;
|
|
35
41
|
/** Its shapes as a create's error names them: `{kind: "..."}` with its fields. */
|
|
36
42
|
describe: string;
|
|
37
43
|
/** When it fires, for the OpenAPI document's source description. */
|
|
@@ -57,6 +63,9 @@ export type TriggerAdapter = {
|
|
|
57
63
|
/** A pushed source's requests (push-handler.ts), served at /v2/hooks/{trigger_id} when its settings are a trigger's,
|
|
58
64
|
* else at /v2/hooks/{its id}, with no token: the request's check is its credential. */
|
|
59
65
|
push?: Push;
|
|
66
|
+
/** For a pushed source whose hook is not the one its settings' scope gives (a source that keeps a key per scope, served
|
|
67
|
+
* at /v2/hooks/{its id}/{scope}): the path under /v2/hooks/ a trigger of `source` is delivered at, its `hook_url`. */
|
|
68
|
+
hookOf?(source: Source): string;
|
|
60
69
|
/** For a pushed source whose settings are the server's: the scope a trigger of it listens on, matched to each event's
|
|
61
70
|
* `scope` to find the triggers it fires. */
|
|
62
71
|
scopeOf?(source: Source): string;
|
|
@@ -67,6 +76,44 @@ export type TriggerAdapter = {
|
|
|
67
76
|
/** Whether each firing of a trigger of `source` starts its own run, its last run active or not (a webhook that takes
|
|
68
77
|
* only the events it names). Default false: a firing while the last run is active is skipped. */
|
|
69
78
|
concurrent?(source: Source): boolean;
|
|
79
|
+
/** For a clock source that polls (the email trigger): what it finds when its time comes, read from outside the server.
|
|
80
|
+
* The engine fires each event it returns through the path a pushed event takes (`takes`, `concurrent`,
|
|
81
|
+
* max_active_runs, the day-kept keys, a run per event), records no `missed` row for a time it was not there for, and
|
|
82
|
+
* keeps the poll's cursor once its firings are recorded. A poll with no cursor is where its trigger starts watching:
|
|
83
|
+
* the engine polls at once when the trigger is made, turned on again (its cursor and last check forgotten first) or its
|
|
84
|
+
* source edited (its cursor kept: a poll whose cursor was read elsewhere starts over itself). */
|
|
85
|
+
poll?(source: Source, ctx: PollContext): Promise<PollResult>;
|
|
86
|
+
/** A run's title after its trigger's name, from what its source says of the firing (its attrs): an email's sender and
|
|
87
|
+
* subject. Default: the event and action the attrs name. */
|
|
88
|
+
title?(attrs: Record<string, string>): string | undefined;
|
|
89
|
+
};
|
|
90
|
+
/** What a poll is given: its trigger's own settings (its cursor, public, as the adapter's `settings` names them) and the
|
|
91
|
+
* source's credentials, read now (TriggerDeps.credentials: the email account, opened). */
|
|
92
|
+
export type PollContext = {
|
|
93
|
+
trigger: string;
|
|
94
|
+
setting(field: string): string | undefined;
|
|
95
|
+
credentials(): Promise<unknown>;
|
|
96
|
+
};
|
|
97
|
+
/** One event a poll found: a pushed event's fields; `cursor`, the settings to keep once it and every event before it are
|
|
98
|
+
* recorded; `left`, when it is recorded as skipped and starts nothing, why (in words). */
|
|
99
|
+
export type PolledEvent = PushEvent & {
|
|
100
|
+
cursor: Record<string, string>;
|
|
101
|
+
left?: string;
|
|
102
|
+
};
|
|
103
|
+
/** What a poll found: `check`, said on the trigger as its last check; `refused`, the source's credentials refused (the
|
|
104
|
+
* engine turns the trigger off at the third in a row, `detail` its words); `note`, one history line that starts no run
|
|
105
|
+
* (a first poll's, a reset's); `events`, oldest first; `cursor`, the settings to keep once every event is recorded. */
|
|
106
|
+
export type PollResult = {
|
|
107
|
+
check: {
|
|
108
|
+
ok: boolean;
|
|
109
|
+
message: string;
|
|
110
|
+
};
|
|
111
|
+
refused?: {
|
|
112
|
+
detail: string;
|
|
113
|
+
};
|
|
114
|
+
note?: string;
|
|
115
|
+
events?: PolledEvent[];
|
|
116
|
+
cursor?: Record<string, string>;
|
|
70
117
|
};
|
|
71
118
|
/** Request headers, as Node gives them. */
|
|
72
119
|
export type Headers = Record<string, string | string[] | undefined>;
|
|
@@ -77,6 +124,10 @@ export type Push = {
|
|
|
77
124
|
maxBodyBytes: number;
|
|
78
125
|
/** The settings field it checks a request with. */
|
|
79
126
|
key: string;
|
|
127
|
+
/** For a source whose settings are the server's: it keeps its key per scope (a Composio project's subscription, by its
|
|
128
|
+
* hook), and is served at /v2/hooks/{its id}/{scope} alone, each request checked with that scope's key; its events'
|
|
129
|
+
* `scope` is that scope, for its takes. */
|
|
130
|
+
scoped?: true;
|
|
80
131
|
/** Why the headers alone are refused, before a byte of the body is read. */
|
|
81
132
|
headers?(headers: Headers, nowMs: number): string | undefined;
|
|
82
133
|
/** Why the request is not the sender's under `key`, or undefined when it is (and fits `source`, when given). */
|
package/dist/trigger-adapter.js
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
import { unknownFields } from "./validate.js";
|
|
2
|
+
/** Whether a run `adapter`'s firing starts is handed its trigger's last completed result: the one place it is decided
|
|
3
|
+
* (its previousResult, by default true). */
|
|
4
|
+
export const carriesPrevious = (adapter) => adapter.previousResult ?? true;
|
|
5
|
+
/** The most of a firing's payload passed on, in bytes of UTF-8 (triggers.ts cuts past it, at a character's start). A
|
|
6
|
+
* source that answers JSON fits its payload within it first (trigger-email.ts), so its JSON is never cut. */
|
|
7
|
+
export const PAYLOAD_KEPT_BYTES = 16 * 1024;
|
|
2
8
|
/** A closed object schema: every field in `required` is, and `optional`'s may be. */
|
|
3
9
|
export const closedSchema = (required, optional = {}) => ({ type: "object", additionalProperties: false, required: Object.keys(required), properties: { ...required, ...optional } });
|
|
4
10
|
/** `value`'s fields past `allowed`, as issues under `source`. */
|
package/dist/trigger-adapters.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import { composio } from "./trigger-composio.js";
|
|
1
2
|
import { schedule } from "./trigger-schedule.js";
|
|
2
3
|
import { github } from "./trigger-github.js";
|
|
3
4
|
import { webhook } from "./trigger-webhook.js";
|
|
4
|
-
|
|
5
|
+
import { email } from "./trigger-email.js";
|
|
6
|
+
export const TRIGGER_ADAPTERS = [schedule, webhook, github, composio, email];
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type TriggerAdapter } from "./trigger-adapter.js";
|
|
2
|
+
/** A Composio trigger slug: upper case, digits and `_` (GITHUB_ISSUE_ADDED_EVENT). */
|
|
3
|
+
export declare const COMPOSIO_EVENT: RegExp;
|
|
4
|
+
/** The id of a project's route here, made once when its subscription is made or moved here. */
|
|
5
|
+
export declare const COMPOSIO_HOOK: RegExp;
|
|
6
|
+
/** The source's field the move of a subscription is asked with: at a create alone, never kept. */
|
|
7
|
+
export declare const MOVE_FIELD = "move_subscription";
|
|
8
|
+
/** The settings field the project's subscription secret is sealed under, one scope per hook. */
|
|
9
|
+
export declare const COMPOSIO_SECRET = "secret";
|
|
10
|
+
export declare const composio: TriggerAdapter;
|