@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,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `@distilled.cloud/litellm/credential_management` calls `LiteLLM.Credential` uses
|
|
3
|
+
* (LiteLLM 1.103.0; names verified in the generated source, never guessed):
|
|
4
|
+
*
|
|
5
|
+
* read `getCredentialByNameCredentialsByNameCredentialNameGet` GET /credentials/by_name/{name}
|
|
6
|
+
* create `createCredentialCredentialsPost` POST /credentials
|
|
7
|
+
* update `updateCredentialCredentialsCredentialNamePatch` PATCH /credentials/{name}
|
|
8
|
+
* delete `deleteCredentialCredentialsCredentialNameDelete` DELETE /credentials/{name}
|
|
9
|
+
*
|
|
10
|
+
* ★ THE UPDATE IS A PATCH, NOT A REWRITE. The vendor's PATCH merges value keys; nonempty info
|
|
11
|
+
* normally replaces the DB map but merges in memory (`endpoints.py:312-319,384-387`, 1.103.0).
|
|
12
|
+
* The body carries `credential_name` as a second member
|
|
13
|
+
* (`credential_name_body`, wire-named `credential_name`) because the vendor's
|
|
14
|
+
* `UpdateCredentialItem` requires it in the body and a Smithy member has one binding — the
|
|
15
|
+
* distilled patch `patches/credential_management/update_credential_credentials__credential_name__patch.json`.
|
|
16
|
+
* A PATCH that fails on the wire leaves the row it was merging into, where the old DELETE + POST
|
|
17
|
+
* rewrite left NO row when the POST failed after the DELETE (review finding 3). credential.ts
|
|
18
|
+
* still rewrites to drop value or info keys, since PATCH cannot remove them from both stores.
|
|
19
|
+
* ⛔ NO MESSAGE SNIFFING (S21). The read's and delete's `404` is typed as the SDK's
|
|
20
|
+
* `CredentialNotFound` (a distilled patch matched on the vendor's "Credential not found" message,
|
|
21
|
+
* `endpoints.py`), so absence is that TAG, `catchTag`ed — never `instanceof`, never error text. A
|
|
22
|
+
* 404 from a front proxy, Access, or a wrong base path decodes as core's `NotFound` and stays an
|
|
23
|
+
* error, never absence. A create on a name the DB already has answers `409` (`endpoints.py`'s
|
|
24
|
+
* unique-violation handling), decoded as core `Conflict`, and is PROPAGATED: a row another writer
|
|
25
|
+
* raced in is not this declaration's row. The PATCH's own 404 (message `Credential not found in
|
|
26
|
+
* DB.`) is NOT `CredentialNotFound`: it stays core `NotFound`, an error — a row deleted between
|
|
27
|
+
* the read and the PATCH must not silently read as absence.
|
|
28
|
+
* ⚠️ THE READ AND THE DELETE ASK DIFFERENT STORES (measured, `endpoints.py`): the by-name read
|
|
29
|
+
* walks the proxy's IN-MEMORY `credential_list` (a row the proxy has not loaded answers 404),
|
|
30
|
+
* while the delete consults the DATABASE (`delete_by_name`) and removes the in-memory entry
|
|
31
|
+
* after. A row present in the DB but not loaded in memory reads as ABSENT, and a create for it
|
|
32
|
+
* answers `409` — the resource reports that failure loudly instead of pretending to converge.
|
|
33
|
+
* ⚠️ Unlike pass-through endpoints, each credential is its own DB row: no semaphore.
|
|
34
|
+
*/
|
|
35
|
+
import * as credentials from '@distilled.cloud/litellm/credential_management';
|
|
36
|
+
import * as Effect from 'effect/Effect';
|
|
37
|
+
import type { CredentialAttributes } from './credential-types.ts';
|
|
38
|
+
import { LitellmCredentialDebugLoggingError, LitellmCredentialTransportError, LitellmCredentialUnreadableError } from './credential-errors.ts';
|
|
39
|
+
import { type LitellmOpContext } from './operations.ts';
|
|
40
|
+
/**
|
|
41
|
+
* One credential by name, or `undefined` when the proxy does not hold it in memory. ⛔ ANY FAILURE
|
|
42
|
+
* OTHER THAN `CredentialNotFound` PROPAGATES: a 401, a 422 or a dead network says nothing about
|
|
43
|
+
* whether the row exists, and must never be read as absence.
|
|
44
|
+
*/
|
|
45
|
+
export declare const readCredential: (credentialName: string) => Effect.Effect<CredentialAttributes | undefined, credentials.GetCredentialByNameCredentialsByNameCredentialNameGetError | LitellmCredentialUnreadableError, LitellmOpContext>;
|
|
46
|
+
/**
|
|
47
|
+
* POST /credentials. The answer carries no row (`{"success": true, ...}`), so the read back is the
|
|
48
|
+
* proof.
|
|
49
|
+
*
|
|
50
|
+
* ⛔ THE REQUEST BODY CARRIES THE VALUES, AND A FAILED CALL CAN CARRY ITS REQUEST — exactly the
|
|
51
|
+
* `{"key":"sk-…"}` leak `generateKey` (key-operations.ts) closes, and it is closed the same way:
|
|
52
|
+
* a transport failure is an `HttpClientError` in the error channel, a body that fails mid-read is
|
|
53
|
+
* the SAME error as a DEFECT (`Effect.orDie` in core's `protocol-rest.ts`). Both become
|
|
54
|
+
* `LitellmCredentialTransportError`, which keeps the NAME and the reason's tag and nothing else.
|
|
55
|
+
* ⛔ RECONCILE REFUSES WHILE `DISTILLED_DEBUG_HTTP` IS SET, before any request: the SDK prints
|
|
56
|
+
* the first 400 characters of every request body (core `protocol-http.ts`), which would put the values on
|
|
57
|
+
* stderr — the same refusal `key-secret.ts` makes for `/key/generate`.
|
|
58
|
+
*/
|
|
59
|
+
export declare const createCredential: (body: credentials.CreateCredentialCredentialsPostRequest) => Effect.Effect<void, credentials.CreateCredentialCredentialsPostError | LitellmCredentialTransportError, LitellmOpContext>;
|
|
60
|
+
/**
|
|
61
|
+
* PATCH /credentials/{name}. Sends the full intended `credential_info` (DB replacement, memory
|
|
62
|
+
* merge) and merges resolved `credential_values` when present. The answer carries no row
|
|
63
|
+
* (`{"success": true, ...}`), so the read back is the proof.
|
|
64
|
+
*
|
|
65
|
+
* ⛔ THE SAME TWO GUARDS AS `createCredential`: the body carries the values, so a transport failure
|
|
66
|
+
* becomes a `LitellmCredentialTransportError` that keeps the NAME and the reason's tag and
|
|
67
|
+
* nothing else, and reconcile refuses while `DISTILLED_DEBUG_HTTP` is set (the SDK would print
|
|
68
|
+
* the values). A PATCH that fails on the wire leaves the row in place — the point of using it
|
|
69
|
+
* over a DELETE + POST rewrite.
|
|
70
|
+
*/
|
|
71
|
+
export declare const updateCredential: (body: credentials.UpdateCredentialCredentialsCredentialNamePatchRequest) => Effect.Effect<void, credentials.UpdateCredentialCredentialsCredentialNamePatchError | LitellmCredentialTransportError, LitellmOpContext>;
|
|
72
|
+
/**
|
|
73
|
+
* DELETE /credentials/{name}, idempotent BY THIS FUNCTION: the vendor answers 404 for a name its
|
|
74
|
+
* database does not have, which this treats as already-absent — the DB is the authoritative store
|
|
75
|
+
* the delete consults (the read consults memory, see the header). Any other failure propagates.
|
|
76
|
+
*/
|
|
77
|
+
export declare const deleteCredential: (credentialName: string) => Effect.Effect<void, credentials.DeleteCredentialCredentialsCredentialNameDeleteError, LitellmOpContext>;
|
|
78
|
+
/**
|
|
79
|
+
* Whether `DISTILLED_DEBUG_HTTP` is set, refused once at the top of reconcile, before even a
|
|
80
|
+
* DELETE can run (the following POST would carry values). Reads `process.env` because that is
|
|
81
|
+
* what the SDK's `protocol-http.ts` reads.
|
|
82
|
+
*/
|
|
83
|
+
export declare const refuseDebugLogging: (credentialName: string) => Effect.Effect<void, LitellmCredentialDebugLoggingError>;
|
|
84
|
+
//# sourceMappingURL=credential-operations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"credential-operations.d.ts","sourceRoot":"","sources":["../../src/litellm/credential-operations.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,OAAO,KAAK,WAAW,MAAM,gDAAgD,CAAC;AAC9E,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAIxC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,EACL,kCAAkC,EAClC,+BAA+B,EAC/B,gCAAgC,EACjC,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,KAAK,gBAAgB,EAAgB,MAAM,iBAAiB,CAAC;AAEtE;;;;GAIG;AACH,eAAO,MAAM,cAAc,mBACT,MAAM,KACrB,MAAM,CAAC,MAAM,CACd,oBAAoB,GAAG,SAAS,EAC9B,WAAW,CAAC,0DAA0D,GACtE,gCAAgC,EAClC,gBAAgB,CA4Bf,CAAC;AAEJ;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,gBAAgB,SACrB,WAAW,CAAC,sCAAsC,KACvD,MAAM,CAAC,MAAM,CACd,IAAI,EACJ,WAAW,CAAC,oCAAoC,GAAG,+BAA+B,EAClF,gBAAgB,CAuBjB,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,gBAAgB,SACrB,WAAW,CAAC,qDAAqD,KACtE,MAAM,CAAC,MAAM,CACd,IAAI,EACJ,WAAW,CAAC,mDAAmD,GAAG,+BAA+B,EACjG,gBAAgB,CAuBjB,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,mBACX,MAAM,KACrB,MAAM,CAAC,MAAM,CACd,IAAI,EACJ,WAAW,CAAC,oDAAoD,EAChE,gBAAgB,CASf,CAAC;AAEJ;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,mBACb,MAAM,KACrB,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,kCAAkC,CAGxC,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type * as credentials from '@distilled.cloud/litellm/credential_management';
|
|
2
|
+
import * as Effect from 'effect/Effect';
|
|
3
|
+
import { LitellmCredentialRewriteError } from './credential-errors.ts';
|
|
4
|
+
import type { LitellmOpContext } from './operations.ts';
|
|
5
|
+
export declare const rewriteCredential: (body: credentials.CreateCredentialCredentialsPostRequest) => Effect.Effect<void, LitellmCredentialRewriteError | credentials.DeleteCredentialCredentialsCredentialNameDeleteError, LitellmOpContext>;
|
|
6
|
+
//# sourceMappingURL=credential-rewrite.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"credential-rewrite.d.ts","sourceRoot":"","sources":["../../src/litellm/credential-rewrite.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,WAAW,MAAM,gDAAgD,CAAC;AACnF,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,EACL,6BAA6B,EAE9B,MAAM,wBAAwB,CAAC;AAEhC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAExD,eAAO,MAAM,iBAAiB,SAAU,WAAW,CAAC,sCAAsC,4IAsCtF,CAAC"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What `LiteLLM.Credential` declares (props) and what is remembered about it (attributes).
|
|
3
|
+
*
|
|
4
|
+
* ⛔ NO CREDENTIAL VALUE IS EVER A PROP OR AN ATTRIBUTE (S25). Alchemy persists props AND
|
|
5
|
+
* attributes unencrypted (`StateEncoding.ts` writes a `Redacted` value's inner string beside
|
|
6
|
+
* the tag — `secrets/write-only.ts`, measured on alchemy 2.0.0-beta.79), and LiteLLM stores a
|
|
7
|
+
* credential's values ENCRYPTED in its database while the reads answer them MASKED, so a value
|
|
8
|
+
* the declaration holds is `{ fromEnv: 'NAME' }` — NAME lands in state, and the value is read
|
|
9
|
+
* from the DEPLOYING process's environment only when a write is being made
|
|
10
|
+
* (`credential-values.ts`, the same shape `McpServerProps.authValue` uses). Unlike a model
|
|
11
|
+
* deployment's `os.environ/NAME` reference (the PROXY resolves that in its own environment),
|
|
12
|
+
* the credential table stores LITERAL values — measured in the live 1.103.0 container
|
|
13
|
+
* (`credential_endpoints/endpoints.py`: `create_credential` encrypts the body's
|
|
14
|
+
* `credential_values` before the insert, `CredentialsRepository.create`) — so the proxy could
|
|
15
|
+
* not resolve a reference here even if one were sent.
|
|
16
|
+
* ⛔ THE LIVE ROW'S MASKED VALUES ARE NEVER MIRRORED INTO ATTRIBUTES. Both reads answer
|
|
17
|
+
* `credential_values` with every SENSITIVE-keyed value masked (the vendor's own rule,
|
|
18
|
+
* `_get_masked_values` in `litellm_logging.py`: a key matching `authorization`, `token`, `key`,
|
|
19
|
+
* `secret`, `vertex_credentials`, `credentials`, `password` or `passwd` — substring,
|
|
20
|
+
* case-insensitive — answers `v[:2] + "****" + v[-2:]` for a string longer than four
|
|
21
|
+
* characters, `*****` otherwise; non-string values and non-sensitive keys answer in full).
|
|
22
|
+
* A masked fragment (`sk****45`) is a PARTIAL SECRET, so `toAttributes` copies no
|
|
23
|
+
* `credential_values` entry at all (`credential-form.ts`); what was last written is remembered
|
|
24
|
+
* as the digest of the values this process RESOLVED, `valuesSeal` — never the values.
|
|
25
|
+
* ⚠️ `credential_info` IS THE COMPLETE INTENDED MAP, INCLUDING ON ADOPTION. Measured in
|
|
26
|
+
* LiteLLM 1.103.0 `credential_endpoints/endpoints.py:314-319`: a nonempty PATCH normally resets
|
|
27
|
+
* the DB info map (except when it contains a literal `credential_info` key); an empty patch
|
|
28
|
+
* leaves it alone. Memory only merges (:385-387), retaining removed keys until restart.
|
|
29
|
+
* Therefore removing any live info key requires a rewrite; every PATCH sends the full map.
|
|
30
|
+
* Sensitive info keys are refused at plan time because the vendor returns info UNMASKED.
|
|
31
|
+
* Reads retain their NAMES only, so removal can converge without persisting their values.
|
|
32
|
+
*/
|
|
33
|
+
import type { FromEnv } from '../secrets/write-only.ts';
|
|
34
|
+
/**
|
|
35
|
+
* The credential's name — its identity in the vendor's table (a unique column, enforced by the
|
|
36
|
+
* database, `schema.prisma`'s `Credentials` model). ADOPTED: the live row whose `credential_name`
|
|
37
|
+
* equals it. ⛔ A RENAMED ROW IS A DIFFERENT CREDENTIAL: the name is the only address the vendor's
|
|
38
|
+
* routes have, so a changed `credentialName` plans a REPLACE — the old row survives under the
|
|
39
|
+
* resource's default `retain` policy, never renamed in place.
|
|
40
|
+
*/
|
|
41
|
+
export interface CredentialProps {
|
|
42
|
+
readonly credentialName: string;
|
|
43
|
+
/**
|
|
44
|
+
* Free-form metadata stored beside the values (`credential_info` in the vendor's row), compared
|
|
45
|
+
* as the complete intended map with canonical-JSON deep equality (omitted means empty). ⛔ Refused for a key matching the vendor's
|
|
46
|
+
* own sensitive-key list: those belong in `credentialValues`, where LiteLLM stores them
|
|
47
|
+
* encrypted and answers them masked — in `credential_info` they would be stored in clear.
|
|
48
|
+
*/
|
|
49
|
+
readonly credentialInfo?: Readonly<Record<string, unknown>>;
|
|
50
|
+
/**
|
|
51
|
+
* The credential's values, each declared as `{ fromEnv: 'NAME' }` naming the environment
|
|
52
|
+
* variable the DEPLOYING process reads at call time. AT LEAST ONE is required: LiteLLM's create
|
|
53
|
+
* model refuses a body whose `credential_values` and `model_id` are both empty
|
|
54
|
+
* (`models/credentials.py`'s `CreateCredentialItem` validator → 422), and `model_id` — which
|
|
55
|
+
* would copy a deployment's values — is not modelled here, so a value-less declaration has
|
|
56
|
+
* nothing to write. A value that never resolves in a plan-only environment never drifts
|
|
57
|
+
* (credential-values.ts); one that resolves is SENT as the literal the proxy stores encrypted.
|
|
58
|
+
*/
|
|
59
|
+
readonly credentialValues: Readonly<Record<string, FromEnv>>;
|
|
60
|
+
}
|
|
61
|
+
export interface CredentialAttributes {
|
|
62
|
+
readonly credentialName: string;
|
|
63
|
+
/**
|
|
64
|
+
* The row's `credential_info` as the read answers it, minus any SENSITIVE-KEYED entry — those
|
|
65
|
+
* would mirror a clear secret into Alchemy's state and are skipped (`toAttributes`). The digest
|
|
66
|
+
* comparison removes undeclared live keys, including on adoption (credential-form.ts).
|
|
67
|
+
*/
|
|
68
|
+
readonly credentialInfo: Readonly<Record<string, unknown>>;
|
|
69
|
+
/**
|
|
70
|
+
* `scrypt:<salt>:<digest>` of the values the LAST WRITE resolved — the only way a plan notices
|
|
71
|
+
* a rotated credential, because the live row answers masked fragments that can never be
|
|
72
|
+
* compared (`secrets/write-only.ts`). An ADOPTED row starts `''`, which reads as `stale`.
|
|
73
|
+
*/
|
|
74
|
+
readonly valuesSeal: string;
|
|
75
|
+
/** Names only, never masked fragments. Optional for states written by older providers. */
|
|
76
|
+
readonly valueKeys?: readonly string[];
|
|
77
|
+
/** All info key names, including withheld sensitive entries; optional for older states. */
|
|
78
|
+
readonly infoKeys?: readonly string[];
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Whether a value is not a string with something in it. Takes `unknown`: a declaration can say
|
|
82
|
+
* anything. (Same rule as model-types.ts and registry-support.ts.)
|
|
83
|
+
*/
|
|
84
|
+
export declare const isBlank: (value: unknown) => boolean;
|
|
85
|
+
/** Whether a key is one the vendor itself treats as sensitive. */
|
|
86
|
+
export declare const isSensitiveKey: (key: string) => boolean;
|
|
87
|
+
//# sourceMappingURL=credential-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"credential-types.d.ts","sourceRoot":"","sources":["../../src/litellm/credential-types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AAExD;;;;;;GAMG;AACH,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAEhC;;;;;OAKG;IACH,QAAQ,CAAC,cAAc,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IAE5D;;;;;;;;OAQG;IACH,QAAQ,CAAC,gBAAgB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;CAC9D;AAED,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAEhC;;;;OAIG;IACH,QAAQ,CAAC,cAAc,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IAE3D;;;;OAIG;IACH,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAE5B,0FAA0F;IAC1F,QAAQ,CAAC,SAAS,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAEvC,2FAA2F;IAC3F,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CACvC;AAED;;;GAGG;AACH,eAAO,MAAM,OAAO,UAAW,OAAO,KAAG,OACS,CAAC;AAmBnD,kEAAkE;AAClE,eAAO,MAAM,cAAc,QAAS,MAAM,KAAG,OAG5C,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The values of a `LiteLLM.Credential` — resolved from the deploying process's environment at
|
|
3
|
+
* call time, held as `Redacted`, and compared by seal.
|
|
4
|
+
*
|
|
5
|
+
* ★ THIS IS THE CREDENTIAL LITELLM STORES, so the deploying process holds the value: the wire
|
|
6
|
+
* body carries the LITERAL (the proxy encrypts it into its database, measured in the live
|
|
7
|
+
* 1.103.0 container — `credential_endpoints/endpoints.py`'s `encrypt_credential_values`), which
|
|
8
|
+
* is exactly why the prop is only a NAME (`credential-types.ts`). Inside this process the value
|
|
9
|
+
* is a `Redacted<string>`, so a stray log or error dump prints `<redacted>`; it is unwrapped in
|
|
10
|
+
* exactly one place, the wire body (credential-form.ts). Never a prop or an attribute.
|
|
11
|
+
* ⚠️ LITELLM DOES NOT HAND THE VALUES BACK TO COMPARE WITH: both reads answer them MASKED
|
|
12
|
+
* (2 + `****` + 2, `*****` for a short string — `litellm_logging.py::_get_masked_values`), and a
|
|
13
|
+
* masked fragment is a partial secret that must never be compared or stored. So what was last
|
|
14
|
+
* written is remembered as a SEAL, and a plan asks "are the values in my environment the ones I
|
|
15
|
+
* wrote". Four answers, mcp-server-credential.ts's own list:
|
|
16
|
+
* - `none` — no values are declared, nothing to compare.
|
|
17
|
+
* - `unknown` — one or more declared variables is unset here, so a plan cannot tell. Never
|
|
18
|
+
* drift: a plan-only environment must not report every credentialed row as
|
|
19
|
+
* changed. A WRITE still demands them (`requireValues`).
|
|
20
|
+
* - `stale` — every variable is set and there is no seal (an adopted row, or one written
|
|
21
|
+
* outside this stack) or the seal disagrees. The declaration is authoritative,
|
|
22
|
+
* so it is written.
|
|
23
|
+
* - `match` — the seal was made from exactly these resolved values.
|
|
24
|
+
* ⚠️ ALL-OR-NOTHING RESOLUTION: a write sends `credential_values` only when EVERY declared
|
|
25
|
+
* variable resolves — the values-stale PATCH and the whole-row create both demand every value
|
|
26
|
+
* (`requireValues`, credential.ts), because sending the resolved half would store a row whose
|
|
27
|
+
* unset half was silently blanked. When any variable is missing the state is `unknown`: an
|
|
28
|
+
* info-only PATCH can proceed, but a required rewrite refuses before DELETE.
|
|
29
|
+
* ⚠️ A SEAL OF A GUESSABLE SECRET IS STILL GUESSABLE (secrets/write-only.ts). Use a random token.
|
|
30
|
+
*/
|
|
31
|
+
import * as Effect from 'effect/Effect';
|
|
32
|
+
import * as Redacted from 'effect/Redacted';
|
|
33
|
+
import { type Environment } from '../secrets/write-only.ts';
|
|
34
|
+
import { LitellmCredentialEnvUnsetError } from './credential-errors.ts';
|
|
35
|
+
import type { CredentialProps } from './credential-types.ts';
|
|
36
|
+
/** What the environment holds for the declared values. `missing` names the unset variables. */
|
|
37
|
+
export interface ResolvedValues {
|
|
38
|
+
readonly values: Readonly<Record<string, Redacted.Redacted<string>>>;
|
|
39
|
+
readonly missing: readonly string[];
|
|
40
|
+
}
|
|
41
|
+
export type CredentialValuesState = 'none' | 'unknown' | 'stale' | 'match';
|
|
42
|
+
/** ⛔ Reads the environment at CALL time, never at module load (docs/credentials.md). */
|
|
43
|
+
export declare const resolveValues: (props: CredentialProps, env?: Environment) => ResolvedValues;
|
|
44
|
+
/** `scrypt:<salt>:<digest>` of the resolved values, for `valuesSeal`. ⛔ Never a value. */
|
|
45
|
+
export declare const sealValues: (values: Readonly<Record<string, Redacted.Redacted<string>>>) => string;
|
|
46
|
+
export declare const valuesState: (props: CredentialProps, sealed: string, resolved?: ResolvedValues) => CredentialValuesState;
|
|
47
|
+
/**
|
|
48
|
+
* Fails naming the missing variables when this write has to send the values and the deploying
|
|
49
|
+
* process does not hold them all. Creates, rewrites and value-stale PATCHes need every value;
|
|
50
|
+
* an info-only PATCH leaves values alone and does not need this guard (credential.ts).
|
|
51
|
+
*/
|
|
52
|
+
export declare const requireValues: (props: CredentialProps, resolved: ResolvedValues) => Effect.Effect<void, LitellmCredentialEnvUnsetError>;
|
|
53
|
+
//# sourceMappingURL=credential-values.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"credential-values.d.ts","sourceRoot":"","sources":["../../src/litellm/credential-values.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,QAAQ,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,KAAK,WAAW,EAAiC,MAAM,0BAA0B,CAAC;AAC3F,OAAO,EAAE,8BAA8B,EAAE,MAAM,wBAAwB,CAAC;AACxE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAE7D,+FAA+F;AAC/F,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;IACrE,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;CACrC;AAED,MAAM,MAAM,qBAAqB,GAAG,MAAM,GAAG,SAAS,GAAG,OAAO,GAAG,OAAO,CAAC;AAE3E,wFAAwF;AACxF,eAAO,MAAM,aAAa,UACjB,eAAe,QACjB,WAAW,KACf,cAQF,CAAC;AAKF,0FAA0F;AAC1F,eAAO,MAAM,UAAU,WAAY,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,KAAG,MACjE,CAAC;AAEzB,eAAO,MAAM,WAAW,UACf,eAAe,UACd,MAAM,aACJ,cAAc,KACvB,qBAMF,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,aAAa,UACjB,eAAe,YACZ,cAAc,KACvB,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,8BAA8B,CAQ9C,CAAC"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `LiteLLM.Credential` — one row of LiteLLM's reusable credential table (`/credentials/*`), a
|
|
3
|
+
* named bag of values the proxy stores encrypted and can bind to a deployment by `model_id`.
|
|
4
|
+
*
|
|
5
|
+
* ★ ADOPT BY NAME. `credentialName` finds the live row whose `credential_name` equals it; a live
|
|
6
|
+
* row with no state is `Unowned`, so it needs `--adopt`. The name is the vendor's only address
|
|
7
|
+
* (the table's unique column, `schema.prisma`), so a row is located by the by-name read and
|
|
8
|
+
* never guessed at.
|
|
9
|
+
* ★ `defaultRemovalPolicy: 'retain'` — deleting a credential a deployment references would break
|
|
10
|
+
* that deployment's next call. Opt in with `.pipe(RemovalPolicy.destroy())`.
|
|
11
|
+
* ⛔ THE VALUES ARE `{ fromEnv: 'NAME' }`, NEVER A VALUE (S25): LiteLLM STORES these literals
|
|
12
|
+
* (encrypted at rest), so the deploying process must hold them — credential-types.ts carries the
|
|
13
|
+
* full reasoning, and a `model` deployment's `os.environ/NAME` reference is the opposite case.
|
|
14
|
+
* A plan compares the live row's `credential_info` per declared key and the values through a
|
|
15
|
+
* digest of what was resolved (`valuesSeal`); it never compares the masked read, and a value
|
|
16
|
+
* whose variable is unset never drifts a plan-only environment (credential-values.ts).
|
|
17
|
+
* ⚠️ A RENAME IS A REPLACE: the name is the row's identity and its only address, so a changed
|
|
18
|
+
* `credentialName` creates the new row and the old one survives under 'retain' — never renamed
|
|
19
|
+
* in place.
|
|
20
|
+
* ⚠️ A CHANGED ROW IS PATCHED, NOT REWRITTEN — PATCH merges values and normally replaces DB
|
|
21
|
+
* info, but only merges in-memory info (1.103.0 credential_endpoints/endpoints.py:312-319,384-387).
|
|
22
|
+
* A failed PATCH leaves the row behind (review finding 3: DELETE + POST left NO row when POST
|
|
23
|
+
* failed). Dropping a value key OR an info key still requires DELETE + POST; both stores must
|
|
24
|
+
* converge. All refusals run before the first write. Every write reads back to prove removal.
|
|
25
|
+
*/
|
|
26
|
+
import { Resource } from 'alchemy';
|
|
27
|
+
import type { Input } from 'alchemy/Input';
|
|
28
|
+
import * as Provider from 'alchemy/Provider';
|
|
29
|
+
import * as Effect from 'effect/Effect';
|
|
30
|
+
import { LitellmCredentialAbsentAfterWriteError, LitellmCredentialInvalidError, LitellmCredentialNotConvergedError } from './credential-errors.ts';
|
|
31
|
+
import type { CredentialAttributes, CredentialProps } from './credential-types.ts';
|
|
32
|
+
export type { CredentialAttributes, CredentialProps };
|
|
33
|
+
export type { CredentialError } from './credential-errors.ts';
|
|
34
|
+
export interface LiteLLMCredential extends Resource<'LiteLLM.Credential', CredentialProps, CredentialAttributes> {
|
|
35
|
+
}
|
|
36
|
+
export declare const LiteLLMCredential: import("alchemy").ResourceClass<LiteLLMCredential>;
|
|
37
|
+
export declare const isLiteLLMCredential: (value: unknown) => value is LiteLLMCredential;
|
|
38
|
+
type Args<P> = {
|
|
39
|
+
fqn: string;
|
|
40
|
+
instanceId: string;
|
|
41
|
+
output: CredentialAttributes | undefined;
|
|
42
|
+
} & P;
|
|
43
|
+
/** ⛔ TEST-ONLY EXPORT. Not on index.ts's barrel. */
|
|
44
|
+
export declare const credentialHandlers: {
|
|
45
|
+
/**
|
|
46
|
+
* ⛔ WITH NO `output` THIS IS ALCHEMY'S ADOPTION PROBE, AND THE ONLY PLAN-TIME HOOK A NEW
|
|
47
|
+
* CREDENTIAL GETS — so the refusals run here too, as a defect (mcp-server.ts's own rule: the
|
|
48
|
+
* cold-start probe must fail the plan, and a recovery read must degrade to "nothing
|
|
49
|
+
* recovered", which only a defect does).
|
|
50
|
+
*/
|
|
51
|
+
read: ({ olds, output }: Args<{
|
|
52
|
+
olds: CredentialProps;
|
|
53
|
+
}>) => Effect.Effect<CredentialAttributes | undefined, import("./credential-errors.ts").LitellmCredentialDebugLoggingError | import("./credential-errors.ts").LitellmCredentialUnreadableError | import("@distilled.cloud/litellm/credential_management").GetCredentialByNameCredentialsByNameCredentialNameGetError, import("@distilled.cloud/litellm/Protocol").LitellmOpContext>;
|
|
54
|
+
diff: ({ news, output, }: {
|
|
55
|
+
news: Input<CredentialProps>;
|
|
56
|
+
output: CredentialAttributes | undefined;
|
|
57
|
+
}) => Effect.Effect<{
|
|
58
|
+
readonly action: 'replace';
|
|
59
|
+
readonly deleteFirst: false;
|
|
60
|
+
} | {
|
|
61
|
+
readonly deleteFirst?: never;
|
|
62
|
+
readonly action: 'noop';
|
|
63
|
+
} | {
|
|
64
|
+
readonly deleteFirst?: never;
|
|
65
|
+
readonly action: 'update';
|
|
66
|
+
} | undefined, LitellmCredentialInvalidError, never>;
|
|
67
|
+
reconcile: ({ fqn, instanceId, news, output }: Args<{
|
|
68
|
+
news: CredentialProps;
|
|
69
|
+
}>) => Effect.Effect<{
|
|
70
|
+
credentialName: string;
|
|
71
|
+
credentialInfo: Readonly<Record<string, unknown>>;
|
|
72
|
+
valueKeys?: readonly string[];
|
|
73
|
+
infoKeys?: readonly string[];
|
|
74
|
+
valuesSeal: string;
|
|
75
|
+
}, import("@distilled.cloud/caddy").BadGateway | import("@distilled.cloud/caddy").ConfigError | import("@distilled.cloud/litellm/credential_management").CredentialNotFound | import("@distilled.cloud/caddy").GatewayTimeout | import("effect/unstable/http/HttpClientError").HttpClientError | import("@distilled.cloud/caddy").InternalServerError | LitellmCredentialAbsentAfterWriteError | import("./credential-errors.ts").LitellmCredentialDebugLoggingError | import("./credential-errors.ts").LitellmCredentialEnvUnsetError | LitellmCredentialInvalidError | LitellmCredentialNotConvergedError | import("./credential-errors.ts").LitellmCredentialRewriteError | import("./credential-errors.ts").LitellmCredentialTransportError | import("./credential-errors.ts").LitellmCredentialUnreadableError | 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/credential_management").UnprocessableEntity, import("@distilled.cloud/litellm/Protocol").LitellmOpContext>;
|
|
76
|
+
delete: ({ output }: {
|
|
77
|
+
output: CredentialAttributes;
|
|
78
|
+
}) => Effect.Effect<void, import("@distilled.cloud/litellm/credential_management").DeleteCredentialCredentialsCredentialNameDeleteError, import("@distilled.cloud/litellm/Protocol").LitellmOpContext>;
|
|
79
|
+
/** ⛔ EMPTY: adoption is an explicit act (`--adopt`), and no ownership mark exists to filter by. */
|
|
80
|
+
list: () => Effect.Effect<never[], never, never>;
|
|
81
|
+
};
|
|
82
|
+
export declare const LiteLLMCredentialProvider: () => import("effect/Layer").Layer<Provider.Provider<LiteLLMCredential>, never, import("@distilled.cloud/litellm/Protocol").LitellmOpContext>;
|
|
83
|
+
//# sourceMappingURL=credential.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"credential.d.ts","sourceRoot":"","sources":["../../src/litellm/credential.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;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;AAGxC,OAAO,EACL,sCAAsC,EACtC,6BAA6B,EAC7B,kCAAkC,EACnC,MAAM,wBAAwB,CAAC;AAiBhC,OAAO,KAAK,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAInF,YAAY,EAAE,oBAAoB,EAAE,eAAe,EAAE,CAAC;AACtD,YAAY,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAE9D,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;AAc9E,KAAK,IAAI,CAAC,CAAC,IAAI;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,oBAAoB,GAAG,SAAS,CAAC;CAC1C,GAAG,CAAC,CAAC;AAEN,oDAAoD;AACpD,eAAO,MAAM,kBAAkB;IAC7B;;;;;OAKG;IACH,IAAI,qBAAqB,IAAI,CAAC;QAAE,IAAI,EAAE,eAAe,CAAA;KAAE,CAAC;IAmBxD,IAAI,sBAGD;QACD,IAAI,EAAE,KAAK,CAAC,eAAe,CAAC,CAAC;QAC7B,MAAM,EAAE,oBAAoB,GAAG,SAAS,CAAC;KAC1C;yBAOsB,SAAS;;;;yBASb,MAAM;;;yBACN,QAAQ;;IAG3B,SAAS,sCAAsC,IAAI,CAAC;QAAE,IAAI,EAAE,eAAe,CAAA;KAAE,CAAC;;;;;;;IAuE9E,MAAM,eAAe;QAAE,MAAM,EAAE,oBAAoB,CAAA;KAAE;IAErD,mGAAmG;IACnG,IAAI;CACL,CAAC;AAEF,eAAO,MAAM,yBAAyB,+IAInC,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A fake of LiteLLM's `/v1/unified_access_group` routes for tests — TEST ONLY. Skeleton and the
|
|
3
|
+
* rules every fake follows: fake-registry-base.ts.
|
|
4
|
+
*
|
|
5
|
+
* ★ MEASURED FROM THE LIVE 1.103.0 CONTAINER'S SOURCE (2026-09-30, `access_group_endpoints.py`, read,
|
|
6
|
+
* not called): the name is UNIQUE (a create or a rename onto a taken name is a 409); a create
|
|
7
|
+
* answers 201 with the row; the update is partial (`exclude_unset`) and turns a `null` list into
|
|
8
|
+
* `[]`; a delete answers 204 with NO BODY and a missing id is a 404; writes need PROXY_ADMIN
|
|
9
|
+
* (`forbidWrites` models the 403). The list is the table.
|
|
10
|
+
* ⚠️ NOT MODELLED: `assigned_team_ids` / `assigned_key_ids` mirroring into teams and keys (the fake
|
|
11
|
+
* keeps the arrays and does nothing with them), and the display-name expansion of the response.
|
|
12
|
+
* `dropModel` models `access_group_model_sync.py`: LiteLLM itself removes a model name from a group
|
|
13
|
+
* when its last deployment goes, which is the drift source the docs warn about.
|
|
14
|
+
*/
|
|
15
|
+
import { type FakeRecord } from './fake-registry-base.ts';
|
|
16
|
+
import type { Row } from './registry-support.ts';
|
|
17
|
+
export interface FakeAccessGroupLitellm extends FakeRecord {
|
|
18
|
+
/** Every stored group, exactly as the proxy holds it. */
|
|
19
|
+
readonly groups: () => readonly Row[];
|
|
20
|
+
/** LiteLLM's own model-name pruning (`access_group_model_sync.py`). */
|
|
21
|
+
readonly dropModel: (name: string) => void;
|
|
22
|
+
}
|
|
23
|
+
export interface FakeAccessGroupOptions {
|
|
24
|
+
readonly masterKey?: string;
|
|
25
|
+
readonly seed?: readonly Row[];
|
|
26
|
+
/** `POST`/`PUT`/`DELETE` answer 403, as for a key that is not PROXY_ADMIN. */
|
|
27
|
+
readonly forbidWrites?: boolean;
|
|
28
|
+
/** A `PUT` drops empty lists instead of writing them (a truthiness check). */
|
|
29
|
+
readonly editIgnoresEmpty?: boolean;
|
|
30
|
+
}
|
|
31
|
+
/** A row as `AccessGroupResponse` carries it: every required field present. */
|
|
32
|
+
export declare const groupRow: (fields: Row) => Row;
|
|
33
|
+
export declare const startFakeAccessGroupLitellm: (options?: FakeAccessGroupOptions) => FakeAccessGroupLitellm;
|
|
34
|
+
//# sourceMappingURL=fake-access-group-litellm.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fake-access-group-litellm.d.ts","sourceRoot":"","sources":["../../src/litellm/fake-access-group-litellm.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,EAAY,KAAK,UAAU,EAA+B,MAAM,yBAAyB,CAAC;AACjG,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;AAEjD,MAAM,WAAW,sBAAuB,SAAQ,UAAU;IACxD,yDAAyD;IACzD,QAAQ,CAAC,MAAM,EAAE,MAAM,SAAS,GAAG,EAAE,CAAC;IACtC,uEAAuE;IACvE,QAAQ,CAAC,SAAS,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CAC5C;AAED,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,GAAG,EAAE,CAAC;IAC/B,8EAA8E;IAC9E,QAAQ,CAAC,YAAY,CAAC,EAAE,OAAO,CAAC;IAChC,8EAA8E;IAC9E,QAAQ,CAAC,gBAAgB,CAAC,EAAE,OAAO,CAAC;CACrC;AAED,+EAA+E;AAC/E,eAAO,MAAM,QAAQ,WAAY,GAAG,KAAG,GAcrC,CAAC;AAEH,eAAO,MAAM,2BAA2B,aAC7B,sBAAsB,KAC9B,sBA0EF,CAAC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A fake of LiteLLM's `/credentials/*` routes for tests — TEST ONLY, never imported by `index.ts`.
|
|
3
|
+
* Like `fake-model-litellm.ts` it is a `fetch` function handed to Effect's real `FetchHttpClient`
|
|
4
|
+
* through its `Fetch` reference, so a test exercises distilled's REAL path assembly, JSON encoding
|
|
5
|
+
* and status-to-error matching; only the wire responses a scenario needs are written here.
|
|
6
|
+
*
|
|
7
|
+
* ★ THE MASKING RULE IS THE VENDOR'S, READ FROM THE LIVE 1.103.0 CONTAINER
|
|
8
|
+
* (`litellm_logging.py::_get_masked_values`): a key whose lowercased form contains `token`,
|
|
9
|
+
* `key`, `secret`, `password`, `passwd`, `credentials`, `vertex_credentials` or
|
|
10
|
+
* `authorization` answers `v[:2] + "****" + v[-2:]` for a string longer than four characters,
|
|
11
|
+
* `*****` for a shorter one, the value untouched for a non-string, and a non-sensitive key
|
|
12
|
+
* answers its full value. Both the list and the by-name read apply it (the by-name read with
|
|
13
|
+
* `unmasked_length=4, number_of_asterisks=4` — the same rule).
|
|
14
|
+
* ★ THE READ AND THE DELETE ASK DIFFERENT STORES, AS THE VENDOR DOES (measured): the by-name read
|
|
15
|
+
* answers only rows loaded in memory, while the delete consults the table. `memoryOmits` models
|
|
16
|
+
* a row committed to the table but not loaded in memory, so the read answers 404 while the
|
|
17
|
+
* create for the same name answers 409 — the asymmetry credential-operations.ts documents.
|
|
18
|
+
* ★ A CREATE ON AN EXISTING NAME ANSWERS 409 (the vendor's unique-violation handling,
|
|
19
|
+
* `_credential_exists_detail`), decoded by the real SDK path as core `Conflict`. The PATCH route
|
|
20
|
+
* merges values in both stores; nonempty info normally replaces DB info but merges in memory
|
|
21
|
+
* (`credential_endpoints/endpoints.py:312-319,384-387`, 1.103.0). Empty info leaves DB unchanged. With
|
|
22
|
+
* the body's `credential_name` (the `credential_name_body` member) applied as the new name only
|
|
23
|
+
* when it differs from the path's (the kit never renames in place, so it never does).
|
|
24
|
+
* ★ `FAKE-*` VALUES ONLY. Nothing here is, or looks like, a real credential.
|
|
25
|
+
*/
|
|
26
|
+
/** One request that reached the fake. Its own type, so this file depends on no other fake. */
|
|
27
|
+
export interface FakeCredentialRequest {
|
|
28
|
+
readonly method: string;
|
|
29
|
+
readonly path: string;
|
|
30
|
+
}
|
|
31
|
+
type Row = Record<string, unknown>;
|
|
32
|
+
export interface FakeCredentialLitellm {
|
|
33
|
+
readonly fetch: typeof globalThis.fetch;
|
|
34
|
+
/**
|
|
35
|
+
* Every stored row as the fake's table holds it — values in CLEAR, the fake's own choice: the
|
|
36
|
+
* real table encrypts them, but nothing reads the table directly, only the masked reads, so the
|
|
37
|
+
* encryption seam is invisible here and a test can assert what a write SENT.
|
|
38
|
+
*/
|
|
39
|
+
readonly rows: () => readonly Row[];
|
|
40
|
+
readonly requests: () => readonly FakeCredentialRequest[];
|
|
41
|
+
/** The JSON bodies of every `POST` and `PATCH`, in order (including rejected PATCH requests). */
|
|
42
|
+
readonly bodies: () => readonly Row[];
|
|
43
|
+
}
|
|
44
|
+
export interface FakeCredentialOptions {
|
|
45
|
+
readonly masterKey?: string;
|
|
46
|
+
readonly seed?: readonly Row[];
|
|
47
|
+
/** Names committed to the table that the in-memory read omits (a row not loaded). */
|
|
48
|
+
readonly memoryOmits?: readonly string[];
|
|
49
|
+
}
|
|
50
|
+
/** A minimal 1.103.0-shaped row, as the table holds it. */
|
|
51
|
+
export declare const credentialRow: (fields: Row) => Row;
|
|
52
|
+
export declare const startFakeCredentialLitellm: (options?: FakeCredentialOptions) => FakeCredentialLitellm;
|
|
53
|
+
export {};
|
|
54
|
+
//# sourceMappingURL=fake-credential-litellm.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fake-credential-litellm.d.ts","sourceRoot":"","sources":["../../src/litellm/fake-credential-litellm.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,8FAA8F;AAC9F,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED,KAAK,GAAG,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAEnC,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,KAAK,EAAE,OAAO,UAAU,CAAC,KAAK,CAAC;IACxC;;;;OAIG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,SAAS,GAAG,EAAE,CAAC;IACpC,QAAQ,CAAC,QAAQ,EAAE,MAAM,SAAS,qBAAqB,EAAE,CAAC;IAC1D,iGAAiG;IACjG,QAAQ,CAAC,MAAM,EAAE,MAAM,SAAS,GAAG,EAAE,CAAC;CACvC;AAED,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,GAAG,EAAE,CAAC;IAC/B,qFAAqF;IACrF,QAAQ,CAAC,WAAW,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAC1C;AAKD,2DAA2D;AAC3D,eAAO,MAAM,aAAa,WAAY,GAAG,KAAG,GAK1C,CAAC;AAgCH,eAAO,MAAM,0BAA0B,aAC5B,qBAAqB,KAC7B,qBAuHF,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A fake of LiteLLM's `/key/*` routes for `LiteLLM.Key` tests — TEST ONLY, never imported by
|
|
3
|
+
* `index.ts`. `fake-litellm.ts` mounts it, so a test still goes through distilled's REAL path
|
|
4
|
+
* assembly, JSON encode/decode and status→typed-error matching over `FetchHttpClient.Fetch`.
|
|
5
|
+
*
|
|
6
|
+
* ★ MEASURED against the litellm 1.103.0 wheel's source (`key_management_endpoints.py`), not a live
|
|
7
|
+
* proxy: a user-defined `key` must start with `sk-` and be 16+ characters, else 400 (:1477-1490); a
|
|
8
|
+
* duplicate `key_alias` is 400 on generate and update (`_enforce_unique_key_alias`, :7639-7667);
|
|
9
|
+
* `/key/update` applies `model_dump(exclude_unset=True)`, so an explicit `null` clears a column
|
|
10
|
+
* (`duration: null` sets `expires` null, :2468-2500) and omitted fields are untouched; an update
|
|
11
|
+
* that finds no alias is 404 (`_get_and_validate_existing_key`, per the distilled patch); a delete
|
|
12
|
+
* of an alias it does not hold is 404 "No keys found" (:4914-4918) and of a key the caller may not
|
|
13
|
+
* delete 403 (:4933-4936), BOTH answered as a `ProxyException` envelope, because `delete_key_fn`
|
|
14
|
+
* re-raises through `handle_exception_on_proxy` (`proxy/utils.py:7815`), whose `message` is `str(detail)`
|
|
15
|
+
* (`_types.py` `ProxyException`): `{"error": {"message": "{'error': 'No keys found'}", "code": "404", ...}}`;
|
|
16
|
+
* `/key/list` filters `key_alias` exactly unless told otherwise, and
|
|
17
|
+
* `return_full_object` answers full rows, `token` being the sha256 hex of the key (`hash_token`).
|
|
18
|
+
* ⚠️ NOT MODELLED, or only a stand-in: `disable_custom_api_keys` (a 403 for ANY user-defined key);
|
|
19
|
+
* a `budget_id` that names no budget is a foreign-key violation whose status is UNMEASURED — 400
|
|
20
|
+
* here, so a test can prove the Budget is written first.
|
|
21
|
+
* ⛔ THE PLAINTEXT KEY NEVER SITS IN A ROW. Rows carry only `token`, a sha256 of the value, the way
|
|
22
|
+
* a LiteLLM row carries a hash. The values the proxy was SENT are kept apart in `received()`, so a
|
|
23
|
+
* test can prove what reached the wire without the value ever being in the state a resource sees.
|
|
24
|
+
*/
|
|
25
|
+
type Row = Record<string, unknown>;
|
|
26
|
+
export interface FakeKeysOptions {
|
|
27
|
+
/** Live rows, wire-shaped like `UserAPIKeyAuth` (`key_alias`, `budget_id`, `models`, `token`, …). */
|
|
28
|
+
readonly keySeed?: readonly Row[];
|
|
29
|
+
/** `GET /key/list` answers this status and nothing else — a transient read failure. */
|
|
30
|
+
readonly keyListStatus?: number;
|
|
31
|
+
/** `POST /key/delete` answers 403 and keeps the row — a caller that may not delete. */
|
|
32
|
+
readonly keyDeleteForbidden?: boolean;
|
|
33
|
+
/** `POST /key/delete` deletes the row and STILL answers 404 — another caller got there first. */
|
|
34
|
+
readonly keyDeleteRaces?: boolean;
|
|
35
|
+
/** `/key/generate` ignores the user-defined `key` and mints its own. */
|
|
36
|
+
readonly keyIgnoresUserValue?: boolean;
|
|
37
|
+
/** `/key/update` drops explicit `null`s instead of writing them (an `exclude_none` merge). */
|
|
38
|
+
readonly keyUpdateIgnoresNull?: boolean;
|
|
39
|
+
}
|
|
40
|
+
export interface FakeKeys {
|
|
41
|
+
readonly route: (request: Request, url: URL) => Promise<Response>;
|
|
42
|
+
readonly rows: () => readonly Row[];
|
|
43
|
+
/** Every JSON body a `/key/*` write carried, in order. FAKE-* material only. */
|
|
44
|
+
readonly writes: () => readonly {
|
|
45
|
+
readonly path: string;
|
|
46
|
+
readonly body: Row;
|
|
47
|
+
}[];
|
|
48
|
+
/** The raw key values `/key/generate` was sent — kept off the rows on purpose. */
|
|
49
|
+
readonly received: () => readonly string[];
|
|
50
|
+
}
|
|
51
|
+
export declare const createFakeKeys: (options: FakeKeysOptions | undefined, budgetExists: (budgetId: string) => boolean) => FakeKeys;
|
|
52
|
+
export {};
|
|
53
|
+
//# sourceMappingURL=fake-keys.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fake-keys.d.ts","sourceRoot":"","sources":["../../src/litellm/fake-keys.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,KAAK,GAAG,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAEnC,MAAM,WAAW,eAAe;IAC9B,qGAAqG;IACrG,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,GAAG,EAAE,CAAC;IAClC,uFAAuF;IACvF,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAChC,uFAAuF;IACvF,QAAQ,CAAC,kBAAkB,CAAC,EAAE,OAAO,CAAC;IACtC,iGAAiG;IACjG,QAAQ,CAAC,cAAc,CAAC,EAAE,OAAO,CAAC;IAClC,wEAAwE;IACxE,QAAQ,CAAC,mBAAmB,CAAC,EAAE,OAAO,CAAC;IACvC,8FAA8F;IAC9F,QAAQ,CAAC,oBAAoB,CAAC,EAAE,OAAO,CAAC;CACzC;AAED,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,KAAK,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,GAAG,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC;IAClE,QAAQ,CAAC,IAAI,EAAE,MAAM,SAAS,GAAG,EAAE,CAAC;IACpC,gFAAgF;IAChF,QAAQ,CAAC,MAAM,EAAE,MAAM,SAAS;QAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,IAAI,EAAE,GAAG,CAAA;KAAE,EAAE,CAAC;IAChF,kFAAkF;IAClF,QAAQ,CAAC,QAAQ,EAAE,MAAM,SAAS,MAAM,EAAE,CAAC;CAC5C;AAmCD,eAAO,MAAM,cAAc,YAChB,eAAe,GAAG,SAAS,gBACtB,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,KAC1C,QAuGF,CAAC"}
|
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
* fake now matches that measured vendor behaviour.
|
|
28
28
|
*/
|
|
29
29
|
import type { PassThroughGenericEndpoint } from '@distilled.cloud/litellm/misc';
|
|
30
|
+
import { type FakeKeys, type FakeKeysOptions } from './fake-keys.ts';
|
|
30
31
|
/** RFC 2606 placeholder — never a real host. Shared across tests, like `../netbox/fake-netbox.ts`. */
|
|
31
32
|
export declare const FAKE_BASE = "https://litellm.example.com";
|
|
32
33
|
export interface FakeRequest {
|
|
@@ -37,11 +38,18 @@ export interface FakeLitellm {
|
|
|
37
38
|
readonly fetch: typeof globalThis.fetch;
|
|
38
39
|
readonly rows: () => readonly PassThroughGenericEndpoint[];
|
|
39
40
|
readonly requests: () => readonly FakeRequest[];
|
|
41
|
+
/** `/budget/*` rows, wire-shaped (`tpm_limit`/`rpm_limit` as decimal strings, like the real table). */
|
|
42
|
+
readonly budgets: () => readonly Record<string, unknown>[];
|
|
43
|
+
/** `/key/*` rows and the writes they took — see fake-keys.ts. */
|
|
44
|
+
readonly keys: FakeKeys;
|
|
40
45
|
}
|
|
41
46
|
export declare const startFakeLitellm: (options?: {
|
|
42
47
|
readonly masterKey?: string;
|
|
43
48
|
readonly seed?: readonly PassThroughGenericEndpoint[];
|
|
44
49
|
/** Every `DELETE` 400s `not_allowed_access`, whether or not the row exists — see the file header. */
|
|
45
50
|
readonly forbidDelete?: boolean;
|
|
46
|
-
|
|
51
|
+
readonly budgetSeed?: readonly Record<string, unknown>[];
|
|
52
|
+
/** `/budget/update` drops `null`s instead of writing them (an `exclude_none` merge). */
|
|
53
|
+
readonly budgetExcludeNone?: boolean;
|
|
54
|
+
} & FakeKeysOptions) => FakeLitellm;
|
|
47
55
|
//# sourceMappingURL=fake-litellm.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fake-litellm.d.ts","sourceRoot":"","sources":["../../src/litellm/fake-litellm.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"fake-litellm.d.ts","sourceRoot":"","sources":["../../src/litellm/fake-litellm.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,+BAA+B,CAAC;AAChF,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,eAAe,EAAkB,MAAM,gBAAgB,CAAC;AAErF,sGAAsG;AACtG,eAAO,MAAM,SAAS,gCAAgC,CAAC;AAEvD,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,KAAK,EAAE,OAAO,UAAU,CAAC,KAAK,CAAC;IACxC,QAAQ,CAAC,IAAI,EAAE,MAAM,SAAS,0BAA0B,EAAE,CAAC;IAC3D,QAAQ,CAAC,QAAQ,EAAE,MAAM,SAAS,WAAW,EAAE,CAAC;IAChD,uGAAuG;IACvG,QAAQ,CAAC,OAAO,EAAE,MAAM,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC;IAC3D,iEAAiE;IACjE,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;CACzB;AAQD,eAAO,MAAM,gBAAgB,aACjB;IACR,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,0BAA0B,EAAE,CAAC;IACtD,qGAAqG;IACrG,QAAQ,CAAC,YAAY,CAAC,EAAE,OAAO,CAAC;IAChC,QAAQ,CAAC,UAAU,CAAC,EAAE,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC;IACzD,wFAAwF;IACxF,QAAQ,CAAC,iBAAiB,CAAC,EAAE,OAAO,CAAC;CACtC,GAAG,eAAe,KAClB,WAkHF,CAAC"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A fake of LiteLLM's `/v1/mcp/server` routes for tests — TEST ONLY, never imported by `index.ts`.
|
|
3
|
+
* Like `fake-litellm.ts` it is a `fetch` function handed to Effect's real `FetchHttpClient` through
|
|
4
|
+
* its `Fetch` reference, so a test exercises distilled's REAL path assembly, JSON encoding and
|
|
5
|
+
* status-to-error matching; only the wire responses a scenario needs are written here.
|
|
6
|
+
*
|
|
7
|
+
* ★ A SEPARATE FILE FROM `fake-litellm.ts` ON PURPOSE: that fake carries the pass-through and
|
|
8
|
+
* budget routes and is at its size budget; a fake per route family keeps each one small.
|
|
9
|
+
* ⚠️ SHAPES ARE FROM THE GENERATED 1.103.0 SCHEMA (`mcp_management.ts`), NOT A LIVE READ. What the
|
|
10
|
+
* real proxy does on a duplicate create, an edit of a missing id, a delete of a missing id, and
|
|
11
|
+
* whether its list redacts `credentials` is UNMEASURED; the answers below (400, 404, 404, redacted
|
|
12
|
+
* unless `echoCredentials`) are the fake's own choices, and every test that leans on one says so.
|
|
13
|
+
* ★ ONE RULE IS MEASURED, NOT CHOSEN: an edit that changes `auth_type` and sends no `credentials` key
|
|
14
|
+
* clears the stored credential (litellm 1.103.0, `db.py` lines 1013-1014, read from the live
|
|
15
|
+
* container; every static type is its own credential class). The engine tests that rely on it are
|
|
16
|
+
* `mcp-server-retype.test.ts`.
|
|
17
|
+
* ★ THREE MORE RULES ARE MEASURED (2026-09-29, the live 1.103.0 container, read from source and, for
|
|
18
|
+
* the alias rule, by running its own normaliser on a body): (1) `GET /v1/mcp/server` is the
|
|
19
|
+
* in-memory REGISTRY, not the table, so a row can be committed and not listed (`registryMisses`,
|
|
20
|
+
* `hideCreated`); the by-id `GET` reads the table first and REGISTERS the row it finds. (2) The
|
|
21
|
+
* list's `description` is `mcp_info.description` when that key exists, else the column. (3) A
|
|
22
|
+
* write with a `server_name` and no `alias` defaults the alias to the name and WRITES it; `-` in
|
|
23
|
+
* either name is a 400, and a space in an alias becomes `_`.
|
|
24
|
+
* ⚠️ `servers()` RETURNS WHAT REACHED THE PROXY, credentials included, so a test can assert what
|
|
25
|
+
* was SENT. The list route (`GET`) is what a resource can read, and it hides them by default.
|
|
26
|
+
* ★ `FAKE-*` VALUES ONLY. Nothing here is, or looks like, a real credential.
|
|
27
|
+
*/
|
|
28
|
+
/** One request that reached the fake. Its own type, so this file depends on no other fake. */
|
|
29
|
+
export interface FakeMcpRequest {
|
|
30
|
+
readonly method: string;
|
|
31
|
+
readonly path: string;
|
|
32
|
+
}
|
|
33
|
+
type Row = Record<string, unknown>;
|
|
34
|
+
export interface FakeMcpLitellm {
|
|
35
|
+
readonly fetch: typeof globalThis.fetch;
|
|
36
|
+
/** Every stored row exactly as the proxy holds it, `credentials` included. */
|
|
37
|
+
readonly servers: () => readonly Row[];
|
|
38
|
+
readonly requests: () => readonly FakeMcpRequest[];
|
|
39
|
+
/** The JSON bodies of every `POST`/`PUT`, in order. */
|
|
40
|
+
readonly bodies: () => readonly Row[];
|
|
41
|
+
}
|
|
42
|
+
export interface FakeMcpOptions {
|
|
43
|
+
readonly masterKey?: string;
|
|
44
|
+
readonly seed?: readonly Row[];
|
|
45
|
+
/** `GET` echoes the stored `credentials` instead of hiding them (a worst-case proxy). */
|
|
46
|
+
readonly echoCredentials?: boolean;
|
|
47
|
+
/** `PUT` drops an empty list and a `false`, like a truthiness check would. */
|
|
48
|
+
readonly editIgnoresFalsy?: boolean;
|
|
49
|
+
/** `POST` ignores a supplied `server_id` and issues its own. */
|
|
50
|
+
readonly issuesOwnId?: boolean;
|
|
51
|
+
/** Every `DELETE` answers 400, whether or not the row exists (no rights). */
|
|
52
|
+
readonly forbidDelete?: boolean;
|
|
53
|
+
/** Ids committed to the table that the registry does not hold (a failed reload), so the list omits them. */
|
|
54
|
+
readonly registryMisses?: readonly string[];
|
|
55
|
+
/** A `POST` commits the row but its registry refresh fails (LiteLLM only logs it). */
|
|
56
|
+
readonly hideCreated?: boolean;
|
|
57
|
+
/**
|
|
58
|
+
* The by-id `GET` answers 403, whether or not the row exists. ⚠️ Not 500: the SDK retries 5xx with
|
|
59
|
+
* backoff (`Retry.Retry`), which would take a test tens of seconds to no purpose.
|
|
60
|
+
*/
|
|
61
|
+
readonly readFails?: boolean;
|
|
62
|
+
}
|
|
63
|
+
/** A minimal 1.103.0-shaped row, as the list route returns it. */
|
|
64
|
+
export declare const serverRow: (fields: Row) => Row;
|
|
65
|
+
export declare const startFakeMcpLitellm: (options?: FakeMcpOptions) => FakeMcpLitellm;
|
|
66
|
+
export {};
|
|
67
|
+
//# sourceMappingURL=fake-mcp-litellm.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fake-mcp-litellm.d.ts","sourceRoot":"","sources":["../../src/litellm/fake-mcp-litellm.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,8FAA8F;AAC9F,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED,KAAK,GAAG,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAEnC,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,KAAK,EAAE,OAAO,UAAU,CAAC,KAAK,CAAC;IACxC,8EAA8E;IAC9E,QAAQ,CAAC,OAAO,EAAE,MAAM,SAAS,GAAG,EAAE,CAAC;IACvC,QAAQ,CAAC,QAAQ,EAAE,MAAM,SAAS,cAAc,EAAE,CAAC;IACnD,uDAAuD;IACvD,QAAQ,CAAC,MAAM,EAAE,MAAM,SAAS,GAAG,EAAE,CAAC;CACvC;AAED,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,GAAG,EAAE,CAAC;IAC/B,yFAAyF;IACzF,QAAQ,CAAC,eAAe,CAAC,EAAE,OAAO,CAAC;IACnC,8EAA8E;IAC9E,QAAQ,CAAC,gBAAgB,CAAC,EAAE,OAAO,CAAC;IACpC,gEAAgE;IAChE,QAAQ,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC;IAC/B,6EAA6E;IAC7E,QAAQ,CAAC,YAAY,CAAC,EAAE,OAAO,CAAC;IAChC,4GAA4G;IAC5G,QAAQ,CAAC,cAAc,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC5C,sFAAsF;IACtF,QAAQ,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC;IAC/B;;;OAGG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC;CAC9B;AAOD,kEAAkE;AAClE,eAAO,MAAM,SAAS,WAAY,GAAG,KAAG,GAOtC,CAAC;AA8BH,eAAO,MAAM,mBAAmB,aAAa,cAAc,KAAQ,cAwGlE,CAAC"}
|