Skip to content

Commit efd462f

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

56 files changed

Lines changed: 3706 additions & 0 deletions

Some content is hidden

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

src/generated/describe-map.gen.ts

Lines changed: 26 additions & 0 deletions
Large diffs are not rendered by default.

src/generated/index.ts

Lines changed: 58 additions & 0 deletions
Large diffs are not rendered by default.

src/generated/operations-map.gen.ts

Lines changed: 160 additions & 0 deletions
Large diffs are not rendered by default.

src/generated/types/Activity.ts

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
/**
2+
* Generated by Kubb (https://kubb.dev/).
3+
* Do not edit manually.
4+
*/
5+
6+
import type { ResearchTaskSubjectTypeKey } from "./ResearchTaskSubjectType";
7+
8+
/**
9+
* @description A single entry in an entity\'s activity timeline.
10+
* @type object
11+
*/
12+
export type Activity = {
13+
/**
14+
* @description Unique activity identifier.
15+
* @example act_01j9x8y7z6w5v4u3t2s1r0q9p8
16+
* @type string
17+
*/
18+
id: string;
19+
/**
20+
* @description Organization the activity belongs to.
21+
* @type string
22+
*/
23+
org_id: string;
24+
/**
25+
* @description The kind of entity a research task targets.
26+
* @type string
27+
*/
28+
subject_type: ResearchTaskSubjectTypeKey;
29+
/**
30+
* @description ID of the company/contact/deal this activity is about.
31+
* @type string
32+
*/
33+
subject_id: string;
34+
/**
35+
* @description Who performed the action (\"agent\" or a user identifier).
36+
* @type string
37+
*/
38+
actor: string;
39+
/**
40+
* @description What happened (created, enriched, drafted, approved, sent).
41+
* @type string
42+
*/
43+
verb: string;
44+
/**
45+
* @description When the action happened.
46+
* @type string
47+
*/
48+
at: string;
49+
};

src/generated/types/AgentRole.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/**
2+
* Generated by Kubb (https://kubb.dev/).
3+
* Do not edit manually.
4+
*/
5+
6+
export const agentRole = {
7+
researcher: "researcher",
8+
enricher: "enricher",
9+
outreach: "outreach"
10+
} as const;
11+
12+
export type AgentRoleKey = (typeof agentRole)[keyof typeof agentRole];
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
/**
2+
* Generated by Kubb (https://kubb.dev/).
3+
* Do not edit manually.
4+
*/
5+
6+
import type { Error } from "./Error";
7+
import type { ResearchTask } from "./ResearchTask";
8+
9+
/**
10+
* @description Unique organization identifier.
11+
* @pattern ^[a-zA-Z0-9_.-]+$
12+
* @example org_abc123
13+
* @type string
14+
*/
15+
export type ApproveCrmResearchTaskPathOrgId = string;
16+
17+
/**
18+
* @description Unique CRM research task identifier (prefixed, e.g. ctk_xxx).
19+
* @pattern ^[a-zA-Z0-9_.-]+$
20+
* @type string
21+
*/
22+
export type ApproveCrmResearchTaskPathTaskId = string;
23+
24+
/**
25+
* @description A unit of work for the autonomous research agent. Workers lease pending tasks from the queue, do the work (enrichment), and write the result back.\n
26+
* @type object
27+
*/
28+
export type ApproveCrmResearchTaskStatus200 = ResearchTask;
29+
30+
/**
31+
* @description Standard error response envelope for PgBeam API requests.
32+
* @type object
33+
*/
34+
export type ApproveCrmResearchTaskStatus400 = Error;
35+
36+
/**
37+
* @description Standard error response envelope for PgBeam API requests.
38+
* @type object
39+
*/
40+
export type ApproveCrmResearchTaskStatus401 = Error;
41+
42+
/**
43+
* @description Standard error response envelope for PgBeam API requests.
44+
* @type object
45+
*/
46+
export type ApproveCrmResearchTaskStatus403 = Error;
47+
48+
/**
49+
* @description Standard error response envelope for PgBeam API requests.
50+
* @type object
51+
*/
52+
export type ApproveCrmResearchTaskStatus404 = Error;
53+
54+
/**
55+
* @type object
56+
*/
57+
export type ApproveCrmResearchTaskRequestConfig = {
58+
data?: never;
59+
/**
60+
* @type object
61+
*/
62+
pathParams: {
63+
org_id: ApproveCrmResearchTaskPathOrgId;
64+
task_id: ApproveCrmResearchTaskPathTaskId;
65+
};
66+
queryParams?: never;
67+
headerParams?: never;
68+
/**
69+
* @type string
70+
*/
71+
url: `/v1/organizations/${string}/crm/research-tasks/${string}/approve`;
72+
};
73+
74+
/**
75+
* @type object
76+
*/
77+
export type ApproveCrmResearchTaskResponses = {
78+
"200": ApproveCrmResearchTaskStatus200;
79+
"400": ApproveCrmResearchTaskStatus400;
80+
"401": ApproveCrmResearchTaskStatus401;
81+
"403": ApproveCrmResearchTaskStatus403;
82+
"404": ApproveCrmResearchTaskStatus404;
83+
};
84+
85+
/**
86+
* @description Union of all possible responses
87+
*/
88+
export type ApproveCrmResearchTaskResponse = (ApproveCrmResearchTaskStatus200 | ApproveCrmResearchTaskStatus400 | ApproveCrmResearchTaskStatus401 | ApproveCrmResearchTaskStatus403 | ApproveCrmResearchTaskStatus404);

