@vibexp/api-client 0.89.0 → 0.91.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.
@@ -1040,7 +1040,17 @@ export const getPromptDependencies = (options) => (options.client ?? client).get
1040
1040
  /**
1041
1041
  * Render a prompt
1042
1042
  *
1043
- * Renders a prompt by resolving @references and substituting placeholders with provided values.
1043
+ * Renders a prompt by resolving references and substituting placeholders with provided values.
1044
+ *
1045
+ * A reference is written `@prompt:<slug>` and resolves to a prompt in the
1046
+ * prompt's own team; `@@` escapes a literal `@`. A bare `@slug` is the
1047
+ * deprecated legacy form: it expands only when it resolves to a prompt and is
1048
+ * otherwise left as plain text without a warning, so emails, handles and
1049
+ * `git@host` remotes are safe. References are resolved on the authored body
1050
+ * only; placeholder values are inserted verbatim.
1051
+ *
1052
+ * With `strict: true`, bare `@slug` is never resolved and an unresolved
1053
+ * `@prompt:<slug>` fails the render with 422.
1044
1054
  *
1045
1055
  */
1046
1056
  export const renderPrompt = (options) => (options.client ?? client).post({
@@ -3796,6 +3806,136 @@ export const exportAdminProjects = (options) => (options?.client ?? client).get(
3796
3806
  url: '/api/v1/admin/projects/export',
3797
3807
  ...options
3798
3808
  });
3809
+ /**
3810
+ * Remove the instance email provider settings
3811
+ *
3812
+ * Removes the stored instance email provider and appends one redacted
3813
+ * entry to the audit log. Instance mail is then discarded until a provider
3814
+ * is configured again. Returns 409 when nothing is stored.
3815
+ * Instance-admin only; non-admin and unauthenticated requests receive 404.
3816
+ *
3817
+ */
3818
+ export const deleteAdminInstanceEmailSettings = (options) => (options?.client ?? client).delete({
3819
+ security: [{
3820
+ key: 'ApiKeyAuth',
3821
+ scheme: 'bearer',
3822
+ type: 'http'
3823
+ }, {
3824
+ in: 'cookie',
3825
+ name: 'vx_session',
3826
+ type: 'apiKey'
3827
+ }],
3828
+ url: '/api/v1/admin/settings/email',
3829
+ ...options
3830
+ });
3831
+ /**
3832
+ * Get the instance email provider settings
3833
+ *
3834
+ * Returns the instance's stored email provider configuration, its delivery
3835
+ * health and whether a credential is stored. Always 200: an instance with
3836
+ * nothing stored reports `configured: false`. The credential is never
3837
+ * returned.
3838
+ * Instance-admin only; non-admin and unauthenticated requests receive 404.
3839
+ *
3840
+ */
3841
+ export const getAdminInstanceEmailSettings = (options) => (options?.client ?? client).get({
3842
+ responseType: 'json',
3843
+ security: [{
3844
+ key: 'ApiKeyAuth',
3845
+ scheme: 'bearer',
3846
+ type: 'http'
3847
+ }, {
3848
+ in: 'cookie',
3849
+ name: 'vx_session',
3850
+ type: 'apiKey'
3851
+ }],
3852
+ url: '/api/v1/admin/settings/email',
3853
+ ...options
3854
+ });
3855
+ /**
3856
+ * Create or replace the instance email provider settings
3857
+ *
3858
+ * Validates, encrypts and stores the instance's email provider, taking
3859
+ * effect on the next send with no restart, and appends one redacted entry
3860
+ * to the audit log. Idempotent: the same body creates or replaces. Omitting
3861
+ * `secret` keeps the stored credential when the provider type is
3862
+ * unchanged; an empty `secret` is rejected. A body carrying an unknown
3863
+ * field is rejected with 400.
3864
+ * Instance-admin only; non-admin and unauthenticated requests receive 404.
3865
+ *
3866
+ */
3867
+ export const upsertAdminInstanceEmailSettings = (options) => (options.client ?? client).put({
3868
+ responseType: 'json',
3869
+ security: [{
3870
+ key: 'ApiKeyAuth',
3871
+ scheme: 'bearer',
3872
+ type: 'http'
3873
+ }, {
3874
+ in: 'cookie',
3875
+ name: 'vx_session',
3876
+ type: 'apiKey'
3877
+ }],
3878
+ url: '/api/v1/admin/settings/email',
3879
+ ...options,
3880
+ headers: {
3881
+ 'Content-Type': 'application/json',
3882
+ ...options.headers
3883
+ }
3884
+ });
3885
+ /**
3886
+ * Send a test message through the instance email provider
3887
+ *
3888
+ * Sends a fixed test message to the calling admin's own account email,
3889
+ * through the stored configuration (empty body) or through a candidate
3890
+ * configuration (see `AdminInstanceEmailTestRequest`). Nothing is stored
3891
+ * and nothing is audited. A failed send is still a 200, reported with
3892
+ * `is_valid: false`. A body carrying an unknown field (including a
3893
+ * `recipient`) is rejected with 400.
3894
+ * Instance-admin only; non-admin and unauthenticated requests receive 404.
3895
+ *
3896
+ */
3897
+ export const testAdminInstanceEmailSettings = (options) => (options?.client ?? client).post({
3898
+ responseType: 'json',
3899
+ security: [{
3900
+ key: 'ApiKeyAuth',
3901
+ scheme: 'bearer',
3902
+ type: 'http'
3903
+ }, {
3904
+ in: 'cookie',
3905
+ name: 'vx_session',
3906
+ type: 'apiKey'
3907
+ }],
3908
+ url: '/api/v1/admin/settings/email/test',
3909
+ ...options,
3910
+ headers: {
3911
+ 'Content-Type': 'application/json',
3912
+ ...options?.headers
3913
+ }
3914
+ });
3915
+ /**
3916
+ * List the instance email provider settings audit log
3917
+ *
3918
+ * Returns one page of the instance email provider's audit log, newest
3919
+ * first. Every entry's `before`/`after` snapshot is redacted: it never
3920
+ * contains a credential. Pass the previous page's `next_cursor` to
3921
+ * continue.
3922
+ * Instance-admin only; non-admin and unauthenticated requests receive 404.
3923
+ *
3924
+ */
3925
+ export const listAdminInstanceEmailSettingsAudit = (options) => (options?.client ?? client).get({
3926
+ responseType: 'json',
3927
+ security: [{
3928
+ key: 'ApiKeyAuth',
3929
+ scheme: 'bearer',
3930
+ type: 'http'
3931
+ }, {
3932
+ in: 'cookie',
3933
+ name: 'vx_session',
3934
+ type: 'apiKey'
3935
+ }],
3936
+ url: '/api/v1/admin/settings/email/audit',
3937
+ ...options
3938
+ });
3799
3939
  /**
3800
3940
  * List a resource's comments
3801
3941
  *
@@ -376,6 +376,10 @@ export type RenderPromptRequest = {
376
376
  placeholders: {
377
377
  [key: string]: string;
378
378
  };
379
+ /**
380
+ * When true, only explicit @prompt:slug references are resolved (a bare @word such as an email, handle or git@host remote stays literal text), and an unresolved @prompt:slug fails the render with 422 instead of a warning. Recommended for unattended agents.
381
+ */
382
+ strict?: boolean;
379
383
  };
