Skip to content

Commit 34357e2

Browse files
committed
feat(crm): org-scoped CRM with a graph-and-loop research agent (#1272)
Synced from sferarc/pgbeam@d78ddfc
1 parent 83ba830 commit 34357e2

50 files changed

Lines changed: 9194 additions & 4388 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

openapi.json

Lines changed: 4614 additions & 2596 deletions
Large diffs are not rendered by default.

openapi.yaml

Lines changed: 3193 additions & 1791 deletions
Large diffs are not rendered by default.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
name: artifact_id
2+
in: path
3+
required: true
4+
description: Unique CRM artifact identifier (prefixed, e.g. art_xxx).
5+
schema:
6+
type: string
7+
pattern: ^[a-zA-Z0-9_.-]+$
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
name: company_id
2+
in: path
3+
required: true
4+
description: Unique CRM company identifier (prefixed, e.g. cmp_xxx).
5+
schema:
6+
type: string
7+
pattern: ^[a-zA-Z0-9_.-]+$
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
name: contact_id
2+
in: path
3+
required: true
4+
description: Unique CRM contact identifier (prefixed, e.g. cnt_xxx).
5+
schema:
6+
type: string
7+
pattern: ^[a-zA-Z0-9_.-]+$
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
name: deal_id
2+
in: path
3+
required: true
4+
description: Unique CRM deal identifier (prefixed, e.g. dl_xxx).
5+
schema:
6+
type: string
7+
pattern: ^[a-zA-Z0-9_.-]+$
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
name: task_id
2+
in: path
3+
required: true
4+
description: Unique CRM research task identifier (prefixed, e.g. ctk_xxx).
5+
schema:
6+
type: string
7+
pattern: ^[a-zA-Z0-9_.-]+$
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
type: object
2+
description: A single entry in an entity's activity timeline.
3+
required:
4+
- id
5+
- org_id
6+
- subject_type
7+
- subject_id
8+
- actor
9+
- verb
10+
- at
11+
properties:
12+
id:
13+
type: string
14+
description: Unique activity identifier.
15+
example: act_01j9x8y7z6w5v4u3t2s1r0q9p8
16+
org_id:
17+
type: string
18+
description: Organization the activity belongs to.
19+
subject_type:
20+
$ref: ./ResearchTaskSubjectType.yaml
21+
subject_id:
22+
type: string
23+
description: ID of the company/contact/deal this activity is about.
24+
actor:
25+
type: string
26+
description: Who performed the action ("agent" or a user identifier).
27+
verb:
28+
type: string
29+
description: What happened (created, enriched, drafted, approved, sent).
30+
at:
31+
type: string
32+
format: date-time
33+
description: When the action happened.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
type: string
2+
description: >
3+
Specialist agent role that owns a task. The researcher is the lead, the
4+
enricher fills in graph edges, and outreach writes and sends.
5+
enum:
6+
- researcher
7+
- enricher
8+
- outreach
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
type: object
2+
description: Long-form agent output (a drafted email, an account brief) for human review.
3+
required:
4+
- id
5+
- org_id
6+
- subject_type
7+
- subject_id
8+
- kind
9+
- title
10+
- body
11+
- status
12+
- created_at
13+
- updated_at
14+
properties:
15+
id:
16+
type: string
17+
description: Unique artifact identifier.
18+
example: art_01j9x8y7z6w5v4u3t2s1r0q9p8
19+
org_id:
20+
type: string
21+
description: Organization the artifact belongs to.
22+
task_id:
23+
type: string
24+
nullable: true
25+
description: Research task that produced this artifact, if any.
26+
subject_type:
27+
$ref: ./ResearchTaskSubjectType.yaml
28+
subject_id:
29+
type: string
30+
description: ID of the company/contact/deal this artifact is about.
31+
kind:
32+
type: string
33+
description: Kind of artifact (e.g. outreach_email, account_brief).
34+
title:
35+
type: string
36+
description: Short title.
37+
body:
38+
type: string
39+
description: Long-form content.
40+
status:
41+
$ref: ./ArtifactStatus.yaml
42+
created_at:
43+
type: string
44+
format: date-time
45+
description: When the artifact was created.
46+
updated_at:
47+
type: string
48+
format: date-time
49+
description: When the artifact was last updated.

0 commit comments

Comments
 (0)