@homeflare/alchemy 0.42.0 → 0.44.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/budget-errors.d.ts +36 -0
- package/dist/litellm/budget-errors.d.ts.map +1 -0
- package/dist/litellm/budget-form.d.ts +50 -0
- package/dist/litellm/budget-form.d.ts.map +1 -0
- package/dist/litellm/budget-operations.d.ts +20 -0
- package/dist/litellm/budget-operations.d.ts.map +1 -0
- package/dist/litellm/budget.d.ts +61 -0
- package/dist/litellm/budget.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 +9 -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 +20 -0
- package/dist/litellm/index.d.ts.map +1 -1
- package/dist/litellm/index.js +3201 -2
- package/dist/litellm/index.js.map +70 -5
- 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/operations.d.ts +22 -0
- package/dist/litellm/operations.d.ts.map +1 -1
- 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/auth-role-form.d.ts +9 -0
- package/dist/openbao/auth-role-form.d.ts.map +1 -1
- package/dist/openbao/auth-role-wire.d.ts.map +1 -1
- package/dist/openbao/fake-engines-roles.d.ts.map +1 -1
- package/dist/openbao/index.js +43 -6
- package/dist/openbao/index.js.map +5 -5
- package/dist/ownership/rows.d.ts +11 -0
- package/dist/ownership/rows.d.ts.map +1 -1
- package/dist/postgres/connection.d.ts +32 -2
- package/dist/postgres/connection.d.ts.map +1 -1
- package/dist/postgres/database-sql.d.ts +28 -9
- package/dist/postgres/database-sql.d.ts.map +1 -1
- package/dist/postgres/database.d.ts +1 -1
- package/dist/postgres/database.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 +40 -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 +35 -8
- package/dist/postgres/index.d.ts.map +1 -1
- package/dist/postgres/index.js +2063 -39
- package/dist/postgres/index.js.map +47 -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 +17 -7
- package/dist/postgres/providers.d.ts.map +1 -1
- package/dist/postgres/psql-executor.d.ts +25 -0
- package/dist/postgres/psql-executor.d.ts.map +1 -0
- package/dist/postgres/role-attrs.d.ts +109 -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 +126 -0
- package/dist/postgres/role-errors.d.ts.map +1 -0
- package/dist/postgres/role-membership-sql.d.ts +75 -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 +6 -0
- package/dist/postgres/role-scram.d.ts.map +1 -0
- package/dist/postgres/role-secrets.d.ts +30 -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/ceph-flag-types.d.ts +57 -0
- package/dist/proxmox/ceph-flag-types.d.ts.map +1 -0
- package/dist/proxmox/ceph-flag-wire.d.ts +77 -0
- package/dist/proxmox/ceph-flag-wire.d.ts.map +1 -0
- package/dist/proxmox/ceph-flag.d.ts +15 -50
- package/dist/proxmox/ceph-flag.d.ts.map +1 -1
- package/dist/proxmox/ceph-osd-write.d.ts +10 -13
- package/dist/proxmox/ceph-osd-write.d.ts.map +1 -1
- package/dist/proxmox/index.js +806 -740
- package/dist/proxmox/index.js.map +9 -8
- 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-budget.md +55 -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 -8
- 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 +114 -0
- package/docs/postgres-schema.md +139 -0
- package/docs/postgres.md +39 -0
- package/docs/proxmox-sdk-migration.md +45 -0
- package/docs/valkey-transport.md +29 -0
- package/docs/valkey.md +187 -0
- package/package.json +7 -3
- 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/budget-errors.ts +38 -0
- package/src/litellm/budget-form.ts +94 -0
- package/src/litellm/budget-operations.ts +51 -0
- package/src/litellm/budget.test.ts +105 -0
- package/src/litellm/budget.ts +127 -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 +66 -7
- 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 +153 -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/operations.ts +1 -1
- 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 +25 -1
- 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/openbao/auth-role-form.test.ts +37 -0
- package/src/openbao/auth-role-form.ts +12 -1
- package/src/openbao/auth-role-wire.test.ts +1 -0
- package/src/openbao/auth-role-wire.ts +13 -1
- package/src/openbao/distilled-retry.test.ts +1 -0
- package/src/openbao/fake-engines-roles.ts +7 -1
- package/src/ownership/ownership.test.ts +33 -1
- package/src/ownership/rows.ts +53 -0
- package/src/postgres/connection.ts +72 -3
- 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 +40 -12
- package/src/postgres/database.ts +3 -2
- 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 +220 -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 +161 -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 +137 -7
- package/src/postgres/installed-classifier.ts +36 -0
- package/src/postgres/providers.ts +44 -7
- package/src/postgres/psql-executor-escaping.test.ts +67 -0
- package/src/postgres/psql-executor.test.ts +167 -0
- package/src/postgres/psql-executor.ts +170 -0
- package/src/postgres/role-adopt.test.ts +98 -0
- package/src/postgres/role-attrs.ts +134 -0
- package/src/postgres/role-diff.ts +89 -0
- package/src/postgres/role-errors.ts +198 -0
- package/src/postgres/role-guard.test.ts +60 -0
- package/src/postgres/role-identity.test.ts +185 -0
- package/src/postgres/role-lifecycle.test.ts +228 -0
- package/src/postgres/role-membership-sql.ts +198 -0
- package/src/postgres/role-password.test.ts +158 -0
- package/src/postgres/role-privilege.test.ts +80 -0
- package/src/postgres/role-provenance.test.ts +200 -0
- package/src/postgres/role-provider.ts +104 -0
- package/src/postgres/role-refusals.test.ts +250 -0
- package/src/postgres/role-scram.test.ts +38 -0
- package/src/postgres/role-scram.ts +38 -0
- package/src/postgres/role-secrets.ts +46 -0
- package/src/postgres/role-sql.ts +211 -0
- package/src/postgres/role-valid-until.test.ts +68 -0
- package/src/postgres/role.ts +218 -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 +161 -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/proxmox/ceph-flag-types.ts +70 -0
- package/src/proxmox/ceph-flag-wire.test.ts +72 -0
- package/src/proxmox/ceph-flag-wire.ts +123 -0
- package/src/proxmox/ceph-flag.ts +77 -130
- package/src/proxmox/ceph-osd-write.ts +10 -13
- 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,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Wire bodies, comparison and refusals for `LiteLLM.AccessGroup`, testable without a server.
|
|
3
|
+
*
|
|
4
|
+
* ★ THE UPDATE IS A PARTIAL ONE, so it sends only what differs. `update_access_group` builds its
|
|
5
|
+
* write from `data.model_dump(exclude_unset=True)` (`access_group_endpoints.py`, 1.103.0), and turns
|
|
6
|
+
* a `null` list into `[]`. Nothing here relies on an omitted field being kept beyond that rule.
|
|
7
|
+
* ★ THE ROW READ BACK IS THE WHOLE TABLE, through `GET /v1/unified_access_group`. That route has no
|
|
8
|
+
* filter and no by-name form, and it answers absence unambiguously, which a by-id `GET` (a 404 the
|
|
9
|
+
* SDK does not declare for this tag) does not.
|
|
10
|
+
*/
|
|
11
|
+
import type * as ag from '@distilled.cloud/litellm/access_groups';
|
|
12
|
+
import type { AccessGroupAttributes, AccessGroupProps } from './access-group-types.ts';
|
|
13
|
+
/** The first reason a declaration is refused, or `undefined`. Runs before any request. */
|
|
14
|
+
export declare const firstProblem: (props: AccessGroupProps) => string | undefined;
|
|
15
|
+
/** One row of the list. `undefined` is "not a row": the caller refuses the whole answer. */
|
|
16
|
+
export declare const toAttributes: (value: unknown) => AccessGroupAttributes | undefined;
|
|
17
|
+
/**
|
|
18
|
+
* Wire names of the fields where live and declared disagree. The description counts only when
|
|
19
|
+
* declared; the two grant lists always count, an undeclared one meaning "grants nothing".
|
|
20
|
+
*/
|
|
21
|
+
export declare const differing: (live: AccessGroupAttributes, props: AccessGroupProps) => readonly string[];
|
|
22
|
+
/** Create body: the name and both grant lists always (a create with none would be an empty group). */
|
|
23
|
+
export declare const createBody: (props: AccessGroupProps) => ag.CreateAccessGroupV1UnifiedAccessGroupPostRequest;
|
|
24
|
+
/** Update body: only the fields that differ, so nothing the declaration does not manage is sent. */
|
|
25
|
+
export declare const updateBody: (props: AccessGroupProps, live: AccessGroupAttributes) => Omit<ag.UpdateAccessGroupV1UnifiedAccessGroupAccessGroupIdPutRequest, 'access_group_id'>;
|
|
26
|
+
//# sourceMappingURL=access-group-form.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"access-group-form.d.ts","sourceRoot":"","sources":["../../src/litellm/access-group-form.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,KAAK,EAAE,MAAM,wCAAwC,CAAC;AAWlE,OAAO,KAAK,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAEvF,0FAA0F;AAC1F,eAAO,MAAM,YAAY,UAAW,gBAAgB,KAAG,MAAM,GAAG,SAkB/D,CAAC;AAEF,4FAA4F;AAC5F,eAAO,MAAM,YAAY,UAAW,OAAO,KAAG,qBAAqB,GAAG,SAarE,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,SAAS,SACd,qBAAqB,SACpB,gBAAgB,KACtB,SAAS,MAAM,EASjB,CAAC;AAEF,sGAAsG;AACtG,eAAO,MAAM,UAAU,UACd,gBAAgB,KACtB,EAAE,CAAC,gDAKJ,CAAC;AAEH,oGAAoG;AACpG,eAAO,MAAM,UAAU,UACd,gBAAgB,QACjB,qBAAqB,KAC1B,IAAI,CAAC,EAAE,CAAC,4DAA4D,EAAE,iBAAiB,CAYzF,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The four LiteLLM `/v1/unified_access_group*` calls `LiteLLM.AccessGroup` uses, through the SDK's
|
|
3
|
+
* typed operations in `@distilled.cloud/litellm/access_groups` (LiteLLM 1.103.0):
|
|
4
|
+
*
|
|
5
|
+
* list `listAccessGroupsV1UnifiedAccessGroupGet` GET /v1/unified_access_group
|
|
6
|
+
* create `createAccessGroupV1UnifiedAccessGroupPost` POST /v1/unified_access_group
|
|
7
|
+
* update `updateAccessGroupV1UnifiedAccessGroupAccessGroupIdPut` PUT /v1/unified_access_group/{id}
|
|
8
|
+
* delete `deleteAccessGroupV1UnifiedAccessGroupAccessGroupIdDelete` DELETE /v1/unified_access_group/{id}
|
|
9
|
+
*
|
|
10
|
+
* `/v1/unified_access_group` is registered as an alias of `/v1/access_group` on the same handlers
|
|
11
|
+
* (`access_group_endpoints.py`, the "Alias routes" block), so the two answer identically.
|
|
12
|
+
* The by-id `GET` is not used: a missing id is a 404 this tag does not declare, and the list decides
|
|
13
|
+
* absence without depending on it.
|
|
14
|
+
*
|
|
15
|
+
* ⛔ WRITES NEED PROXY_ADMIN (`_require_proxy_admin`, 403 otherwise) and READS need admin or admin-view
|
|
16
|
+
* (`_require_admin_view`). A key that can only read sees every group and can change none.
|
|
17
|
+
* ⛔ NO MESSAGE SNIFFING. Nothing here reads a status or message. `create` of a name that exists is a
|
|
18
|
+
* 409 LiteLLM raises itself; the SDK does not declare it for this tag, so it reaches the caller as
|
|
19
|
+
* the SDK's own error, unchanged. `create` runs only after a list showed the name absent, so a 409
|
|
20
|
+
* means a concurrent create, which is a failure to report, not to paper over.
|
|
21
|
+
* ★ DELETE IS IDEMPOTENT BY A REAL READ (the budget and pass-through rule): a failed DELETE is
|
|
22
|
+
* swallowed only when the list no longer has the id. A 403 for lack of rights leaves the row
|
|
23
|
+
* live, so it re-raises the ORIGINAL error.
|
|
24
|
+
* ⚠️ DELETING A GROUP DETACHES IT FROM EVERY TEAM AND KEY (`delete_access_group` rewrites their
|
|
25
|
+
* `access_group_ids`), which is why the resource defaults to `retain`.
|
|
26
|
+
*/
|
|
27
|
+
import * as ag from '@distilled.cloud/litellm/access_groups';
|
|
28
|
+
import * as Effect from 'effect/Effect';
|
|
29
|
+
import { type LitellmOpContext } from './operations.ts';
|
|
30
|
+
import { LitellmRegistryUnreadableError } from './registry-errors.ts';
|
|
31
|
+
import { type AccessGroupAttributes } from './access-group-types.ts';
|
|
32
|
+
/** Every group. The list is the table (`AccessGroupRepository(...).table.find_many`), not a registry. */
|
|
33
|
+
export declare const listAccessGroups: () => Effect.Effect<readonly AccessGroupAttributes[], ag.ListAccessGroupsV1UnifiedAccessGroupGetError | LitellmRegistryUnreadableError, LitellmOpContext>;
|
|
34
|
+
export declare const createAccessGroup: (body: ag.CreateAccessGroupV1UnifiedAccessGroupPostRequest) => Effect.Effect<void, ag.CreateAccessGroupV1UnifiedAccessGroupPostError, import("@distilled.cloud/litellm/Credentials").Credentials>;
|
|
35
|
+
export declare const updateAccessGroup: (accessGroupId: string, body: Omit<ag.UpdateAccessGroupV1UnifiedAccessGroupAccessGroupIdPutRequest, 'access_group_id'>) => Effect.Effect<void, ag.UpdateAccessGroupV1UnifiedAccessGroupAccessGroupIdPutError, import("@distilled.cloud/litellm/Credentials").Credentials>;
|
|
36
|
+
export declare const deleteAccessGroup: (accessGroupId: string) => Effect.Effect<void, ag.DeleteAccessGroupV1UnifiedAccessGroupAccessGroupIdDeleteError, LitellmOpContext>;
|
|
37
|
+
//# sourceMappingURL=access-group-operations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"access-group-operations.d.ts","sourceRoot":"","sources":["../../src/litellm/access-group-operations.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,OAAO,KAAK,EAAE,MAAM,wCAAwC,CAAC;AAC7D,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,KAAK,gBAAgB,EAAgB,MAAM,iBAAiB,CAAC;AACtE,OAAO,EAAE,8BAA8B,EAAE,MAAM,sBAAsB,CAAC;AAEtE,OAAO,EAAE,KAAK,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAKrE,yGAAyG;AACzG,eAAO,MAAM,gBAAgB,QAAO,MAAM,CAAC,MAAM,CAC/C,SAAS,qBAAqB,EAAE,EAChC,EAAE,CAAC,4CAA4C,GAAG,8BAA8B,EAChF,gBAAgB,CAoBf,CAAC;AAEJ,eAAO,MAAM,iBAAiB,SAAU,EAAE,CAAC,gDAAgD,uIACL,CAAC;AAEvF,eAAO,MAAM,iBAAiB,kBACb,MAAM,QACf,IAAI,CAAC,EAAE,CAAC,4DAA4D,EAAE,iBAAiB,CAAC,mJAOzE,CAAC;AAExB,eAAO,MAAM,iBAAiB,kBAAmB,MAAM,4GAepD,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What a `LiteLLM.AccessGroup` declares (props) and what is remembered about it (attributes).
|
|
3
|
+
*
|
|
4
|
+
* ★ THIS IS THE UNIFIED ACCESS GROUP, `LiteLLM_AccessGroupTable` (`/v1/unified_access_group`), not
|
|
5
|
+
* the two other things LiteLLM calls an "access group": a MODEL access group (`access_groups` in a
|
|
6
|
+
* model's `model_info`) and an MCP access group (a bare name on an MCP server row, referenced by
|
|
7
|
+
* `object_permission.mcp_access_groups`). A unified group bundles models, MCP servers and agents
|
|
8
|
+
* under one name and attaches to teams and keys (docs.litellm.ai/docs/proxy/access_groups).
|
|
9
|
+
* ⚠️ TOOLSETS ARE NOT IN IT. `AccessGroupCreateRequest` (`litellm/types/access_group.py`, 1.103.0)
|
|
10
|
+
* has `access_model_names`, `access_mcp_server_ids`, `access_agent_ids`, `assigned_team_ids` and
|
|
11
|
+
* `assigned_key_ids` and no toolset field. A toolset is granted through `object_permission.mcp_toolsets`
|
|
12
|
+
* on a team or key (`LiteLLM.Team`), not through a group.
|
|
13
|
+
* ★ MODELS ARE MODEL NAMES, MCP SERVERS ARE SERVER IDS. `access_model_names` holds the `model_name`
|
|
14
|
+
* a caller sends (`cf-code`), and `access_mcp_server_ids` holds `server_id`s. Declare a server's id
|
|
15
|
+
* with `server.serverId` (a `LiteLLM.MCPServer`) so the dependency edge exists.
|
|
16
|
+
* ⚠️ NOT MODELLED, on purpose: `assigned_team_ids`, `assigned_key_ids` and `access_agent_ids`. A
|
|
17
|
+
* team's group membership is declared on the TEAM (`accessGroupIds`), and LiteLLM mirrors it into
|
|
18
|
+
* `assigned_team_ids` in the same transaction; two resources writing one edge would fight. Agents
|
|
19
|
+
* are not managed here. None of the three is ever sent, and the update is a partial one, so an
|
|
20
|
+
* adopted group keeps whatever it has there.
|
|
21
|
+
*/
|
|
22
|
+
export interface AccessGroupProps {
|
|
23
|
+
/**
|
|
24
|
+
* The group's name, and the way an existing row is ADOPTED: `access_group_name` is UNIQUE in the
|
|
25
|
+
* table (`access_group_endpoints.py` finds it with `find_unique`), so the match is exact. Changing
|
|
26
|
+
* it is an update of the same row, never a replace: the id does not change.
|
|
27
|
+
*/
|
|
28
|
+
readonly accessGroupName: string;
|
|
29
|
+
/** Compared only when declared: adopting a row never clears text a person wrote. Blank is refused. */
|
|
30
|
+
readonly description?: string;
|
|
31
|
+
/**
|
|
32
|
+
* `model_name`s the group grants, compared as a SET and ALWAYS compared (default `[]`): it is an
|
|
33
|
+
* access grant, so an adopted group that grants more than declared is corrected, never left open.
|
|
34
|
+
* ⚠️ LiteLLM prunes a name itself when its last deployment is deleted
|
|
35
|
+
* (`management_helpers/access_group_model_sync.py`), so a plan can show an update for a model that
|
|
36
|
+
* was removed elsewhere.
|
|
37
|
+
*/
|
|
38
|
+
readonly modelNames?: readonly string[];
|
|
39
|
+
/** MCP `server_id`s the group grants, compared as a set and always compared (default `[]`). */
|
|
40
|
+
readonly mcpServerIds?: readonly string[];
|
|
41
|
+
}
|
|
42
|
+
export interface AccessGroupAttributes {
|
|
43
|
+
readonly accessGroupId: string;
|
|
44
|
+
readonly accessGroupName: string;
|
|
45
|
+
readonly description: string | null;
|
|
46
|
+
readonly modelNames: readonly string[];
|
|
47
|
+
readonly mcpServerIds: readonly string[];
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=access-group-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"access-group-types.d.ts","sourceRoot":"","sources":["../../src/litellm/access-group-types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;;;OAIG;IACH,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IACjC,sGAAsG;IACtG,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B;;;;;;OAMG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACxC,+FAA+F;IAC/F,QAAQ,CAAC,YAAY,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAC3C;AAED,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC,QAAQ,CAAC,UAAU,EAAE,SAAS,MAAM,EAAE,CAAC;IACvC,QAAQ,CAAC,YAAY,EAAE,SAAS,MAAM,EAAE,CAAC;CAC1C"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `LiteLLM.AccessGroup` — one row of LiteLLM's unified access group table
|
|
3
|
+
* (`LiteLLM_AccessGroupTable`, `/v1/unified_access_group`): a named bundle of models and MCP servers
|
|
4
|
+
* that teams and keys are attached to. Types and what is left out: access-group-types.ts.
|
|
5
|
+
*
|
|
6
|
+
* ★ ADOPT BY NAME. `access_group_name` is unique in the table, so `accessGroupName` finds the one
|
|
7
|
+
* live row that carries it. A live row with no state is `Unowned`, so it needs `--adopt`.
|
|
8
|
+
* ★ `defaultRemovalPolicy: 'retain'` — deleting a group detaches it from every team and key that
|
|
9
|
+
* holds it (`delete_access_group` rewrites their `access_group_ids`), and those callers lose the
|
|
10
|
+
* models and servers it granted. Opt in with `.pipe(RemovalPolicy.destroy())`.
|
|
11
|
+
* ★ THE GRANTS ARE THE DECLARATION. `modelNames` and `mcpServerIds` are always compared (an
|
|
12
|
+
* undeclared list means "grants nothing"), so an adopted group that grants more is corrected.
|
|
13
|
+
* ⚠️ NO LICENCE GATE ON THESE ROUTES: `access_group_endpoints.py` has no `premium_user` check
|
|
14
|
+
* (grep, 1.103.0), and docs.litellm.ai/docs/proxy/access_groups makes no Enterprise statement.
|
|
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 type { AccessGroupAttributes, AccessGroupProps } from './access-group-types.ts';
|
|
22
|
+
import { LitellmRegistryAbsentAfterWriteError, LitellmRegistryNotConvergedError } from './registry-errors.ts';
|
|
23
|
+
export type { AccessGroupAttributes, AccessGroupProps };
|
|
24
|
+
export type { RegistryError as AccessGroupError } from './registry-errors.ts';
|
|
25
|
+
export interface LiteLLMAccessGroup extends Resource<'LiteLLM.AccessGroup', AccessGroupProps, AccessGroupAttributes> {
|
|
26
|
+
}
|
|
27
|
+
export declare const LiteLLMAccessGroup: import("alchemy").ResourceClass<LiteLLMAccessGroup>;
|
|
28
|
+
export declare const isLiteLLMAccessGroup: (value: unknown) => value is LiteLLMAccessGroup;
|
|
29
|
+
/** ⛔ TEST-ONLY EXPORT. Not on index.ts's barrel. */
|
|
30
|
+
export declare const accessGroupHandlers: {
|
|
31
|
+
/** ⛔ With no `output` this is the adoption probe, so the refusals run here too (registry-support.ts). */
|
|
32
|
+
read: ({ olds, output }: {
|
|
33
|
+
olds: AccessGroupProps;
|
|
34
|
+
output: AccessGroupAttributes | undefined;
|
|
35
|
+
}) => Effect.Effect<AccessGroupAttributes | undefined, import("./registry-errors.ts").LitellmRegistryUnreadableError | import("@distilled.cloud/litellm/Protocol").LitellmOpError, import("@distilled.cloud/litellm/Protocol").LitellmOpContext>;
|
|
36
|
+
diff: ({ news, output, }: {
|
|
37
|
+
news: Input<AccessGroupProps>;
|
|
38
|
+
output: AccessGroupAttributes | 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: AccessGroupProps;
|
|
46
|
+
output: AccessGroupAttributes | undefined;
|
|
47
|
+
}) => Effect.Effect<AccessGroupAttributes, 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 | LitellmRegistryAbsentAfterWriteError | import("./registry-errors.ts").LitellmRegistryInvalidError | LitellmRegistryNotConvergedError | import("./registry-errors.ts").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/access_groups").UnprocessableEntity, import("@distilled.cloud/litellm/Protocol").LitellmOpContext>;
|
|
48
|
+
delete: ({ output }: {
|
|
49
|
+
output: AccessGroupAttributes;
|
|
50
|
+
}) => Effect.Effect<void, import("@distilled.cloud/litellm/access_groups").DeleteAccessGroupV1UnifiedAccessGroupAccessGroupIdDeleteError, import("@distilled.cloud/litellm/Protocol").LitellmOpContext>;
|
|
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 LiteLLMAccessGroupProvider: () => import("effect/Layer").Layer<Provider.Provider<LiteLLMAccessGroup>, never, import("@distilled.cloud/litellm/Protocol").LitellmOpContext>;
|
|
55
|
+
//# sourceMappingURL=access-group.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"access-group.d.ts","sourceRoot":"","sources":["../../src/litellm/access-group.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;AASxC,OAAO,KAAK,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AACvF,OAAO,EACL,oCAAoC,EACpC,gCAAgC,EACjC,MAAM,sBAAsB,CAAC;AAG9B,YAAY,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,CAAC;AACxD,YAAY,EAAE,aAAa,IAAI,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAI9E,MAAM,WAAW,kBAAmB,SAAQ,QAAQ,CAClD,qBAAqB,EACrB,gBAAgB,EAChB,qBAAqB,CACtB;CAAG;AAEJ,eAAO,MAAM,kBAAkB,qDAE7B,CAAC;AAEH,eAAO,MAAM,oBAAoB,UAAW,OAAO,KAAG,KAAK,IAAI,kBACe,CAAC;AAgB/E,oDAAoD;AACpD,eAAO,MAAM,mBAAmB;IAC9B,yGAAyG;IACzG,IAAI,qBAAqB;QAAE,IAAI,EAAE,gBAAgB,CAAC;QAAC,MAAM,EAAE,qBAAqB,GAAG,SAAS,CAAA;KAAE;IAU9F,IAAI,sBAGD;QACD,IAAI,EAAE,KAAK,CAAC,gBAAgB,CAAC,CAAC;QAC9B,MAAM,EAAE,qBAAqB,GAAG,SAAS,CAAC;KAC3C;yBAMkB,MAAM;;yBACN,QAAQ;;IAG3B,SAAS,sBAGN;QACD,IAAI,EAAE,gBAAgB,CAAC;QACvB,MAAM,EAAE,qBAAqB,GAAG,SAAS,CAAC;KAC3C;IAmCD,MAAM,eAAe;QAAE,MAAM,EAAE,qBAAqB,CAAA;KAAE;IAGtD,mGAAmG;IACnG,IAAI;CACL,CAAC;AAEF,eAAO,MAAM,0BAA0B,gJAIpC,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The typed refusals `LiteLLM.Budget` raises on top of `@distilled.cloud/litellm`'s own SDK errors.
|
|
3
|
+
*/
|
|
4
|
+
import type * as budgets from '@distilled.cloud/litellm/budget_management';
|
|
5
|
+
declare const LitellmBudgetHardCapUnjustifiedError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
6
|
+
readonly _tag: "LitellmBudgetHardCapUnjustifiedError";
|
|
7
|
+
} & Readonly<A>;
|
|
8
|
+
/** A `maxBudget` (a HARD cap: LiteLLM answers 429 once it is spent) declared with no reason. */
|
|
9
|
+
export declare class LitellmBudgetHardCapUnjustifiedError extends LitellmBudgetHardCapUnjustifiedError_base<{
|
|
10
|
+
readonly budgetId: string | undefined;
|
|
11
|
+
}> {
|
|
12
|
+
}
|
|
13
|
+
declare const LitellmBudgetFieldNotClearedError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
14
|
+
readonly _tag: "LitellmBudgetFieldNotClearedError";
|
|
15
|
+
} & Readonly<A>;
|
|
16
|
+
/**
|
|
17
|
+
* The write returned no error but the row still carries a limit the declaration does not.
|
|
18
|
+
* `/budget/update` may merge with `exclude_none` (the way `/config/pass_through_endpoint` does),
|
|
19
|
+
* in which case a limit can never be cleared by an update. Refused, never claimed as done.
|
|
20
|
+
*/
|
|
21
|
+
export declare class LitellmBudgetFieldNotClearedError extends LitellmBudgetFieldNotClearedError_base<{
|
|
22
|
+
readonly budgetId: string;
|
|
23
|
+
readonly fields: readonly string[];
|
|
24
|
+
}> {
|
|
25
|
+
}
|
|
26
|
+
declare const LitellmBudgetUnreadableError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
27
|
+
readonly _tag: "LitellmBudgetUnreadableError";
|
|
28
|
+
} & Readonly<A>;
|
|
29
|
+
/** `/budget/info` answered something that is not a list of budget rows. */
|
|
30
|
+
export declare class LitellmBudgetUnreadableError extends LitellmBudgetUnreadableError_base<{
|
|
31
|
+
readonly budgetId: string;
|
|
32
|
+
}> {
|
|
33
|
+
}
|
|
34
|
+
export type BudgetError = budgets.PostInfoBudgetBudgetInfoError | budgets.PostNewBudgetBudgetNewError | budgets.UpdateBudgetBudgetUpdatePostError | budgets.DeleteBudgetBudgetDeletePostError | LitellmBudgetHardCapUnjustifiedError | LitellmBudgetFieldNotClearedError | LitellmBudgetUnreadableError;
|
|
35
|
+
export {};
|
|
36
|
+
//# sourceMappingURL=budget-errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"budget-errors.d.ts","sourceRoot":"","sources":["../../src/litellm/budget-errors.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,KAAK,OAAO,MAAM,4CAA4C,CAAC;;;;AAG3E,gGAAgG;AAChG,qBAAa,oCAAqC,SAAQ,0CAExD;IACA,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;CACvC,CAAC;CAAG;;;;AAEL;;;;GAIG;AACH,qBAAa,iCAAkC,SAAQ,uCAErD;IACA,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;CACpC,CAAC;CAAG;;;;AAEL,2EAA2E;AAC3E,qBAAa,4BAA6B,SAAQ,kCAAiD;IACjG,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;CAC3B,CAAC;CAAG;AAEL,MAAM,MAAM,WAAW,GACnB,OAAO,CAAC,6BAA6B,GACrC,OAAO,CAAC,2BAA2B,GACnC,OAAO,CAAC,iCAAiC,GACzC,OAAO,CAAC,iCAAiC,GACzC,oCAAoC,GACpC,iCAAiC,GACjC,4BAA4B,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Props, wire bodies and comparison for `LiteLLM.Budget`, testable without a server.
|
|
3
|
+
*
|
|
4
|
+
* ⛔ NO SILENT `max_budget`. LiteLLM's own field doc: "Requests will fail if this budget (in USD)
|
|
5
|
+
* is exceeded" — a hard cap. On 2026-09-28 an undeclared $60/day `max_budget` on
|
|
6
|
+
* `hf-tier-interactive` 429'd the whole claude2 fleet. So `maxBudget` is never defaulted and is
|
|
7
|
+
* refused unless `maxBudgetReason` says why; `softBudget` is the monitoring field (it "will NOT
|
|
8
|
+
* fail if this is exceeded", it fires the alert).
|
|
9
|
+
* ⚠️ NOT MODELLED: `max_parallel_requests`, `model_max_budget`, `budget_reset_at`. The row read
|
|
10
|
+
* back (`BudgetListItem`, generated at LiteLLM 1.100.0) has none of them, so a declaration of
|
|
11
|
+
* them could never be diffed. Add them when a read that returns them is measured.
|
|
12
|
+
*/
|
|
13
|
+
import type * as budgets from '@distilled.cloud/litellm/budget_management';
|
|
14
|
+
export interface BudgetProps {
|
|
15
|
+
/** Live budget id. Set it to adopt an existing row (`hf-tier-agent`); default is a deterministic physical name. */
|
|
16
|
+
readonly budgetId?: string;
|
|
17
|
+
/** Alert threshold in USD. Requests keep flowing when exceeded. The monitoring field. */
|
|
18
|
+
readonly softBudget?: number;
|
|
19
|
+
/** HARD cap in USD: requests fail (429) once spent. Refused unless `maxBudgetReason` is set. */
|
|
20
|
+
readonly maxBudget?: number;
|
|
21
|
+
/** Why a hard cap is wanted. Required with `maxBudget`; recorded in the declaration only. */
|
|
22
|
+
readonly maxBudgetReason?: string;
|
|
23
|
+
/** Reset period, e.g. `'1d'`, `'28d'`. */
|
|
24
|
+
readonly budgetDuration?: string;
|
|
25
|
+
/** Requests per minute. */
|
|
26
|
+
readonly rpmLimit?: number;
|
|
27
|
+
/** Tokens per minute. */
|
|
28
|
+
readonly tpmLimit?: number;
|
|
29
|
+
}
|
|
30
|
+
export interface BudgetAttributes {
|
|
31
|
+
readonly budgetId: string;
|
|
32
|
+
readonly softBudget: number | null;
|
|
33
|
+
readonly maxBudget: number | null;
|
|
34
|
+
readonly budgetDuration: string | null;
|
|
35
|
+
readonly rpmLimit: number | null;
|
|
36
|
+
readonly tpmLimit: number | null;
|
|
37
|
+
}
|
|
38
|
+
export declare const isHardCapUnjustified: (props: BudgetProps) => boolean;
|
|
39
|
+
/** Create body: only what is declared. */
|
|
40
|
+
export declare const createBody: (props: BudgetProps, budgetId: string) => budgets.PostNewBudgetBudgetNewRequest;
|
|
41
|
+
/** Update body: declared fields, plus an explicit `null` for a live limit the declaration dropped. */
|
|
42
|
+
export declare const updateBody: (props: BudgetProps, live: BudgetAttributes) => budgets.UpdateBudgetBudgetUpdatePostRequest;
|
|
43
|
+
/** Wire names of the fields where live and declared disagree. */
|
|
44
|
+
export declare const differing: (live: BudgetAttributes, props: BudgetProps) => readonly string[];
|
|
45
|
+
/**
|
|
46
|
+
* One row of `/budget/info`. `tpm_limit`/`rpm_limit` are `BigInt?` in LiteLLM's schema and come
|
|
47
|
+
* back as decimal strings (the generated `BudgetListItem` says so), hence `Number()`.
|
|
48
|
+
*/
|
|
49
|
+
export declare const toAttributes: (row: Record<string, unknown>) => BudgetAttributes;
|
|
50
|
+
//# sourceMappingURL=budget-form.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"budget-form.d.ts","sourceRoot":"","sources":["../../src/litellm/budget-form.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,KAAK,KAAK,OAAO,MAAM,4CAA4C,CAAC;AAE3E,MAAM,WAAW,WAAW;IAC1B,mHAAmH;IACnH,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,yFAAyF;IACzF,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,gGAAgG;IAChG,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,6FAA6F;IAC7F,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC;IAClC,0CAA0C;IAC1C,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;IACjC,2BAA2B;IAC3B,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,yBAAyB;IACzB,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,QAAQ,CAAC,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IACvC,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;CAClC;AAWD,eAAO,MAAM,oBAAoB,UAAW,WAAW,KAAG,OACoB,CAAC;AAE/E,0CAA0C;AAC1C,eAAO,MAAM,UAAU,UACd,WAAW,YACR,MAAM,KACf,OAAO,CAAC,6BAIV,CAAC;AAEF,sGAAsG;AACtG,eAAO,MAAM,UAAU,UACd,WAAW,QACZ,gBAAgB,KACrB,OAAO,CAAC,mCAOV,CAAC;AAEF,iEAAiE;AACjE,eAAO,MAAM,SAAS,SAAU,gBAAgB,SAAS,WAAW,KAAG,SAAS,MAAM,EACG,CAAC;AAK1F;;;GAGG;AACH,eAAO,MAAM,YAAY,QAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAG,gBAO1D,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The four LiteLLM `/budget/*` calls `LiteLLM.Budget` uses, through the SDK's typed operations.
|
|
3
|
+
*
|
|
4
|
+
* ★ READS GO THROUGH `/budget/list` (the whole table, a bare array), not `/budget/info`. Both
|
|
5
|
+
* answer `body: unknown` in the generated schema, and what `/budget/info` does for an id that is
|
|
6
|
+
* not there is unmeasured; a list answers absence unambiguously.
|
|
7
|
+
* ⚠️ Unlike pass-through endpoints, each budget is its own DB row, so no semaphore.
|
|
8
|
+
* ⚠️ DELETE is idempotent BY THIS FUNCTION: a `BadRequest` re-lists and is swallowed only when the
|
|
9
|
+
* id is genuinely absent, never on message text (pass-through `operations.ts`' rule).
|
|
10
|
+
*/
|
|
11
|
+
import * as budgets from '@distilled.cloud/litellm/budget_management';
|
|
12
|
+
import * as Effect from 'effect/Effect';
|
|
13
|
+
import { type LitellmOpContext } from './operations.ts';
|
|
14
|
+
import { type BudgetAttributes } from './budget-form.ts';
|
|
15
|
+
import { LitellmBudgetUnreadableError } from './budget-errors.ts';
|
|
16
|
+
export declare const listBudgets: () => Effect.Effect<readonly BudgetAttributes[], budgets.ListBudgetBudgetListGetError | LitellmBudgetUnreadableError, LitellmOpContext>;
|
|
17
|
+
export declare const createBudget: (body: budgets.PostNewBudgetBudgetNewRequest) => Effect.Effect<void, budgets.PostNewBudgetBudgetNewError, import("@distilled.cloud/litellm/Credentials").Credentials>;
|
|
18
|
+
export declare const updateBudget: (body: budgets.UpdateBudgetBudgetUpdatePostRequest) => Effect.Effect<void, budgets.UpdateBudgetBudgetUpdatePostError, import("@distilled.cloud/litellm/Credentials").Credentials>;
|
|
19
|
+
export declare const deleteBudget: (id: string) => Effect.Effect<void, import("@distilled.cloud/caddy").BadGateway | budgets.BadRequest | import("@distilled.cloud/caddy").ConfigError | import("@distilled.cloud/caddy").GatewayTimeout | import("effect/unstable/http/HttpClientError").HttpClientError | import("@distilled.cloud/caddy").InternalServerError | LitellmBudgetUnreadableError | 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 | budgets.UnprocessableEntity, LitellmOpContext>;
|
|
20
|
+
//# sourceMappingURL=budget-operations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"budget-operations.d.ts","sourceRoot":"","sources":["../../src/litellm/budget-operations.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,OAAO,MAAM,4CAA4C,CAAC;AACtE,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,KAAK,gBAAgB,EAAgB,MAAM,iBAAiB,CAAC;AACtE,OAAO,EAAE,KAAK,gBAAgB,EAAgB,MAAM,kBAAkB,CAAC;AACvE,OAAO,EAAE,4BAA4B,EAAE,MAAM,oBAAoB,CAAC;AAElE,eAAO,MAAM,WAAW,QAAO,MAAM,CAAC,MAAM,CAC1C,SAAS,gBAAgB,EAAE,EAC3B,OAAO,CAAC,4BAA4B,GAAG,4BAA4B,EACnE,gBAAgB,CAaf,CAAC;AAEJ,eAAO,MAAM,YAAY,SAAU,OAAO,CAAC,6BAA6B,yHACA,CAAC;AAEzE,eAAO,MAAM,YAAY,SAAU,OAAO,CAAC,mCAAmC,+HACA,CAAC;AAE/E,eAAO,MAAM,YAAY,OAAQ,MAAM,ypBAUpC,CAAC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `LiteLLM.Budget` — one row of LiteLLM's `LiteLLM_BudgetTable` (`/budget/*`), the "tier" keys and
|
|
3
|
+
* teams bind to (`hf-tier-*`).
|
|
4
|
+
*
|
|
5
|
+
* ★ MONITORING, NOT LIMITS (Tim, 2026-09-28): `softBudget` is the prop; `maxBudget` is a hard cap
|
|
6
|
+
* that 429s every caller and is refused without `maxBudgetReason` (budget-form.ts).
|
|
7
|
+
* ★ ADOPT BY id. `budgetId` names the live row; without it a deterministic physical name is used.
|
|
8
|
+
* A foreign row with that id is `Unowned`, so it needs `--adopt`.
|
|
9
|
+
* ★ `defaultRemovalPolicy: 'retain'` — deleting a budget row that keys still reference either
|
|
10
|
+
* fails or detaches them, and a detached key loses its rate limits. Opt in with
|
|
11
|
+
* `.pipe(RemovalPolicy.destroy())`.
|
|
12
|
+
* ⛔ CLEARING A LIMIT: sent as an explicit `null`. If this LiteLLM merges with `exclude_none` the
|
|
13
|
+
* row keeps the old value; reconcile reads back and FAILS (`LitellmBudgetFieldNotClearedError`)
|
|
14
|
+
* rather than report a cleared cap. Unmeasured against a live proxy at 1.103.0.
|
|
15
|
+
* ⛔ NO 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 { LitellmBudgetFieldNotClearedError, LitellmBudgetHardCapUnjustifiedError } from './budget-errors.ts';
|
|
22
|
+
import { type BudgetAttributes, type BudgetProps } from './budget-form.ts';
|
|
23
|
+
export type { BudgetAttributes, BudgetProps };
|
|
24
|
+
export type { BudgetError } from './budget-errors.ts';
|
|
25
|
+
export interface LiteLLMBudget extends Resource<'LiteLLM.Budget', BudgetProps, BudgetAttributes> {
|
|
26
|
+
}
|
|
27
|
+
export declare const LiteLLMBudget: import("alchemy").ResourceClass<LiteLLMBudget>;
|
|
28
|
+
export declare const isLiteLLMBudget: (value: unknown) => value is LiteLLMBudget;
|
|
29
|
+
type Args<P> = {
|
|
30
|
+
id: string;
|
|
31
|
+
instanceId: string;
|
|
32
|
+
output: BudgetAttributes | undefined;
|
|
33
|
+
} & P;
|
|
34
|
+
/** ⛔ TEST-ONLY EXPORT. Not on index.ts's barrel. */
|
|
35
|
+
export declare const budgetHandlers: {
|
|
36
|
+
read: ({ id, instanceId, olds, output }: Args<{
|
|
37
|
+
olds: BudgetProps;
|
|
38
|
+
}>) => Effect.Effect<BudgetAttributes | undefined, import("./budget-errors.ts").LitellmBudgetUnreadableError | import("@distilled.cloud/litellm/budget_management").ListBudgetBudgetListGetError, import("alchemy").InstanceId | import("alchemy").Stack | import("alchemy").Stage | import("@distilled.cloud/litellm/Protocol").LitellmOpContext>;
|
|
39
|
+
diff: ({ news, output }: {
|
|
40
|
+
news: Input<BudgetProps>;
|
|
41
|
+
output: BudgetAttributes | undefined;
|
|
42
|
+
}) => Effect.Effect<{
|
|
43
|
+
readonly action: 'replace';
|
|
44
|
+
readonly deleteFirst: false;
|
|
45
|
+
} | {
|
|
46
|
+
readonly deleteFirst?: never;
|
|
47
|
+
readonly action: 'noop';
|
|
48
|
+
} | {
|
|
49
|
+
readonly deleteFirst?: never;
|
|
50
|
+
readonly action: 'update';
|
|
51
|
+
} | undefined, LitellmBudgetHardCapUnjustifiedError, never>;
|
|
52
|
+
reconcile: ({ id, instanceId, news, output }: Args<{
|
|
53
|
+
news: BudgetProps;
|
|
54
|
+
}>) => Effect.Effect<BudgetAttributes, import("@distilled.cloud/caddy").BadGateway | import("@distilled.cloud/litellm/budget_management").BadRequest | import("@distilled.cloud/caddy").ConfigError | import("@distilled.cloud/caddy").GatewayTimeout | import("effect/unstable/http/HttpClientError").HttpClientError | import("@distilled.cloud/caddy").InternalServerError | LitellmBudgetFieldNotClearedError | LitellmBudgetHardCapUnjustifiedError | import("./budget-errors.ts").LitellmBudgetUnreadableError | 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/budget_management").UnprocessableEntity, import("alchemy").InstanceId | import("alchemy").Stack | import("alchemy").Stage | import("@distilled.cloud/litellm/Protocol").LitellmOpContext>;
|
|
55
|
+
delete: ({ output }: {
|
|
56
|
+
output: BudgetAttributes;
|
|
57
|
+
}) => Effect.Effect<void, import("@distilled.cloud/caddy").BadGateway | import("@distilled.cloud/litellm/budget_management").BadRequest | import("@distilled.cloud/caddy").ConfigError | import("@distilled.cloud/caddy").GatewayTimeout | import("effect/unstable/http/HttpClientError").HttpClientError | import("@distilled.cloud/caddy").InternalServerError | import("./budget-errors.ts").LitellmBudgetUnreadableError | 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/budget_management").UnprocessableEntity, import("@distilled.cloud/litellm/Protocol").LitellmOpContext>;
|
|
58
|
+
list: () => Effect.Effect<never[], never, never>;
|
|
59
|
+
};
|
|
60
|
+
export declare const LiteLLMBudgetProvider: () => import("effect/Layer").Layer<Provider.Provider<LiteLLMBudget>, never, import("alchemy").Stack | import("alchemy").Stage | import("@distilled.cloud/litellm/Protocol").LitellmOpContext>;
|
|
61
|
+
//# sourceMappingURL=budget.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"budget.d.ts","sourceRoot":"","sources":["../../src/litellm/budget.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;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,iCAAiC,EACjC,oCAAoC,EACrC,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,WAAW,EAKjB,MAAM,kBAAkB,CAAC;AAG1B,YAAY,EAAE,gBAAgB,EAAE,WAAW,EAAE,CAAC;AAC9C,YAAY,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEtD,MAAM,WAAW,aAAc,SAAQ,QAAQ,CAAC,gBAAgB,EAAE,WAAW,EAAE,gBAAgB,CAAC;CAAG;AAEnG,eAAO,MAAM,aAAa,gDAExB,CAAC;AAEH,eAAO,MAAM,eAAe,UAAW,OAAO,KAAG,KAAK,IAAI,aACe,CAAC;AAmB1E,KAAK,IAAI,CAAC,CAAC,IAAI;IACb,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,gBAAgB,GAAG,SAAS,CAAC;CACtC,GAAG,CAAC,CAAC;AAEN,oDAAoD;AACpD,eAAO,MAAM,cAAc;IACzB,IAAI,qCAAqC,IAAI,CAAC;QAAE,IAAI,EAAE,WAAW,CAAA;KAAE,CAAC;IAQpE,IAAI,qBAAqB;QAAE,IAAI,EAAE,KAAK,CAAC,WAAW,CAAC,CAAC;QAAC,MAAM,EAAE,gBAAgB,GAAG,SAAS,CAAA;KAAE;yBAOpE,SAAS;;;;yBAGb,MAAM;;;yBACN,QAAQ;;IAG3B,SAAS,qCAAqC,IAAI,CAAC;QAAE,IAAI,EAAE,WAAW,CAAA;KAAE,CAAC;IAuBzE,MAAM,eAAe;QAAE,MAAM,EAAE,gBAAgB,CAAA;KAAE;IAEjD,IAAI;CACL,CAAC;AAEF,eAAO,MAAM,qBAAqB,+LACyD,CAAC"}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The typed refusals `LiteLLM.Credential` raises on top of `@distilled.cloud/litellm`'s own SDK
|
|
3
|
+
* errors.
|
|
4
|
+
*
|
|
5
|
+
* ⛔ NO MESSAGE HERE MAY CARRY A CREDENTIAL VALUE: only the credential's NAME, field names, the
|
|
6
|
+
* NAMES of environment variables, and SDK error text — exactly like mcp-server-errors.ts.
|
|
7
|
+
* ⚠️ THE SDK'S TYPED UNION IS NARROW ON PURPOSE, and the runtime is wider: the credential routes
|
|
8
|
+
* declare only `UnprocessableEntity` (422) in `credential_management.ts`, so a create on an
|
|
9
|
+
* existing name — which the live 1.103.0 container answers `409` (`endpoints.py`'s
|
|
10
|
+
* `_credential_exists_detail`) — decodes at run time as the core `Conflict` class (`Errors.ts`
|
|
11
|
+
* re-exports it, but it is not in the operation's TS union) and PROPAGATES as such, never
|
|
12
|
+
* silently swallowed (S21). The read's and delete's `404` is TYPED as the SDK's
|
|
13
|
+
* `CredentialNotFound` (a distilled patch matched on the vendor's "Credential not found"
|
|
14
|
+
* message, `endpoints.py`), so credential-operations.ts `catchTag`s it instead of `instanceof`
|
|
15
|
+
* `NotFound`: a 404 from a front proxy, Access, or a wrong base path stays a `NotFound` and is
|
|
16
|
+
* never read as absence. `CredentialError` carries the typed members of the four operations the
|
|
17
|
+
* resource calls (create, by-name read, PATCH, delete), plus the refusals below.
|
|
18
|
+
*/
|
|
19
|
+
import type * as credentials from '@distilled.cloud/litellm/credential_management';
|
|
20
|
+
import type { HttpClientErrorReason } from 'effect/unstable/http/HttpClientError';
|
|
21
|
+
declare const LitellmCredentialInvalidError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
22
|
+
readonly _tag: "LitellmCredentialInvalidError";
|
|
23
|
+
} & Readonly<A>;
|
|
24
|
+
/** A declaration the resource refuses before any request: a combination nobody meant. */
|
|
25
|
+
export declare class LitellmCredentialInvalidError extends LitellmCredentialInvalidError_base<{
|
|
26
|
+
readonly credentialName: string;
|
|
27
|
+
readonly problem: string;
|
|
28
|
+
}> {
|
|
29
|
+
get message(): string;
|
|
30
|
+
}
|
|
31
|
+
declare const LitellmCredentialTransportError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
32
|
+
readonly _tag: "LitellmCredentialTransportError";
|
|
33
|
+
} & Readonly<A>;
|
|
34
|
+
/**
|
|
35
|
+
* A create's `POST /credentials` or an update's `PATCH /credentials/{name}` failed on the wire (or
|
|
36
|
+
* its answer could not be read), so nobody knows whether the credential is what was asked for.
|
|
37
|
+
*
|
|
38
|
+
* ⛔ THIS IS WHAT STANDS IN FOR AN `HttpClientError`, WHICH CARRIES ITS REQUEST, AND THE REQUEST
|
|
39
|
+
* BODY OF A CREATE OR UPDATE IS `{"credential_name": …, "credential_values": {"api_key": "…"}}`.
|
|
40
|
+
* Measured 2026-09-30: on a dropped connection `JSON.stringify(error)`, `Bun.inspect(error)` and
|
|
41
|
+
* Effect's JSON logger all printed the value, as did a failed deploy over it — the same leak
|
|
42
|
+
* key-operations.ts's `LitellmKeyTransportError` closes. A defect reading a broken answer
|
|
43
|
+
* (`protocol-rest.ts` reads it `Effect.orDie`) carries the same request. So `reason` keeps the
|
|
44
|
+
* `HttpClientError` reason's TAG (a string) and nothing else: no request, no cause, no
|
|
45
|
+
* description. The credential NAME stays — it is not secret.
|
|
46
|
+
*/
|
|
47
|
+
export declare class LitellmCredentialTransportError extends LitellmCredentialTransportError_base<{
|
|
48
|
+
readonly credentialName: string;
|
|
49
|
+
readonly reason: HttpClientErrorReason['_tag'] | 'Defect';
|
|
50
|
+
}> {
|
|
51
|
+
get message(): string;
|
|
52
|
+
}
|
|
53
|
+
declare const LitellmCredentialDebugLoggingError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
54
|
+
readonly _tag: "LitellmCredentialDebugLoggingError";
|
|
55
|
+
} & Readonly<A>;
|
|
56
|
+
/**
|
|
57
|
+
* The SDK prints request and response bodies to stderr while `DISTILLED_DEBUG_HTTP` is set, and a
|
|
58
|
+
* `POST /credentials` carries the values in its body — refused before any request, exactly like
|
|
59
|
+
* `key-secret.ts`'s `refuseDebugLogging` for `/key/generate`.
|
|
60
|
+
*/
|
|
61
|
+
export declare class LitellmCredentialDebugLoggingError extends LitellmCredentialDebugLoggingError_base<{
|
|
62
|
+
readonly credentialName: string;
|
|
63
|
+
}> {
|
|
64
|
+
get message(): string;
|
|
65
|
+
}
|
|
66
|
+
declare const LitellmCredentialEnvUnsetError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
67
|
+
readonly _tag: "LitellmCredentialEnvUnsetError";
|
|
68
|
+
} & Readonly<A>;
|
|
69
|
+
/**
|
|
70
|
+
* A write had to send the credential values and the deploying process does not hold one or more
|
|
71
|
+
* of the declared variables. The names are listed, never a value.
|
|
72
|
+
*/
|
|
73
|
+
export declare class LitellmCredentialEnvUnsetError extends LitellmCredentialEnvUnsetError_base<{
|
|
74
|
+
readonly credentialName: string;
|
|
75
|
+
readonly variables: readonly string[];
|
|
76
|
+
}> {
|
|
77
|
+
get message(): string;
|
|
78
|
+
}
|
|
79
|
+
declare const LitellmCredentialUnreadableError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
80
|
+
readonly _tag: "LitellmCredentialUnreadableError";
|
|
81
|
+
} & Readonly<A>;
|
|
82
|
+
/**
|
|
83
|
+
* A credentials read answered something that is not a row of the credential table (or named a
|
|
84
|
+
* different row), so adopt-by-name cannot trust it. The by-name read is this resource's only
|
|
85
|
+
* read, so a row it cannot recognise is refused rather than guessed at.
|
|
86
|
+
*/
|
|
87
|
+
export declare class LitellmCredentialUnreadableError extends LitellmCredentialUnreadableError_base<{
|
|
88
|
+
readonly reason: string;
|
|
89
|
+
}> {
|
|
90
|
+
get message(): string;
|
|
91
|
+
}
|
|
92
|
+
declare const LitellmCredentialAbsentAfterWriteError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
93
|
+
readonly _tag: "LitellmCredentialAbsentAfterWriteError";
|
|
94
|
+
} & Readonly<A>;
|
|
95
|
+
/**
|
|
96
|
+
* A create or update returned no error, yet the by-name read does not answer the credential — the
|
|
97
|
+
* proxy failed to record it in memory or in the DB. Refused instead of reported as done.
|
|
98
|
+
*/
|
|
99
|
+
export declare class LitellmCredentialAbsentAfterWriteError extends LitellmCredentialAbsentAfterWriteError_base<{
|
|
100
|
+
readonly credentialName: string;
|
|
101
|
+
}> {
|
|
102
|
+
get message(): string;
|
|
103
|
+
}
|
|
104
|
+
declare const LitellmCredentialNotConvergedError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
105
|
+
readonly _tag: "LitellmCredentialNotConvergedError";
|
|
106
|
+
} & Readonly<A>;
|
|
107
|
+
/**
|
|
108
|
+
* The write returned no error but the credential still differs from the declaration. The update
|
|
109
|
+
* path this resource uses is a PATCH merge (credential.ts, credential-operations.ts) — or a
|
|
110
|
+
* whole-row rewrite to drop a key — so a residual difference is refused here instead of being
|
|
111
|
+
* reported as converged.
|
|
112
|
+
*/
|
|
113
|
+
export declare class LitellmCredentialNotConvergedError extends LitellmCredentialNotConvergedError_base<{
|
|
114
|
+
readonly credentialName: string;
|
|
115
|
+
readonly fields: readonly string[];
|
|
116
|
+
}> {
|
|
117
|
+
get message(): string;
|
|
118
|
+
}
|
|
119
|
+
declare const LitellmCredentialRewriteError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
120
|
+
readonly _tag: "LitellmCredentialRewriteError";
|
|
121
|
+
} & Readonly<A>;
|
|
122
|
+
/** A rewrite deleted the old row before its POST failed. Keep only the failure tag. */
|
|
123
|
+
export declare class LitellmCredentialRewriteError extends LitellmCredentialRewriteError_base<{
|
|
124
|
+
readonly credentialName: string;
|
|
125
|
+
readonly reason: string;
|
|
126
|
+
}> {
|
|
127
|
+
get message(): string;
|
|
128
|
+
}
|
|
129
|
+
export type CredentialError = credentials.CreateCredentialCredentialsPostError | credentials.GetCredentialByNameCredentialsByNameCredentialNameGetError | credentials.UpdateCredentialCredentialsCredentialNamePatchError | credentials.DeleteCredentialCredentialsCredentialNameDeleteError | LitellmCredentialInvalidError | LitellmCredentialTransportError | LitellmCredentialRewriteError | LitellmCredentialDebugLoggingError | LitellmCredentialEnvUnsetError | LitellmCredentialUnreadableError | LitellmCredentialAbsentAfterWriteError | LitellmCredentialNotConvergedError;
|
|
130
|
+
export {};
|
|
131
|
+
//# sourceMappingURL=credential-errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"credential-errors.d.ts","sourceRoot":"","sources":["../../src/litellm/credential-errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,KAAK,KAAK,WAAW,MAAM,gDAAgD,CAAC;AAEnF,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,sCAAsC,CAAC;;;;AAElF,yFAAyF;AACzF,qBAAa,6BAA8B,SAAQ,mCAEjD;IACA,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B,CAAC;IACA,IAAa,OAAO,IAAI,MAAM,CAE7B;CACF;;;;AAED;;;;;;;;;;;;GAYG;AACH,qBAAa,+BAAgC,SAAQ,qCAEnD;IACA,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,MAAM,EAAE,qBAAqB,CAAC,MAAM,CAAC,GAAG,QAAQ,CAAC;CAC3D,CAAC;IACA,IAAa,OAAO,IAAI,MAAM,CAQ7B;CACF;;;;AAED;;;;GAIG;AACH,qBAAa,kCAAmC,SAAQ,wCAEtD;IACA,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;CACjC,CAAC;IACA,IAAa,OAAO,IAAI,MAAM,CAM7B;CACF;;;;AAED;;;GAGG;AACH,qBAAa,8BAA+B,SAAQ,oCAElD;IACA,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,SAAS,EAAE,SAAS,MAAM,EAAE,CAAC;CACvC,CAAC;IACA,IAAa,OAAO,IAAI,MAAM,CAK7B;CACF;;;;AAED;;;;GAIG;AACH,qBAAa,gCAAiC,SAAQ,sCAEpD;IACA,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB,CAAC;IACA,IAAa,OAAO,IAAI,MAAM,CAE7B;CACF;;;;AAED;;;GAGG;AACH,qBAAa,sCAAuC,SAAQ,4CAE1D;IACA,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;CACjC,CAAC;IACA,IAAa,OAAO,IAAI,MAAM,CAK7B;CACF;;;;AAED;;;;;GAKG;AACH,qBAAa,kCAAmC,SAAQ,wCAEtD;IACA,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;CACpC,CAAC;IACA,IAAa,OAAO,IAAI,MAAM,CAK7B;CACF;;;;AAED,uFAAuF;AACvF,qBAAa,6BAA8B,SAAQ,mCAEjD;IACA,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB,CAAC;IACA,IAAa,OAAO,IAAI,MAAM,CAO7B;CACF;AAED,MAAM,MAAM,eAAe,GACvB,WAAW,CAAC,oCAAoC,GAChD,WAAW,CAAC,0DAA0D,GACtE,WAAW,CAAC,mDAAmD,GAC/D,WAAW,CAAC,oDAAoD,GAChE,6BAA6B,GAC7B,+BAA+B,GAC/B,6BAA6B,GAC7B,kCAAkC,GAClC,8BAA8B,GAC9B,gCAAgC,GAChC,sCAAsC,GACtC,kCAAkC,CAAC"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Refusals, wire bodies, the read shape and the comparison for `LiteLLM.Credential`, testable
|
|
3
|
+
* without a server. Value handling is credential-values.ts's.
|
|
4
|
+
*
|
|
5
|
+
* ⛔ WHAT IS COMPARED, WITH THE VENDOR'S MASKING IN MIND. Both reads answer `credential_values`
|
|
6
|
+
* with SENSITIVE-keyed values masked (2 + `****` + 2, `*****` for a short string —
|
|
7
|
+
* `litellm_logging.py::_get_masked_values`, measured in the live 1.103.0 container) and
|
|
8
|
+
* `credential_info` in full:
|
|
9
|
+
* - `credential_info` is the complete intended map, including on adoption. Nonempty PATCH
|
|
10
|
+
* normally replaces DB info (`credential_endpoints/endpoints.py:314-319`, 1.103.0), while
|
|
11
|
+
* memory merges (:385-387). Empty info leaves DB unchanged. Dropping a live info key therefore
|
|
12
|
+
* requires a rewrite to converge both stores (`removedInfoKeys`). Every PATCH sends full info.
|
|
13
|
+
* - the values are compared only through the seal of the values this process RESOLVED
|
|
14
|
+
* (`valuesSeal`, credential-values.ts) — never against the masked fragments, which are
|
|
15
|
+
* partial secrets and are never copied into state.
|
|
16
|
+
* ★ A CHANGED ROW IS PATCHED, NOT REWRITTEN. The vendor's PATCH merges VALUES by key
|
|
17
|
+
* (`update_db_credential`:312), so updating a value or an `info` entry is a PATCH carrying the
|
|
18
|
+
* declared `credential_info` and (only when the values are stale) the resolved
|
|
19
|
+
* `credential_values`. A PATCH that fails on the wire leaves the row it was merging into — the
|
|
20
|
+
* fix for the review's finding 3, where a DELETE + POST rewrite left NO row when the POST failed
|
|
21
|
+
* after the DELETE. PATCH cannot REMOVE a value key or an in-memory info key, so dropping either
|
|
22
|
+
* is still a whole-row rewrite (credential.ts decides). Names from the read prove removal. The
|
|
23
|
+
* PATCH body carries `credential_name` IN THE BODY as a second member (`credential_name_body`,
|
|
24
|
+
* wire-named `credential_name`) because the vendor's `UpdateCredentialItem` requires it and a
|
|
25
|
+
* Smithy member has one binding — the path label can't also be the body field; the distilled
|
|
26
|
+
* patch for it is `patches/credential_management/update_credential_credentials__credential_name__patch.json`.
|
|
27
|
+
*/
|
|
28
|
+
import type * as credentials from '@distilled.cloud/litellm/credential_management';
|
|
29
|
+
import { type CredentialAttributes, type CredentialProps } from './credential-types.ts';
|
|
30
|
+
import type { ResolvedValues } from './credential-values.ts';
|
|
31
|
+
/** The first reason a declaration is refused, or `undefined`. Pure: no environment, no server. */
|
|
32
|
+
export declare const firstProblem: (props: CredentialProps) => string | undefined;
|
|
33
|
+
/**
|
|
34
|
+
* Wire names of the fields where the live row and the declaration disagree, for a
|
|
35
|
+
* `NotConvergedError` and for the drift decision. The NAME is identity — a changed name plans a
|
|
36
|
+
* REPLACE in credential.ts and is never compared here. Values are never compared against the
|
|
37
|
+
* live row at all: the seal decides (credential-values.ts).
|
|
38
|
+
*/
|
|
39
|
+
export declare const differing: (live: CredentialAttributes, props: CredentialProps) => readonly string[];
|
|
40
|
+
/**
|
|
41
|
+
* One row of a credentials read, as attributes. ⛔ COPIES NO `credential_values` ENTRY: a masked
|
|
42
|
+
* fragment (`sk****45`) is a partial secret, and a sensitive key the read masks would land half a
|
|
43
|
+
* secret in Alchemy's state. The `credential_info` mirror drops SENSITIVE-KEYED entries (they are
|
|
44
|
+
* returned unmasked and would mirror a clear secret into state). The digest is the caller's
|
|
45
|
+
* (credential.ts fills `valuesSeal` from state; a row cannot supply one).
|
|
46
|
+
*/
|
|
47
|
+
export declare const toAttributes: (row: Record<string, unknown>) => CredentialAttributes;
|
|
48
|
+
/** The rows a credentials read carries, `CredentialItem`-shaped. */
|
|
49
|
+
export declare const isCredentialRow: (row: unknown) => row is Record<string, unknown>;
|
|
50
|
+
/**
|
|
51
|
+
* The literal values a create or a values-stale PATCH sends, unwrapped from their `Redacted`
|
|
52
|
+
* exactly once. ⛔ EVERY DECLARED ENTRY IS SENT: the whole-row create and the values-stale PATCH
|
|
53
|
+
* both demand every declared value (`requireValues`), so there is no partial send that could
|
|
54
|
+
* leave a stale value behind under a declared key.
|
|
55
|
+
*/
|
|
56
|
+
export declare const literalValues: (resolved: ResolvedValues) => Readonly<Record<string, unknown>>;
|
|
57
|
+
/** The body `POST /credentials` carries — the name IN THE BODY (measured with a stub fetch). */
|
|
58
|
+
export declare const createBody: (props: CredentialProps, resolved: ResolvedValues) => credentials.CreateCredentialCredentialsPostRequest;
|
|
59
|
+
/**
|
|
60
|
+
* The body `PATCH /credentials/{name}` carries — the declared `credential_info` always (the
|
|
61
|
+
* vendor's `UpdateCredentialItem` REQUIRES it, and the DB normally replaces the info map), the
|
|
62
|
+
* resolved `credential_values` only when the caller passes them (a values-stale write; an
|
|
63
|
+
* info-only drift sends none, so it never demands a value the environment does not hold).
|
|
64
|
+
*
|
|
65
|
+
* ⛔ `credential_name` APPEARS TWICE, ON PURPOSE: `credential_name` is the path label (its URI
|
|
66
|
+
* placeholder is the row's address), and `credential_name_body` is the SAME value as a body
|
|
67
|
+
* field wire-named `credential_name` — the vendor's `UpdateCredentialItem` requires the name in
|
|
68
|
+
* the body, a Smithy member can carry only ONE binding, and the kit never renames in place (a
|
|
69
|
+
* changed name is a REPLACE, credential.ts), so the two are always equal here.
|
|
70
|
+
*/
|
|
71
|
+
export declare const patchBody: (props: CredentialProps, values: Readonly<Record<string, unknown>> | undefined) => credentials.UpdateCredentialCredentialsCredentialNamePatchRequest;
|
|
72
|
+
/**
|
|
73
|
+
* All live info keys absent from the intended map, including on adoption. DB replacement alone
|
|
74
|
+
* cannot clear memory, so these require a rewrite. Only names of sensitive info are remembered.
|
|
75
|
+
*/
|
|
76
|
+
export declare const removedInfoKeys: (prior: CredentialAttributes | undefined, props: CredentialProps) => readonly string[];
|
|
77
|
+
/** Values merge in BOTH stores, so dropped names from the masked read require a rewrite. */
|
|
78
|
+
export declare const removedValueKeys: (live: CredentialAttributes | undefined, props: CredentialProps) => readonly string[];
|
|
79
|
+
//# sourceMappingURL=credential-form.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"credential-form.d.ts","sourceRoot":"","sources":["../../src/litellm/credential-form.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,OAAO,KAAK,KAAK,WAAW,MAAM,gDAAgD,CAAC;AAEnF,OAAO,EACL,KAAK,oBAAoB,EACzB,KAAK,eAAe,EAGrB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAE7D,kGAAkG;AAClG,eAAO,MAAM,YAAY,UAAW,eAAe,KAAG,MAAM,GAAG,SAoC9D,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,SAAS,SACd,oBAAoB,SACnB,eAAe,KACrB,SAAS,MAAM,EAUjB,CAAC;AAkBF;;;;;;GAMG;AACH,eAAO,MAAM,YAAY,QAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAG,oBAa3D,CAAC;AAEF,oEAAoE;AACpE,eAAO,MAAM,eAAe,QAAS,OAAO,KAAG,GAAG,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAGH,CAAC;AAE1E;;;;;GAKG;AACH,eAAO,MAAM,aAAa,aAAc,cAAc,KAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAGtF,CAAC;AAEJ,gGAAgG;AAChG,eAAO,MAAM,UAAU,UACd,eAAe,YACZ,cAAc,KACvB,WAAW,CAAC,sCAOd,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,SAAS,UACb,eAAe,UACd,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GAAG,SAAS,KACpD,WAAW,CAAC,qDAQd,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,eAAe,UACnB,oBAAoB,GAAG,SAAS,SAChC,eAAe,KACrB,SAAS,MAAM,EAMjB,CAAC;AAEF,4FAA4F;AAC5F,eAAO,MAAM,gBAAgB,SACrB,oBAAoB,GAAG,SAAS,SAC/B,eAAe,KACrB,SAAS,MAAM,EACoE,CAAC"}
|