380
384
  export type RenderPromptResponse = {
381
385
  rendered_body: string;
@@ -385,7 +389,7 @@ export type RenderPromptResponse = {
385
389
  placeholders_missing?: Array<string>;
386
390
  references_used?: Array<string>;
387
391
  /**
388
- * Warnings about issues during rendering (e.g., missing references)
392
+ * Warnings about issues during rendering, such as an explicit @prompt:slug reference that does not resolve (kept as-is in rendered_body). A bare @word that does not resolve is plain text and never produces a warning.
389
393
  */
390
394
  warnings?: Array<string>;
391
395
  };
@@ -6050,6 +6054,236 @@ export type AdminSavedFiltersReplaceRequest = {
6050
6054
  */
6051
6055
  version: number;
6052
6056
  };
6057
+ /**
6058
+ * Which provider the instance sends through. Matched case-insensitively.
6059
+ */
6060
+ export type AdminInstanceEmailProviderType = 'smtp' | 'mailgun' | 'postmark' | 'sendgrid';
6061
+ /**
6062
+ * The instance's email provider configuration. This is an upsert, so the same
6063
+ * body creates or replaces. The per-type `settings` and the write-only
6064
+ * `secret` follow the team email provider request exactly. A body carrying an
6065
+ * unknown field is rejected with 400.
6066
+ *
6067
+ */
6068
+ export type AdminInstanceEmailSettingsRequest = {
6069
+ provider_type: AdminInstanceEmailProviderType;
6070
+ settings?: TeamEmailProviderSettings;
6071
+ /**
6072
+ * The provider's single credential (SMTP password, Mailgun sending key,
6073
+ * Postmark server token, or SendGrid API key). It is write-only: never
6074
+ * returned by any endpoint.
6075
+ *
6076
+ * OMIT it to keep the stored credential, which is allowed only when the
6077
+ * provider type is unchanged; a new configuration or a change of provider
6078
+ * type must carry its own. An explicitly empty string is rejected.
6079
+ *
6080
+ */
6081
+ secret?: string;
6082
+ /**
6083
+ * The address instance mail is sent from.
6084
+ */
6085
+ from_address: string;
6086
+ /**
6087
+ * Optional display name shown beside the from address.
6088
+ */
6089
+ from_name?: string | null;
6090
+ /**
6091
+ * Optional Reply-To address.
6092
+ */
6093
+ reply_to?: string | null;
6094
+ /**
6095
+ * Where the contact form delivers. Omitted or null falls back to the from
6096
+ * address.
6097
+ *
6098
+ */
6099
+ contact_recipient_address?: string | null;
6100
+ /**
6101
+ * Absolute http(s) URL of the privacy policy linked from outbound mail.
6102
+ * Omitted or null links none.
6103
+ *
6104
+ */
6105
+ privacy_policy_url?: string | null;
6106
+ };
6107
+ /**
6108
+ * An optional candidate configuration for a test send. An empty body (or an
6109
+ * empty object) tests the STORED configuration. A body with any field set is
6110
+ * tested as a full configuration, validated like an upsert; if it omits
6111
+ * `secret`, the stored credential is used only when the candidate targets
6112
+ * the same destination (same provider type and, for SMTP, the same
6113
+ * host/port/username; for Mailgun, the same domain/base URL).
6114
+ *
6115
+ * There is no recipient field: the test message always goes to the calling
6116
+ * admin's own account email. A body carrying an unknown field is rejected
6117
+ * with 400.
6118
+ *
6119
+ */
6120
+ export type AdminInstanceEmailTestRequest = {
6121
+ provider_type?: AdminInstanceEmailProviderType;
6122
+ settings?: TeamEmailProviderSettings;
6123
+ /**
6124
+ * The candidate credential. Omit it to test with the stored credential
6125
+ * (same destination only, see above). Never returned.
6126
+ *
6127
+ */
6128
+ secret?: string;
6129
+ /**
6130
+ * The from address to test with.
6131
+ */
6132
+ from_address?: string;
6133
+ /**
6134
+ * Optional display name to test with.
6135
+ */
6136
+ from_name?: string | null;
6137
+ /**
6138
+ * Optional Reply-To address to test with.
6139
+ */
6140
+ reply_to?: string | null;
6141
+ /**
6142
+ * Accepted for parity with the upsert body; a test send does not use it.
6143
+ */
6144
+ contact_recipient_address?: string | null;
6145
+ /**
6146
+ * Accepted for parity with the upsert body; a test send does not use it.
6147
+ */
6148
+ privacy_policy_url?: string | null;
6149
+ };
6150
+ /**
6151
+ * The instance's stored email configuration. This is never a 404: an
6152
+ * instance with nothing stored reports `configured: false`, with every other
6153
+ * field null or absent, and discards its mail.
6154
+ *
6155
+ * No field here can carry the credential; `has_credential` reports only that
6156
+ * one is stored.
6157
+ *
6158
+ */
6159
+ export type AdminInstanceEmailSettings = {
6160
+ /**
6161
+ * Whether an instance email provider is stored.
6162
+ */
6163
+ configured: boolean;
6164
+ /**
6165
+ * The stored provider type, or null when nothing is configured.
6166
+ */
6167
+ provider_type: 'smtp' | 'mailgun' | 'postmark' | 'sendgrid' | null;
6168
+ settings?: TeamEmailProviderSettings;
6169
+ /**
6170
+ * Whether a credential is stored. The credential itself is never
6171
+ * returned. An SMTP relay without authentication legitimately has none.
6172
+ *
6173
+ */
6174
+ has_credential: boolean;
6175
+ /**
6176
+ * The configured from address; null when nothing is configured.
6177
+ */
6178
+ from_address?: string | null;
6179
+ /**
6180
+ * The configured display name.
6181
+ */
6182
+ from_name?: string | null;
6183
+ /**
6184
+ * The configured Reply-To address.
6185
+ */
6186
+ reply_to?: string | null;
6187
+ /**
6188
+ * Where the contact form delivers; null falls back to the from address.
6189
+ */
6190
+ contact_recipient_address?: string | null;
6191
+ /**
6192
+ * The privacy policy URL linked from outbound mail; null links none.
6193
+ */
6194
+ privacy_policy_url?: string | null;
6195
+ /**
6196
+ * Whether the last observed send succeeded, derived by comparing
6197
+ * `last_success_at` with `last_error_at` (a provider that has never sent
6198
+ * is healthy). Null when nothing is configured.
6199
+ *
6200
+ */
6201
+ is_healthy: boolean | null;
6202
+ /**
6203
+ * When a send through the instance provider last succeeded.
6204
+ */
6205
+ last_success_at?: string | null;
6206
+ /**
6207
+ * The last delivery error, retained after recovery for diagnosis; use
6208
+ * `is_healthy` to tell whether the provider is currently failing.
6209
+ *
6210
+ */
6211
+ last_error?: string | null;
6212
+ /**
6213
+ * When the last delivery error occurred.
6214
+ */
6215
+ last_error_at?: string | null;
6216
+ /**
6217
+ * When the configuration was last saved; null when nothing is configured.
6218
+ */
6219
+ updated_at?: string | null;
6220
+ /**
6221
+ * The admin who last saved the configuration. Null for the boot-time
6222
+ * import from config.yaml, or once that user has been deleted.
6223
+ *
6224
+ */
6225
+ updated_by?: string | null;
6226
+ };
6227
+ /**
6228
+ * One append-only change to an instance setting. `before` and `after` are
6229
+ * REDACTED snapshots: they never contain a credential, only
6230
+ * `has_credential` and, on an upsert's `after`, a `secret` marker saying
6231
+ * whether the credential was `changed` or `unchanged`.
6232
+ *
6233
+ */
6234
+ export type AdminInstanceSettingsAuditEntry = {
6235
+ /**
6236
+ * Audit entry id.
6237
+ */
6238
+ id: string;
6239
+ /**
6240
+ * The instance setting the entry describes.
6241
+ */
6242
+ setting: string;
6243
+ /**
6244
+ * `upsert` (created or replaced by an admin), `delete` (removed by an
6245
+ * admin) or `import` (the boot-time import from config.yaml, which has no
6246
+ * actor).
6247
+ *
6248
+ */
6249
+ action: 'upsert' | 'delete' | 'import';
6250
+ /**
6251
+ * The admin who made the change. Null for an import, or once that user
6252
+ * has been deleted.
6253
+ *
6254
+ */
6255
+ actor_user_id: string | null;
6256
+ /**
6257
+ * The actor's display name (or email), when it could be resolved.
6258
+ */
6259
+ actor_name: string | null;
6260
+ /**
6261
+ * The redacted setting before the change; null when the change created it.
6262
+ */
6263
+ before: {
6264
+ [key: string]: unknown;
6265
+ } | null;
6266
+ /**
6267
+ * The redacted setting after the change; null when the change deleted it.
6268
+ */
6269
+ after: {
6270
+ [key: string]: unknown;
6271
+ } | null;
6272
+ /**
6273
+ * When the change was made.
6274
+ */
6275
+ created_at: string;
6276
+ };
6277
+ /**
6278
+ * One page of an instance setting's audit log, newest first.
6279
+ */
6280
+ export type AdminInstanceSettingsAuditPage = {
6281
+ entries: Array<AdminInstanceSettingsAuditEntry>;
6282
+ /**
6283
+ * Opaque cursor for the next page; null on the last page.
6284
+ */
6285
+ next_cursor: string | null;
6286
+ };
6053
6287
  export type ProjectResponse = Project & {
6054
6288
  /**
6055
6289
  * Whether the project's git URL matches a repository accessible via the team's GitHub App installation
@@ -9127,6 +9361,10 @@ export type RenderPromptErrors = {
9127
9361
  * Prompt not found
9128
9362
  */
9129
9363
  404: ErrorResponse;
9364
+ /**
9365
+ * Strict render failed: one or more explicit @prompt:slug references do not resolve. The detail names the missing slugs.
9366
+ */
9367
+ 422: ErrorResponse;
9130
9368
  };
9131
9369
  export type RenderPromptError = RenderPromptErrors[keyof RenderPromptErrors];
9132
9370
  export type RenderPromptResponses = {
@@ -14593,6 +14831,156 @@ export type ExportAdminProjectsResponses = {
14593
14831
  200: string;
14594
14832
  };
14595
14833
  export type ExportAdminProjectsResponse = ExportAdminProjectsResponses[keyof ExportAdminProjectsResponses];
14834
+ export type DeleteAdminInstanceEmailSettingsData = {
14835
+ body?: never;
14836
+ path?: never;
14837
+ query?: never;
14838
+ url: '/api/v1/admin/settings/email';
14839
+ };
14840
+ export type DeleteAdminInstanceEmailSettingsErrors = {
14841
+ /**
14842
+ * Not found — the caller is not an instance admin
14843
+ */
14844
+ 404: ErrorResponse;
14845
+ /**
14846
+ * Conflict — no instance email provider is configured (`INSTANCE_EMAIL_PROVIDER_NOT_CONFIGURED`)
14847
+ */
14848
+ 409: ErrorResponse;
14849
+ /**
14850
+ * Internal server error
14851
+ */
14852
+ 500: ErrorResponse;
14853
+ };
14854
+ export type DeleteAdminInstanceEmailSettingsError = DeleteAdminInstanceEmailSettingsErrors[keyof DeleteAdminInstanceEmailSettingsErrors];
14855
+ export type DeleteAdminInstanceEmailSettingsResponses = {
14856
+ /**
14857
+ * The settings were removed
14858
+ */
14859
+ 204: void;
14860
+ };
14861
+ export type DeleteAdminInstanceEmailSettingsResponse = DeleteAdminInstanceEmailSettingsResponses[keyof DeleteAdminInstanceEmailSettingsResponses];
14862
+ export type GetAdminInstanceEmailSettingsData = {
14863
+ body?: never;
14864
+ path?: never;
14865
+ query?: never;
14866
+ url: '/api/v1/admin/settings/email';
14867
+ };
14868
+ export type GetAdminInstanceEmailSettingsErrors = {
14869
+ /**
14870
+ * Not found — the caller is not an instance admin
14871
+ */
14872
+ 404: ErrorResponse;
14873
+ /**
14874
+ * Internal server error
14875
+ */
14876
+ 500: ErrorResponse;
14877
+ };
14878
+ export type GetAdminInstanceEmailSettingsError = GetAdminInstanceEmailSettingsErrors[keyof GetAdminInstanceEmailSettingsErrors];
14879
+ export type GetAdminInstanceEmailSettingsResponses = {
14880
+ /**
14881
+ * The instance email provider settings
14882
+ */
14883
+ 200: AdminInstanceEmailSettings;
14884
+ };
14885
+ export type GetAdminInstanceEmailSettingsResponse = GetAdminInstanceEmailSettingsResponses[keyof GetAdminInstanceEmailSettingsResponses];
14886
+ export type UpsertAdminInstanceEmailSettingsData = {
14887
+ body: AdminInstanceEmailSettingsRequest;
14888
+ path?: never;
14889
+ query?: never;
14890
+ url: '/api/v1/admin/settings/email';
14891
+ };
14892
+ export type UpsertAdminInstanceEmailSettingsErrors = {
14893
+ /**
14894
+ * Bad request — the configuration is invalid (`INSTANCE_EMAIL_PROVIDER_VALIDATION_FAILED`,
14895
+ * with `validation_errors`), or the body carries an unknown field
14896
+ *
14897
+ */
14898
+ 400: ErrorResponse;
14899
+ /**
14900
+ * Not found — the caller is not an instance admin
14901
+ */
14902
+ 404: ErrorResponse;
14903
+ /**
14904
+ * Internal server error
14905
+ */
14906
+ 500: ErrorResponse;
14907
+ };
14908
+ export type UpsertAdminInstanceEmailSettingsError = UpsertAdminInstanceEmailSettingsErrors[keyof UpsertAdminInstanceEmailSettingsErrors];
14909
+ export type UpsertAdminInstanceEmailSettingsResponses = {
14910
+ /**
14911
+ * The stored settings
14912
+ */
14913
+ 200: AdminInstanceEmailSettings;
14914
+ };
14915
+ export type UpsertAdminInstanceEmailSettingsResponse = UpsertAdminInstanceEmailSettingsResponses[keyof UpsertAdminInstanceEmailSettingsResponses];
14916
+ export type TestAdminInstanceEmailSettingsData = {
14917
+ body?: AdminInstanceEmailTestRequest;
14918
+ path?: never;
14919
+ query?: never;
14920
+ url: '/api/v1/admin/settings/email/test';
14921
+ };
14922
+ export type TestAdminInstanceEmailSettingsErrors = {
14923
+ /**
14924
+ * Bad request — the candidate configuration is invalid, nothing is stored to
14925
+ * test (`INSTANCE_EMAIL_PROVIDER_VALIDATION_FAILED`), or the body carries an
14926
+ * unknown field
14927
+ *
14928
+ */
14929
+ 400: ErrorResponse;
14930
+ /**
14931
+ * Not found — the caller is not an instance admin
14932
+ */
14933
+ 404: ErrorResponse;
14934
+ /**
14935
+ * Internal server error
14936
+ */
14937
+ 500: ErrorResponse;
14938
+ };
14939
+ export type TestAdminInstanceEmailSettingsError = TestAdminInstanceEmailSettingsErrors[keyof TestAdminInstanceEmailSettingsErrors];
14940
+ export type TestAdminInstanceEmailSettingsResponses = {
14941
+ /**
14942
+ * The outcome of the test send
14943
+ */
14944
+ 200: TeamEmailProviderTestResponse;
14945
+ };
14946
+ export type TestAdminInstanceEmailSettingsResponse = TestAdminInstanceEmailSettingsResponses[keyof TestAdminInstanceEmailSettingsResponses];
14947
+ export type ListAdminInstanceEmailSettingsAuditData = {
14948
+ body?: never;
14949
+ path?: never;
14950
+ query?: {
14951
+ /**
14952
+ * Opaque cursor from a previous page's `next_cursor`.
14953
+ */
14954
+ cursor?: string;
14955
+ /**
14956
+ * Page size.
14957
+ */
14958
+ limit?: number;
14959
+ };
14960
+ url: '/api/v1/admin/settings/email/audit';
14961
+ };
14962
+ export type ListAdminInstanceEmailSettingsAuditErrors = {
14963
+ /**
14964
+ * Bad request — malformed cursor, or `limit` out of range
14965
+ */
14966
+ 400: ErrorResponse;
14967
+ /**
14968
+ * Not found — the caller is not an instance admin
14969
+ */
14970
+ 404: ErrorResponse;
14971
+ /**
14972
+ * Internal server error
14973
+ */
14974
+ 500: ErrorResponse;
14975
+ };
14976
+ export type ListAdminInstanceEmailSettingsAuditError = ListAdminInstanceEmailSettingsAuditErrors[keyof ListAdminInstanceEmailSettingsAuditErrors];
14977
+ export type ListAdminInstanceEmailSettingsAuditResponses = {
14978
+ /**
14979
+ * One page of audit entries, newest first
14980
+ */
14981
+ 200: AdminInstanceSettingsAuditPage;
14982
+ };
14983
+ export type ListAdminInstanceEmailSettingsAuditResponse = ListAdminInstanceEmailSettingsAuditResponses[keyof ListAdminInstanceEmailSettingsAuditResponses];
14596
14984
  export type ListCommentsData = {
14597
14985
  body?: never;
14598
14986
  path: {