@contractspec/module.ai-chat 4.3.12 → 4.3.15

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 CHANGED
@@ -36,10 +36,11 @@ Import the root entrypoint from `@contractspec/module.ai-chat`, or choose a docu
36
36
 
37
37
  ## Public Entry Points
38
38
 
39
- - Exports the root module plus context, core, presentation, presentation/components, presentation/hooks, and providers subpaths.
39
+ - Exports the root module plus context, core, core/workflow, presentation, presentation/components, presentation/hooks, and providers subpaths.
40
40
  - Export `.` resolves through `./src/index.ts`.
41
41
  - Export `./context` resolves through `./src/context/index.ts`.
42
42
  - Export `./core` resolves through `./src/core/index.ts`.
43
+ - Export `./core/workflow` resolves through `./src/core/workflow.ts`.
43
44
  - Export `./presentation` resolves through `./src/presentation/index.ts`.
44
45
  - Export `./presentation/components` resolves through `./src/presentation/components/index.ts`.
45
46
  - Export `./presentation/hooks` resolves through `./src/presentation/hooks/index.ts`.
@@ -0,0 +1,50 @@
1
+ import { type WorkflowApiLike, WorkflowChatTransport } from '@contractspec/integration.workflow-devkit';
2
+ import { z } from 'zod';
3
+ import type { ThinkingLevel } from './thinking-levels';
4
+ export declare const WORKFLOW_CHAT_ROUTE_MAX_DURATION = 30;
5
+ declare const START_BODY_SCHEMA: z.ZodObject<{
6
+ chatId: z.ZodOptional<z.ZodString>;
7
+ messages: z.ZodArray<z.ZodUnknown>;
8
+ model: z.ZodOptional<z.ZodString>;
9
+ thinkingLevel: z.ZodOptional<z.ZodEnum<{
10
+ instant: "instant";
11
+ thinking: "thinking";
12
+ extra_thinking: "extra_thinking";
13
+ max: "max";
14
+ }>>;
15
+ }, z.core.$strip>;
16
+ declare const FOLLOW_UP_BODY_SCHEMA: z.ZodObject<{
17
+ chatId: z.ZodOptional<z.ZodString>;
18
+ message: z.ZodOptional<z.ZodUnknown>;
19
+ messages: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
20
+ payload: z.ZodOptional<z.ZodUnknown>;
21
+ }, z.core.$strip>;
22
+ type WorkflowChatStartBody = z.infer<typeof START_BODY_SCHEMA>;
23
+ type WorkflowChatFollowUpBody = z.infer<typeof FOLLOW_UP_BODY_SCHEMA>;
24
+ export interface CreateWorkflowChatRoutesOptions {
25
+ buildFollowUpPayload?: (body: WorkflowChatFollowUpBody) => Promise<unknown> | unknown;
26
+ getFollowUpToken: (params: {
27
+ body: WorkflowChatFollowUpBody;
28
+ runId: string;
29
+ }) => string;
30
+ workflow: (payload: WorkflowChatStartBody & {
31
+ thinkingLevel?: ThinkingLevel;
32
+ }) => Promise<unknown>;
33
+ workflowApi?: Partial<WorkflowApiLike>;
34
+ }
35
+ export declare function createWorkflowChatRoutes(options: CreateWorkflowChatRoutesOptions): {
36
+ followUp: (request: Request, context: {
37
+ params: {
38
+ id?: string;
39
+ runId?: string;
40
+ };
41
+ }) => Promise<Response>;
42
+ start: (request: Request) => Promise<Response>;
43
+ stream: (request: Request, context: {
44
+ params: {
45
+ id?: string;
46
+ runId?: string;
47
+ };
48
+ }) => Promise<Response>;
49
+ };
50
+ export { WorkflowChatTransport };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export * from './create-workflow-chat-routes';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contractspec/module.ai-chat",
3
- "version": "4.3.12",
3
+ "version": "4.3.15",
4
4
  "description": "AI chat interface module",
5
5
  "keywords": [
6
6
  "contractspec",
@@ -31,30 +31,31 @@
31
31
  "typecheck": "tsc --noEmit"
32
32
  },
33
33
  "dependencies": {
34
- "@contractspec/lib.ai-agent": "8.0.0",
35
- "@contractspec/lib.surface-runtime": "0.5.12",
36
- "@contractspec/lib.ai-providers": "3.7.9",
37
- "@contractspec/lib.contracts-spec": "5.0.0",
38
- "@contractspec/lib.workflow-composer": "3.7.12",
39
- "@contractspec/lib.schema": "3.7.10",
40
- "@contractspec/lib.metering": "3.7.12",
41
- "@contractspec/lib.cost-tracking": "3.7.9",
42
- "@contractspec/lib.design-system": "3.8.5",
43
- "@contractspec/lib.ui-kit-web": "3.9.4",
44
- "@ai-sdk/react": "3.0.118",
45
- "ai": "6.0.116",
46
- "lucide-react": "^0.577.0",
34
+ "@contractspec/lib.ai-agent": "8.0.3",
35
+ "@contractspec/lib.surface-runtime": "0.5.15",
36
+ "@contractspec/lib.ai-providers": "3.7.11",
37
+ "@contractspec/lib.contracts-spec": "5.0.3",
38
+ "@contractspec/integration.workflow-devkit": "0.1.1",
39
+ "@contractspec/lib.workflow-composer": "3.7.15",
40
+ "@contractspec/lib.schema": "3.7.12",
41
+ "@contractspec/lib.metering": "3.7.15",
42
+ "@contractspec/lib.cost-tracking": "3.7.11",
43
+ "@contractspec/lib.design-system": "3.8.8",
44
+ "@contractspec/lib.ui-kit-web": "3.9.7",
45
+ "@ai-sdk/react": "3.0.140",
46
+ "ai": "6.0.138",
47
+ "lucide-react": "^1.6.0",
47
48
  "react": "19.2.0",
48
49
  "zod": "^4.3.5"
49
50
  },
50
51
  "devDependencies": {
51
- "@contractspec/tool.typescript": "3.7.9",
52
+ "@contractspec/tool.typescript": "3.7.11",
52
53
  "@types/react": "^19.2.14",
53
54
  "typescript": "^5.9.3",
54
- "@contractspec/tool.bun": "3.7.9"
55
+ "@contractspec/tool.bun": "3.7.11"
55
56
  },
56
57
  "peerDependencies": {
57
- "react": ">=19.2.0"
58
+ "react": ">=19.2.4"
58
59
  },
59
60
  "exports": {
60
61
  ".": {