src/generated/types/Artifact.ts

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
/**
2+
* Generated by Kubb (https://kubb.dev/).
3+
* Do not edit manually.
4+
*/
5+
6+
import type { ArtifactStatusKey } from "./ArtifactStatus";
7+
import type { ResearchTaskSubjectTypeKey } from "./ResearchTaskSubjectType";
8+
9+
/**
10+
* @description Long-form agent output (a drafted email, an account brief) for human review.
11+
* @type object
12+
*/
13+
export type Artifact = {
14+
/**
15+
* @description Unique artifact identifier.
16+
* @example art_01j9x8y7z6w5v4u3t2s1r0q9p8
17+
* @type string
18+
*/
19+
id: string;
20+
/**
21+
* @description Organization the artifact belongs to.
22+
* @type string
23+
*/
24+
org_id: string;
25+
/**
26+
* @description Research task that produced this artifact, if any.
27+
* @type string
28+
*/
29+
task_id?: string | null;
30+
/**
31+
* @description The kind of entity a research task targets.
32+
* @type string
33+
*/
34+
subject_type: ResearchTaskSubjectTypeKey;
35+
/**
36+
* @description ID of the company/contact/deal this artifact is about.
37+
* @type string
38+
*/
39+
subject_id: string;
40+
/**
41+
* @description Kind of artifact (e.g. outreach_email, account_brief).
42+
* @type string
43+
*/
44+
kind: string;
45+
/**
46+
* @description Short title.
47+
* @type string
48+
*/
49+
title: string;
50+
/**
51+
* @description Long-form content.
52+
* @type string
53+
*/
54+
body: string;
55+
/**
56+
* @description Lifecycle state of an artifact.
57+
* @type string
58+
*/
59+
status: ArtifactStatusKey;
60+
/**
61+
* @description When the artifact was created.
62+
* @type string
63+
*/
64+
created_at: string;
65+
/**
66+
* @description When the artifact was last updated.
67+
* @type string
68+
*/
69+
updated_at: string;
70+
};
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/**
2+
* Generated by Kubb (https://kubb.dev/).
3+
* Do not edit manually.
4+
*/
5+
6+
export const artifactStatus = {
7+
draft: "draft",
8+
approved: "approved",
9+
sent: "sent",
10+
discarded: "discarded"
11+
} as const;
12+
13+
export type ArtifactStatusKey = (typeof artifactStatus)[keyof typeof artifactStatus];
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
/**
2+
* Generated by Kubb (https://kubb.dev/).
3+
* Do not edit manually.
4+
*/
5+
6+
import type { Error } from "./Error";
7+
import type { ResearchTask } from "./ResearchTask";
8+
9+
/**
10+
* @description Unique organization identifier.
11+
* @pattern ^[a-zA-Z0-9_.-]+$
12+
* @example org_abc123
13+
* @type string
14+
*/
15+
export type CancelCrmResearchTaskPathOrgId = string;
16+
17+
/**
18+
* @description Unique CRM research task identifier (prefixed, e.g. ctk_xxx).
19+
* @pattern ^[a-zA-Z0-9_.-]+$
20+
* @type string
21+
*/
22+
export type CancelCrmResearchTaskPathTaskId = string;
23+
24+
/**
25+
* @description A unit of work for the autonomous research agent. Workers lease pending tasks from the queue, do the work (enrichment), and write the result back.\n
26+
* @type object
27+
*/
28+
export type CancelCrmResearchTaskStatus200 = ResearchTask;
29+
30+
/**
31+
* @description Standard error response envelope for PgBeam API requests.
32+
* @type object
33+
*/
34+
export type CancelCrmResearchTaskStatus400 = Error;
35+
36+
/**
37+
* @description Standard error response envelope for PgBeam API requests.
38+
* @type object
39+
*/
40+
export type CancelCrmResearchTaskStatus401 = Error;
41+
42+
/**
43+
* @description Standard error response envelope for PgBeam API requests.
44+
* @type object
45+
*/
46+
export type CancelCrmResearchTaskStatus403 = Error;
47+
48+
/**
49+
* @description Standard error response envelope for PgBeam API requests.
50+
* @type object
51+
*/
52+
export type CancelCrmResearchTaskStatus404 = Error;
53+
54+
/**
55+
* @type object
56+
*/
57+
export type CancelCrmResearchTaskRequestConfig = {
58+
data?: never;
59+
/**
60+
* @type object
61+
*/
62+
pathParams: {
63+
org_id: CancelCrmResearchTaskPathOrgId;
64+
task_id: CancelCrmResearchTaskPathTaskId;
65+
};
66+
queryParams?: never;
67+
headerParams?: never;
68+
/**
69+
* @type string
70+
*/
71+
url: `/v1/organizations/${string}/crm/research-tasks/${string}/cancel`;
72+
};
73+
74+
/**
75+
* @type object
76+
*/
77+
export type CancelCrmResearchTaskResponses = {
78+
"200": CancelCrmResearchTaskStatus200;
79+
"400": CancelCrmResearchTaskStatus400;
80+
"401": CancelCrmResearchTaskStatus401;
81+
"403": CancelCrmResearchTaskStatus403;
82+
"404": CancelCrmResearchTaskStatus404;
83+
};
84+
85+
/**
86+
* @description Union of all possible responses
87+
*/
88+
export type CancelCrmResearchTaskResponse = (CancelCrmResearchTaskStatus200 | CancelCrmResearchTaskStatus400 | CancelCrmResearchTaskStatus401 | CancelCrmResearchTaskStatus403 | CancelCrmResearchTaskStatus404);

0 commit comments

Comments
 (0)