@homeflare/alchemy 0.43.0 → 0.45.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/README.md +10 -1
- package/dist/caddy/index.js +35 -1
- package/dist/caddy/index.js.map +3 -3
- package/dist/launchd/index.js +35 -1
- package/dist/launchd/index.js.map +3 -3
- package/dist/linux/index.js +35 -1
- package/dist/linux/index.js.map +3 -3
- package/dist/litellm/access-group-form.d.ts +26 -0
- package/dist/litellm/access-group-form.d.ts.map +1 -0
- package/dist/litellm/access-group-operations.d.ts +37 -0
- package/dist/litellm/access-group-operations.d.ts.map +1 -0
- package/dist/litellm/access-group-types.d.ts +49 -0
- package/dist/litellm/access-group-types.d.ts.map +1 -0
- package/dist/litellm/access-group.d.ts +55 -0
- package/dist/litellm/access-group.d.ts.map +1 -0
- package/dist/litellm/credential-errors.d.ts +131 -0
- package/dist/litellm/credential-errors.d.ts.map +1 -0
- package/dist/litellm/credential-form.d.ts +79 -0
- package/dist/litellm/credential-form.d.ts.map +1 -0
- package/dist/litellm/credential-operations.d.ts +84 -0
- package/dist/litellm/credential-operations.d.ts.map +1 -0
- package/dist/litellm/credential-rewrite.d.ts +6 -0
- package/dist/litellm/credential-rewrite.d.ts.map +1 -0
- package/dist/litellm/credential-types.d.ts +87 -0
- package/dist/litellm/credential-types.d.ts.map +1 -0
- package/dist/litellm/credential-values.d.ts +53 -0
- package/dist/litellm/credential-values.d.ts.map +1 -0
- package/dist/litellm/credential.d.ts +83 -0
- package/dist/litellm/credential.d.ts.map +1 -0
- package/dist/litellm/fake-access-group-litellm.d.ts +34 -0
- package/dist/litellm/fake-access-group-litellm.d.ts.map +1 -0
- package/dist/litellm/fake-credential-litellm.d.ts +54 -0
- package/dist/litellm/fake-credential-litellm.d.ts.map +1 -0
- package/dist/litellm/fake-keys.d.ts +53 -0
- package/dist/litellm/fake-keys.d.ts.map +1 -0
- package/dist/litellm/fake-litellm.d.ts +4 -1
- package/dist/litellm/fake-litellm.d.ts.map +1 -1
- package/dist/litellm/fake-mcp-litellm.d.ts +67 -0
- package/dist/litellm/fake-mcp-litellm.d.ts.map +1 -0
- package/dist/litellm/fake-model-litellm-post-update.d.ts +49 -0
- package/dist/litellm/fake-model-litellm-post-update.d.ts.map +1 -0
- package/dist/litellm/fake-model-litellm.d.ts +48 -0
- package/dist/litellm/fake-model-litellm.d.ts.map +1 -0
- package/dist/litellm/fake-policy-attachment-litellm.d.ts +33 -0
- package/dist/litellm/fake-policy-attachment-litellm.d.ts.map +1 -0
- package/dist/litellm/fake-policy-litellm.d.ts +32 -0
- package/dist/litellm/fake-policy-litellm.d.ts.map +1 -0
- package/dist/litellm/fake-registry-base.d.ts +42 -0
- package/dist/litellm/fake-registry-base.d.ts.map +1 -0
- package/dist/litellm/fake-stack.d.ts +8 -1
- package/dist/litellm/fake-stack.d.ts.map +1 -1
- package/dist/litellm/fake-team-litellm.d.ts +47 -0
- package/dist/litellm/fake-team-litellm.d.ts.map +1 -0
- package/dist/litellm/fake-tool-litellm.d.ts +28 -0
- package/dist/litellm/fake-tool-litellm.d.ts.map +1 -0
- package/dist/litellm/fake-toolset-litellm.d.ts +29 -0
- package/dist/litellm/fake-toolset-litellm.d.ts.map +1 -0
- package/dist/litellm/index.d.ts +18 -0
- package/dist/litellm/index.d.ts.map +1 -1
- package/dist/litellm/index.js +3078 -2
- package/dist/litellm/index.js.map +65 -4
- package/dist/litellm/key-errors.d.ts +169 -0
- package/dist/litellm/key-errors.d.ts.map +1 -0
- package/dist/litellm/key-form.d.ts +119 -0
- package/dist/litellm/key-form.d.ts.map +1 -0
- package/dist/litellm/key-harness.d.ts +41 -0
- package/dist/litellm/key-harness.d.ts.map +1 -0
- package/dist/litellm/key-metadata-errors.d.ts +30 -0
- package/dist/litellm/key-metadata-errors.d.ts.map +1 -0
- package/dist/litellm/key-metadata.d.ts +22 -0
- package/dist/litellm/key-metadata.d.ts.map +1 -0
- package/dist/litellm/key-operations.d.ts +63 -0
- package/dist/litellm/key-operations.d.ts.map +1 -0
- package/dist/litellm/key-secret.d.ts +33 -0
- package/dist/litellm/key-secret.d.ts.map +1 -0
- package/dist/litellm/key.d.ts +78 -0
- package/dist/litellm/key.d.ts.map +1 -0
- package/dist/litellm/mcp-server-credential.d.ts +50 -0
- package/dist/litellm/mcp-server-credential.d.ts.map +1 -0
- package/dist/litellm/mcp-server-errors.d.ts +101 -0
- package/dist/litellm/mcp-server-errors.d.ts.map +1 -0
- package/dist/litellm/mcp-server-form.d.ts +56 -0
- package/dist/litellm/mcp-server-form.d.ts.map +1 -0
- package/dist/litellm/mcp-server-locate.d.ts +26 -0
- package/dist/litellm/mcp-server-locate.d.ts.map +1 -0
- package/dist/litellm/mcp-server-operations.d.ts +63 -0
- package/dist/litellm/mcp-server-operations.d.ts.map +1 -0
- package/dist/litellm/mcp-server-shadow.d.ts +24 -0
- package/dist/litellm/mcp-server-shadow.d.ts.map +1 -0
- package/dist/litellm/mcp-server-types.d.ts +118 -0
- package/dist/litellm/mcp-server-types.d.ts.map +1 -0
- package/dist/litellm/mcp-server-url.d.ts +11 -0
- package/dist/litellm/mcp-server-url.d.ts.map +1 -0
- package/dist/litellm/mcp-server.d.ts +95 -0
- package/dist/litellm/mcp-server.d.ts.map +1 -0
- package/dist/litellm/model-claim.d.ts +24 -0
- package/dist/litellm/model-claim.d.ts.map +1 -0
- package/dist/litellm/model-credential.d.ts +12 -0
- package/dist/litellm/model-credential.d.ts.map +1 -0
- package/dist/litellm/model-errors.d.ts +119 -0
- package/dist/litellm/model-errors.d.ts.map +1 -0
- package/dist/litellm/model-form.d.ts +78 -0
- package/dist/litellm/model-form.d.ts.map +1 -0
- package/dist/litellm/model-locate.d.ts +13 -0
- package/dist/litellm/model-locate.d.ts.map +1 -0
- package/dist/litellm/model-operations.d.ts +59 -0
- package/dist/litellm/model-operations.d.ts.map +1 -0
- package/dist/litellm/model-types.d.ts +91 -0
- package/dist/litellm/model-types.d.ts.map +1 -0
- package/dist/litellm/model.d.ts +88 -0
- package/dist/litellm/model.d.ts.map +1 -0
- package/dist/litellm/policy-attachment-form.d.ts +19 -0
- package/dist/litellm/policy-attachment-form.d.ts.map +1 -0
- package/dist/litellm/policy-attachment-operations.d.ts +31 -0
- package/dist/litellm/policy-attachment-operations.d.ts.map +1 -0
- package/dist/litellm/policy-attachment-types.d.ts +48 -0
- package/dist/litellm/policy-attachment-types.d.ts.map +1 -0
- package/dist/litellm/policy-attachment.d.ts +61 -0
- package/dist/litellm/policy-attachment.d.ts.map +1 -0
- package/dist/litellm/policy-form.d.ts +22 -0
- package/dist/litellm/policy-form.d.ts.map +1 -0
- package/dist/litellm/policy-operations.d.ts +42 -0
- package/dist/litellm/policy-operations.d.ts.map +1 -0
- package/dist/litellm/policy-types.d.ts +57 -0
- package/dist/litellm/policy-types.d.ts.map +1 -0
- package/dist/litellm/policy.d.ts +65 -0
- package/dist/litellm/policy.d.ts.map +1 -0
- package/dist/litellm/providers.d.ts +1 -1
- package/dist/litellm/providers.d.ts.map +1 -1
- package/dist/litellm/registry-errors.d.ts +62 -0
- package/dist/litellm/registry-errors.d.ts.map +1 -0
- package/dist/litellm/registry-support.d.ts +42 -0
- package/dist/litellm/registry-support.d.ts.map +1 -0
- package/dist/litellm/team-form.d.ts +26 -0
- package/dist/litellm/team-form.d.ts.map +1 -0
- package/dist/litellm/team-members.d.ts +10 -0
- package/dist/litellm/team-members.d.ts.map +1 -0
- package/dist/litellm/team-operations.d.ts +38 -0
- package/dist/litellm/team-operations.d.ts.map +1 -0
- package/dist/litellm/team-permission.d.ts +35 -0
- package/dist/litellm/team-permission.d.ts.map +1 -0
- package/dist/litellm/team-types.d.ts +101 -0
- package/dist/litellm/team-types.d.ts.map +1 -0
- package/dist/litellm/team.d.ts +67 -0
- package/dist/litellm/team.d.ts.map +1 -0
- package/dist/litellm/tool-policy-form.d.ts +21 -0
- package/dist/litellm/tool-policy-form.d.ts.map +1 -0
- package/dist/litellm/tool-policy-operations.d.ts +30 -0
- package/dist/litellm/tool-policy-operations.d.ts.map +1 -0
- package/dist/litellm/tool-policy-types.d.ts +46 -0
- package/dist/litellm/tool-policy-types.d.ts.map +1 -0
- package/dist/litellm/tool-policy.d.ts +62 -0
- package/dist/litellm/tool-policy.d.ts.map +1 -0
- package/dist/litellm/toolset-form.d.ts +20 -0
- package/dist/litellm/toolset-form.d.ts.map +1 -0
- package/dist/litellm/toolset-operations.d.ts +39 -0
- package/dist/litellm/toolset-operations.d.ts.map +1 -0
- package/dist/litellm/toolset-types.d.ts +46 -0
- package/dist/litellm/toolset-types.d.ts.map +1 -0
- package/dist/litellm/toolset.d.ts +55 -0
- package/dist/litellm/toolset.d.ts.map +1 -0
- package/dist/openbao/index.js +35 -1
- package/dist/openbao/index.js.map +3 -3
- package/dist/ownership/rows.d.ts +11 -0
- package/dist/ownership/rows.d.ts.map +1 -1
- package/dist/postgres/connection.d.ts +14 -2
- package/dist/postgres/connection.d.ts.map +1 -1
- package/dist/postgres/database-sql.d.ts +27 -8
- package/dist/postgres/database-sql.d.ts.map +1 -1
- package/dist/postgres/fake-grants-parse.d.ts +37 -0
- package/dist/postgres/fake-grants-parse.d.ts.map +1 -0
- package/dist/postgres/fake-grants-read.d.ts +61 -0
- package/dist/postgres/fake-grants-read.d.ts.map +1 -0
- package/dist/postgres/fake-grants-sql.d.ts +46 -0
- package/dist/postgres/fake-grants-sql.d.ts.map +1 -0
- package/dist/postgres/fake-grants-write.d.ts +29 -0
- package/dist/postgres/fake-grants-write.d.ts.map +1 -0
- package/dist/postgres/fake-role-sql.d.ts +41 -0
- package/dist/postgres/fake-role-sql.d.ts.map +1 -0
- package/dist/postgres/fake-schema-sql.d.ts +42 -0
- package/dist/postgres/fake-schema-sql.d.ts.map +1 -0
- package/dist/postgres/fake-sql-parse.d.ts +23 -0
- package/dist/postgres/fake-sql-parse.d.ts.map +1 -0
- package/dist/postgres/fake-sql-quote.d.ts +12 -0
- package/dist/postgres/fake-sql-quote.d.ts.map +1 -0
- package/dist/postgres/fake-sql.d.ts +42 -0
- package/dist/postgres/fake-sql.d.ts.map +1 -1
- package/dist/postgres/grants-attrs.d.ts +115 -0
- package/dist/postgres/grants-attrs.d.ts.map +1 -0
- package/dist/postgres/grants-declare.d.ts +88 -0
- package/dist/postgres/grants-declare.d.ts.map +1 -0
- package/dist/postgres/grants-diff.d.ts +25 -0
- package/dist/postgres/grants-diff.d.ts.map +1 -0
- package/dist/postgres/grants-errors.d.ts +137 -0
- package/dist/postgres/grants-errors.d.ts.map +1 -0
- package/dist/postgres/grants-existence.d.ts +14 -0
- package/dist/postgres/grants-existence.d.ts.map +1 -0
- package/dist/postgres/grants-ops.d.ts +65 -0
- package/dist/postgres/grants-ops.d.ts.map +1 -0
- package/dist/postgres/grants-ownership.d.ts +18 -0
- package/dist/postgres/grants-ownership.d.ts.map +1 -0
- package/dist/postgres/grants-plan-restore.d.ts +22 -0
- package/dist/postgres/grants-plan-restore.d.ts.map +1 -0
- package/dist/postgres/grants-plan.d.ts +65 -0
- package/dist/postgres/grants-plan.d.ts.map +1 -0
- package/dist/postgres/grants-read-defaults.d.ts +17 -0
- package/dist/postgres/grants-read-defaults.d.ts.map +1 -0
- package/dist/postgres/grants-read.d.ts +77 -0
- package/dist/postgres/grants-read.d.ts.map +1 -0
- package/dist/postgres/grants-refuse.d.ts +25 -0
- package/dist/postgres/grants-refuse.d.ts.map +1 -0
- package/dist/postgres/grants-sql.d.ts +42 -0
- package/dist/postgres/grants-sql.d.ts.map +1 -0
- package/dist/postgres/grants-words.d.ts +29 -0
- package/dist/postgres/grants-words.d.ts.map +1 -0
- package/dist/postgres/grants.d.ts +37 -0
- package/dist/postgres/grants.d.ts.map +1 -0
- package/dist/postgres/index.d.ts +31 -6
- package/dist/postgres/index.d.ts.map +1 -1
- package/dist/postgres/index.js +1998 -37
- package/dist/postgres/index.js.map +46 -7
- package/dist/postgres/installed-classifier.d.ts +13 -0
- package/dist/postgres/installed-classifier.d.ts.map +1 -0
- package/dist/postgres/providers.d.ts +16 -8
- package/dist/postgres/providers.d.ts.map +1 -1
- package/dist/postgres/psql-executor.d.ts +4 -0
- package/dist/postgres/psql-executor.d.ts.map +1 -1
- package/dist/postgres/role-attrs.d.ts +112 -0
- package/dist/postgres/role-attrs.d.ts.map +1 -0
- package/dist/postgres/role-diff.d.ts +22 -0
- package/dist/postgres/role-diff.d.ts.map +1 -0
- package/dist/postgres/role-errors.d.ts +132 -0
- package/dist/postgres/role-errors.d.ts.map +1 -0
- package/dist/postgres/role-membership-sql.d.ts +78 -0
- package/dist/postgres/role-membership-sql.d.ts.map +1 -0
- package/dist/postgres/role-provider.d.ts +11 -0
- package/dist/postgres/role-provider.d.ts.map +1 -0
- package/dist/postgres/role-scram.d.ts +8 -0
- package/dist/postgres/role-scram.d.ts.map +1 -0
- package/dist/postgres/role-secrets.d.ts +38 -0
- package/dist/postgres/role-secrets.d.ts.map +1 -0
- package/dist/postgres/role-sql.d.ts +68 -0
- package/dist/postgres/role-sql.d.ts.map +1 -0
- package/dist/postgres/role.d.ts +57 -0
- package/dist/postgres/role.d.ts.map +1 -0
- package/dist/postgres/schema-assert.d.ts +50 -0
- package/dist/postgres/schema-assert.d.ts.map +1 -0
- package/dist/postgres/schema-attrs.d.ts +51 -0
- package/dist/postgres/schema-attrs.d.ts.map +1 -0
- package/dist/postgres/schema-delete.d.ts +28 -0
- package/dist/postgres/schema-delete.d.ts.map +1 -0
- package/dist/postgres/schema-diff.d.ts +14 -0
- package/dist/postgres/schema-diff.d.ts.map +1 -0
- package/dist/postgres/schema-errors.d.ts +139 -0
- package/dist/postgres/schema-errors.d.ts.map +1 -0
- package/dist/postgres/schema-identity.d.ts +8 -0
- package/dist/postgres/schema-identity.d.ts.map +1 -0
- package/dist/postgres/schema-reconcile.d.ts +12 -0
- package/dist/postgres/schema-reconcile.d.ts.map +1 -0
- package/dist/postgres/schema-sql.d.ts +45 -0
- package/dist/postgres/schema-sql.d.ts.map +1 -0
- package/dist/postgres/schema-test-kit.d.ts +67 -0
- package/dist/postgres/schema-test-kit.d.ts.map +1 -0
- package/dist/postgres/schema.d.ts +54 -0
- package/dist/postgres/schema.d.ts.map +1 -0
- package/dist/proxmox/index.js +35 -1
- package/dist/proxmox/index.js.map +3 -3
- package/dist/release/fake-engine.d.ts +10 -0
- package/dist/release/fake-engine.d.ts.map +1 -1
- package/dist/release/index.js +35 -1
- package/dist/release/index.js.map +3 -3
- package/dist/valkey/acl-attrs.d.ts +94 -0
- package/dist/valkey/acl-attrs.d.ts.map +1 -0
- package/dist/valkey/acl-compare.d.ts +28 -0
- package/dist/valkey/acl-compare.d.ts.map +1 -0
- package/dist/valkey/acl-connection.d.ts +6 -0
- package/dist/valkey/acl-connection.d.ts.map +1 -0
- package/dist/valkey/acl-form.d.ts +62 -0
- package/dist/valkey/acl-form.d.ts.map +1 -0
- package/dist/valkey/acl-managed.d.ts +4 -0
- package/dist/valkey/acl-managed.d.ts.map +1 -0
- package/dist/valkey/acl-ops.d.ts +37 -0
- package/dist/valkey/acl-ops.d.ts.map +1 -0
- package/dist/valkey/acl-profiles.d.ts +53 -0
- package/dist/valkey/acl-profiles.d.ts.map +1 -0
- package/dist/valkey/acl-reconcile.d.ts +26 -0
- package/dist/valkey/acl-reconcile.d.ts.map +1 -0
- package/dist/valkey/acl.d.ts +24 -0
- package/dist/valkey/acl.d.ts.map +1 -0
- package/dist/valkey/connection-service.d.ts +22 -0
- package/dist/valkey/connection-service.d.ts.map +1 -0
- package/dist/valkey/connection.d.ts +59 -0
- package/dist/valkey/connection.d.ts.map +1 -0
- package/dist/valkey/errors.d.ts +165 -0
- package/dist/valkey/errors.d.ts.map +1 -0
- package/dist/valkey/fake-acl.d.ts +29 -0
- package/dist/valkey/fake-acl.d.ts.map +1 -0
- package/dist/valkey/fake-valkey.d.ts +35 -0
- package/dist/valkey/fake-valkey.d.ts.map +1 -0
- package/dist/valkey/handler-test-fixture.d.ts +20 -0
- package/dist/valkey/handler-test-fixture.d.ts.map +1 -0
- package/dist/valkey/index.d.ts +18 -0
- package/dist/valkey/index.d.ts.map +1 -0
- package/dist/valkey/index.js +964 -0
- package/dist/valkey/index.js.map +27 -0
- package/dist/valkey/instance-attrs.d.ts +46 -0
- package/dist/valkey/instance-attrs.d.ts.map +1 -0
- package/dist/valkey/instance-form.d.ts +22 -0
- package/dist/valkey/instance-form.d.ts.map +1 -0
- package/dist/valkey/instance.d.ts +48 -0
- package/dist/valkey/instance.d.ts.map +1 -0
- package/dist/valkey/provider-socket-fixture.d.ts +8 -0
- package/dist/valkey/provider-socket-fixture.d.ts.map +1 -0
- package/dist/valkey/providers.d.ts +16 -0
- package/dist/valkey/providers.d.ts.map +1 -0
- package/dist/valkey/resp.d.ts +38 -0
- package/dist/valkey/resp.d.ts.map +1 -0
- package/dist/valkey/transport-error.d.ts +36 -0
- package/dist/valkey/transport-error.d.ts.map +1 -0
- package/dist/valkey/transport.d.ts +50 -0
- package/dist/valkey/transport.d.ts.map +1 -0
- package/docs/litellm-access-group.md +105 -0
- package/docs/litellm-credential.md +60 -0
- package/docs/litellm-key-metadata.md +56 -0
- package/docs/litellm-key.md +194 -0
- package/docs/litellm-mcp.md +187 -0
- package/docs/litellm-model.md +111 -0
- package/docs/litellm-policy-attachment.md +86 -0
- package/docs/litellm-policy.md +103 -0
- package/docs/litellm-team.md +117 -0
- package/docs/litellm-tool-policy.md +90 -0
- package/docs/litellm-toolset.md +92 -0
- package/docs/litellm.md +16 -9
- package/docs/peers.md +15 -6
- package/docs/postgres-grants-example.md +55 -0
- package/docs/postgres-grants.md +157 -0
- package/docs/postgres-role.md +126 -0
- package/docs/postgres-schema.md +139 -0
- package/docs/postgres.md +20 -3
- package/docs/valkey-transport.md +29 -0
- package/docs/valkey.md +187 -0
- package/package.json +6 -2
- package/src/ceph/ceph-argv.test.ts +1 -1
- package/src/launchd/sudo-allowlist.test.ts +2 -2
- package/src/linux/sudo-allowlist.test.ts +3 -3
- package/src/linux/sudo-runner.test.ts +2 -2
- package/src/litellm/access-group-form.ts +105 -0
- package/src/litellm/access-group-operations.ts +92 -0
- package/src/litellm/access-group-types.ts +49 -0
- package/src/litellm/access-group.test.ts +197 -0
- package/src/litellm/access-group.ts +151 -0
- package/src/litellm/credential-errors.ts +183 -0
- package/src/litellm/credential-form.test.ts +151 -0
- package/src/litellm/credential-form.ts +211 -0
- package/src/litellm/credential-guards.test.ts +241 -0
- package/src/litellm/credential-operations.ts +208 -0
- package/src/litellm/credential-recovery.test.ts +93 -0
- package/src/litellm/credential-rewrite.test.ts +164 -0
- package/src/litellm/credential-rewrite.ts +50 -0
- package/src/litellm/credential-types.ts +117 -0
- package/src/litellm/credential-values.ts +94 -0
- package/src/litellm/credential.test.ts +218 -0
- package/src/litellm/credential.ts +227 -0
- package/src/litellm/fake-access-group-litellm.ts +127 -0
- package/src/litellm/fake-credential-litellm.ts +216 -0
- package/src/litellm/fake-keys.ts +190 -0
- package/src/litellm/fake-litellm.ts +19 -9
- package/src/litellm/fake-mcp-litellm.ts +214 -0
- package/src/litellm/fake-model-litellm-post-update.ts +103 -0
- package/src/litellm/fake-model-litellm.ts +233 -0
- package/src/litellm/fake-policy-attachment-litellm.ts +97 -0
- package/src/litellm/fake-policy-litellm.ts +186 -0
- package/src/litellm/fake-registry-base.ts +69 -0
- package/src/litellm/fake-stack.ts +17 -1
- package/src/litellm/fake-team-litellm.ts +229 -0
- package/src/litellm/fake-tool-litellm.ts +88 -0
- package/src/litellm/fake-toolset-litellm.ts +110 -0
- package/src/litellm/index.ts +140 -0
- package/src/litellm/key-delete.test.ts +212 -0
- package/src/litellm/key-errors.ts +241 -0
- package/src/litellm/key-form.ts +200 -0
- package/src/litellm/key-harness.ts +121 -0
- package/src/litellm/key-metadata-errors.ts +49 -0
- package/src/litellm/key-metadata.test.ts +156 -0
- package/src/litellm/key-metadata.ts +74 -0
- package/src/litellm/key-operations.ts +184 -0
- package/src/litellm/key-rotation.test.ts +110 -0
- package/src/litellm/key-scope.test.ts +135 -0
- package/src/litellm/key-secret.test.ts +248 -0
- package/src/litellm/key-secret.ts +137 -0
- package/src/litellm/key-transport.test.ts +166 -0
- package/src/litellm/key.test.ts +231 -0
- package/src/litellm/key.ts +213 -0
- package/src/litellm/mcp-server-adopt.test.ts +86 -0
- package/src/litellm/mcp-server-alias.test.ts +184 -0
- package/src/litellm/mcp-server-credential.ts +85 -0
- package/src/litellm/mcp-server-errors.ts +141 -0
- package/src/litellm/mcp-server-exports.test.ts +15 -0
- package/src/litellm/mcp-server-form.test.ts +241 -0
- package/src/litellm/mcp-server-form.ts +233 -0
- package/src/litellm/mcp-server-handlers.test.ts +150 -0
- package/src/litellm/mcp-server-locate.ts +66 -0
- package/src/litellm/mcp-server-operations.ts +111 -0
- package/src/litellm/mcp-server-registry.test.ts +146 -0
- package/src/litellm/mcp-server-retype.test.ts +114 -0
- package/src/litellm/mcp-server-shadow.test.ts +91 -0
- package/src/litellm/mcp-server-shadow.ts +45 -0
- package/src/litellm/mcp-server-tools.test.ts +85 -0
- package/src/litellm/mcp-server-types.ts +143 -0
- package/src/litellm/mcp-server-url.ts +66 -0
- package/src/litellm/mcp-server.test.ts +213 -0
- package/src/litellm/mcp-server.ts +225 -0
- package/src/litellm/model-claim.ts +69 -0
- package/src/litellm/model-credential.ts +45 -0
- package/src/litellm/model-errors.ts +168 -0
- package/src/litellm/model-foreign-row.test.ts +173 -0
- package/src/litellm/model-form.test.ts +228 -0
- package/src/litellm/model-form.ts +223 -0
- package/src/litellm/model-locate.test.ts +128 -0
- package/src/litellm/model-locate.ts +67 -0
- package/src/litellm/model-operations.test.ts +93 -0
- package/src/litellm/model-operations.ts +146 -0
- package/src/litellm/model-params-preserve.test.ts +119 -0
- package/src/litellm/model-recovery.test.ts +57 -0
- package/src/litellm/model-types.ts +112 -0
- package/src/litellm/model.test.ts +222 -0
- package/src/litellm/model.ts +237 -0
- package/src/litellm/policy-attachment-form.ts +103 -0
- package/src/litellm/policy-attachment-operations.ts +74 -0
- package/src/litellm/policy-attachment-types.ts +48 -0
- package/src/litellm/policy-attachment.test.ts +198 -0
- package/src/litellm/policy-attachment.ts +178 -0
- package/src/litellm/policy-form.ts +122 -0
- package/src/litellm/policy-operations.ts +112 -0
- package/src/litellm/policy-types.ts +58 -0
- package/src/litellm/policy.test.ts +214 -0
- package/src/litellm/policy.ts +146 -0
- package/src/litellm/providers.ts +24 -3
- package/src/litellm/registry-errors.ts +88 -0
- package/src/litellm/registry-exports.test.ts +66 -0
- package/src/litellm/registry-support.ts +109 -0
- package/src/litellm/team-form.ts +140 -0
- package/src/litellm/team-members.test.ts +150 -0
- package/src/litellm/team-members.ts +58 -0
- package/src/litellm/team-operations.ts +90 -0
- package/src/litellm/team-permission.ts +159 -0
- package/src/litellm/team-read.test.ts +89 -0
- package/src/litellm/team-types.ts +106 -0
- package/src/litellm/team.test.ts +206 -0
- package/src/litellm/team.ts +159 -0
- package/src/litellm/tool-policy-form.ts +94 -0
- package/src/litellm/tool-policy-operations.ts +58 -0
- package/src/litellm/tool-policy-types.ts +48 -0
- package/src/litellm/tool-policy.test.ts +172 -0
- package/src/litellm/tool-policy.ts +125 -0
- package/src/litellm/toolset-form.ts +104 -0
- package/src/litellm/toolset-operations.ts +90 -0
- package/src/litellm/toolset-types.ts +47 -0
- package/src/litellm/toolset.test.ts +198 -0
- package/src/litellm/toolset.ts +151 -0
- package/src/ownership/ownership.test.ts +33 -1
- package/src/ownership/rows.ts +53 -0
- package/src/postgres/connection.ts +42 -7
- package/src/postgres/database-bigint-serialization.test.ts +1 -0
- package/src/postgres/database-refusals.test.ts +2 -2
- package/src/postgres/database-sql.ts +36 -9
- package/src/postgres/fake-grants-parse.ts +189 -0
- package/src/postgres/fake-grants-read.ts +250 -0
- package/src/postgres/fake-grants-sql.ts +207 -0
- package/src/postgres/fake-grants-write.ts +90 -0
- package/src/postgres/fake-role-sql.ts +240 -0
- package/src/postgres/fake-schema-semantics.test.ts +36 -0
- package/src/postgres/fake-schema-sql.ts +146 -0
- package/src/postgres/fake-sql-parse.ts +86 -0
- package/src/postgres/fake-sql-quote.ts +36 -0
- package/src/postgres/fake-sql.ts +166 -46
- package/src/postgres/fixtures/pg-REL_18_6-acl.h.txt +147 -0
- package/src/postgres/fixtures/pg-REL_18_6-aclexplode-func.txt +31 -0
- package/src/postgres/fixtures/pg-REL_18_6-alter-default-privileges-synopsis.txt +82 -0
- package/src/postgres/fixtures/pg-REL_18_6-alter_role.sgml.txt +44 -0
- package/src/postgres/fixtures/pg-REL_18_6-create_role.sgml.txt +26 -0
- package/src/postgres/fixtures/pg-REL_18_6-grant-synopsis.txt +95 -0
- package/src/postgres/fixtures/pg-REL_18_6-pg_attribute.h.txt +24 -0
- package/src/postgres/fixtures/pg-REL_18_6-pg_auth_members.h.txt +62 -0
- package/src/postgres/fixtures/pg-REL_18_6-pg_authid.h.txt +70 -0
- package/src/postgres/fixtures/pg-REL_18_6-pg_class.h.txt +33 -0
- package/src/postgres/fixtures/pg-REL_18_6-pg_default_acl.h.txt +81 -0
- package/src/postgres/fixtures/pg-REL_18_6-pg_namespace.h.txt +28 -0
- package/src/postgres/fixtures/pg-REL_18_6-revoke-synopsis.txt +124 -0
- package/src/postgres/grants-acl.test.ts +61 -0
- package/src/postgres/grants-attrs.ts +185 -0
- package/src/postgres/grants-database.test.ts +158 -0
- package/src/postgres/grants-declare.ts +172 -0
- package/src/postgres/grants-delete-proof.test.ts +154 -0
- package/src/postgres/grants-diff.ts +101 -0
- package/src/postgres/grants-errors.ts +215 -0
- package/src/postgres/grants-existence-guards.test.ts +113 -0
- package/src/postgres/grants-existence.ts +101 -0
- package/src/postgres/grants-lifecycle-guards.test.ts +208 -0
- package/src/postgres/grants-lifecycle-repair.test.ts +208 -0
- package/src/postgres/grants-lifecycle.test.ts +181 -0
- package/src/postgres/grants-ops.ts +229 -0
- package/src/postgres/grants-owner-revoke.test.ts +121 -0
- package/src/postgres/grants-ownership.ts +49 -0
- package/src/postgres/grants-plan-collateral.test.ts +202 -0
- package/src/postgres/grants-plan-diff.test.ts +204 -0
- package/src/postgres/grants-plan-restore.ts +43 -0
- package/src/postgres/grants-plan-revocations.test.ts +69 -0
- package/src/postgres/grants-plan.test.ts +148 -0
- package/src/postgres/grants-plan.ts +245 -0
- package/src/postgres/grants-provenance.test.ts +134 -0
- package/src/postgres/grants-psql-lifecycle.test.ts +105 -0
- package/src/postgres/grants-read-absent.test.ts +91 -0
- package/src/postgres/grants-read-defaults.ts +51 -0
- package/src/postgres/grants-read.ts +250 -0
- package/src/postgres/grants-refusals.test.ts +136 -0
- package/src/postgres/grants-refuse.ts +119 -0
- package/src/postgres/grants-relkind-wire.test.ts +111 -0
- package/src/postgres/grants-repair-plan.test.ts +201 -0
- package/src/postgres/grants-sql.test.ts +128 -0
- package/src/postgres/grants-sql.ts +144 -0
- package/src/postgres/grants-words.ts +34 -0
- package/src/postgres/grants.ts +110 -0
- package/src/postgres/index.ts +129 -5
- package/src/postgres/installed-classifier.ts +36 -0
- package/src/postgres/providers.ts +33 -9
- package/src/postgres/psql-executor-escaping.test.ts +67 -0
- package/src/postgres/psql-executor.test.ts +63 -2
- package/src/postgres/psql-executor.ts +74 -34
- package/src/postgres/role-adopt.test.ts +98 -0
- package/src/postgres/role-attrs.ts +137 -0
- package/src/postgres/role-diff.ts +93 -0
- package/src/postgres/role-errors.ts +206 -0
- package/src/postgres/role-guard.test.ts +60 -0
- package/src/postgres/role-identity.test.ts +197 -0
- package/src/postgres/role-lifecycle.test.ts +228 -0
- package/src/postgres/role-membership-options.test.ts +73 -0
- package/src/postgres/role-membership-repair.test.ts +153 -0
- package/src/postgres/role-membership-sql.ts +223 -0
- package/src/postgres/role-password-ascii.test.ts +53 -0
- package/src/postgres/role-password-transports.test.ts +123 -0
- package/src/postgres/role-password.test.ts +158 -0
- package/src/postgres/role-privilege.test.ts +107 -0
- package/src/postgres/role-provenance.test.ts +200 -0
- package/src/postgres/role-provider.ts +105 -0
- package/src/postgres/role-refusals.test.ts +225 -0
- package/src/postgres/role-scram.test.ts +38 -0
- package/src/postgres/role-scram.ts +40 -0
- package/src/postgres/role-secrets.ts +61 -0
- package/src/postgres/role-sql.ts +213 -0
- package/src/postgres/role-valid-until.test.ts +68 -0
- package/src/postgres/role.ts +226 -0
- package/src/postgres/schema-assert.ts +139 -0
- package/src/postgres/schema-attrs.ts +71 -0
- package/src/postgres/schema-delete-proofs.test.ts +192 -0
- package/src/postgres/schema-delete.ts +96 -0
- package/src/postgres/schema-diff.ts +44 -0
- package/src/postgres/schema-drop-2bp01.test.ts +146 -0
- package/src/postgres/schema-errors.ts +209 -0
- package/src/postgres/schema-handlers.test.ts +193 -0
- package/src/postgres/schema-identity.ts +39 -0
- package/src/postgres/schema-lifecycle.test.ts +246 -0
- package/src/postgres/schema-race.test.ts +70 -0
- package/src/postgres/schema-reconcile.ts +100 -0
- package/src/postgres/schema-refusals.test.ts +144 -0
- package/src/postgres/schema-socket.test.ts +162 -0
- package/src/postgres/schema-sql.ts +130 -0
- package/src/postgres/schema-takeover.test.ts +149 -0
- package/src/postgres/schema-test-kit.ts +85 -0
- package/src/postgres/schema.ts +130 -0
- package/src/release/binary-alias.test.ts +3 -3
- package/src/release/binary-claims.test.ts +3 -3
- package/src/release/binary-directory-umask.test.ts +65 -0
- package/src/release/fake-engine.ts +15 -0
- package/src/valkey/acl-attrs.ts +98 -0
- package/src/valkey/acl-compare.ts +57 -0
- package/src/valkey/acl-connection.ts +13 -0
- package/src/valkey/acl-delete.test.ts +127 -0
- package/src/valkey/acl-form.ts +239 -0
- package/src/valkey/acl-managed.ts +13 -0
- package/src/valkey/acl-ops.ts +122 -0
- package/src/valkey/acl-ownership.test.ts +118 -0
- package/src/valkey/acl-prefix.test.ts +38 -0
- package/src/valkey/acl-profiles.ts +81 -0
- package/src/valkey/acl-reconcile.ts +180 -0
- package/src/valkey/acl-reserved.test.ts +69 -0
- package/src/valkey/acl-revocation.test.ts +94 -0
- package/src/valkey/acl-seat-prefix.test.ts +111 -0
- package/src/valkey/acl-validation.test.ts +54 -0
- package/src/valkey/acl.test.ts +215 -0
- package/src/valkey/acl.ts +169 -0
- package/src/valkey/connection-service.ts +46 -0
- package/src/valkey/connection.ts +180 -0
- package/src/valkey/errors.ts +239 -0
- package/src/valkey/fake-acl.ts +128 -0
- package/src/valkey/fake-valkey.ts +224 -0
- package/src/valkey/handler-test-fixture.ts +43 -0
- package/src/valkey/handlers.test.ts +205 -0
- package/src/valkey/index.ts +54 -0
- package/src/valkey/instance-attrs.ts +48 -0
- package/src/valkey/instance-form.ts +104 -0
- package/src/valkey/instance.test.ts +108 -0
- package/src/valkey/instance.ts +160 -0
- package/src/valkey/provider-socket-fixture.ts +71 -0
- package/src/valkey/providers.test.ts +129 -0
- package/src/valkey/providers.ts +21 -0
- package/src/valkey/resp.ts +212 -0
- package/src/valkey/transport-bounds.test.ts +150 -0
- package/src/valkey/transport-error.ts +37 -0
- package/src/valkey/transport.test.ts +158 -0
- package/src/valkey/transport.ts +109 -0
- package/src/valkey/upstream-bounds.test.ts +14 -0
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What a `LiteLLM.Team` declares (props) and what is remembered about it (attributes).
|
|
3
|
+
*
|
|
4
|
+
* ★ A TEAM (`LiteLLM_TeamTable`, `/team/*`) owns keys, a member roster and an ACCESS CEILING: the
|
|
5
|
+
* models it may use, and an `object_permission` that says which MCP servers, MCP access groups,
|
|
6
|
+
* toolsets and tools its keys may reach. This resource manages exactly those, plus the team's
|
|
7
|
+
* attachment to unified access groups. Nothing else about a team is touched.
|
|
8
|
+
* ⛔ THE TEAM'S `mcpServers` LIST IS A CEILING THAT INTERSECTS EVERY KEY'S OWN GRANTS. Where both a team
|
|
9
|
+
* and a key list servers, the key reaches only the intersection
|
|
10
|
+
* (`user_api_key_auth_mcp.py` lines 1482-1503, 1.103.0; docs.litellm.ai/docs/mcp_grant_access). A
|
|
11
|
+
* NON-EMPTY team list therefore silently removes access from any key that was granted a server the
|
|
12
|
+
* team does not list, and `[]` is "this level does not restrict". Grant servers on keys, toolsets
|
|
13
|
+
* (`mcpToolsets`) or unified access groups, and leave the team's list `[]`, unless a ceiling is meant.
|
|
14
|
+
* ⛔ `models: []` MEANS EVERY MODEL, not none (LiteLLM's own field doc: "If empty, assumes all models
|
|
15
|
+
* are allowed"). Compared only when declared.
|
|
16
|
+
* ⚠️ NOT MODELLED, on purpose, so an adopted team keeps them and none is ever sent: budgets and rate
|
|
17
|
+
* limits (a team's `max_budget` is a HARD cap that 429s every key, the 2026-09-28 incident), the
|
|
18
|
+
* metadata-backed fields (`guardrails`, `policies`, `tags`, `prompts`, `logging`,
|
|
19
|
+
* `secret_manager_settings`, `allowed_passthrough_routes`, `team_member_key_duration`,
|
|
20
|
+
* `disable_global_guardrails` — Enterprise, each a 403 when set on a proxy without a licence,
|
|
21
|
+
* `common_utils.py` line 463 and `_types.py` lines 4843-4853), `model_max_budget` (Enterprise, 403,
|
|
22
|
+
* `common_utils.py` lines 73-86), `metadata`, `router_settings`, `model_aliases`, organisation and the
|
|
23
|
+
* other `object_permission` fields (vector stores, agents, models, search tools, skills).
|
|
24
|
+
*/
|
|
25
|
+
/** The object permission fields this resource manages. Each one is compared and sent ONLY WHEN DECLARED. */
|
|
26
|
+
export interface TeamObjectPermission {
|
|
27
|
+
/**
|
|
28
|
+
* MCP servers the team's keys may reach, by `server_id`, alias or name. ⛔ A ceiling: see above.
|
|
29
|
+
* `[]` clears the list. The sentinel `all-proxy-mcpservers` is refused (Proxy admin only,
|
|
30
|
+
* `object_permission_utils.py` line 480, and it grants every server).
|
|
31
|
+
*/
|
|
32
|
+
readonly mcpServers?: readonly string[];
|
|
33
|
+
/** MCP access group NAMES (the bare names on MCP server rows), not unified access group ids. */
|
|
34
|
+
readonly mcpAccessGroups?: readonly string[];
|
|
35
|
+
/** Toolset IDS (`toolset.toolsetId` of a `LiteLLM.Toolset`), not names. */
|
|
36
|
+
readonly mcpToolsets?: readonly string[];
|
|
37
|
+
/** Per-server tool allowlist: `server_id` (or alias or name) to the tools it may call. */
|
|
38
|
+
readonly mcpToolPermissions?: Readonly<Record<string, readonly string[]>>;
|
|
39
|
+
/**
|
|
40
|
+
* Tool names blocked for this team. ⚠️ The same list `POST /v1/tool/policy` writes for a team override,
|
|
41
|
+
* which is why `LiteLLM.ToolPolicy` does not model overrides.
|
|
42
|
+
*/
|
|
43
|
+
readonly blockedTools?: readonly string[];
|
|
44
|
+
}
|
|
45
|
+
export interface TeamMember {
|
|
46
|
+
/** The user's `user_id`. A member is added by id only: an email would make LiteLLM allocate the id. */
|
|
47
|
+
readonly userId: string;
|
|
48
|
+
/** Default `user`. `admin` is an ENTERPRISE feature (400 on a proxy without a licence). */
|
|
49
|
+
readonly role?: 'user' | 'admin';
|
|
50
|
+
}
|
|
51
|
+
export interface TeamProps {
|
|
52
|
+
/** The team's alias. Not unique in LiteLLM (a policy attachment matches it as a pattern). Always compared. */
|
|
53
|
+
readonly teamAlias: string;
|
|
54
|
+
/**
|
|
55
|
+
* The team's id. Set it to ADOPT an existing team (it needs `--adopt`); without it a deterministic
|
|
56
|
+
* physical name is used for a create. ⛔ A DIFFERENT DECLARED ID IS A REPLACE (create-first, so the old
|
|
57
|
+
* team is only removed by an opt-in `RemovalPolicy.destroy()`, which also deletes its keys).
|
|
58
|
+
*/
|
|
59
|
+
readonly teamId?: string;
|
|
60
|
+
/** Models the team's keys may use, compared as a set, only when declared. `[]` means every model. */
|
|
61
|
+
readonly models?: readonly string[];
|
|
62
|
+
/** Whether the team is blocked (every key stops). Compared only when declared. */
|
|
63
|
+
readonly blocked?: boolean;
|
|
64
|
+
/**
|
|
65
|
+
* Unified access group ids the team is attached to (`accessGroup.accessGroupId`), compared as a set,
|
|
66
|
+
* only when declared. LiteLLM mirrors it into each group's `assigned_team_ids` in the same transaction,
|
|
67
|
+
* so `LiteLLM.AccessGroup` does not declare teams.
|
|
68
|
+
*/
|
|
69
|
+
readonly accessGroupIds?: readonly string[];
|
|
70
|
+
readonly objectPermission?: TeamObjectPermission;
|
|
71
|
+
/**
|
|
72
|
+
* Members that must exist, compared only when declared. ⛔ ADDITIVE ONLY: a live member the declaration
|
|
73
|
+
* does not list is left alone, because `/team/member_delete` also DELETES the keys that user created
|
|
74
|
+
* for the team (`team_endpoints.py` lines 3701-3748). A declared member with another role is updated.
|
|
75
|
+
* Adding a member creates its user row when the id is new. `/team/new` itself adds the caller as an
|
|
76
|
+
* `admin` member unless the proxy sets `disable_auto_add_proxy_admin_to_teams`.
|
|
77
|
+
*/
|
|
78
|
+
readonly members?: readonly TeamMember[];
|
|
79
|
+
}
|
|
80
|
+
/** The object permission as a read returns it: every managed field, `[]` where LiteLLM holds none. */
|
|
81
|
+
export interface TeamObjectPermissionAttributes {
|
|
82
|
+
readonly mcpServers: readonly string[];
|
|
83
|
+
readonly mcpAccessGroups: readonly string[];
|
|
84
|
+
readonly mcpToolsets: readonly string[];
|
|
85
|
+
readonly mcpToolPermissions: Readonly<Record<string, readonly string[]>>;
|
|
86
|
+
readonly blockedTools: readonly string[];
|
|
87
|
+
}
|
|
88
|
+
export interface TeamMemberAttributes {
|
|
89
|
+
readonly userId: string;
|
|
90
|
+
readonly role: string;
|
|
91
|
+
}
|
|
92
|
+
export interface TeamAttributes {
|
|
93
|
+
readonly teamId: string;
|
|
94
|
+
readonly teamAlias: string;
|
|
95
|
+
readonly models: readonly string[];
|
|
96
|
+
readonly blocked: boolean;
|
|
97
|
+
readonly accessGroupIds: readonly string[];
|
|
98
|
+
readonly objectPermission: TeamObjectPermissionAttributes;
|
|
99
|
+
readonly members: readonly TeamMemberAttributes[];
|
|
100
|
+
}
|
|
101
|
+
//# sourceMappingURL=team-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"team-types.d.ts","sourceRoot":"","sources":["../../src/litellm/team-types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,4GAA4G;AAC5G,MAAM,WAAW,oBAAoB;IACnC;;;;OAIG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACxC,gGAAgG;IAChG,QAAQ,CAAC,eAAe,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC7C,2EAA2E;IAC3E,QAAQ,CAAC,WAAW,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACzC,0FAA0F;IAC1F,QAAQ,CAAC,kBAAkB,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC,CAAC,CAAC;IAC1E;;;OAGG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAC3C;AAED,MAAM,WAAW,UAAU;IACzB,uGAAuG;IACvG,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,2FAA2F;IAC3F,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;CAClC;AAED,MAAM,WAAW,SAAS;IACxB,8GAA8G;IAC9G,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B;;;;OAIG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,qGAAqG;IACrG,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC,kFAAkF;IAClF,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;IAC3B;;;;OAIG;IACH,QAAQ,CAAC,cAAc,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC5C,QAAQ,CAAC,gBAAgB,CAAC,EAAE,oBAAoB,CAAC;IACjD;;;;;;OAMG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,UAAU,EAAE,CAAC;CAC1C;AAED,sGAAsG;AACtG,MAAM,WAAW,8BAA8B;IAC7C,QAAQ,CAAC,UAAU,EAAE,SAAS,MAAM,EAAE,CAAC;IACvC,QAAQ,CAAC,eAAe,EAAE,SAAS,MAAM,EAAE,CAAC;IAC5C,QAAQ,CAAC,WAAW,EAAE,SAAS,MAAM,EAAE,CAAC;IACxC,QAAQ,CAAC,kBAAkB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC,CAAC,CAAC;IACzE,QAAQ,CAAC,YAAY,EAAE,SAAS,MAAM,EAAE,CAAC;CAC1C;AAED,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;IACnC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,cAAc,EAAE,SAAS,MAAM,EAAE,CAAC;IAC3C,QAAQ,CAAC,gBAAgB,EAAE,8BAA8B,CAAC;IAC1D,QAAQ,CAAC,OAAO,EAAE,SAAS,oBAAoB,EAAE,CAAC;CACnD"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `LiteLLM.Team` — one row of LiteLLM's team table (`/team/*`): the models, MCP grants and roster that
|
|
3
|
+
* bound every key of a team. Props, the MCP ceiling and everything left out: team-types.ts.
|
|
4
|
+
*
|
|
5
|
+
* ★ ADOPT BY ID. `teamId` names the live team; without it a deterministic physical name is used. A
|
|
6
|
+
* team with that id and no state is `Unowned`, so it needs `--adopt`. (`team_alias` is not unique, so
|
|
7
|
+
* it cannot identify a team.)
|
|
8
|
+
* ★ `defaultRemovalPolicy: 'retain'` — deleting a team DELETES EVERY KEY OF THE TEAM (team-operations.ts).
|
|
9
|
+
* Opt in with `.pipe(RemovalPolicy.destroy())`, knowing that.
|
|
10
|
+
* ★ A DECLARED FIELD IS THE TRUTH, AN UNDECLARED ONE IS LEFT ALONE. `models`, `blocked`,
|
|
11
|
+
* `accessGroupIds`, each object-permission field and the roster are compared and sent only when
|
|
12
|
+
* declared; the update is a partial one, and the object permission a merge by field (team-permission.ts),
|
|
13
|
+
* so an adopted team keeps everything this resource does not manage.
|
|
14
|
+
* ⛔ THE ROSTER IS ADDITIVE ONLY (team-members.ts): removing a member would delete that user's keys.
|
|
15
|
+
* ⚠️ NO LICENCE GATE ON THE FIELDS IT MANAGES except a member's `admin` role (Enterprise, 400 without a
|
|
16
|
+
* licence: `team_endpoints.py` lines 2713-2723, 3806-3810). Every other Enterprise team field is one
|
|
17
|
+
* this resource never sends (team-types.ts lists them).
|
|
18
|
+
* ⛔ NO LITELLM CREDENTIAL IS A PROP; `litellmProviders`' layer supplies `Credentials`.
|
|
19
|
+
*/
|
|
20
|
+
import { Resource } from 'alchemy';
|
|
21
|
+
import type { Input } from 'alchemy/Input';
|
|
22
|
+
import * as Provider from 'alchemy/Provider';
|
|
23
|
+
import * as Effect from 'effect/Effect';
|
|
24
|
+
import { LitellmRegistryAbsentAfterWriteError, LitellmRegistryNotConvergedError } from './registry-errors.ts';
|
|
25
|
+
import type { TeamAttributes, TeamProps } from './team-types.ts';
|
|
26
|
+
export type { TeamAttributes, TeamProps };
|
|
27
|
+
export type { TeamMember, TeamMemberAttributes, TeamObjectPermission, TeamObjectPermissionAttributes, } from './team-types.ts';
|
|
28
|
+
export type { RegistryError as TeamError } from './registry-errors.ts';
|
|
29
|
+
export interface LiteLLMTeam extends Resource<'LiteLLM.Team', TeamProps, TeamAttributes> {
|
|
30
|
+
}
|
|
31
|
+
export declare const LiteLLMTeam: import("alchemy").ResourceClass<LiteLLMTeam>;
|
|
32
|
+
export declare const isLiteLLMTeam: (value: unknown) => value is LiteLLMTeam;
|
|
33
|
+
type Args<P> = {
|
|
34
|
+
id: string;
|
|
35
|
+
instanceId: string;
|
|
36
|
+
output: TeamAttributes | undefined;
|
|
37
|
+
} & P;
|
|
38
|
+
/** ⛔ TEST-ONLY EXPORT. Not on index.ts's barrel. */
|
|
39
|
+
export declare const teamHandlers: {
|
|
40
|
+
/** ⛔ With no `output` this is the adoption probe, so the refusals run here too (registry-support.ts). */
|
|
41
|
+
read: ({ id, instanceId, olds, output }: Args<{
|
|
42
|
+
olds: TeamProps;
|
|
43
|
+
}>) => Effect.Effect<TeamAttributes | undefined, import("@distilled.cloud/litellm/team_management").GetTeamInfoTeamInfoError, import("@distilled.cloud/litellm/Credentials").Credentials | import("alchemy").InstanceId | import("alchemy").Stack | import("alchemy").Stage>;
|
|
44
|
+
diff: ({ news, output }: {
|
|
45
|
+
news: Input<TeamProps>;
|
|
46
|
+
output: TeamAttributes | undefined;
|
|
47
|
+
}) => Effect.Effect<{
|
|
48
|
+
readonly action: 'replace';
|
|
49
|
+
readonly deleteFirst: false;
|
|
50
|
+
} | {
|
|
51
|
+
readonly deleteFirst?: never;
|
|
52
|
+
readonly action: 'noop';
|
|
53
|
+
} | {
|
|
54
|
+
readonly deleteFirst?: never;
|
|
55
|
+
readonly action: 'update';
|
|
56
|
+
} | undefined, import("./registry-errors.ts").LitellmRegistryInvalidError, never>;
|
|
57
|
+
reconcile: ({ id, instanceId, news, output }: Args<{
|
|
58
|
+
news: TeamProps;
|
|
59
|
+
}>) => Effect.Effect<TeamAttributes, LitellmRegistryAbsentAfterWriteError | import("./registry-errors.ts").LitellmRegistryInvalidError | LitellmRegistryNotConvergedError | import("@distilled.cloud/litellm/team_management").UpdateTeamTeamUpdatePostError, import("@distilled.cloud/litellm/Credentials").Credentials | import("alchemy").InstanceId | import("alchemy").Stack | import("alchemy").Stage>;
|
|
60
|
+
delete: ({ output }: {
|
|
61
|
+
output: TeamAttributes;
|
|
62
|
+
}) => Effect.Effect<void, import("@distilled.cloud/caddy").BadGateway | import("@distilled.cloud/litellm/team_management").BadRequest | import("@distilled.cloud/caddy").ConfigError | import("@distilled.cloud/caddy").GatewayTimeout | import("effect/unstable/http/HttpClientError").HttpClientError | import("@distilled.cloud/caddy").InternalServerError | import("@distilled.cloud/litellm/Errors").LitellmParseError | import("@distilled.cloud/litellm/team_management").NotFound | import("@distilled.cloud/caddy").ServiceUnavailable | import("@distilled.cloud/caddy").TooManyRequests | import("@distilled.cloud/caddy").Unauthorized | import("@distilled.cloud/litellm/Errors").UnknownLitellmError | import("@distilled.cloud/litellm/team_management").UnprocessableEntity, import("@distilled.cloud/litellm/Credentials").Credentials>;
|
|
63
|
+
/** ⛔ EMPTY: adoption is an explicit act (`--adopt`), and no ownership mark exists to filter by. */
|
|
64
|
+
list: () => Effect.Effect<never[], never, never>;
|
|
65
|
+
};
|
|
66
|
+
export declare const LiteLLMTeamProvider: () => import("effect/Layer").Layer<Provider.Provider<LiteLLMTeam>, never, import("@distilled.cloud/litellm/Credentials").Credentials | import("alchemy").Stack | import("alchemy").Stage>;
|
|
67
|
+
//# sourceMappingURL=team.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"team.d.ts","sourceRoot":"","sources":["../../src/litellm/team.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAGnC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,KAAK,QAAQ,MAAM,kBAAkB,CAAC;AAC7C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,EACL,oCAAoC,EACpC,gCAAgC,EACjC,MAAM,sBAAsB,CAAC;AAY9B,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAEjE,YAAY,EAAE,cAAc,EAAE,SAAS,EAAE,CAAC;AAC1C,YAAY,EACV,UAAU,EACV,oBAAoB,EACpB,oBAAoB,EACpB,8BAA8B,GAC/B,MAAM,iBAAiB,CAAC;AACzB,YAAY,EAAE,aAAa,IAAI,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAIvE,MAAM,WAAW,WAAY,SAAQ,QAAQ,CAAC,cAAc,EAAE,SAAS,EAAE,cAAc,CAAC;CAAG;AAE3F,eAAO,MAAM,WAAW,8CAEtB,CAAC;AAEH,eAAO,MAAM,aAAa,UAAW,OAAO,KAAG,KAAK,IAAI,WACe,CAAC;AAexE,KAAK,IAAI,CAAC,CAAC,IAAI;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,cAAc,GAAG,SAAS,CAAA;CAAE,GAAG,CAAC,CAAC;AAE1F,oDAAoD;AACpD,eAAO,MAAM,YAAY;IACvB,yGAAyG;IACzG,IAAI,qCAAqC,IAAI,CAAC;QAAE,IAAI,EAAE,SAAS,CAAA;KAAE,CAAC;IAUlE,IAAI,qBAAqB;QAAE,IAAI,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;QAAC,MAAM,EAAE,cAAc,GAAG,SAAS,CAAA;KAAE;yBAOhE,SAAS;;;;yBAGb,MAAM;;;yBACN,QAAQ;;IAG3B,SAAS,qCAAqC,IAAI,CAAC;QAAE,IAAI,EAAE,SAAS,CAAA;KAAE,CAAC;IA6CvE,MAAM,eAAe;QAAE,MAAM,EAAE,cAAc,CAAA;KAAE;IAE/C,mGAAmG;IACnG,IAAI;CACL,CAAC;AAEF,eAAO,MAAM,mBAAmB,2LACqD,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Wire bodies, comparison and refusals for `LiteLLM.ToolPolicy`, testable without a server.
|
|
3
|
+
*
|
|
4
|
+
* ★ THE WRITE IS AN UPSERT. `update_tool_policy` (`db/tool_registry_writer.py`, 1.103.0) upserts on
|
|
5
|
+
* `tool_name`: it CREATES the row when the tool has not been seen (a sent field, else `untrusted`),
|
|
6
|
+
* and on an existing row updates only the fields that are sent. So there is no separate create.
|
|
7
|
+
*/
|
|
8
|
+
import type * as tools from '@distilled.cloud/litellm/tools';
|
|
9
|
+
import { type ToolPolicyAttributes, type ToolPolicyProps } from './tool-policy-types.ts';
|
|
10
|
+
/** The first reason a declaration is refused, or `undefined`. Runs before any request. */
|
|
11
|
+
export declare const firstProblem: (props: ToolPolicyProps) => string | undefined;
|
|
12
|
+
/** One tool row. `undefined` is "not a tool row". A missing policy reads as LiteLLM's default. */
|
|
13
|
+
export declare const toAttributes: (value: unknown) => ToolPolicyAttributes | undefined;
|
|
14
|
+
/** Wire names of the DECLARED fields where live and declared disagree. */
|
|
15
|
+
export declare const differing: (live: ToolPolicyAttributes, props: ToolPolicyProps) => readonly string[];
|
|
16
|
+
/**
|
|
17
|
+
* The write: the declared fields that differ (all declared ones when the tool row is new). ⚠️ NEVER a
|
|
18
|
+
* `team_id` or `key_hash` — those turn the call into an override of another object's `blocked_tools`.
|
|
19
|
+
*/
|
|
20
|
+
export declare const updateBody: (props: ToolPolicyProps, live: ToolPolicyAttributes | undefined) => tools.UpdateToolPolicyV1ToolPolicyPostRequest;
|
|
21
|
+
//# sourceMappingURL=tool-policy-form.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool-policy-form.d.ts","sourceRoot":"","sources":["../../src/litellm/tool-policy-form.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,KAAK,KAAK,MAAM,gCAAgC,CAAC;AAE7D,OAAO,EAGL,KAAK,oBAAoB,EACzB,KAAK,eAAe,EACrB,MAAM,wBAAwB,CAAC;AAShC,0FAA0F;AAC1F,eAAO,MAAM,YAAY,UAAW,eAAe,KAAG,MAAM,GAAG,SAiB9D,CAAC;AAEF,kGAAkG;AAClG,eAAO,MAAM,YAAY,UAAW,OAAO,KAAG,oBAAoB,GAAG,SAcpE,CAAC;AAEF,0EAA0E;AAC1E,eAAO,MAAM,SAAS,SACd,oBAAoB,SACnB,eAAe,KACrB,SAAS,MAAM,EASjB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,UAAU,UACd,eAAe,QAChB,oBAAoB,GAAG,SAAS,KACrC,KAAK,CAAC,uCAWR,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The two LiteLLM `/v1/tool*` calls `LiteLLM.ToolPolicy` uses, through the SDK's typed operations in
|
|
3
|
+
* `@distilled.cloud/litellm/tools` (LiteLLM 1.103.0):
|
|
4
|
+
*
|
|
5
|
+
* read `getToolV1ToolToolNameGet` GET /v1/tool/{tool_name:path}
|
|
6
|
+
* write `updateToolPolicyV1ToolPolicyPost` POST /v1/tool/policy (an UPSERT on tool_name)
|
|
7
|
+
*
|
|
8
|
+
* ⛔ A READ THAT SAYS "NOT FOUND" IS NOT PROOF OF ABSENCE. `db_get_tool` (`db/tool_registry_writer.py`)
|
|
9
|
+
* wraps its query in `except Exception: log; return None`, and the route turns `None` into a 404, so a
|
|
10
|
+
* database error reads exactly like a tool that was never seen. Nothing here depends on it: the write
|
|
11
|
+
* is an upsert, so a wrong "absent" ends in a write that succeeds or fails loudly, and the read back
|
|
12
|
+
* after it is what the deploy reports.
|
|
13
|
+
* ⛔ THERE IS NO DELETE ROUTE for a tool row or for its global policy: `DELETE /v1/tool/{name}/overrides`
|
|
14
|
+
* removes only a team or key override. So this resource's delete RESETS the fields it managed to
|
|
15
|
+
* LiteLLM's default (`untrusted`), it does not remove a row. It is a write, so it runs only when the
|
|
16
|
+
* stack opts in (`retain` is the default), and only for a field that is not already the default.
|
|
17
|
+
* ⛔ NO MESSAGE SNIFFING: absence is the SDK's `NotFound` CLASS (registry-support.ts) and nothing else.
|
|
18
|
+
*/
|
|
19
|
+
import * as tools from '@distilled.cloud/litellm/tools';
|
|
20
|
+
import * as Effect from 'effect/Effect';
|
|
21
|
+
import { type ToolPolicyProps } from './tool-policy-types.ts';
|
|
22
|
+
/** One tool by name, or `undefined` when the proxy has no such row (see the file header). */
|
|
23
|
+
export declare const readTool: (toolName: string) => Effect.Effect<import("./tool-policy-types.ts").ToolPolicyAttributes | undefined, tools.GetToolV1ToolToolNameGetError, import("@distilled.cloud/litellm/Credentials").Credentials>;
|
|
24
|
+
export declare const writeToolPolicy: (body: tools.UpdateToolPolicyV1ToolPolicyPostRequest) => Effect.Effect<void, tools.UpdateToolPolicyV1ToolPolicyPostError, import("@distilled.cloud/litellm/Credentials").Credentials>;
|
|
25
|
+
/**
|
|
26
|
+
* The delete: reset each managed field that is not already the default, and nothing else. A tool the
|
|
27
|
+
* proxy does not know, or one already at the defaults, sends no request (an empty body would be a 400).
|
|
28
|
+
*/
|
|
29
|
+
export declare const resetToolPolicy: (props: ToolPolicyProps) => Effect.Effect<void, import("@distilled.cloud/caddy").BadGateway | import("@distilled.cloud/caddy").ConfigError | import("@distilled.cloud/caddy").GatewayTimeout | import("effect/unstable/http/HttpClientError").HttpClientError | import("@distilled.cloud/caddy").InternalServerError | import("@distilled.cloud/litellm/Errors").LitellmParseError | import("@distilled.cloud/caddy").ServiceUnavailable | import("@distilled.cloud/caddy").TooManyRequests | import("@distilled.cloud/caddy").Unauthorized | import("@distilled.cloud/litellm/Errors").UnknownLitellmError | tools.UnprocessableEntity, import("@distilled.cloud/litellm/Credentials").Credentials>;
|
|
30
|
+
//# sourceMappingURL=tool-policy-operations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool-policy-operations.d.ts","sourceRoot":"","sources":["../../src/litellm/tool-policy-operations.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,KAAK,KAAK,MAAM,gCAAgC,CAAC;AACxD,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAIxC,OAAO,EAAuB,KAAK,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAEnF,6FAA6F;AAC7F,eAAO,MAAM,QAAQ,aAAc,MAAM,sLAOtC,CAAC;AAEJ,eAAO,MAAM,eAAe,SAAU,KAAK,CAAC,uCAAuC,iIACH,CAAC;AAEjF;;;GAGG;AACH,eAAO,MAAM,eAAe,UAAW,eAAe,6oBAenD,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What a `LiteLLM.ToolPolicy` declares (props) and what is remembered about it (attributes).
|
|
3
|
+
*
|
|
4
|
+
* ★ A TOOL POLICY IS THE TRUST SETTING OF ONE TOOL in `LiteLLM_ToolTable` (`/v1/tool/policy`): an
|
|
5
|
+
* input policy (`untrusted`, `trusted`, `blocked`) and an output policy (`untrusted`, `trusted`).
|
|
6
|
+
* LiteLLM DISCOVERS tools as requests use them and gives each `untrusted`/`untrusted`
|
|
7
|
+
* (`TOOL_POLICY_OPTIONS`, `tool_management_endpoints.py`, 1.103.0); this resource sets them.
|
|
8
|
+
* ⛔ IT DOES NOTHING UNTIL THE `tool_policy` GUARDRAIL IS CONFIGURED. The rows are data; only
|
|
9
|
+
* `guardrails/guardrail_hooks/tool_policy/tool_policy_guardrail.py` reads them, and it is a guardrail
|
|
10
|
+
* the proxy's own config must enable (`guardrails: - guardrail_name: tool_policy, litellm_params:
|
|
11
|
+
* { guardrail: tool_policy, mode: post_call }`, its module docstring). Declaring a policy without it
|
|
12
|
+
* is an inert row, not a control. Measured 2026-09-30: the rendered CT100 config has no
|
|
13
|
+
* `tool_policy` guardrail (count 0), so on that proxy today these rows are not enforced.
|
|
14
|
+
* ⚠️ NOT MODELLED: the team and key OVERRIDES of `POST /v1/tool/policy` (`team_id`, `key_hash`). An
|
|
15
|
+
* override is stored as an entry of that team's or key's `object_permission.blocked_tools`
|
|
16
|
+
* (`add_tool_to_object_permission_blocked`), the same list `LiteLLM.Team` manages through
|
|
17
|
+
* `objectPermission.blockedTools`; two resources writing one list would fight. Block a tool for a
|
|
18
|
+
* team there, and for a key on the key.
|
|
19
|
+
*/
|
|
20
|
+
export type ToolInputPolicy = 'untrusted' | 'trusted' | 'blocked';
|
|
21
|
+
export type ToolOutputPolicy = 'untrusted' | 'trusted';
|
|
22
|
+
export interface ToolPolicyProps {
|
|
23
|
+
/**
|
|
24
|
+
* The tool's name as LiteLLM records it (for an MCP tool, `<server prefix>-<tool>`). Changing it is
|
|
25
|
+
* a DIFFERENT tool, so it is a replace. Refused if it is one of the names the route table shadows
|
|
26
|
+
* (`list`, `spend`, `policy/options`) or ends in `/detail` or `/logs`: the read is
|
|
27
|
+
* `GET /v1/tool/{tool_name:path}`, which those routes are registered before.
|
|
28
|
+
*/
|
|
29
|
+
readonly toolName: string;
|
|
30
|
+
/** Compared and sent only when declared. Declare at least one of the two. */
|
|
31
|
+
readonly inputPolicy?: ToolInputPolicy;
|
|
32
|
+
/** Compared and sent only when declared. Declare at least one of the two. */
|
|
33
|
+
readonly outputPolicy?: ToolOutputPolicy;
|
|
34
|
+
}
|
|
35
|
+
export interface ToolPolicyAttributes {
|
|
36
|
+
readonly toolName: string;
|
|
37
|
+
readonly toolId: string;
|
|
38
|
+
/** What the row carries, as a string: a later LiteLLM may add a value this package does not know. */
|
|
39
|
+
readonly inputPolicy: string;
|
|
40
|
+
readonly outputPolicy: string;
|
|
41
|
+
}
|
|
42
|
+
/** What LiteLLM gives a newly discovered tool, and what `delete` resets a managed field to. */
|
|
43
|
+
export declare const DEFAULT_TOOL_POLICY = "untrusted";
|
|
44
|
+
export declare const INPUT_POLICIES: readonly ToolInputPolicy[];
|
|
45
|
+
export declare const OUTPUT_POLICIES: readonly ToolOutputPolicy[];
|
|
46
|
+
//# sourceMappingURL=tool-policy-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool-policy-types.d.ts","sourceRoot":"","sources":["../../src/litellm/tool-policy-types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,MAAM,eAAe,GAAG,WAAW,GAAG,SAAS,GAAG,SAAS,CAAC;AAClE,MAAM,MAAM,gBAAgB,GAAG,WAAW,GAAG,SAAS,CAAC;AAEvD,MAAM,WAAW,eAAe;IAC9B;;;;;OAKG;IACH,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,6EAA6E;IAC7E,QAAQ,CAAC,WAAW,CAAC,EAAE,eAAe,CAAC;IACvC,6EAA6E;IAC7E,QAAQ,CAAC,YAAY,CAAC,EAAE,gBAAgB,CAAC;CAC1C;AAED,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,qGAAqG;IACrG,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;CAC/B;AAED,+FAA+F;AAC/F,eAAO,MAAM,mBAAmB,cAAc,CAAC;AAC/C,eAAO,MAAM,cAAc,EAAE,SAAS,eAAe,EAAwC,CAAC;AAC9F,eAAO,MAAM,eAAe,EAAE,SAAS,gBAAgB,EAA6B,CAAC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `LiteLLM.ToolPolicy` — the input and output trust policy of one tool in LiteLLM's tool registry
|
|
3
|
+
* (`LiteLLM_ToolTable`, `POST /v1/tool/policy`). Props, the enforcement precondition and what is left
|
|
4
|
+
* out: tool-policy-types.ts.
|
|
5
|
+
*
|
|
6
|
+
* ⛔ INERT WITHOUT THE `tool_policy` GUARDRAIL in the proxy's own config (tool-policy-types.ts).
|
|
7
|
+
* ★ ADOPT BY NAME. LiteLLM discovers tools itself, so a tool it has already seen has a live row with no
|
|
8
|
+
* state: `Unowned`, which needs `--adopt` (a row at the defaults is adopted the same way). A tool
|
|
9
|
+
* never seen has no row, and the write creates it.
|
|
10
|
+
* ★ `defaultRemovalPolicy: 'retain'` — there is no delete route. `delete` RESETS the managed fields to
|
|
11
|
+
* `untrusted` (tool-policy-operations.ts), which for an `input_policy` of `blocked` re-opens a tool.
|
|
12
|
+
* Opt in with `.pipe(RemovalPolicy.destroy())`.
|
|
13
|
+
* ⚠️ NO LICENCE GATE ON THESE ROUTES: `tool_management_endpoints.py` has no `premium_user` check
|
|
14
|
+
* (1.103.0). Whether the `tool_policy` guardrail itself is licence-gated is UNVERIFIED (its module
|
|
15
|
+
* has no `premium` reference either).
|
|
16
|
+
* ⛔ NO LITELLM CREDENTIAL IS A PROP; `litellmProviders`' layer supplies `Credentials`.
|
|
17
|
+
*/
|
|
18
|
+
import { Resource } from 'alchemy';
|
|
19
|
+
import type { Input } from 'alchemy/Input';
|
|
20
|
+
import * as Provider from 'alchemy/Provider';
|
|
21
|
+
import * as Effect from 'effect/Effect';
|
|
22
|
+
import { LitellmRegistryAbsentAfterWriteError, LitellmRegistryNotConvergedError } from './registry-errors.ts';
|
|
23
|
+
import type { ToolPolicyAttributes, ToolPolicyProps } from './tool-policy-types.ts';
|
|
24
|
+
export type { ToolPolicyAttributes, ToolPolicyProps };
|
|
25
|
+
export type { ToolInputPolicy, ToolOutputPolicy } from './tool-policy-types.ts';
|
|
26
|
+
export type { RegistryError as ToolPolicyError } from './registry-errors.ts';
|
|
27
|
+
export interface LiteLLMToolPolicy extends Resource<'LiteLLM.ToolPolicy', ToolPolicyProps, ToolPolicyAttributes> {
|
|
28
|
+
}
|
|
29
|
+
export declare const LiteLLMToolPolicy: import("alchemy").ResourceClass<LiteLLMToolPolicy>;
|
|
30
|
+
export declare const isLiteLLMToolPolicy: (value: unknown) => value is LiteLLMToolPolicy;
|
|
31
|
+
/** ⛔ TEST-ONLY EXPORT. Not on index.ts's barrel. */
|
|
32
|
+
export declare const toolPolicyHandlers: {
|
|
33
|
+
/** ⛔ With no `output` this is the adoption probe, so the refusals run here too (registry-support.ts). */
|
|
34
|
+
read: ({ olds, output }: {
|
|
35
|
+
olds: ToolPolicyProps;
|
|
36
|
+
output: ToolPolicyAttributes | undefined;
|
|
37
|
+
}) => Effect.Effect<ToolPolicyAttributes | undefined, import("@distilled.cloud/litellm/tools").GetToolV1ToolToolNameGetError, import("@distilled.cloud/litellm/Credentials").Credentials>;
|
|
38
|
+
diff: ({ news, output, }: {
|
|
39
|
+
news: Input<ToolPolicyProps>;
|
|
40
|
+
output: ToolPolicyAttributes | undefined;
|
|
41
|
+
}) => Effect.Effect<{
|
|
42
|
+
readonly action: 'replace';
|
|
43
|
+
readonly deleteFirst: false;
|
|
44
|
+
} | {
|
|
45
|
+
readonly deleteFirst?: never;
|
|
46
|
+
readonly action: 'noop';
|
|
47
|
+
} | {
|
|
48
|
+
readonly deleteFirst?: never;
|
|
49
|
+
readonly action: 'update';
|
|
50
|
+
} | undefined, import("./registry-errors.ts").LitellmRegistryInvalidError, never>;
|
|
51
|
+
reconcile: ({ news }: {
|
|
52
|
+
news: ToolPolicyProps;
|
|
53
|
+
}) => Effect.Effect<ToolPolicyAttributes, LitellmRegistryAbsentAfterWriteError | import("./registry-errors.ts").LitellmRegistryInvalidError | LitellmRegistryNotConvergedError | import("@distilled.cloud/litellm/tools").UpdateToolPolicyV1ToolPolicyPostError, import("@distilled.cloud/litellm/Credentials").Credentials>;
|
|
54
|
+
/** ⛔ A RESET, not a removal: see tool-policy-operations.ts. */
|
|
55
|
+
delete: ({ olds }: {
|
|
56
|
+
olds: ToolPolicyProps;
|
|
57
|
+
}) => Effect.Effect<void, import("@distilled.cloud/caddy").BadGateway | import("@distilled.cloud/caddy").ConfigError | import("@distilled.cloud/caddy").GatewayTimeout | import("effect/unstable/http/HttpClientError").HttpClientError | import("@distilled.cloud/caddy").InternalServerError | import("@distilled.cloud/litellm/Errors").LitellmParseError | import("@distilled.cloud/caddy").ServiceUnavailable | import("@distilled.cloud/caddy").TooManyRequests | import("@distilled.cloud/caddy").Unauthorized | import("@distilled.cloud/litellm/Errors").UnknownLitellmError | import("@distilled.cloud/litellm/tools").UnprocessableEntity, import("@distilled.cloud/litellm/Credentials").Credentials>;
|
|
58
|
+
/** ⛔ EMPTY: adoption is an explicit act (`--adopt`), and a discovered tool row has no owner mark. */
|
|
59
|
+
list: () => Effect.Effect<never[], never, never>;
|
|
60
|
+
};
|
|
61
|
+
export declare const LiteLLMToolPolicyProvider: () => import("effect/Layer").Layer<Provider.Provider<LiteLLMToolPolicy>, never, import("@distilled.cloud/litellm/Credentials").Credentials>;
|
|
62
|
+
//# sourceMappingURL=tool-policy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool-policy.d.ts","sourceRoot":"","sources":["../../src/litellm/tool-policy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAGnC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,KAAK,QAAQ,MAAM,kBAAkB,CAAC;AAC7C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,EACL,oCAAoC,EACpC,gCAAgC,EACjC,MAAM,sBAAsB,CAAC;AAI9B,OAAO,KAAK,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAEpF,YAAY,EAAE,oBAAoB,EAAE,eAAe,EAAE,CAAC;AACtD,YAAY,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAChF,YAAY,EAAE,aAAa,IAAI,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAI7E,MAAM,WAAW,iBAAkB,SAAQ,QAAQ,CACjD,oBAAoB,EACpB,eAAe,EACf,oBAAoB,CACrB;CAAG;AAEJ,eAAO,MAAM,iBAAiB,oDAE5B,CAAC;AAEH,eAAO,MAAM,mBAAmB,UAAW,OAAO,KAAG,KAAK,IAAI,iBACe,CAAC;AAE9E,oDAAoD;AACpD,eAAO,MAAM,kBAAkB;IAC7B,yGAAyG;IACzG,IAAI,qBAAqB;QAAE,IAAI,EAAE,eAAe,CAAC;QAAC,MAAM,EAAE,oBAAoB,GAAG,SAAS,CAAA;KAAE;IAU5F,IAAI,sBAGD;QACD,IAAI,EAAE,KAAK,CAAC,eAAe,CAAC,CAAC;QAC7B,MAAM,EAAE,oBAAoB,GAAG,SAAS,CAAC;KAC1C;yBAOsB,SAAS;;;;yBAGb,MAAM;;;yBACN,QAAQ;;IAG3B,SAAS,aAAa;QAAE,IAAI,EAAE,eAAe,CAAA;KAAE;IA4B/C,+DAA+D;IAC/D,MAAM,aAAa;QAAE,IAAI,EAAE,eAAe,CAAA;KAAE;IAE5C,qGAAqG;IACrG,IAAI;CACL,CAAC;AAEF,eAAO,MAAM,yBAAyB,6IAInC,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Wire bodies, comparison and refusals for `LiteLLM.Toolset`, testable without a server.
|
|
3
|
+
*
|
|
4
|
+
* ★ THE EDIT IS A PARTIAL ONE (`update_mcp_toolset`, 1.103.0, read from the live container): an absent
|
|
5
|
+
* field keeps its stored value, a `null` clears it, EXCEPT `toolset_name` and `tools`, where `null`
|
|
6
|
+
* is a no-op ("a toolset always has a name and a tool list"). So `tools` is sent only as a list, and
|
|
7
|
+
* emptying a selection is an explicit `[]`. This resource never sends a `null` name or list.
|
|
8
|
+
*/
|
|
9
|
+
import type * as mcp from '@distilled.cloud/litellm/mcp_management';
|
|
10
|
+
import type { ToolsetAttributes, ToolsetProps } from './toolset-types.ts';
|
|
11
|
+
/** The first reason a declaration is refused, or `undefined`. Runs before any request. */
|
|
12
|
+
export declare const firstProblem: (props: ToolsetProps) => string | undefined;
|
|
13
|
+
/** One toolset row. `undefined` is "not a toolset": the caller refuses the whole answer. */
|
|
14
|
+
export declare const toAttributes: (value: unknown) => ToolsetAttributes | undefined;
|
|
15
|
+
/** Wire names of the fields where live and declared disagree. */
|
|
16
|
+
export declare const differing: (live: ToolsetAttributes, props: ToolsetProps) => readonly string[];
|
|
17
|
+
export declare const createBody: (props: ToolsetProps) => mcp.AddMcpToolsetV1McpToolsetPostRequest;
|
|
18
|
+
/** Only what differs, and never a `null` name or list (LiteLLM ignores those). */
|
|
19
|
+
export declare const updateBody: (props: ToolsetProps, live: ToolsetAttributes) => mcp.EditMcpToolsetV1McpToolsetPutRequest;
|
|
20
|
+
//# sourceMappingURL=toolset-form.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toolset-form.d.ts","sourceRoot":"","sources":["../../src/litellm/toolset-form.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,KAAK,KAAK,GAAG,MAAM,yCAAyC,CAAC;AAEpE,OAAO,KAAK,EAAE,iBAAiB,EAAE,YAAY,EAAe,MAAM,oBAAoB,CAAC;AAgBvF,0FAA0F;AAC1F,eAAO,MAAM,YAAY,UAAW,YAAY,KAAG,MAAM,GAAG,SAoB3D,CAAC;AAEF,4FAA4F;AAC5F,eAAO,MAAM,YAAY,UAAW,OAAO,KAAG,iBAAiB,GAAG,SAmBjE,CAAC;AAEF,iEAAiE;AACjE,eAAO,MAAM,SAAS,SAAU,iBAAiB,SAAS,YAAY,KAAG,SAAS,MAAM,EAQvF,CAAC;AAKF,eAAO,MAAM,UAAU,UAAW,YAAY,KAAG,GAAG,CAAC,oCAInD,CAAC;AAEH,kFAAkF;AAClF,eAAO,MAAM,UAAU,UACd,YAAY,QACb,iBAAiB,KACtB,GAAG,CAAC,oCAQN,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The five LiteLLM `/v1/mcp/toolset*` calls `LiteLLM.Toolset` uses, through the SDK's typed operations
|
|
3
|
+
* in `@distilled.cloud/litellm/mcp_management` (LiteLLM 1.103.0):
|
|
4
|
+
*
|
|
5
|
+
* list `fetchMcpToolsetsV1McpToolsetGet` GET /v1/mcp/toolset
|
|
6
|
+
* read `fetchMcpToolsetV1McpToolsetToolsetIdGet` GET /v1/mcp/toolset/{toolset_id}
|
|
7
|
+
* create `addMcpToolsetV1McpToolsetPost` POST /v1/mcp/toolset (201)
|
|
8
|
+
* update `editMcpToolsetV1McpToolsetPut` PUT /v1/mcp/toolset
|
|
9
|
+
* delete `removeMcpToolsetV1McpToolsetToolsetIdDelete` DELETE /v1/mcp/toolset/{toolset_id} (202, no body)
|
|
10
|
+
*
|
|
11
|
+
* ⛔ THE LIST CANNOT PROVE ABSENCE, THE BY-ID READ CAN (`mcp_management_endpoints.py` and
|
|
12
|
+
* `toolset_db.py`, read from the live 1.103.0 container). `list_mcp_toolsets` wraps its query in
|
|
13
|
+
* `except Exception: … return []`, so a database error answers an EMPTY LIST with a 200; and the
|
|
14
|
+
* route narrows the answer to the caller's granted toolsets unless the caller is an admin. The by-id
|
|
15
|
+
* route reads the table (`get_mcp_toolset`, a `find_unique`) and answers 404 only for a missing row.
|
|
16
|
+
* So the list is used ONLY to adopt by name, and everything else reads by id. A wrong "absent" from
|
|
17
|
+
* the list can only end in a create, which a unique name turns into a 409 that fails the deploy.
|
|
18
|
+
* ⛔ NO MESSAGE SNIFFING. `readToolset` tests the SDK's `NotFound` CLASS (registry-support.ts) and
|
|
19
|
+
* nothing else; a 401, a 403 or a dead network propagates, and is never read as absence.
|
|
20
|
+
* ★ DELETE IS IDEMPOTENT BY A REAL READ: a failed DELETE is swallowed only when a by-id read says the
|
|
21
|
+
* row is gone. A 403 (only PROXY_ADMIN may delete) leaves it live, so it re-raises the original.
|
|
22
|
+
*/
|
|
23
|
+
import * as mcp from '@distilled.cloud/litellm/mcp_management';
|
|
24
|
+
import * as Effect from 'effect/Effect';
|
|
25
|
+
import { type LitellmOpContext } from './operations.ts';
|
|
26
|
+
import { LitellmRegistryUnreadableError } from './registry-errors.ts';
|
|
27
|
+
import type { ToolsetAttributes } from './toolset-types.ts';
|
|
28
|
+
/** ⚠️ NOT PROOF OF ABSENCE: see the file header. Adopt-by-name only. */
|
|
29
|
+
export declare const listToolsets: () => Effect.Effect<readonly ToolsetAttributes[], mcp.FetchMcpToolsetsV1McpToolsetGetError | LitellmRegistryUnreadableError, LitellmOpContext>;
|
|
30
|
+
/**
|
|
31
|
+
* One toolset BY ID, from the table, or `undefined` when the proxy has no such row. The row must carry
|
|
32
|
+
* the id asked for; anything else the proxy answers is "no such row".
|
|
33
|
+
*/
|
|
34
|
+
export declare const readToolset: (toolsetId: string) => Effect.Effect<ToolsetAttributes | undefined, mcp.FetchMcpToolsetV1McpToolsetToolsetIdGetError, import("@distilled.cloud/litellm/Credentials").Credentials>;
|
|
35
|
+
/** The created row, which carries the id LiteLLM issued. `undefined` when the answer is not a toolset. */
|
|
36
|
+
export declare const createToolset: (body: mcp.AddMcpToolsetV1McpToolsetPostRequest) => Effect.Effect<ToolsetAttributes | undefined, mcp.AddMcpToolsetV1McpToolsetPostError, import("@distilled.cloud/litellm/Credentials").Credentials>;
|
|
37
|
+
export declare const updateToolset: (body: mcp.EditMcpToolsetV1McpToolsetPutRequest) => Effect.Effect<void, mcp.EditMcpToolsetV1McpToolsetPutError, import("@distilled.cloud/litellm/Credentials").Credentials>;
|
|
38
|
+
export declare const deleteToolset: (toolsetId: string) => Effect.Effect<void, mcp.RemoveMcpToolsetV1McpToolsetToolsetIdDeleteError, import("@distilled.cloud/litellm/Credentials").Credentials>;
|
|
39
|
+
//# sourceMappingURL=toolset-operations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toolset-operations.d.ts","sourceRoot":"","sources":["../../src/litellm/toolset-operations.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,OAAO,KAAK,GAAG,MAAM,yCAAyC,CAAC;AAC/D,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,KAAK,gBAAgB,EAAgB,MAAM,iBAAiB,CAAC;AACtE,OAAO,EAAE,8BAA8B,EAAE,MAAM,sBAAsB,CAAC;AAGtE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAI5D,wEAAwE;AACxE,eAAO,MAAM,YAAY,QAAO,MAAM,CAAC,MAAM,CAC3C,SAAS,iBAAiB,EAAE,EAC5B,GAAG,CAAC,oCAAoC,GAAG,8BAA8B,EACzE,gBAAgB,CAoBf,CAAC;AAEJ;;;GAGG;AACH,eAAO,MAAM,WAAW,cAAe,MAAM,+JAO1C,CAAC;AAEJ,0GAA0G;AAC1G,eAAO,MAAM,aAAa,SAAU,GAAG,CAAC,oCAAoC,qJAGzE,CAAC;AAEJ,eAAO,MAAM,aAAa,SAAU,GAAG,CAAC,oCAAoC,4HACD,CAAC;AAE5E,eAAO,MAAM,aAAa,cAAe,MAAM,0IAS5C,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What a `LiteLLM.Toolset` declares (props) and what is remembered about it (attributes).
|
|
3
|
+
*
|
|
4
|
+
* ★ A TOOLSET IS A NAMED SELECTION OF `{ server_id, tool_name }` PAIRS drawn from one or more MCP
|
|
5
|
+
* servers (`LiteLLM_MCPToolsetTable`, `/v1/mcp/toolset`; docs.litellm.ai/docs/mcp_toolsets). A key or
|
|
6
|
+
* team is granted one through `object_permission.mcp_toolsets`, which holds the toolset's ID
|
|
7
|
+
* (`fetch_mcp_toolsets` filters `list_mcp_toolsets(toolset_ids=…)`), so `LiteLLM.Team` takes
|
|
8
|
+
* `toolset.toolsetId`, not the name.
|
|
9
|
+
* ⚠️ THE ID IS THE PROXY'S. `create_mcp_toolset` sets `toolset_id = str(uuid.uuid4())` and the create
|
|
10
|
+
* request has no id field, so nothing here can pick one. The id LiteLLM answers is what is recorded.
|
|
11
|
+
* ★ THE NAME IS A URL SEGMENT. A toolset is served at `/toolset/{toolset_name}/mcp`
|
|
12
|
+
* (`proxy_server.py` line 19346) and `litellm_proxy/mcp/<toolset_name>` (docs), so a name with a `/`
|
|
13
|
+
* can never be addressed. LiteLLM itself accepts one; the refusal is this package's.
|
|
14
|
+
* ⚠️ NOT MODELLED: nothing beyond name, description and tools — the table has no other column that a
|
|
15
|
+
* write reaches.
|
|
16
|
+
*/
|
|
17
|
+
export interface ToolsetTool {
|
|
18
|
+
/** The MCP server's `server_id`. Declare it as `server.serverId` (a `LiteLLM.MCPServer`). */
|
|
19
|
+
readonly serverId: string;
|
|
20
|
+
/** The tool's name on that server, as the server lists it. */
|
|
21
|
+
readonly toolName: string;
|
|
22
|
+
}
|
|
23
|
+
export interface ToolsetProps {
|
|
24
|
+
/**
|
|
25
|
+
* The toolset's name, and the way an existing row is ADOPTED. `toolset_name` is unique in the table
|
|
26
|
+
* (a create or rename onto a taken name is a 409), so the match is exact. Changing it is an update of
|
|
27
|
+
* the same row, never a replace.
|
|
28
|
+
*/
|
|
29
|
+
readonly toolsetName: string;
|
|
30
|
+
/** Compared only when declared: adopting a row never clears text a person wrote. Blank is refused. */
|
|
31
|
+
readonly description?: string;
|
|
32
|
+
/**
|
|
33
|
+
* The selection, compared as a SET of pairs and ALWAYS compared: it is what a caller may reach, so an
|
|
34
|
+
* adopted toolset with more than declared is corrected. `[]` is an explicit empty selection (LiteLLM
|
|
35
|
+
* keeps an empty list only when it is sent as one). Required, so the declaration always says.
|
|
36
|
+
*/
|
|
37
|
+
readonly tools: readonly ToolsetTool[];
|
|
38
|
+
}
|
|
39
|
+
export interface ToolsetAttributes {
|
|
40
|
+
readonly toolsetId: string;
|
|
41
|
+
readonly toolsetName: string;
|
|
42
|
+
readonly description: string | null;
|
|
43
|
+
/** Sorted by server, then tool, so two reads of one row are equal. */
|
|
44
|
+
readonly tools: readonly ToolsetTool[];
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=toolset-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toolset-types.d.ts","sourceRoot":"","sources":["../../src/litellm/toolset-types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,MAAM,WAAW,WAAW;IAC1B,6FAA6F;IAC7F,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,8DAA8D;IAC9D,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;CAC3B;AAED,MAAM,WAAW,YAAY;IAC3B;;;;OAIG;IACH,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,sGAAsG;IACtG,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B;;;;OAIG;IACH,QAAQ,CAAC,KAAK,EAAE,SAAS,WAAW,EAAE,CAAC;CACxC;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC,sEAAsE;IACtE,QAAQ,CAAC,KAAK,EAAE,SAAS,WAAW,EAAE,CAAC;CACxC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `LiteLLM.Toolset` — one row of LiteLLM's MCP toolset table (`/v1/mcp/toolset`): a named selection of
|
|
3
|
+
* `{ server_id, tool_name }` pairs a key or team can be granted instead of whole servers. Props and
|
|
4
|
+
* what is left out: toolset-types.ts.
|
|
5
|
+
*
|
|
6
|
+
* ★ ADOPT BY NAME. `toolset_name` is unique, so `toolsetName` finds the one live row (from the LIST,
|
|
7
|
+
* which is the only by-name lookup the API has, and which cannot prove absence: toolset-operations.ts).
|
|
8
|
+
* A live row with no state is `Unowned`, so it needs `--adopt`.
|
|
9
|
+
* ★ THE ID IS THE PROXY'S and is what state remembers; every later read is BY ID, from the table.
|
|
10
|
+
* ★ `defaultRemovalPolicy: 'retain'` — deleting a toolset does not detach it: teams and keys that hold
|
|
11
|
+
* its id keep a dangling grant, and every caller reaching MCP through it loses the tools.
|
|
12
|
+
* ⚠️ NO LICENCE GATE ON THESE ROUTES: `mcp_management_endpoints.py`'s toolset block has no
|
|
13
|
+
* `premium_user` check (1.103.0), and docs.litellm.ai/docs/mcp_toolsets makes no Enterprise statement.
|
|
14
|
+
* Writes need PROXY_ADMIN (403 otherwise).
|
|
15
|
+
* ⛔ NO LITELLM CREDENTIAL IS A PROP; `litellmProviders`' layer supplies `Credentials`.
|
|
16
|
+
*/
|
|
17
|
+
import { Resource } from 'alchemy';
|
|
18
|
+
import type { Input } from 'alchemy/Input';
|
|
19
|
+
import * as Provider from 'alchemy/Provider';
|
|
20
|
+
import * as Effect from 'effect/Effect';
|
|
21
|
+
import { LitellmRegistryAbsentAfterWriteError, LitellmRegistryAmbiguousError, LitellmRegistryNotConvergedError, LitellmRegistryUnreadableError } from './registry-errors.ts';
|
|
22
|
+
import type { ToolsetAttributes, ToolsetProps } from './toolset-types.ts';
|
|
23
|
+
export type { ToolsetAttributes, ToolsetProps };
|
|
24
|
+
export type { RegistryError as ToolsetError } from './registry-errors.ts';
|
|
25
|
+
export interface LiteLLMToolset extends Resource<'LiteLLM.Toolset', ToolsetProps, ToolsetAttributes> {
|
|
26
|
+
}
|
|
27
|
+
export declare const LiteLLMToolset: import("alchemy").ResourceClass<LiteLLMToolset>;
|
|
28
|
+
export declare const isLiteLLMToolset: (value: unknown) => value is LiteLLMToolset;
|
|
29
|
+
/** ⛔ TEST-ONLY EXPORT. Not on index.ts's barrel. */
|
|
30
|
+
export declare const toolsetHandlers: {
|
|
31
|
+
/** ⛔ With no `output` this is the adoption probe, so the refusals run here too (registry-support.ts). */
|
|
32
|
+
read: ({ olds, output }: {
|
|
33
|
+
olds: ToolsetProps;
|
|
34
|
+
output: ToolsetAttributes | undefined;
|
|
35
|
+
}) => Effect.Effect<ToolsetAttributes | undefined, import("@distilled.cloud/caddy").BadGateway | import("@distilled.cloud/caddy").ConfigError | import("@distilled.cloud/caddy").GatewayTimeout | import("effect/unstable/http/HttpClientError").HttpClientError | import("@distilled.cloud/caddy").InternalServerError | import("@distilled.cloud/litellm/Errors").LitellmParseError | LitellmRegistryAmbiguousError | LitellmRegistryUnreadableError | import("@distilled.cloud/caddy").ServiceUnavailable | import("@distilled.cloud/caddy").TooManyRequests | import("@distilled.cloud/caddy").Unauthorized | import("@distilled.cloud/litellm/Errors").UnknownLitellmError | import("@distilled.cloud/litellm/mcp_management").UnprocessableEntity, import("@distilled.cloud/litellm/Protocol").LitellmOpContext>;
|
|
36
|
+
diff: ({ news, output }: {
|
|
37
|
+
news: Input<ToolsetProps>;
|
|
38
|
+
output: ToolsetAttributes | undefined;
|
|
39
|
+
}) => Effect.Effect<{
|
|
40
|
+
readonly action: 'noop';
|
|
41
|
+
} | {
|
|
42
|
+
readonly action: 'update';
|
|
43
|
+
} | undefined, import("./registry-errors.ts").LitellmRegistryInvalidError, never>;
|
|
44
|
+
reconcile: ({ news, output }: {
|
|
45
|
+
news: ToolsetProps;
|
|
46
|
+
output: ToolsetAttributes | undefined;
|
|
47
|
+
}) => Effect.Effect<ToolsetAttributes, LitellmRegistryAbsentAfterWriteError | LitellmRegistryAmbiguousError | import("./registry-errors.ts").LitellmRegistryInvalidError | LitellmRegistryNotConvergedError | LitellmRegistryUnreadableError | import("@distilled.cloud/litellm/mcp_management").EditMcpToolsetV1McpToolsetPutError, import("@distilled.cloud/litellm/Protocol").LitellmOpContext>;
|
|
48
|
+
delete: ({ output }: {
|
|
49
|
+
output: ToolsetAttributes;
|
|
50
|
+
}) => Effect.Effect<void, import("@distilled.cloud/litellm/mcp_management").RemoveMcpToolsetV1McpToolsetToolsetIdDeleteError, import("@distilled.cloud/litellm/Credentials").Credentials>;
|
|
51
|
+
/** ⛔ EMPTY: adoption is an explicit act (`--adopt`), and no ownership mark exists to filter by. */
|
|
52
|
+
list: () => Effect.Effect<never[], never, never>;
|
|
53
|
+
};
|
|
54
|
+
export declare const LiteLLMToolsetProvider: () => import("effect/Layer").Layer<Provider.Provider<LiteLLMToolset>, never, import("@distilled.cloud/litellm/Protocol").LitellmOpContext>;
|
|
55
|
+
//# sourceMappingURL=toolset.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toolset.d.ts","sourceRoot":"","sources":["../../src/litellm/toolset.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAGnC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,KAAK,QAAQ,MAAM,kBAAkB,CAAC;AAC7C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,EACL,oCAAoC,EACpC,6BAA6B,EAC7B,gCAAgC,EAChC,8BAA8B,EAC/B,MAAM,sBAAsB,CAAC;AAU9B,OAAO,KAAK,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAE1E,YAAY,EAAE,iBAAiB,EAAE,YAAY,EAAE,CAAC;AAChD,YAAY,EAAE,aAAa,IAAI,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAI1E,MAAM,WAAW,cAAe,SAAQ,QAAQ,CAC9C,iBAAiB,EACjB,YAAY,EACZ,iBAAiB,CAClB;CAAG;AAEJ,eAAO,MAAM,cAAc,iDAEzB,CAAC;AAEH,eAAO,MAAM,gBAAgB,UAAW,OAAO,KAAG,KAAK,IAAI,cACe,CAAC;AAuB3E,oDAAoD;AACpD,eAAO,MAAM,eAAe;IAC1B,yGAAyG;IACzG,IAAI,qBAAqB;QAAE,IAAI,EAAE,YAAY,CAAC;QAAC,MAAM,EAAE,iBAAiB,GAAG,SAAS,CAAA;KAAE;IAUtF,IAAI,qBAAqB;QAAE,IAAI,EAAE,KAAK,CAAC,YAAY,CAAC,CAAC;QAAC,MAAM,EAAE,iBAAiB,GAAG,SAAS,CAAA;KAAE;yBAM1E,MAAM;;yBACN,QAAQ;;IAG3B,SAAS,qBAAqB;QAAE,IAAI,EAAE,YAAY,CAAC;QAAC,MAAM,EAAE,iBAAiB,GAAG,SAAS,CAAA;KAAE;IAyC3F,MAAM,eAAe;QAAE,MAAM,EAAE,iBAAiB,CAAA;KAAE;IAElD,mGAAmG;IACnG,IAAI;CACL,CAAC;AAEF,eAAO,MAAM,sBAAsB,4IAC2D,CAAC"}
|
package/dist/openbao/index.js
CHANGED
|
@@ -429,6 +429,40 @@ var recordedInstance = (fqn, instanceId) => Effect5.gen(function* () {
|
|
|
429
429
|
return (yield* wholeDeclaration(fqn, generation.props)) ? "whole" : "partial";
|
|
430
430
|
});
|
|
431
431
|
var isCreate = (fqn, instanceId) => Effect5.map(recordedGeneration(fqn, instanceId), (generation) => generation?.status === "creating");
|
|
432
|
+
var idOf = (attr) => {
|
|
433
|
+
if (typeof attr !== "object" || attr === null)
|
|
434
|
+
return;
|
|
435
|
+
const id = attr.id;
|
|
436
|
+
return typeof id === "string" && id !== "" ? id : undefined;
|
|
437
|
+
};
|
|
438
|
+
var olderGenerationIds = (fqn, instanceId) => Effect5.gen(function* () {
|
|
439
|
+
const found = yield* storeOf;
|
|
440
|
+
if (found === undefined)
|
|
441
|
+
return [];
|
|
442
|
+
const ids = [];
|
|
443
|
+
for (const at of [fqn, ...found.resources[fqn]?.FormerFqns ?? []]) {
|
|
444
|
+
collectOlder(yield* rowAt(found.store, found.where, at), instanceId, ids);
|
|
445
|
+
}
|
|
446
|
+
return ids;
|
|
447
|
+
});
|
|
448
|
+
var collectOlder = (row, instanceId, ids) => {
|
|
449
|
+
let at = row;
|
|
450
|
+
let seen = false;
|
|
451
|
+
while (typeof at === "object" && at !== null && !isActionState(at)) {
|
|
452
|
+
const generation = at;
|
|
453
|
+
if (!seen) {
|
|
454
|
+
seen = generation.instanceId === instanceId;
|
|
455
|
+
at = generation.old;
|
|
456
|
+
continue;
|
|
457
|
+
}
|
|
458
|
+
if (generation.instanceId !== instanceId) {
|
|
459
|
+
const id = idOf(generation.attr);
|
|
460
|
+
if (id !== undefined)
|
|
461
|
+
ids.push(id);
|
|
462
|
+
}
|
|
463
|
+
at = generation.old;
|
|
464
|
+
}
|
|
465
|
+
};
|
|
432
466
|
var forgetRefusedCreate = (fqn, instanceId) => Effect5.gen(function* () {
|
|
433
467
|
const found = yield* storeOf;
|
|
434
468
|
if (found === undefined)
|
|
@@ -3595,5 +3629,5 @@ export {
|
|
|
3595
3629
|
revokeSelfEffect
|
|
3596
3630
|
};
|
|
3597
3631
|
|
|
3598
|
-
//# debugId=
|
|
3632
|
+
//# debugId=3866B2DE62460BDF64756E2164756E21
|
|
3599
3633
|
//# sourceMappingURL=index.js.map
|