@proteos/sdk 0.89.0 → 0.91.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.cjs +160 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +470 -24
- package/dist/index.d.ts +470 -24
- package/dist/index.js +160 -9
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/agent/index.ts +3 -0
- package/src/agent/model-types.ts +2 -0
- package/src/agent/session-types.ts +88 -8
- package/src/agent/sessions.ts +51 -0
- package/src/agent/types.ts +14 -0
- package/src/auth/platform-entities.ts +6 -0
- package/src/connector/index.ts +2 -0
- package/src/connector/types.ts +2 -0
- package/src/discovery/index.ts +183 -0
- package/src/discovery/types.ts +264 -0
- package/src/functions/actions.ts +5 -1
- package/src/index.ts +40 -0
- package/src/knowledge/index.ts +13 -1
- package/src/knowledge/types.ts +47 -3
- package/src/knowledge/whiteboard-templates.ts +85 -0
- package/src/types/options.ts +11 -0
package/dist/index.js
CHANGED
|
@@ -282,6 +282,13 @@ var SessionServiceImpl = class {
|
|
|
282
282
|
request
|
|
283
283
|
);
|
|
284
284
|
}
|
|
285
|
+
async transferVoice(id, request) {
|
|
286
|
+
return this.client.request(
|
|
287
|
+
"POST",
|
|
288
|
+
`${SESSIONS_BASE_PATH}/${id}/voice/transfer`,
|
|
289
|
+
request
|
|
290
|
+
);
|
|
291
|
+
}
|
|
285
292
|
async appendSpeech(id, request, requestOptions) {
|
|
286
293
|
const response = await this.client.request(
|
|
287
294
|
"POST",
|
|
@@ -299,6 +306,15 @@ var SessionServiceImpl = class {
|
|
|
299
306
|
requestOptions
|
|
300
307
|
);
|
|
301
308
|
}
|
|
309
|
+
async getVoiceRecording(id, voiceSessionId, requestOptions) {
|
|
310
|
+
const { response } = await this.client.requestRaw(
|
|
311
|
+
"GET",
|
|
312
|
+
`${SESSIONS_BASE_PATH}/${id}/voice/${voiceSessionId}/recording`,
|
|
313
|
+
void 0,
|
|
314
|
+
requestOptions
|
|
315
|
+
);
|
|
316
|
+
return await response.blob();
|
|
317
|
+
}
|
|
302
318
|
};
|
|
303
319
|
function parseEvent(data) {
|
|
304
320
|
if (!data) return null;
|
|
@@ -1093,7 +1109,10 @@ var PLATFORM_ENTITIES = [
|
|
|
1093
1109
|
{ slug: "availability-constraints", name: "Availability Constraints" },
|
|
1094
1110
|
// Discovery (discovery-service): what users send Proteos to show how they
|
|
1095
1111
|
// work — screenshots, recordings, written feedback. Mass noun, no plural.
|
|
1096
|
-
{ slug: "discovery-evidence", name: "Discovery Evidence" }
|
|
1112
|
+
{ slug: "discovery-evidence", name: "Discovery Evidence" },
|
|
1113
|
+
// Interview guides an admin writes; whoever reads a definition reads its
|
|
1114
|
+
// interviews, and whoever writes it invites people.
|
|
1115
|
+
{ slug: "discovery-interview-definitions", name: "Discovery Interview Definitions" }
|
|
1097
1116
|
];
|
|
1098
1117
|
var PLATFORM_ENTITY_SLUGS = PLATFORM_ENTITIES.map(
|
|
1099
1118
|
(entity) => entity.slug
|
|
@@ -1119,7 +1138,10 @@ var SCOPED_PLATFORM_ENTITY_SLUGS = [
|
|
|
1119
1138
|
// discovery-service: evidence is owned by its creator; a caller holding no
|
|
1120
1139
|
// grant at all is treated as scoped (own rows), so every org member can
|
|
1121
1140
|
// send feedback and see what they sent.
|
|
1122
|
-
"discovery-evidence"
|
|
1141
|
+
"discovery-evidence",
|
|
1142
|
+
// discovery-service: an interview definition is owned by its creator; its
|
|
1143
|
+
// interviews follow it.
|
|
1144
|
+
"discovery-interview-definitions"
|
|
1123
1145
|
];
|
|
1124
1146
|
function isPlatformEntity(slug) {
|
|
1125
1147
|
return PLATFORM_ENTITY_SLUGS.includes(slug);
|
|
@@ -1314,6 +1336,8 @@ var DEFAULT_OPTIONS = {
|
|
|
1314
1336
|
timeout: 3e4,
|
|
1315
1337
|
headers: {}
|
|
1316
1338
|
};
|
|
1339
|
+
var INVOKE_TIMEOUT_MS = 75e3;
|
|
1340
|
+
var BATCH_INVOKE_TIMEOUT_MS = 315e3;
|
|
1317
1341
|
function resolveOptions(options) {
|
|
1318
1342
|
return {
|
|
1319
1343
|
baseUrl: options.baseUrl.replace(/\/$/, ""),
|
|
@@ -1753,7 +1777,8 @@ var ConnectorConnectionServiceImpl = class {
|
|
|
1753
1777
|
const response = await this.client.request(
|
|
1754
1778
|
"POST",
|
|
1755
1779
|
`${CONNECTOR_BASE_PATH}/connections/${encodeURIComponent(id)}/methods/${encodeURIComponent(method)}/invoke`,
|
|
1756
|
-
params
|
|
1780
|
+
params,
|
|
1781
|
+
{ timeout: INVOKE_TIMEOUT_MS }
|
|
1757
1782
|
);
|
|
1758
1783
|
return response.result;
|
|
1759
1784
|
}
|
|
@@ -3402,10 +3427,14 @@ var DiscoveryClient = class {
|
|
|
3402
3427
|
evidence;
|
|
3403
3428
|
narrations;
|
|
3404
3429
|
platform;
|
|
3430
|
+
interviewDefinitions;
|
|
3431
|
+
interviews;
|
|
3405
3432
|
constructor(client) {
|
|
3406
3433
|
this.evidence = new DiscoveryEvidenceServiceImpl(client);
|
|
3407
3434
|
this.narrations = new DiscoveryEvidenceNarrationServiceImpl(client);
|
|
3408
3435
|
this.platform = new PlatformDiscoveryEvidenceServiceImpl(client);
|
|
3436
|
+
this.interviewDefinitions = new DiscoveryInterviewDefinitionServiceImpl(client);
|
|
3437
|
+
this.interviews = new DiscoveryInterviewServiceImpl(client);
|
|
3409
3438
|
}
|
|
3410
3439
|
};
|
|
3411
3440
|
var DiscoveryEvidenceServiceImpl = class {
|
|
@@ -3482,6 +3511,87 @@ var PlatformDiscoveryEvidenceServiceImpl = class {
|
|
|
3482
3511
|
);
|
|
3483
3512
|
}
|
|
3484
3513
|
};
|
|
3514
|
+
var DiscoveryInterviewDefinitionServiceImpl = class {
|
|
3515
|
+
constructor(client) {
|
|
3516
|
+
this.client = client;
|
|
3517
|
+
}
|
|
3518
|
+
client;
|
|
3519
|
+
path(id, suffix = "") {
|
|
3520
|
+
const base = `${DISCOVERY_BASE_PATH}/interview-definitions`;
|
|
3521
|
+
return id === void 0 ? base : `${base}/${encode(id)}${suffix}`;
|
|
3522
|
+
}
|
|
3523
|
+
create(request) {
|
|
3524
|
+
return this.client.request("POST", this.path(), request);
|
|
3525
|
+
}
|
|
3526
|
+
list(query = {}) {
|
|
3527
|
+
return this.client.requestWithQuery("GET", this.path(), query);
|
|
3528
|
+
}
|
|
3529
|
+
get(id) {
|
|
3530
|
+
return this.client.request("GET", this.path(id));
|
|
3531
|
+
}
|
|
3532
|
+
update(id, request) {
|
|
3533
|
+
return this.client.request("PATCH", this.path(id), request);
|
|
3534
|
+
}
|
|
3535
|
+
async delete(id) {
|
|
3536
|
+
await this.client.request("DELETE", this.path(id));
|
|
3537
|
+
}
|
|
3538
|
+
publish(id) {
|
|
3539
|
+
return this.client.request("POST", this.path(id, "/publish"));
|
|
3540
|
+
}
|
|
3541
|
+
close(id) {
|
|
3542
|
+
return this.client.request("POST", this.path(id, "/close"));
|
|
3543
|
+
}
|
|
3544
|
+
reopen(id) {
|
|
3545
|
+
return this.client.request("POST", this.path(id, "/reopen"));
|
|
3546
|
+
}
|
|
3547
|
+
async invite(id, request) {
|
|
3548
|
+
const response = await this.client.request(
|
|
3549
|
+
"POST",
|
|
3550
|
+
this.path(id, "/interviews"),
|
|
3551
|
+
request
|
|
3552
|
+
);
|
|
3553
|
+
return response.data;
|
|
3554
|
+
}
|
|
3555
|
+
getParticipation(id) {
|
|
3556
|
+
return this.client.request("GET", this.path(id, "/participation"));
|
|
3557
|
+
}
|
|
3558
|
+
startParticipation(id, request) {
|
|
3559
|
+
return this.client.request("POST", this.path(id, "/participation/start"), request);
|
|
3560
|
+
}
|
|
3561
|
+
};
|
|
3562
|
+
var DiscoveryInterviewServiceImpl = class {
|
|
3563
|
+
constructor(client) {
|
|
3564
|
+
this.client = client;
|
|
3565
|
+
}
|
|
3566
|
+
client;
|
|
3567
|
+
path(id, suffix = "") {
|
|
3568
|
+
return `${DISCOVERY_BASE_PATH}/interviews/${encode(id)}${suffix}`;
|
|
3569
|
+
}
|
|
3570
|
+
list(query) {
|
|
3571
|
+
return this.client.requestWithQuery("GET", `${DISCOVERY_BASE_PATH}/interviews`, query);
|
|
3572
|
+
}
|
|
3573
|
+
get(id) {
|
|
3574
|
+
return this.client.request("GET", this.path(id));
|
|
3575
|
+
}
|
|
3576
|
+
async remind(id) {
|
|
3577
|
+
await this.client.request("POST", this.path(id, "/remind"));
|
|
3578
|
+
}
|
|
3579
|
+
synthesize(id) {
|
|
3580
|
+
return this.client.request("POST", this.path(id, "/synthesize"));
|
|
3581
|
+
}
|
|
3582
|
+
async delete(id) {
|
|
3583
|
+
await this.client.request("DELETE", this.path(id));
|
|
3584
|
+
}
|
|
3585
|
+
createDownloadUrl(id, fileId) {
|
|
3586
|
+
return this.client.request("POST", this.path(id, `/files/${encode(fileId)}/download-url`));
|
|
3587
|
+
}
|
|
3588
|
+
complete(id) {
|
|
3589
|
+
return this.client.request("POST", this.path(id, "/complete"), {});
|
|
3590
|
+
}
|
|
3591
|
+
getParticipation(id) {
|
|
3592
|
+
return this.client.request("GET", this.path(id, "/participation"));
|
|
3593
|
+
}
|
|
3594
|
+
};
|
|
3485
3595
|
|
|
3486
3596
|
// src/events/index.ts
|
|
3487
3597
|
var EVENTS_BASE_PATH = "/events/v1";
|
|
@@ -3602,7 +3712,8 @@ var ActionServiceImpl = class {
|
|
|
3602
3712
|
const response = await this.client.request(
|
|
3603
3713
|
"POST",
|
|
3604
3714
|
`${ACTIONS_BASE_PATH}/${slug}/invoke`,
|
|
3605
|
-
params
|
|
3715
|
+
params,
|
|
3716
|
+
{ timeout: INVOKE_TIMEOUT_MS }
|
|
3606
3717
|
);
|
|
3607
3718
|
return response.result;
|
|
3608
3719
|
}
|
|
@@ -3611,7 +3722,7 @@ var ActionServiceImpl = class {
|
|
|
3611
3722
|
"POST",
|
|
3612
3723
|
`/functions/v1/public/orgs/${encodeURIComponent(orgId)}/actions/${encodeURIComponent(slug)}/invoke`,
|
|
3613
3724
|
params,
|
|
3614
|
-
{ skipAuth: true }
|
|
3725
|
+
{ skipAuth: true, timeout: INVOKE_TIMEOUT_MS }
|
|
3615
3726
|
);
|
|
3616
3727
|
return response.result;
|
|
3617
3728
|
}
|
|
@@ -3619,7 +3730,8 @@ var ActionServiceImpl = class {
|
|
|
3619
3730
|
const response = await this.client.request(
|
|
3620
3731
|
"POST",
|
|
3621
3732
|
`/functions/v1/entities/${entitySlug}/records/${recordId}/actions/${slug}/invoke`,
|
|
3622
|
-
params
|
|
3733
|
+
params,
|
|
3734
|
+
{ timeout: INVOKE_TIMEOUT_MS }
|
|
3623
3735
|
);
|
|
3624
3736
|
return response.result;
|
|
3625
3737
|
}
|
|
@@ -3627,7 +3739,8 @@ var ActionServiceImpl = class {
|
|
|
3627
3739
|
const response = await this.client.request(
|
|
3628
3740
|
"POST",
|
|
3629
3741
|
`/functions/v1/entities/${entitySlug}/actions/${slug}/invoke`,
|
|
3630
|
-
{ record_ids: recordIds, params }
|
|
3742
|
+
{ record_ids: recordIds, params },
|
|
3743
|
+
{ timeout: BATCH_INVOKE_TIMEOUT_MS }
|
|
3631
3744
|
);
|
|
3632
3745
|
return response.result;
|
|
3633
3746
|
}
|
|
@@ -3893,12 +4006,47 @@ var SpaceServiceImpl = class {
|
|
|
3893
4006
|
await this.client.request("DELETE", `${SPACES_BASE_PATH}/${slug}`);
|
|
3894
4007
|
}
|
|
3895
4008
|
};
|
|
4009
|
+
|
|
4010
|
+
// src/knowledge/whiteboard-templates.ts
|
|
4011
|
+
var WHITEBOARD_TEMPLATES_BASE_PATH = "/knowledge/v1/whiteboard-templates";
|
|
4012
|
+
var WhiteboardTemplateServiceImpl = class {
|
|
4013
|
+
constructor(client) {
|
|
4014
|
+
this.client = client;
|
|
4015
|
+
}
|
|
4016
|
+
client;
|
|
4017
|
+
list(options = {}) {
|
|
4018
|
+
return new PageIterator((opts) => this.listPage(opts), options);
|
|
4019
|
+
}
|
|
4020
|
+
async listPage(options = {}) {
|
|
4021
|
+
return this.client.requestWithQuery(
|
|
4022
|
+
"GET",
|
|
4023
|
+
WHITEBOARD_TEMPLATES_BASE_PATH,
|
|
4024
|
+
options
|
|
4025
|
+
);
|
|
4026
|
+
}
|
|
4027
|
+
async get(id) {
|
|
4028
|
+
return this.client.request("GET", `${WHITEBOARD_TEMPLATES_BASE_PATH}/${id}`);
|
|
4029
|
+
}
|
|
4030
|
+
async create(request) {
|
|
4031
|
+
return this.client.request("POST", WHITEBOARD_TEMPLATES_BASE_PATH, request);
|
|
4032
|
+
}
|
|
4033
|
+
async update(id, request) {
|
|
4034
|
+
return this.client.request(
|
|
4035
|
+
"PATCH",
|
|
4036
|
+
`${WHITEBOARD_TEMPLATES_BASE_PATH}/${id}`,
|
|
4037
|
+
request
|
|
4038
|
+
);
|
|
4039
|
+
}
|
|
4040
|
+
async delete(id) {
|
|
4041
|
+
await this.client.request("DELETE", `${WHITEBOARD_TEMPLATES_BASE_PATH}/${id}`);
|
|
4042
|
+
}
|
|
4043
|
+
};
|
|
3896
4044
|
var UNASSIGNED_SPACE_SLUG = "__unassigned__";
|
|
3897
4045
|
var KnowledgeNodeMetadataSchema = z.object({
|
|
3898
4046
|
id: z.string(),
|
|
3899
4047
|
org_id: z.string(),
|
|
3900
4048
|
title: z.string(),
|
|
3901
|
-
type: z.enum(["markdown", "file", "url"]),
|
|
4049
|
+
type: z.enum(["markdown", "file", "url", "whiteboard"]),
|
|
3902
4050
|
status: z.enum(["draft", "published", "archived"]),
|
|
3903
4051
|
embedding_model: z.string().nullish(),
|
|
3904
4052
|
embedded_at: z.string().nullish(),
|
|
@@ -3962,7 +4110,7 @@ var NodeNeighborhoodSchema = z.object({
|
|
|
3962
4110
|
z.object({
|
|
3963
4111
|
id: z.string(),
|
|
3964
4112
|
title: z.string(),
|
|
3965
|
-
type: z.enum(["markdown", "file", "url"]),
|
|
4113
|
+
type: z.enum(["markdown", "file", "url", "whiteboard"]),
|
|
3966
4114
|
status: z.enum(["draft", "published", "archived"]),
|
|
3967
4115
|
distance: z.number()
|
|
3968
4116
|
})
|
|
@@ -3991,6 +4139,8 @@ var KnowledgeClient = class {
|
|
|
3991
4139
|
spaces;
|
|
3992
4140
|
/** Whole-org graph bulk read (radiant graph view): `knowledge.graph.get()`. */
|
|
3993
4141
|
graph;
|
|
4142
|
+
/** Org-wide whiteboard templates: `knowledge.whiteboardTemplates`. */
|
|
4143
|
+
whiteboardTemplates;
|
|
3994
4144
|
constructor(client) {
|
|
3995
4145
|
this.nodes = new NodeServiceImpl(client);
|
|
3996
4146
|
this.links = new LinkServiceImpl(client);
|
|
@@ -3998,6 +4148,7 @@ var KnowledgeClient = class {
|
|
|
3998
4148
|
this.labels = new LabelServiceImpl(client);
|
|
3999
4149
|
this.spaces = new SpaceServiceImpl(client);
|
|
4000
4150
|
this.graph = new GraphServiceImpl(client);
|
|
4151
|
+
this.whiteboardTemplates = new WhiteboardTemplateServiceImpl(client);
|
|
4001
4152
|
}
|
|
4002
4153
|
};
|
|
4003
4154
|
|