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