@elevasis/core 0.15.0 → 0.16.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/dist/index.d.ts +1718 -19
- package/dist/index.js +369 -25
- package/dist/organization-model/index.d.ts +1718 -19
- package/dist/organization-model/index.js +369 -25
- package/dist/test-utils/index.d.ts +1108 -371
- package/dist/test-utils/index.js +357 -17
- package/package.json +5 -1
- package/src/__tests__/publish.test.ts +14 -13
- package/src/__tests__/template-core-compatibility.test.ts +4 -4
- package/src/_gen/__tests__/__snapshots__/contracts.md.snap +1109 -882
- package/src/auth/multi-tenancy/index.ts +3 -0
- package/src/auth/multi-tenancy/theme-presets.ts +45 -0
- package/src/auth/multi-tenancy/types.ts +57 -83
- package/src/auth/multi-tenancy/users/api-schemas.ts +165 -194
- package/src/business/acquisition/activity-events.ts +13 -4
- package/src/business/acquisition/api-schemas.test.ts +315 -4
- package/src/business/acquisition/api-schemas.ts +122 -8
- package/src/business/acquisition/build-templates.ts +44 -0
- package/src/business/acquisition/crm-next-action.test.ts +262 -0
- package/src/business/acquisition/crm-next-action.ts +220 -0
- package/src/business/acquisition/crm-priority.test.ts +216 -0
- package/src/business/acquisition/crm-priority.ts +349 -0
- package/src/business/acquisition/crm-state-actions.test.ts +151 -160
- package/src/business/acquisition/deal-ownership.test.ts +351 -0
- package/src/business/acquisition/deal-ownership.ts +120 -0
- package/src/business/acquisition/derive-actions.test.ts +101 -37
- package/src/business/acquisition/derive-actions.ts +102 -87
- package/src/business/acquisition/index.ts +10 -0
- package/src/business/acquisition/types.ts +400 -366
- package/src/business/crm/api-schemas.ts +40 -0
- package/src/business/crm/index.ts +1 -0
- package/src/business/deals/api-schemas.ts +79 -0
- package/src/business/deals/index.ts +1 -0
- package/src/business/projects/types.ts +124 -88
- package/src/execution/core/runner-types.ts +61 -80
- package/src/execution/engine/index.ts +4 -3
- package/src/execution/engine/tools/integration/server/adapters/gmail/gmail-tools.ts +105 -104
- package/src/execution/engine/tools/integration/server/adapters/instantly/instantly-tools.ts +1474 -1473
- package/src/execution/engine/tools/integration/server/adapters/millionverifier/millionverifier-tools.ts +103 -102
- package/src/execution/engine/tools/integration/server/adapters/signature-api/signature-api-tools.ts +182 -179
- package/src/execution/engine/tools/integration/server/adapters/stripe/stripe-tools.ts +310 -309
- package/src/execution/engine/tools/integration/tool.ts +255 -253
- package/src/execution/engine/tools/lead-service-types.ts +939 -924
- package/src/execution/engine/tools/messages.ts +43 -0
- package/src/execution/engine/tools/platform/acquisition/list-tools.ts +6 -5
- package/src/execution/engine/tools/platform/acquisition/types.ts +5 -2
- package/src/execution/engine/tools/platform/email/types.ts +97 -96
- package/src/execution/engine/tools/registry.ts +4 -3
- package/src/execution/engine/tools/tool-maps.ts +3 -1
- package/src/execution/engine/tools/types.ts +234 -233
- package/src/execution/engine/workflow/types.ts +195 -193
- package/src/execution/external/api-schemas.ts +40 -0
- package/src/execution/external/index.ts +1 -0
- package/src/knowledge/README.md +32 -0
- package/src/knowledge/__tests__/queries.test.ts +504 -0
- package/src/knowledge/format.ts +99 -0
- package/src/knowledge/index.ts +5 -0
- package/src/knowledge/queries.ts +256 -0
- package/src/organization-model/__tests__/defaults.test.ts +172 -172
- package/src/organization-model/__tests__/foundation.test.ts +7 -7
- package/src/organization-model/__tests__/icons.test.ts +27 -0
- package/src/organization-model/__tests__/knowledge.test.ts +214 -0
- package/src/organization-model/contracts.ts +17 -15
- package/src/organization-model/defaults.ts +74 -19
- package/src/organization-model/domains/knowledge.ts +53 -0
- package/src/organization-model/domains/navigation.ts +416 -399
- package/src/organization-model/domains/prospecting.ts +204 -1
- package/src/organization-model/domains/sales.test.ts +29 -0
- package/src/organization-model/domains/sales.ts +102 -0
- package/src/organization-model/domains/shared.ts +6 -5
- package/src/organization-model/foundation.ts +10 -6
- package/src/organization-model/graph/build.ts +209 -182
- package/src/organization-model/graph/schema.ts +37 -34
- package/src/organization-model/graph/types.ts +47 -31
- package/src/organization-model/icons.ts +81 -0
- package/src/organization-model/index.ts +8 -3
- package/src/organization-model/organization-model.mdx +1 -1
- package/src/organization-model/published.ts +103 -86
- package/src/organization-model/schema.ts +90 -85
- package/src/organization-model/types.ts +42 -35
- package/src/platform/constants/versions.ts +1 -1
- package/src/platform/index.ts +23 -27
- package/src/platform/registry/index.ts +0 -4
- package/src/platform/registry/resource-registry.ts +0 -77
- package/src/platform/registry/serialized-types.ts +148 -219
- package/src/platform/registry/stats-types.ts +60 -60
- package/src/reference/_generated/contracts.md +829 -595
- package/src/supabase/database.types.ts +2978 -2958
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CRM API Schemas — SSOT subpath entry
|
|
3
|
+
*
|
|
4
|
+
* Re-exports all CRM-related Zod schemas from their canonical locations
|
|
5
|
+
* so consumers can import from a single surface:
|
|
6
|
+
* import { CrmSchemas, CrmPriorityOverrideSchema } from '@repo/core/business/crm/api-schemas'
|
|
7
|
+
*
|
|
8
|
+
* Schema definitions live in:
|
|
9
|
+
* packages/core/src/business/sales/api-schemas.ts (activity / recent-activity)
|
|
10
|
+
* packages/core/src/business/acquisition/crm-priority.ts (priority override shapes)
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
// ---------------------------------------------------------------------------
|
|
14
|
+
// Re-exports from sales/api-schemas (recent-activity surface)
|
|
15
|
+
// ---------------------------------------------------------------------------
|
|
16
|
+
|
|
17
|
+
export {
|
|
18
|
+
CrmActivityKindSchema,
|
|
19
|
+
RecentActivityEntrySchema,
|
|
20
|
+
GetRecentActivityQuerySchema,
|
|
21
|
+
GetRecentActivityResponseSchema,
|
|
22
|
+
CrmSchemas,
|
|
23
|
+
type CrmActivityKind,
|
|
24
|
+
type RecentActivityEntry,
|
|
25
|
+
type GetRecentActivityQuery,
|
|
26
|
+
type GetRecentActivityResponse
|
|
27
|
+
} from '../sales/api-schemas'
|
|
28
|
+
|
|
29
|
+
// ---------------------------------------------------------------------------
|
|
30
|
+
// Re-exports from acquisition/crm-priority (priority override surface)
|
|
31
|
+
// ---------------------------------------------------------------------------
|
|
32
|
+
|
|
33
|
+
export {
|
|
34
|
+
CrmPriorityBucketKeySchema,
|
|
35
|
+
CrmPriorityBucketOverrideSchema,
|
|
36
|
+
CrmPriorityOverrideSchema,
|
|
37
|
+
type CrmPriorityBucketOverride,
|
|
38
|
+
type CrmPriorityOverride,
|
|
39
|
+
type ResolvedCrmPriorityRuleConfig
|
|
40
|
+
} from '../acquisition/crm-priority'
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './api-schemas'
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Deals API Schemas — SSOT subpath entry
|
|
3
|
+
*
|
|
4
|
+
* Re-exports all deal-related Zod schemas from their canonical locations
|
|
5
|
+
* so consumers can import from a single surface:
|
|
6
|
+
* import { DealSchemas, ... } from '@repo/core/business/deals/api-schemas'
|
|
7
|
+
*
|
|
8
|
+
* Schema definitions live in:
|
|
9
|
+
* packages/core/src/business/acquisition/api-schemas.ts (deal shapes)
|
|
10
|
+
* packages/core/src/business/acquisition/crm-priority.ts (priority overrides)
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
export {
|
|
14
|
+
// Enum schemas
|
|
15
|
+
DealStageSchema,
|
|
16
|
+
AcqDealTaskKindSchema,
|
|
17
|
+
|
|
18
|
+
// Params
|
|
19
|
+
DealIdParamsSchema,
|
|
20
|
+
DealTaskIdParamsSchema,
|
|
21
|
+
|
|
22
|
+
// Query schemas
|
|
23
|
+
ListDealsQuerySchema,
|
|
24
|
+
DealLookupQuerySchema,
|
|
25
|
+
ListDealTasksDueQuerySchema,
|
|
26
|
+
|
|
27
|
+
// Request body schemas
|
|
28
|
+
CreateDealNoteRequestSchema,
|
|
29
|
+
CreateDealTaskRequestSchema,
|
|
30
|
+
TransitionItemRequestSchema,
|
|
31
|
+
TransitionDealStateRequestSchema,
|
|
32
|
+
ExecuteActionParamsSchema,
|
|
33
|
+
ExecuteActionRequestSchema,
|
|
34
|
+
|
|
35
|
+
// Response schemas
|
|
36
|
+
DealContactSummarySchema,
|
|
37
|
+
DealPrioritySchema,
|
|
38
|
+
DealListItemSchema,
|
|
39
|
+
DealListResponseSchema,
|
|
40
|
+
DealSummaryResponseSchema,
|
|
41
|
+
DealLookupItemSchema,
|
|
42
|
+
DealLookupResponseSchema,
|
|
43
|
+
ConversationMessageSchema,
|
|
44
|
+
DealConversationSchema,
|
|
45
|
+
DealDetailResponseSchema,
|
|
46
|
+
DealNoteResponseSchema,
|
|
47
|
+
DealNoteListResponseSchema,
|
|
48
|
+
DealTaskResponseSchema,
|
|
49
|
+
DealTaskListResponseSchema,
|
|
50
|
+
|
|
51
|
+
// Bundled export
|
|
52
|
+
DealSchemas,
|
|
53
|
+
|
|
54
|
+
// Inferred types
|
|
55
|
+
type DealStage,
|
|
56
|
+
type AcqDealTaskKind,
|
|
57
|
+
type DealIdParams,
|
|
58
|
+
type DealTaskIdParams,
|
|
59
|
+
type ListDealsQuery,
|
|
60
|
+
type DealLookupQuery,
|
|
61
|
+
type ListDealTasksDueQuery,
|
|
62
|
+
type CreateDealNoteRequest,
|
|
63
|
+
type CreateDealTaskRequest,
|
|
64
|
+
type TransitionItemRequest,
|
|
65
|
+
type TransitionDealStateRequest,
|
|
66
|
+
type ExecuteActionParams,
|
|
67
|
+
type ExecuteActionRequest,
|
|
68
|
+
type DealPriorityResponse,
|
|
69
|
+
type DealListResponse,
|
|
70
|
+
type DealSummaryResponse,
|
|
71
|
+
type DealLookupItem,
|
|
72
|
+
type DealLookupResponse,
|
|
73
|
+
type ConversationMessage,
|
|
74
|
+
type DealDetailResponse,
|
|
75
|
+
type DealNoteResponse,
|
|
76
|
+
type DealNoteListResponse,
|
|
77
|
+
type DealTaskResponse,
|
|
78
|
+
type DealTaskListResponse
|
|
79
|
+
} from '../acquisition/api-schemas'
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './api-schemas'
|
|
@@ -1,89 +1,125 @@
|
|
|
1
|
-
import type { Database } from '../../supabase/database.types'
|
|
2
|
-
|
|
3
|
-
// Row types from Supabase
|
|
4
|
-
export type ProjectRow = Database['public']['Tables']['prj_projects']['Row']
|
|
5
|
-
export type ProjectInsert = Database['public']['Tables']['prj_projects']['Insert']
|
|
6
|
-
export type ProjectUpdate = Database['public']['Tables']['prj_projects']['Update']
|
|
7
|
-
|
|
8
|
-
export type MilestoneRow = Database['public']['Tables']['prj_milestones']['Row']
|
|
9
|
-
export type MilestoneInsert = Database['public']['Tables']['prj_milestones']['Insert']
|
|
10
|
-
export type MilestoneUpdate = Database['public']['Tables']['prj_milestones']['Update']
|
|
11
|
-
|
|
12
|
-
export type TaskRow = Database['public']['Tables']['prj_tasks']['Row']
|
|
13
|
-
export type TaskInsert = Database['public']['Tables']['prj_tasks']['Insert']
|
|
14
|
-
export type TaskUpdate = Database['public']['Tables']['prj_tasks']['Update']
|
|
15
|
-
|
|
16
|
-
export type NoteRow = Database['public']['Tables']['prj_notes']['Row']
|
|
17
|
-
export type NoteInsert = Database['public']['Tables']['prj_notes']['Insert']
|
|
18
|
-
|
|
19
|
-
// Status enums
|
|
20
|
-
export type ProjectStatus = 'active' | 'on_track' | 'at_risk' | 'blocked' | 'completed' | 'paused'
|
|
21
|
-
|
|
22
|
-
export type ProjectKind = 'client_engagement' | 'internal' | 'research' | 'other'
|
|
23
|
-
|
|
24
|
-
export type MilestoneStatus = 'upcoming' | 'in_progress' | 'completed' | 'overdue' | 'blocked'
|
|
25
|
-
|
|
26
|
-
export type TaskStatus =
|
|
27
|
-
| 'planned'
|
|
28
|
-
| 'in_progress'
|
|
29
|
-
| 'blocked'
|
|
30
|
-
| 'completed'
|
|
31
|
-
| 'cancelled'
|
|
32
|
-
| 'submitted'
|
|
33
|
-
| 'approved'
|
|
34
|
-
| 'rejected'
|
|
35
|
-
| 'revision_requested'
|
|
36
|
-
|
|
37
|
-
export type TaskType = 'documentation' | 'code' | 'report' | 'design' | 'other'
|
|
38
|
-
|
|
1
|
+
import type { Database } from '../../supabase/database.types'
|
|
2
|
+
|
|
3
|
+
// Row types from Supabase
|
|
4
|
+
export type ProjectRow = Database['public']['Tables']['prj_projects']['Row']
|
|
5
|
+
export type ProjectInsert = Database['public']['Tables']['prj_projects']['Insert']
|
|
6
|
+
export type ProjectUpdate = Database['public']['Tables']['prj_projects']['Update']
|
|
7
|
+
|
|
8
|
+
export type MilestoneRow = Database['public']['Tables']['prj_milestones']['Row']
|
|
9
|
+
export type MilestoneInsert = Database['public']['Tables']['prj_milestones']['Insert']
|
|
10
|
+
export type MilestoneUpdate = Database['public']['Tables']['prj_milestones']['Update']
|
|
11
|
+
|
|
12
|
+
export type TaskRow = Database['public']['Tables']['prj_tasks']['Row']
|
|
13
|
+
export type TaskInsert = Database['public']['Tables']['prj_tasks']['Insert']
|
|
14
|
+
export type TaskUpdate = Database['public']['Tables']['prj_tasks']['Update']
|
|
15
|
+
|
|
16
|
+
export type NoteRow = Database['public']['Tables']['prj_notes']['Row']
|
|
17
|
+
export type NoteInsert = Database['public']['Tables']['prj_notes']['Insert']
|
|
18
|
+
|
|
19
|
+
// Status enums
|
|
20
|
+
export type ProjectStatus = 'active' | 'on_track' | 'at_risk' | 'blocked' | 'completed' | 'paused'
|
|
21
|
+
|
|
22
|
+
export type ProjectKind = 'client_engagement' | 'internal' | 'research' | 'other'
|
|
23
|
+
|
|
24
|
+
export type MilestoneStatus = 'upcoming' | 'in_progress' | 'completed' | 'overdue' | 'blocked'
|
|
25
|
+
|
|
26
|
+
export type TaskStatus =
|
|
27
|
+
| 'planned'
|
|
28
|
+
| 'in_progress'
|
|
29
|
+
| 'blocked'
|
|
30
|
+
| 'completed'
|
|
31
|
+
| 'cancelled'
|
|
32
|
+
| 'submitted'
|
|
33
|
+
| 'approved'
|
|
34
|
+
| 'rejected'
|
|
35
|
+
| 'revision_requested'
|
|
36
|
+
|
|
37
|
+
export type TaskType = 'documentation' | 'code' | 'report' | 'design' | 'other'
|
|
38
|
+
|
|
39
39
|
export type NoteType = 'call_note' | 'status_update' | 'issue' | 'blocker' | 'agent_learning'
|
|
40
|
-
|
|
41
|
-
// Filter types
|
|
42
|
-
export interface ProjectFilters {
|
|
43
|
-
status?: ProjectStatus
|
|
44
|
-
kind?: ProjectKind
|
|
45
|
-
companyId?: string
|
|
46
|
-
search?: string
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
export interface MilestoneFilters {
|
|
50
|
-
status?: MilestoneStatus
|
|
51
|
-
projectId?: string
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
export interface TaskFilters {
|
|
55
|
-
status?: TaskStatus
|
|
56
|
-
type?: TaskType
|
|
57
|
-
milestoneId?: string
|
|
58
|
-
projectId?: string
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
export interface NoteFilters {
|
|
62
|
-
type?: NoteType
|
|
63
|
-
projectId?: string
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
// Display types (for JOINed data)
|
|
67
|
-
export interface ProjectWithCounts extends ProjectRow {
|
|
68
|
-
milestoneCount: number
|
|
69
|
-
taskCount: number
|
|
70
|
-
completedMilestones?: number
|
|
71
|
-
completedTasks?: number
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
export interface ProjectDetail extends ProjectRow {
|
|
75
|
-
milestones: MilestoneRow[]
|
|
76
|
-
tasks: TaskRow[]
|
|
77
|
-
company: { id: string; name: string; domain: string | null } | null
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
export interface MilestoneWithTasks extends MilestoneRow {
|
|
81
|
-
tasks: TaskRow[]
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
// Checklist item stored in prj_milestones.checklist JSONB column
|
|
85
|
-
export interface ChecklistItem {
|
|
86
|
-
id: string
|
|
87
|
-
label: string
|
|
88
|
-
completed: boolean
|
|
89
|
-
}
|
|
40
|
+
|
|
41
|
+
// Filter types
|
|
42
|
+
export interface ProjectFilters {
|
|
43
|
+
status?: ProjectStatus
|
|
44
|
+
kind?: ProjectKind
|
|
45
|
+
companyId?: string
|
|
46
|
+
search?: string
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export interface MilestoneFilters {
|
|
50
|
+
status?: MilestoneStatus
|
|
51
|
+
projectId?: string
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export interface TaskFilters {
|
|
55
|
+
status?: TaskStatus
|
|
56
|
+
type?: TaskType
|
|
57
|
+
milestoneId?: string
|
|
58
|
+
projectId?: string
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export interface NoteFilters {
|
|
62
|
+
type?: NoteType
|
|
63
|
+
projectId?: string
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// Display types (for JOINed data)
|
|
67
|
+
export interface ProjectWithCounts extends ProjectRow {
|
|
68
|
+
milestoneCount: number
|
|
69
|
+
taskCount: number
|
|
70
|
+
completedMilestones?: number
|
|
71
|
+
completedTasks?: number
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export interface ProjectDetail extends ProjectRow {
|
|
75
|
+
milestones: MilestoneRow[]
|
|
76
|
+
tasks: TaskRow[]
|
|
77
|
+
company: { id: string; name: string; domain: string | null } | null
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export interface MilestoneWithTasks extends MilestoneRow {
|
|
81
|
+
tasks: TaskRow[]
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
// Checklist item stored in prj_milestones.checklist JSONB column
|
|
85
|
+
export interface ChecklistItem {
|
|
86
|
+
id: string
|
|
87
|
+
label: string
|
|
88
|
+
completed: boolean
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
// ---------------------------------------------------------------------------
|
|
92
|
+
// CamelCase domain types (snake_case DB rows mapped via service.transformRow)
|
|
93
|
+
// ---------------------------------------------------------------------------
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* CamelCase domain type for a project row.
|
|
97
|
+
* Produced by ProjectsService.transformRow() from the snake_case ProjectRow.
|
|
98
|
+
*/
|
|
99
|
+
export interface Project {
|
|
100
|
+
id: string
|
|
101
|
+
organizationId: string
|
|
102
|
+
name: string
|
|
103
|
+
kind: ProjectKind
|
|
104
|
+
status: ProjectStatus
|
|
105
|
+
description: string | null
|
|
106
|
+
dealId: string | null
|
|
107
|
+
clientCompanyId: string | null
|
|
108
|
+
startDate: string | null
|
|
109
|
+
targetEndDate: string | null
|
|
110
|
+
actualEndDate: string | null
|
|
111
|
+
contractValue: number | null
|
|
112
|
+
metadata: Record<string, unknown> | null
|
|
113
|
+
createdAt: string
|
|
114
|
+
updatedAt: string
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* CamelCase project with aggregated counts (for list views).
|
|
119
|
+
*/
|
|
120
|
+
export interface ProjectSummary extends Project {
|
|
121
|
+
milestoneCount: number
|
|
122
|
+
taskCount: number
|
|
123
|
+
completedMilestones: number
|
|
124
|
+
completedTasks: number
|
|
125
|
+
}
|
|
@@ -1,80 +1,61 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Execution Runner Types
|
|
3
|
-
*
|
|
4
|
-
* Shared types for
|
|
5
|
-
* Used by both API (apps/api) and frontend (apps/command-center).
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
import type {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
//
|
|
12
|
-
//
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
//
|
|
23
|
-
//
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
//
|
|
33
|
-
//
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
resourceId: string
|
|
38
|
-
resourceName: string
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
metrics?: ExecutionMetrics
|
|
63
|
-
input?: unknown
|
|
64
|
-
output?: unknown
|
|
65
|
-
error?: { message: string }
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
export interface ExecutionListResponse {
|
|
69
|
-
executions: ExecutionSummary[]
|
|
70
|
-
pagination: PaginationMetadata
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
// ============================================================================
|
|
74
|
-
// RUN RESOURCE TYPES
|
|
75
|
-
// ============================================================================
|
|
76
|
-
|
|
77
|
-
export interface RunResourceResponse {
|
|
78
|
-
executionId: string
|
|
79
|
-
status: ExecutionStatus
|
|
80
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* Execution Runner Types
|
|
3
|
+
*
|
|
4
|
+
* Shared types for execution history and run responses.
|
|
5
|
+
* Used by both API (apps/api) and frontend (apps/command-center).
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import type { ExecutionStatus } from './sse-executions'
|
|
9
|
+
|
|
10
|
+
// ============================================================================
|
|
11
|
+
// PAGINATION
|
|
12
|
+
// ============================================================================
|
|
13
|
+
|
|
14
|
+
export interface PaginationMetadata {
|
|
15
|
+
total: number
|
|
16
|
+
limit: number
|
|
17
|
+
offset: number
|
|
18
|
+
hasMore: boolean
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
// ============================================================================
|
|
22
|
+
// EXECUTION METRICS
|
|
23
|
+
// ============================================================================
|
|
24
|
+
|
|
25
|
+
export interface ExecutionMetrics {
|
|
26
|
+
tokenCount?: number
|
|
27
|
+
stepCount?: number
|
|
28
|
+
toolCallCount?: number
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// ============================================================================
|
|
32
|
+
// EXECUTION HISTORY TYPES
|
|
33
|
+
// ============================================================================
|
|
34
|
+
|
|
35
|
+
export interface ExecutionSummary {
|
|
36
|
+
id: string
|
|
37
|
+
resourceId: string
|
|
38
|
+
resourceName: string
|
|
39
|
+
status: ExecutionStatus
|
|
40
|
+
startedAt: string
|
|
41
|
+
completedAt?: string
|
|
42
|
+
durationMs?: number
|
|
43
|
+
metrics?: ExecutionMetrics
|
|
44
|
+
input?: unknown
|
|
45
|
+
output?: unknown
|
|
46
|
+
error?: { message: string }
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export interface ExecutionListResponse {
|
|
50
|
+
executions: ExecutionSummary[]
|
|
51
|
+
pagination: PaginationMetadata
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// ============================================================================
|
|
55
|
+
// RUN RESOURCE TYPES
|
|
56
|
+
// ============================================================================
|
|
57
|
+
|
|
58
|
+
export interface RunResourceResponse {
|
|
59
|
+
executionId: string
|
|
60
|
+
status: ExecutionStatus
|
|
61
|
+
}
|
|
@@ -297,9 +297,10 @@ export {
|
|
|
297
297
|
type UpdateProposalDataParams,
|
|
298
298
|
type MarkProposalSentParams,
|
|
299
299
|
type MarkProposalReviewedParams,
|
|
300
|
-
type UpdateCloseLostReasonParams,
|
|
301
|
-
type UpdateFeesParams,
|
|
302
|
-
type
|
|
300
|
+
type UpdateCloseLostReasonParams,
|
|
301
|
+
type UpdateFeesParams,
|
|
302
|
+
type CacheInstantlyThreadIdsParams,
|
|
303
|
+
type TransitionItemParams,
|
|
303
304
|
type SetContactNurtureParams,
|
|
304
305
|
type CancelSchedulesAndHitlByEmailParams,
|
|
305
306
|
type CancelHitlByDealIdParams,
|