@salsita-ai/contracts 0.50.0-develop.1162eef277 → 0.50.0-develop.11a39afa73
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 +11 -3
- package/dist/api/index.d.ts +1 -0
- package/dist/api/index.js +1 -1
- package/dist/api/studio-session.d.ts +57 -0
- package/dist/api/studio-session.js +1 -0
- package/dist/assistant/ban-tool.d.ts +17 -0
- package/dist/assistant/ban-tool.js +1 -0
- package/dist/assistant/deployment-assistant.d.ts +111 -0
- package/dist/assistant/deployment-assistant.js +1 -1
- package/dist/assistant/graphql-tools.d.ts +14 -1
- package/dist/assistant/graphql-tools.js +1 -1
- package/dist/assistant/image-reference.d.ts +10 -0
- package/dist/assistant/image-reference.js +1 -0
- package/dist/assistant/index.d.ts +9 -4
- package/dist/assistant/index.js +1 -1
- package/dist/assistant/message-metadata.d.ts +138 -1
- package/dist/assistant/message-metadata.js +1 -1
- package/dist/assistant/speech-text.d.ts +15 -0
- package/dist/assistant/speech-text.js +1 -0
- package/dist/assistant/transcript-event.d.ts +25 -0
- package/dist/assistant/transcript-event.js +1 -0
- package/dist/assistant/voice-recording.d.ts +13 -0
- package/dist/assistant/voice-recording.js +1 -0
- package/dist/chat/api.d.ts +0 -41
- package/dist/chat/api.js +1 -1
- package/dist/chat/completions/types.d.ts +0 -3
- package/dist/chat/completions/types.js +1 -1
- package/dist/chat/functions/process.d.ts +1 -2
- package/dist/chat/functions/process.js +1 -1
- package/dist/chat/index.d.ts +3 -6
- package/dist/chat/index.js +1 -1
- package/dist/domain/deployments/assistant-limit-domain.d.ts +13 -0
- package/dist/domain/deployments/assistant-limit-domain.js +1 -0
- package/dist/domain/deployments/customer-domain.d.ts +2 -0
- package/dist/domain/deployments/deployment-build-domain.d.ts +10 -0
- package/dist/domain/deployments/environment-domain.d.ts +3 -0
- package/dist/domain/deployments/index.d.ts +2 -1
- package/dist/domain/deployments/index.js +1 -1
- package/dist/domain/deployments/oauth-connection-domain.d.ts +0 -7
- package/dist/domain/deployments/oauth-connection-domain.js +1 -1
- package/dist/domain/index.d.ts +3 -0
- package/dist/domain/index.js +1 -1
- package/dist/domain/password-policy.d.ts +22 -0
- package/dist/domain/password-policy.js +1 -0
- package/dist/domain/product-configurations/configurations-domain.d.ts +2 -7
- package/dist/domain/product-configurations/configurations-domain.js +1 -1
- package/dist/domain/product-configurations/index.d.ts +1 -1
- package/dist/domain/product-configurations/index.js +1 -1
- package/dist/domain/workspace-invitation-role.d.ts +7 -0
- package/dist/domain/workspace-invitation-role.js +1 -0
- package/dist/domain/workspace-invitation.d.ts +7 -0
- package/dist/domain/workspace-invitation.js +1 -0
- package/dist/webhook/implementation/backend-data-response.d.ts +3 -0
- package/dist/webhook/implementation/backend-data-response.js +1 -0
- package/dist/webhook/implementation/index.d.ts +0 -1
- package/dist/webhook/implementation/index.js +1 -1
- package/dist/webhook/implementation/webhook-api-types.d.ts +65 -1
- package/dist/webhook/implementation/webhook-api-types.js +1 -1
- package/dist/webhook/implementation/webhook-routing.d.ts +0 -6
- package/dist/webhook/implementation/webhook-routing.js +1 -1
- package/dist/webhook/implementation/webhook-tunnel-types.d.ts +9 -0
- package/dist/webhook/implementation/webhook-tunnel-types.js +1 -1
- package/package.json +5 -6
- package/dist/assistant/browser-details-tool.d.ts +0 -16
- package/dist/assistant/browser-details-tool.js +0 -1
- package/dist/chat/completions/messages.d.ts +0 -3
- package/dist/chat/completions/messages.js +0 -1
- package/dist/chat/functions/augmentations.d.ts +0 -3
- package/dist/chat/functions/augmentations.js +0 -1
- package/dist/chat/functions/create.d.ts +0 -5
- package/dist/chat/functions/create.js +0 -1
- package/dist/webhook/implementation/webhook-client.d.ts +0 -86
- package/dist/webhook/implementation/webhook-client.js +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salsita-ai/contracts",
|
|
3
|
-
"version": "0.50.0-develop.
|
|
3
|
+
"version": "0.50.0-develop.11a39afa73",
|
|
4
4
|
"description": "Shared API, authentication, domain, chat, and webhook contracts for Phoenix.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"salsita",
|
|
@@ -48,23 +48,22 @@
|
|
|
48
48
|
"@tanstack/ai": "0.64.0",
|
|
49
49
|
"@types/aws-lambda": "8.10.133",
|
|
50
50
|
"ajv": "8.20.0",
|
|
51
|
-
"http-errors": "2.0.1",
|
|
52
51
|
"jose": "6.2.3",
|
|
53
|
-
"lodash-es": "4.18.1",
|
|
54
52
|
"openai": "7.23.0",
|
|
53
|
+
"remark": "15.0.1",
|
|
54
|
+
"remark-gfm": "4.0.0",
|
|
55
55
|
"ts-pattern": "5.9.0",
|
|
56
56
|
"uuid": "14.0.0",
|
|
57
57
|
"valid-url": "1.0.9",
|
|
58
58
|
"zod": "3.25.76",
|
|
59
|
-
"@salsita-ai/common": "0.50.0-develop.
|
|
59
|
+
"@salsita-ai/common": "0.50.0-develop.11a39afa73"
|
|
60
60
|
},
|
|
61
61
|
"devDependencies": {
|
|
62
62
|
"@lingui/core": "5.9.5",
|
|
63
63
|
"@swc/cli": "0.8.1",
|
|
64
64
|
"@swc/core": "1.15.40",
|
|
65
|
-
"@types/
|
|
65
|
+
"@types/mdast": "4.0.4",
|
|
66
66
|
"@types/json-schema": "7.0.15",
|
|
67
|
-
"@types/lodash-es": "4.17.12",
|
|
68
67
|
"@types/valid-url": "1.0.7",
|
|
69
68
|
"eslint": "9.39.4",
|
|
70
69
|
"prettier": "3.8.3",
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Client-side tool of the assistant chat: the browser draws its own details (user agent, viewport,
|
|
3
|
-
* pixel ratio, language) onto a canvas and returns the capture as an image content part. It carries
|
|
4
|
-
* no domain meaning; it proves that a client tool result reaches the model as an image.
|
|
5
|
-
*
|
|
6
|
-
* The server passes the definition to the model without an implementation, so every call becomes a
|
|
7
|
-
* client-tool interrupt; the SDK registers the browser implementation via `.client()`.
|
|
8
|
-
*
|
|
9
|
-
* The input schema is plain JSON Schema because `@tanstack/ai` converts only schemas that expose
|
|
10
|
-
* `~standard.jsonSchema` (Zod 4.2+), which the workspace's Zod 3 does not.
|
|
11
|
-
*/
|
|
12
|
-
export declare const browserDetailsTool: import("@tanstack/ai").ToolDefinition<{
|
|
13
|
-
type: string;
|
|
14
|
-
properties: {};
|
|
15
|
-
required: never[];
|
|
16
|
-
}, undefined, "getBrowserDetails", false, undefined>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{toolDefinition as e}from"@tanstack/ai";export const browserDetailsTool=e({name:"getBrowserDetails",description:"Captures the user's browser details (user agent, viewport size, device pixel ratio, language) as an image.",inputSchema:{type:"object",properties:{},required:[]}});
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import type OpenAI from 'openai';
|
|
2
|
-
export declare const createAssistantMessage: (content?: string, toolCalls?: OpenAI.Chat.Completions.ChatCompletionMessageToolCall[]) => OpenAI.ChatCompletionAssistantMessageParam;
|
|
3
|
-
export declare const createToolCallResultMessage: (content: string, toolCallId: string) => OpenAI.Chat.Completions.ChatCompletionToolMessageParam;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export const createAssistantMessage=(t,o)=>({role:"assistant",...t?{content:t}:void 0,...o?{tool_calls:o.filter(t=>"function"===t.type).map(t=>({id:t.id,function:t.function,type:"function"}))}:void 0});export const createToolCallResultMessage=(t,o)=>({role:"tool",content:t,tool_call_id:o});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export const simpleAugmentationHandler=t=>e=>({result:e[t]?JSON.stringify(e):""});
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { JSONSchemaType } from 'ajv';
|
|
2
|
-
import type { Empty } from '../utils/types.js';
|
|
3
|
-
import type { ChatExecutableFunction, ChatFunction, ChatFunctionDefinition } from './types.js';
|
|
4
|
-
export declare const createChatExecutableFunction: <C extends Empty = Empty, R extends Empty = Empty, P = undefined>(name: string, parameters: JSONSchemaType<P> | undefined, func: ChatFunction<C, R, P>) => ChatExecutableFunction<C, R, P>;
|
|
5
|
-
export declare const createChatFunctionDefinition: <C extends Empty = Empty, R extends Empty = Empty, P = undefined>(name: string, description: string, parameters: JSONSchemaType<P> | undefined, func: ChatFunction<C, R, P>) => ChatFunctionDefinition<C, R, P>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{createValidator as t}from"./validate.js";export const createChatExecutableFunction=(e,a,n)=>({name:e,function:n,validate:t(a)});export const createChatFunctionDefinition=(t,e,a,n)=>({description:e,parameters:a,...createChatExecutableFunction(t,a,n)});
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
import type { ApplicationType } from '../../domain/index.js';
|
|
2
|
-
import { type AssistantSetupPayload, AssistantSetupResponse, type CallbackPayload, CallbackResponse, type FetchBackendDataPayload, type FinalizeWebhookPayload } from './webhook-api-types.js';
|
|
3
|
-
export type WebhookHttpClient = (url: string, init: RequestInit) => Promise<Response>;
|
|
4
|
-
export declare const fetchWebhookHttpClient: WebhookHttpClient;
|
|
5
|
-
export declare const createUrlWebhookHttpClient: (baseUrl: string, httpClient?: WebhookHttpClient) => WebhookHttpClient;
|
|
6
|
-
export declare class WebhookClient {
|
|
7
|
-
private readonly _httpClient;
|
|
8
|
-
constructor(httpClient: WebhookHttpClient);
|
|
9
|
-
/** @deprecated Pass createUrlWebhookHttpClient(baseUrl, httpClient) instead. This overload will be removed in a future version. */
|
|
10
|
-
constructor(baseUrl: string, httpClient?: WebhookHttpClient);
|
|
11
|
-
handleRefreshFlow: (refreshToken: string) => Promise<{
|
|
12
|
-
success: true;
|
|
13
|
-
data: Record<string, unknown>;
|
|
14
|
-
role: "admin" | "anonymous" | "superadmin" | "user";
|
|
15
|
-
refreshToken?: string | undefined;
|
|
16
|
-
expirationTime?: number | undefined;
|
|
17
|
-
scopes?: string[] | undefined;
|
|
18
|
-
userId?: string | undefined;
|
|
19
|
-
userIdSource?: "clerk" | "custom" | undefined;
|
|
20
|
-
} | {
|
|
21
|
-
success: false;
|
|
22
|
-
}>;
|
|
23
|
-
handleCodeFlow: (accessToken: string, refreshToken: string | undefined, idToken: string | undefined) => Promise<{
|
|
24
|
-
success: true;
|
|
25
|
-
data: Record<string, unknown>;
|
|
26
|
-
role: "admin" | "anonymous" | "superadmin" | "user";
|
|
27
|
-
refreshToken?: string | undefined;
|
|
28
|
-
expirationTime?: number | undefined;
|
|
29
|
-
scopes?: string[] | undefined;
|
|
30
|
-
userId?: string | undefined;
|
|
31
|
-
userIdSource?: "clerk" | "custom" | undefined;
|
|
32
|
-
} | {
|
|
33
|
-
success: false;
|
|
34
|
-
}>;
|
|
35
|
-
handleAnonymousFlow: () => Promise<{
|
|
36
|
-
success: true;
|
|
37
|
-
data: Record<string, unknown>;
|
|
38
|
-
role: "admin" | "anonymous" | "superadmin" | "user";
|
|
39
|
-
refreshToken?: string | undefined;
|
|
40
|
-
expirationTime?: number | undefined;
|
|
41
|
-
scopes?: string[] | undefined;
|
|
42
|
-
userId?: string | undefined;
|
|
43
|
-
userIdSource?: "clerk" | "custom" | undefined;
|
|
44
|
-
} | {
|
|
45
|
-
success: false;
|
|
46
|
-
}>;
|
|
47
|
-
finalize: (data: FinalizeWebhookPayload<Record<string, unknown>, {
|
|
48
|
-
id: string;
|
|
49
|
-
type: string;
|
|
50
|
-
}, Record<string, unknown>, Record<string, unknown>>, applicationType: ApplicationType) => Promise<{
|
|
51
|
-
dataVersion: 1;
|
|
52
|
-
tasks: (import("../tasks/call-lambda-back-task.js").CallLambdaBackTask<Record<string, unknown>, string> | import("../tasks/edit-google-spreadsheet-task.js").EditGoogleSpreadsheetTask | import("../tasks/generate-csv-task.js").GenerateCsvTask | import("../tasks/generate-images-task.js").GenerateImagesTask | import("../tasks/generate-pdf-task.js").GeneratePdfTask | import("../tasks/generate-pdf-task.js").GenerateStaticPdfTask | import("../tasks/send-email-task.js").SendEmailTask | import("../tasks/send-http-task.js").SendHttpRequestTask | import("../tasks/send-email-task.js").SendStaticEmailTask | import("../tasks/woocommerce-add-to-cart-task.js").WooCommerceAddToCartTask | {
|
|
53
|
-
type: "GenerateConfigurationLink";
|
|
54
|
-
name: string;
|
|
55
|
-
frontendUrl: string & import("@salsita-ai/common/utils").Brand<"FrontendUrl">;
|
|
56
|
-
expiration?: number | undefined;
|
|
57
|
-
access: "o" | "r" | "rr";
|
|
58
|
-
configurationId: string & import("@salsita-ai/common/utils").Brand<"ConfigurationId">;
|
|
59
|
-
revisionId?: import("../../domain/index.js").RevisionId | undefined;
|
|
60
|
-
} | {
|
|
61
|
-
type: "PublishRevision";
|
|
62
|
-
version: number & import("@salsita-ai/common/utils").Brand<"PublishedDataRevisionVersion">;
|
|
63
|
-
revisionId: string & import("@salsita-ai/common/utils").Brand<"RevisionId">;
|
|
64
|
-
data: Record<string, unknown>;
|
|
65
|
-
} | {
|
|
66
|
-
type: "PublishRevisionChunks";
|
|
67
|
-
revisionId: string & import("@salsita-ai/common/utils").Brand<"RevisionId">;
|
|
68
|
-
chunks: {
|
|
69
|
-
key: string & import("@salsita-ai/common/utils").Brand<"ChunkKey">;
|
|
70
|
-
scope: string & import("@salsita-ai/common/utils").Brand<"ChunkScope">;
|
|
71
|
-
data: Record<string, unknown>;
|
|
72
|
-
}[];
|
|
73
|
-
publishedDataHash: string;
|
|
74
|
-
} | {
|
|
75
|
-
type: "PublishRevisionChunksStaged";
|
|
76
|
-
revisionId: string & import("@salsita-ai/common/utils").Brand<"RevisionId">;
|
|
77
|
-
publishedDataHash: string;
|
|
78
|
-
})[];
|
|
79
|
-
resources: import("../index.js").FinalizeTaskResource<string>[];
|
|
80
|
-
}>;
|
|
81
|
-
callback: (payload: CallbackPayload<Record<string, unknown>, string>) => Promise<CallbackResponse<Record<string, unknown>>>;
|
|
82
|
-
assistantSetup: (payload: AssistantSetupPayload) => Promise<AssistantSetupResponse>;
|
|
83
|
-
fetchBackendData: (payload: FetchBackendDataPayload<Record<string, unknown>, Record<string, unknown>>) => Promise<{
|
|
84
|
-
backendData: Record<string, unknown>;
|
|
85
|
-
}>;
|
|
86
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{WebhookFinalizeTaskConfiguration as t}from"../tasks/index.js";import{AssistantSetupResponse as e,AuthHandlerResponse as a,CallbackResponse as o,FetchBackendDataHandlerResponse as i}from"./webhook-api-types.js";import{getAssistantSetupRoute as n,getAuthRoute as r,getCallbackRoute as s,getFetchBackendDataRoute as l,getFinalizeRoute as h}from"./webhook-routing.js";export const fetchWebhookHttpClient=(t,e)=>fetch(t,e);export const createUrlWebhookHttpClient=(t,e=fetchWebhookHttpClient)=>(a,o)=>e(`${t}${a}`,o);export class WebhookClient{_httpClient;constructor(t,e=fetchWebhookHttpClient){this._httpClient="string"==typeof t?createUrlWebhookHttpClient(t,e):t}handleRefreshFlow=async t=>{let e=await this._httpClient(r(),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"refresh",refreshToken:t})});if(!e.ok)throw Error(`Refresh webhook call failed: ${await e.text()}`);return a.parse(await e.json())};handleCodeFlow=async(t,e,o)=>{let i=await this._httpClient(r(),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"code",accessToken:t,refreshToken:e,idToken:o})});if(!i.ok)throw Error(`Refresh webhook call failed: ${await i.text()}`);return a.parse(await i.json())};handleAnonymousFlow=async()=>{let t=await this._httpClient(r(),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"anonymous"})});if(!t.ok)throw Error(`Refresh webhook call failed: ${await t.text()}`);return a.parse(await t.json())};finalize=async(e,a)=>{let o=await this._httpClient(h(a),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!o.ok)throw Error("Lambda call failed: "+await o.text());let i=await o.json();return t.parse(i)};callback=async t=>{let e=await this._httpClient(s(),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(!e.ok)throw Error("Lambda call failed: "+await e.text());let a=await e.json();return o.parse(a)};assistantSetup=async t=>{let a=await this._httpClient(n(),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(!a.ok)throw Error(`Assistant setup lambda call failed: ${await a.text()}`);return e.parse(await a.json())};fetchBackendData=async t=>{let e=await this._httpClient(l(),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(!e.ok)throw Error("Lambda call failed: "+await e.text());return i.parse(await e.json())}}
|